marklogic-community / slush-marklogic-node Goto Github PK
View Code? Open in Web Editor NEWSlush generator for a MarkLogic/node project
Home Page: https://github.com/marklogic-community/slush-marklogic-node/wiki
License: Other
Slush generator for a MarkLogic/node project
Home Page: https://github.com/marklogic-community/slush-marklogic-node/wiki
License: Other
The data/ folder is the default for deploying content with Roxy. It would be convenient if the JSON sample documents would be placed in a different folder, for instance sample-data/, since they are loaded with MLCP, and not with Roxy.
detail.xslt is used to provide rendering of XML, but that causes part of rendering to take place outside of the usual views and templates. It also requires client-side compilation (compile directive) to make angular instructions work inside it.
Instead, rendering should take place on client-side only, and server-side should only indent, transform to json and/or highlight..
The current server.js implementation is using a bodyParser:
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({
extended: true
}));
These lines seem to interfere with POST/PUT of JSON and binary to MarkLogic. Passing through JSON has a weird effect that MarkLogic keeps reading request body until it hits the length limit. Binary doesn't come through either.
I had to disable above lines, or revert to the 'request' library, which allows direct piping of request and response. Unfortunately, both solutions cause deprecation warnings to be shown, and the latter looks like it is a bit slower, but that is bit difficult to prove..
Useful for showing XML data directly using syntax highlighting (with highlightjs for instance)..
Great new framework for creating apps in place of app builder.
Is it possible to add the the default configuration the ability edit and delete documents?
Would greatly help in creating sample applications.
Useful for showing edit forms for XML..
Various important issues have been fixed, but not yet released. Time for a new release.
For those who cannot wait:
sudo npm install -g git://github.com/marklogic/slush-marklogic-node.git
Here's Roxy's as an example. Adding this gives potential contributors a better idea of what the maintainers expect.
When I tried importing the testdata. I got an invalid argument warning and the files are not imported into the database:
Warning is:
14/08/18 11:47:59 WARN mapreduce.ContentWriter: Invalid argument (json:INVALIDARG):
Search options from server can be leveraged to improve building structured query, and prevent the need to add app-specific details to properly build queries for facets, geo-bounds, etc.
Search options can also be used amongst others to read sort options, snippet options, discover presence of geospatial facets, discover presence of values and tuples endpoints..
Begin adding geospatial view of data using ESRI Maps JS API. This ticket is to add a map display showing the location of a document that contains geospatial data.
Server.js contains lines like:
app.use('/profile', express.static(__dirname + '/ui/app'));
But it suffices to have a general one:
app.use('/*', express.static(__dirname + '/ui/app'));
Useful for storing JSON as XML, where the JSON is actually retrieved from XML first for the benefit of editing..
You sometimes like to upload binaries, and do processing on them. Activating CPF, and/or triggers for that can be an option, but that can sometimes be a bit heavy for occasional upload of binaries. You can however also do manipulation/enrichment at PUT using a REST-api transformation.
Applying xdmp:document-filter on binaries, and storing results in properties can be a useful REST transform, should be included to the sample app by default.
Could be named QueryBuilder (or qb in short), and would be a good fit for common module.
The current mlrest rewriteResults makes it appear as if there is an extra metadata property named 'metadata-type', but that is actually a sub-property of each metadata field.
The Create and Profile controllers still have references to demo-cat-role and demo-cat-registered-role.
The current documents endpoint doesn't return an accurate mime-type, causing some browsers to show binaries in a wrong way in the browser. This can be fixed with a rest-transform that provides a more accurate mime-type (based on MarkLogic mime-type settings for extensions).
The to-json transform is really a json-to-xml transform, so from-json sounds more appropriate..
In README.mdown
it says
The to-json.xqy module is provided in the sample application under the src/transform directory.
For me, /src
in my project root is an empty directory so I'm not seeing a /src/transform
directory at all and searching the project for a to-json.xqy
file is not yielding anything.
Is it possible that I'm having this issue because I installed via NPM and the NPM module is out of sync with this github repo? The NPM page for the module says last updated 3 months ago, whereas this repo was updated less than a day ago, also the README is very different between the NPM module page and github repo. I generated the slush scaffold via npm install -g slush
/ npm install -g slush-marklogic-node
/ slush marklogic-node <app-name>
I had also read some details about the latest mlcp
over here but this is for other sources, whereas I'd love to just have a look at the sample data source that is meant to be included with the slush
scaffold project.
Would be great to know where to get that so that I can bootstrap some data, apologies if I'm missing something obvious!
Login has not happened yet at init of search ctrl, so unnecessary to try to search. Doing so at successful login is sufficient. You can also save a round-trip to server if authenticated is false, and flush potentially existing search results immediately.
When using rest extensions, the server.js should honor a request with Content-Disposition and forward it as a header back to application
To resolve issue
//If the file is a download then set the header to passthrough
if(response.headers["content-disposition"]) {
res.header("Content-Disposition",response.headers["content-disposition"]);
}
No longer used, of no further use..
Analyzing data is a very common task. A rest-extension that helps to analyze-data in the initial phase, and helps come up with a set of initial indexes, can give a large jump-start. Such a rest-extension is available, and could be included by default in the sample app.
ui/app/styles/ contains both a main.less and a main.css. It is unnecessary to add the latter to git source control as it gets generated..
Detail view only shows { }. It is because document is retrieved as is, but is currently saved as XML-JSON. It requires adding transform: 'to-json' to the /v1/documents call in detail-ctrl.js..
The default app could provide a rest-extension for spell-suggestions. Useful for instance when you have no search results, so you can show a 'did you mean..' kind of message..
Depends on #7. Add index & facet configuration based on the sample data so that some facets will show out of the box.
Use json-generator.com to create ~25 sample documents.
Also add the transform that mlcp can use to ingest JSON into the database. http://blog.davidcassel.net/2014/06/loading-json-into-marklogic-7/
Modules that are fully generic, like sample.common (which includes mlrest service) should not use sample. prefix, but rather use a prefix like ml. or alike.
Might be worth considering making those bower components as well. That would enable explicitly leveraging versioning in dependency management..
common.js: line 5, col 3, Missing "use strict" statement.
Some references to css and js in bower_components and such don't start with /. This will cause the browser to load new copies of such files for each main uri path. E.g. once for /, once for /profile, once for /whatever. Adding / in front of those prevents unnecessary loading resources multiple times.
Write a more general description how to use it, what tools/features it includes, what those are meant for, etc.
Common module and the remaining mlquery.js have been replaced with ml-common-ng. They can be removed from this template.
The built-in search endpoint provides support for similar queries, but that can be a little impractical, and it simply refuses if there is a binary result among your search results.
A separate rest-extension for similar queries can be useful. It could be included by default in the sample app.
Search results containing the searched text term are rendered like:
{"highlight":"Auftrag"}
Nr. 0830009072/70
{"highlight":"Auftrag"}
Nr. 0830009072/75
Should not show JSON structure, and apply some kind of visual highlighting.
Running gulp server shows warnings:
templates gjosten$ gulp server
[gulp] Using gulpfile ~/Projects/slush-marklogic-node/app/templates/gulpfile.js
[gulp] Starting 'server'...
express-session deprecated undefined resave option; provide resave option server.js:34:11
express-session deprecated undefined saveUninitialized option; provide saveUninitialized option server.js:34:11
[gulp] Finished 'server' after 170 ms
Switch from angular-router to ui-router for a more advanced, and popular solution, preferably without adding complexity..
mlMapsProvider.version call in app.js no longer works. It should be .useVersion now. Matt reports all three lines could be commented, since ml-map is not being used (yet)..
Every app that is generated, starts with expressSession secret key '1234567890QWERTY'. Generate a real random one, or at least make it more unique (by prepending app-name, timestamp or whatever).
It is probably intended as add-on, but is not showing as an add-on to the input field. Instead it is shown below. Missing some bootstrap wrapper class like input-group?
Current mlrest service doesn't cover the entire REST-api yet. The api includes very useful endpoints like content-based search suggestions, sparql-endpoint, getting values, and tuples, etc. Existing functions could also support more (optional) parameters to increase flexibility, and for instance call search endpoint to pull facets and results separately.
A default favicon is missing, and the remark to put a favicon.ico in the root is no longer the recommended method. Add explicit links in index.html, and add a ML favicon as default. Makes it easier to find the appropriate place to put a favicon as well.
Involves init and startup script, and a bit of documentation about how to set it up..
Based on experience with an initial install, it looks like bower is also a dependency, and the README doc should be updated.
To make it easy to set up geospatial search, include components in the generator for doing so.
As of MarkLogic 7 the REST-api provides a suggest endpoint (/v1/suggest) out of the box, that is pretty much a drop-in replacement for extsuggest. Do we want to preserve extsuggest in favor of MarkLogic 6?
Search model and search context are both keeping track of selected facets. Search context should be sufficient. Requires extending mlrest/searchcontext functionality regarding facetSelections a bit.
After that, just needs exposing facetSelections of searchContext to facets directive directly. Could be done by adding searchContext to $scope, and then pointing facets dir to searchContext.facetSelections instead of to model.selected..
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.