Git Product home page Git Product logo

ml-javaclient-util's People

Contributors

akshaysonvane avatar billfarber avatar dependabot[bot] avatar hansenmc avatar jedigo avatar nikos avatar paxtonhare avatar rahulvudutala avatar rjrudin avatar ryanjdew avatar sameerapriyathamtadikonda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ml-javaclient-util's Issues

ModulesLoader cannot handle .DS_Store

I'm regularly getting this error now. Can we add logic to ignore .DS_Store? 'gradle test' breaks now in certain situations on my MBP with OS X Yosemite because there are invalid chars in files that reside under .DS_Store.

java.lang.RuntimeException: Unable to insert content at URI: /ext/.DS_Store; cause: Authorization failed for user 'obi-tester'.
    at com.rjrudin.marklogic.modulesloader.impl.XccAssetLoader.loadFile(XccAssetLoader.java:153)
    at com.rjrudin.marklogic.modulesloader.impl.XccAssetLoader.visitFile(XccAssetLoader.java:114)
    at com.rjrudin.marklogic.modulesloader.impl.XccAssetLoader.visitFile(XccAssetLoader.java:35)
    at java.nio.file.FileTreeWalker.walk(FileTreeWalker.java:135)
    at java.nio.file.FileTreeWalker.walk(FileTreeWalker.java:199)
    at java.nio.file.FileTreeWalker.walk(FileTreeWalker.java:69)
    at java.nio.file.Files.walkFileTree(Files.java:2602)
    at java.nio.file.Files.walkFileTree(Files.java:2635)
...

Grab Extension metadata from a jar

@rjrudin I'm working on a pull request that piggybacks on top of your latest addition of loading files from a jar. The code fix you supplied is not passing in any metadata about services and I'd like to be able to grab the service metadata from the sidecar XMLs like you do for regular service loading.

I have a fix in progress. I just wanted to start this ticket so you knew iI was working on it and to have a place to discuss anything that I might need guidance on.

Load modules via 8000

Should be able to ditch the XCC stuff and load modules via 8000 and specify the modules database

Add support for IDEA

Including the IntelliJ IDEA gradle plugin allows also to create project and module files easily.

Load schemas

Similar to loading modules, provide a way to load schemas from the filesystem into a schemas database.

Throw an exception when the BatchWriter fails on a write operation

As a developer
I want to TITLE
So that I can handle the exception appropriately and continue to write the next batch.

I have ran into a Batch error where I have a conflicting update error (the batch of documents have two docs with the same URI). Unfortunately it causes the whole program to crash. I would like to take note and log the error but I would like the program to continue.

I believe it is just adding a throws statement on the BatchWriter.write() method.

Import/export workspaces with a given name

As an ml-gradle user
I want to TITLE
So that I have fine-grained control over the workspaces I import/export

  • WorkspaceManager has a "String... workspaceNames" parameter that is currently ignored
  • On export, the query for workspaces should constrain on any names passed in this array
  • On import, the XML in each file should be parsed (DocumentBuilderFactory should suffice here) and the workspace name extracted. If the workspaceNames array has any values, only those workspaces should be imported (if the array is empty, import all workspaces).
  • Automated testing will be covered in ml-app-deployer (I'll manually test it as part of merging this work into the dev branch)

Compare should be <= for PropertiesModuleManager

When you specify a minimumFileTimestampToLoad for PropertiesModuleManager the comparison is:

if (minimumFileTimestampToLoad > 0 && file.lastModified() < minimumFileTimestampToLoad) {
  if (logger.isDebugEnabled()) {
    logger.debug(String.format("lastModified for file '%s' is %d, which is before the minimumFileTimestampToLoad of %d",
				    file.getAbsolutePath(), file.lastModified(), minimumFileTimestampToLoad));
  }
  return false;
}

This needs to be:

if (minimumFileTimestampToLoad > 0 && file.lastModified() <= minimumFileTimestampToLoad) {
  if (logger.isDebugEnabled()) {
    logger.debug(String.format("lastModified for file '%s' is %d, which is before the minimumFileTimestampToLoad of %d",
				    file.getAbsolutePath(), file.lastModified(), minimumFileTimestampToLoad));
  }
  return false;
}

Note the < becomes <=

RoxyModuleTokenReplacer may be overstepping its bounds

DefaultModuleTokenReplacer has

private String propertyPrefix = "@ml.";

which is causing the token replace to always append @ml. to tokens. That seems bad for the intended default behavior.

I think it should be more like:

private String propertyPrefix;

then in RoxyModuleTokenReplacer.java

    public RoxyModuleTokenReplacer() {
        super();
        setPropertyPrefix("@ml.");
        addPropertiesSource(new FilePropertiesSource(new File("deploy/default.properties")));
        addPropertiesSource(new FilePropertiesSource(new File("deploy/build.properties")));
        addPropertiesSource(new FilePropertiesSource(new File("deploy/local.properties")));
    }

If this is indeed the case then I can submit a PR.

Question - modules loader

I was debugging a long execution time of mlLoadModules and came across to this library. I didn't dive deep into the code, but it seems to me (and please correct me, if I'm wrong), by looking into DefaultModulesLoader.java, that certain things are sequential instead of parallel. Was there a good reason to do this?

Allow for configuring module paths to match a typical Roxy setup

As documented at https://github.com/marklogic/roxy/wiki/Working-with-the-REST-API , a typical Roxy app will have asset modules under "src" or perhaps "modules", while REST resources and query options are under rest-api/ext and rest-api/config. This is a bit different from the samplestack approach, where everything is under a single directory. So it'd be nice if the code for loading modules made it easy to specify where each kind of module can be found.

Load modules from classpath

This is to support a use case where modules are stored in a JAR file that's on the classpath. Can use Spring's PathMatchingResourcePathResolver to find resources and then load them via Spring's Resource interface.

Support also search options in JSON format

Currently the module finder only supports files ending with ".xml", since MarkLogic server allows also to specify search options in JSON, it would be great to support it also.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.