Skip to content
This repository has been archived by the owner on May 30, 2019. It is now read-only.

use fn.head() instead of .next().value #705

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions README-JavaScript.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ When the Samplestack application is launched using Gulp, it runs the Node.js mid

This README documents the installation/configuration of the Samplestack for developing JavaScript-based code in the browser and middle-tier. The commands discussed below run both tiers simultaneously.

This README focuses on the developer automation for JavaScript development that is delivered with Samplestack *in general*. The [browser README](./browser/README.md) discusses particulars of the browser-tier. *A Java developer may wish to work solely in the Java middle-tier code, allowing the browser to continue to function as delivered. This is possible because a static. pre-built copy of the browser code is included and run by the Java Spring server. Developer who wish to develop both Java middle-tier code and broqser code may also do so. Please see [Browser Development with Java](./browser/README.md) for information.*
This README focuses on the developer automation for JavaScript development that is delivered with Samplestack *in general*. The [browser README](./browser/README.md) discusses particulars of the browser-tier. *A Java developer may wish to work solely in the Java middle-tier code, allowing the browser to continue to function as delivered. This is possible because a static, pre-built copy of the browser code is included and run by the Java Spring server. Developer who wish to develop both Java middle-tier code and browser code may also do so. Please see [Browser Development with Java](./browser/README.md) for information.*

## Installing

Expand All @@ -27,7 +27,7 @@ To configure and develop the browser app for Samplestack, you need the following
* npm, version 2.1.1 or higher. See [npmjs.com](https://www.npmjs.com/)
* git. See [git-scm.com](http://git-scm.com/)

This is "tech-stack" or minor variants thereof are almost ubiquitous in JavaScript dwvelopment shops in 2015.
This "tech-stack" or minor variants thereof are almost ubiquitous in JavaScript development shops in 2015.

Before you begin, please ensure that the software above is installed and functional. It is a good idea to update node.js to the most recent version of 10.x if you have not installed a recent version.

Expand Down Expand Up @@ -108,7 +108,7 @@ marklogic-samplestack>$ gulp once --browser=<browsername>
For *<browsername>*, you may supply one of "chrome", "firefox" or "ie". Please specify the name of a browser that you have already installed on your development machine,* for example `gulp once --browser=chrome`.

**Note: in version 1.1.0 of Samplestack, this command leverages the gradle/Java setup/automation code to configure the database.
You must have Java 1.7 or 1.8 installed for this to succeed. In the next release of Samplestack, the above command will in "pure JavaScript".**
You must have Java 1.7 or 1.8 installed for this to succeed.**

## Build, Unit Test, Run

Expand Down Expand Up @@ -166,7 +166,7 @@ Samplestack is configured to either run Selenium locally or to access SauceLabs.
tags present in the feature files. If specified, only features/scenarios which match this
specification will be executed. To specify NOT to match a tag, prefix with `~`. See example below regarding running tests that are known to be broken. *Full documentation of the syntax for the `--tags` flag is available by entering the command `node_modules/cucumber/bin/cucumber.js --help` from the Samplestack repository root directory.*

A few of examples:
A few examples:

```bash
gulp e2e # or gulp e2e --browser=chrome
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ REMEMBER to change the branch name in this code when preparing releases

## README for Version 1.1.0

This release features two middle tiers
This application features two middle tiers

- one for the Java enterprise developer, implemented using Java, Spring and Gradle
- one for the JavaScript developer, imple,emted using JavaScript, Node.js and Gulp.
- one for the JavaScript developer, implemented using JavaScript, Node.js and Gulp.

The project includes the following major components:
* [MarkLogic](http://www.marklogic.com/) for the database tier
Expand Down Expand Up @@ -54,7 +54,7 @@ Then, launch each of the tiers to get a feel for Samplestack's 3-tiered architec

1) **Database**

This version of Samplestack is intended to run with MarkLogic 8.0-1.1 or 8.0-2. Note: There is no direct upgrade path from Early Access releases of MarkLogic 8 to this release. If you had previously been running an early access pre-release, please perform a full uninstall, including manually deleting data directories, before installing a supported 8.x version for use with Samplestsack.
This version of Samplestack has been tested to run on MarkLogic 8.0-3. Log an issue for questions on compatibility with MarkLogic server versions. Note: There is no direct upgrade path from previous releases. If you had previously been running previous or pre-release version, please perform a full uninstall, including manually deleting data directories, before installing a supported 8.x version for use with Samplestack.

2) **Middle Tier - Application Server**

Expand Down Expand Up @@ -99,8 +99,7 @@ Facets | Search constraints, analytics
Ask, Answer, Comment | Document updates
Voting | Updates impact sorting
Accepted Answers and Reputation | Transactional model, data integrity

Coming soon: Related tags — demonstration of semantics with the use of RDF triples and SPARQL.
Related Tags | Semantics, using RDF triples and SPARQL

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion appserver/java-spring/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ available to the Java developer as she iterates through code exploration.

*To build and run:*

Before running anything here, you need MarkLogic 8.0-1.1, installed and
Before running anything here, you need MarkLogic 8.x, installed and
running. Start this quickstart with it installed and running. By default this
process will will secure MarkLogic with username admin, password admin. If you
have already secured MarkLogic, you need to update gradle.properties with the
Expand Down
4 changes: 2 additions & 2 deletions database/transforms/search-response.sjs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function searchTransform(context, params, input) {
var result = results[i];
var matches = result.matches;
var uri = result.uri;
var sourceDoc = fn.doc(uri).next().value;
var sourceDoc = fn.head(fn.doc(uri));
for (var j = 0; j < matches.length; j++) {
var match = matches[j];
var source = "";
Expand Down Expand Up @@ -126,7 +126,7 @@ function searchTransform(context, params, input) {
}
var answerNodePath = "/array-node(\"answers\")/object-node()[" + answerIndex + "]/id";

var answersSource = sourceDoc.xpath(answerNodePath).next().value;
var answersSource = fn.head(sourceDoc.xpath(answerNodePath));
if (answersSource !== undefined) {
match.id = answersSource;
} else {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "marklogic-samplestack",
"version": "1.1.0",
"description": "A sample application demonstrate basic 3-tiered MarkLogic-based development following the MarkLogic Reference Architecture",
"description": "A sample application that demonstrates basic 3-tiered MarkLogic-based application development following the MarkLogic Reference Architecture",
"license": "Apache-2.0",
"repository": {
"type": "git",
Expand Down