Git Product home page Git Product logo

marklogic-java's People

Contributors

fsnow avatar nikos avatar rjrudin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

marklogic-java's Issues

Configure ordering of mlRestApi dependenciess

If a project depends on A and B in mlRestApi, A is being installed first because it's before B alphabetically. But if A depends on B - like if A installs a service that depends on a library in B - then installation of A's modules will fail.

We don't have this issue yet anywhere, but we'll need to figure something out for expressing an order for dependencies to be installed in.

Include an "mlWatch" task by default

The AppConfig instance has all the inputs needed for a default "watch" task:

task watch (type: JavaExec, dependsOn: 'classes') {
main = 'com.marklogic.client.configurer.ml7.ConfigurationFilesWatcher'
classpath = sourceSets.main.runtimeClasspath
args 'src/main/xqy,src/test/xqy', mlHost, mlAppConfig.restPort, mlUsername, mlPassword
}

Clear modules within mlDeploy

At some point during mlDeploy, we need to clear the modules database - of course before mlLoadModules is called. Should be able to call mlInstall, then call mlClearModules.

Log error but don't fail in mlWatch

This is a nice-to-have - if the REST API throws an error when loading a module, mlWatch fails and must be restarted.

I've noticed gulp does the same thing while working on an Angular app, so this behavior doesn't seem that awful.

Create a home directory where user interface code can live

The default directory where the modules get loaded is under src/main/xqy. I have also been storing user interface code (html, css, js, imgs, etc) inside the modules database. But I don't want to store the ui code under src/main/xqy. I would rather put it in a second home directory that I can configure. For example I may want to put all my front end code in src/main/ui.

Merge links in database package

Allow for database packages to override elements with text in the /db:package-database/db:config/db:links block. I don't think we need to support overwriting the forests yet, haven't had a use case for that.

Database packages are being installed multiple times

DatabasePackageManager is doing an install, and so is InstallAppTask. Ought to move the code for installing a triggers database to DPM, then have one place where we check to see if the package needs to be installed.

Execute mlcp via task

Should be more efficient than using JavaExec directly, since we know all the connection details.

Set format of modules via configuration file

RestApiConfigurer has a determineFormat function that is a big hacky if/else block for determining the format type of a module based on extension.

We should really allow for a properties file to define these mappings, thus allowing a developer to provide a custom mapping of extensions to formats. This would address issues where a developer has an .html file that is valid HTML - e.g. an unclosed link - but not valid XML, and thus the developer wants the .html file to have a format of TEXT.

"gradle mlInstallApp" does not work for version 0.4

Rob - I think a modification you made last Friday to get the zip file to install affected the mlInstallApp task

:mlPrepareRestApiDependencies
Found mlRestApi configuration, will unzip all of its dependencies to build/mlRestApi
Finished unzipping mlRestApi dependencies; will now include modules at [src/main/xqy]
:mlMergeDatabasePackages
No mergePackageFilePaths specified, will not produce a new database package file:mlMergeHttpServerPackages
No mergePackageFilePaths specified, will not produce a new HTTP server package file
:mlInstallApp FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':mlInstallApp'.

    Could not find property 'mlUsername' on root project 'geonames'.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 4.036 secs

Install ext modules via zip file and new resource

An idea from Charles Greer - we should be able to speed up installation of lots of modules under /ext by zipping them up, then sending those to a new resource, which would then unzip the file and load them into the modules database.

This would require that that resource be installed first, but that shouldn't be hard to do.

Sleep while MarkLogic is restarting

Need a way to sleep after running mlUninstallApp, resuming once ML has finished restarting. Should be able to use /admin/v1/timestamp. Will need a GetTimestampTask that will probably populate a new timestamp property on ManageConfig. The sleep task will then loop on calls to that endpoint until it gets a newer timestamp.

This isn't urgent, but it's more elegant than sleeping for 6 or 7 seconds, which is fallible too.

Generate new transform

Would be nice to have a task that generates a new transform, either xquery or xslt. Possible syntax:

gradle mlCreateTransform -PtransformType=xqy

Default host to new mlHost property

AppConfig and ManageConfig usually need to point to the same host, so having an mlHost property that they default to would avoid some duplication.

Remove all CPF resources

We have support for removing domains, need it as well for removing pipelines and domain configurations.

Rename plugin 'ml-gradle' to 'MarkLogic'

We need to market these gradle plugins to the World. We can submit plugins through the following website: http://plugins.gradle.org/submit

In this rollout, I suggest we rename the plugin to use the full MarkLogic name. (Yes, this is a marketing story).

ml-gradle = MarkLogic
ml-java = MarkLogic-Java
ml-junit = MarkLogic-JUnit

mlWatch fails when xqy or xslt is invalid

When I have mlWatch on, it would be nice if it just logged out an invalid xqy or xslt file as opposed to just failing. I have to restart everytime I save something that is invalid or not well formed.

Reload modules

Should have an mlReloadModules task that does the following:

  • clears all modules (which needs to depend on mlDeleteLastConfigured)
  • calls mlConfigureApp

This is useful for ensuring you have all the latest modules and no deleted ones without having to do a full deploy.

Load namespaces

Support a /namespaces folder, where the filename minus the suffix is the name of the prefix. Should be able to support either format easily, just use the filename extension as the format.

Set a default path for merged database/server packages

Right now, when using mlMergeDatabase/HttpServer, you have to configure mlManageConfig with the location of the merged package files.

Should be possible for this plumbing to use a default location - e.g. /build/ml-gradle/merged-content-database.xml and merged-http-server.xml. Then a developer doesn't need to configure this on the mlManageConfig.

Load ext modules via MLCP

Loading hundreds of modules via the REST API is slow. Should have an option for using MLCP to load them instead. Would need to update the timestamp that each module was loaded. But this should be straightforward since the /ext modules are loaded based on their directory structure.

Only issue may be ensuring ml-gradle can pull MLCP, as the Maven pom for that isn't correct, have to do this instead:

mlcp('com.marklogic:mlcp-Hadoop2:1.2-3') {
exclude module:"commons-modeler"
}
mlcp('commons-modeler:commons-modeler:2.0') {
transitive = false
}

Run ad hoc xquery via XccTask

An XccTask would simplify creating tasks for running ad hoc XQuery - e.g.

task sample (type: XccTask) {
xquery = "world"
}

Load assets via MLCP

This is much faster than the REST API endpoint when there are dozens or hundreds of modules.

Clear modules database

mlClearModules - handy when some modules need to be deleted, since you can then do mlClearModules followed up by mlConfigureApp

Provide generic Spring config class for tests

If you want to use AbstractSpringTest, you need to provide some Spring configuration. It should be possible to have a basic @configuration class that does the following:

  • sets up a DatabaseClientProvider
  • sets an XccTemplate
  • Reads properties for those two projects from a "test.properties" file. Ideally, this could pull config from the gradle file, since all the info we need - host, username/password, rest/xdbc ports - is in that config. If those are in gradle.properties in the root project dir, then it's easy. If they're not, I don't know if it's possible to read from the build.gradle file.

We already have standard props of mlUsername, mlPassword, and mlHost. Can add mlRestPort and mlXdbcPort, which AppConfig could look for. This generic config class can then look for those properties in gradle.properties.

This would all be based on convention, but it could be easily overridden or just not used at all.

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.