Commit 5cfc41da authored by Gerrit Hübbers's avatar Gerrit Hübbers 🃏
Browse files

Introduce config.yml. Use environment variable defined in it

parent 85c6d97d
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
// Generated on 2016-03-21 using generator-jhipster 2.27.1
'use strict';
var fs = require('fs');
var yaml = require('js-yaml');

var parseString = require('xml2js').parseString;
// Returns the second occurence of the version number
@@ -19,6 +20,11 @@ var parseVersionFromPomXml = function() {
    return version;
};

var parseTargetRepositoryFromApplicationYml = function() {
  var doc = yaml.safeLoad( fs.readFileSync('config.yml', 'utf8') );
  var result = doc.targetRepositoryName;
  return result;
}
// [usemin user-defined step](https://github.com/yeoman/grunt-usemin#user-defined-steps-and-post-processors)
var useminAutoprefixer = {
    name: 'autoprefixer',
@@ -326,7 +332,8 @@ module.exports = function (grunt) {
                },
                constants: {
                    ENV: 'dev',
                    VERSION: parseVersionFromPomXml()
                    VERSION: parseVersionFromPomXml(),
                    TARGET_REPOSITORY_NAME: parseTargetRepositoryFromApplicationYml()
                }
            },
            prod: {
@@ -335,7 +342,8 @@ module.exports = function (grunt) {
                },
                constants: {
                    ENV: 'prod',
                    VERSION: parseVersionFromPomXml()
                    VERSION: parseVersionFromPomXml(),
                    TARGET_REPOSITORY_NAME: parseTargetRepositoryFromApplicationYml()
                }
            }
        }
+6 −3
Original line number Diff line number Diff line
@@ -12,18 +12,21 @@ Once a content provider has successfully used DDA to import a batch of content t
## Initial setup
DDA is currently focused on working with a DSpace 5+ installation. In particular, it requires a running [DSpace REST endpoint](https://wiki.duraspace.org/display/DSDOC5x/REST+API) with [additional endpoints](https://git.gesis.org/dspace/rest-additions). DSpace must be running with [XMLWorkflow](https://wiki.duraspace.org/display/DSDOC5x/Configurable+Workflow) (not the XML-less *Workflow*).

### Creating a *Document Deposit Assistant* DSpace user
### Set properties for your local installation
Edit file `config.yml` and set property values according to your specific environment.

### Create a *Document Deposit Assistant* DSpace user
DDA will import documents to DSpace as a registered DSpace user. To create a new DDA user account within DSpace, first log in with administrator privileges. Then select *Access Control* -> *People*. Click *Click here to add a new E-Person*. Provide a valid and unique e-mail address, provide as first name "Document", as last name "Deposit Assistant", and have *Can Log In* selected. Click *Create E-Person*. Back in the *E-person management* interface, search for e-people with a string "Deposit Assistant", select the correct *Document Deposit Assistant* e-person from the results, and click *Login as E-Person* (in case it is available) or *Reset Password* in order to provide this user a password.


### Creating a *Document Deposit Assistant* DSpace collection
### Create a *Document Deposit Assistant* DSpace collection
DDA needs to know about a DSpace *collection* to which it can import its processed new items to.

In your DSpace installation, we suggest to create a new DSpace collection exclusively for DDA imports. This allows you to easily wipe DDA-supplied imports in case something went wrong.
While being logged in as a DSpace administrator, click on *Browse* -> *Communities & Collections* in order to get the *community list* overview. Either create a new community or select a community which you want the *Document Deposit Assistant* collection to be part of, and click *create Collection*. Provide a meaningful name such as *Document Deposit Assistant* and click *Create*.
You will get into the *Edit Collection* dialog. On the *Assign Roles* tab, within the *submitters* section, click *Create...*. This will create a new group which is granted submitter rights to this collection; and you will be brought to the membership dialog for this group. Within this dialog, have a look at the headline. It should be of the form: `Group Editor: COLLECTION_XXX_SUBMIT (id: YYY)`. Keep note of the `XXX` part, as this is the collection *ID* (not collection *handle*) that we will require later. On this submitter group membership dialog, search for e-people with a string "Deposit Assistant", identify the correct *Document Deposit Assistant* e-person from the results, click on its *Add* button, and click *Save* to finalize this step.

### Creating the *Document Deposit Assistant* reference metadatum field
### Create the *Document Deposit Assistant* reference metadatum field
In order for tracking and uniquely identifying some publication between DDA and the target repository, you have to set up a new kind of metadatum in your DSpace installation.
That metadatum has the key `internal.dda.reference`. While being logged in as a DSpace administrator, in the *Registries* menu section -> click *Metadata*. You will land in the *Metadata registry* overview. In case there is no namespace entry for *Internal* yet, add this new schema with dummy *namespace*=`internal`, and *name*=`internal`, then click *Add new schema*.
Once this entry exists, click on its name `internal`. On the *Metadata Schema: "internal"* page, provide in the first input field 

config.yml

0 → 100755
+1 −0
Original line number Diff line number Diff line
targetRepositoryName: SSOAR
 No newline at end of file

package.json

100644 → 100755
+22 −21
Original line number Diff line number Diff line
@@ -11,53 +11,54 @@
    "bower": "^1.6.3"
  },
  "devDependencies": {
    "browser-sync": "2.10.0",
    "event-stream": "3.3.2",
    "generator-jhipster": "2.27.1",
    "grunt": "0.4.5",
    "grunt-angular-templates": "0.5.7",
    "grunt-autoprefixer": "3.0.3",
    "grunt-build-control": "0.6.1",
    "grunt-wiredep": "2.0.0",
    "grunt-browser-sync": "2.2.0",
    "browser-sync": "2.10.0",
    "grunt-contrib-copy": "0.8.2",
    "grunt-build-control": "0.6.1",
    "grunt-contrib-clean": "0.7.0",
    "grunt-contrib-concat": "0.5.1",
    "grunt-contrib-copy": "0.8.2",
    "grunt-contrib-cssmin": "0.14.0",
    "grunt-contrib-htmlmin": "0.6.0",
    "grunt-contrib-imagemin": "1.0.0",
    "grunt-contrib-jshint": "0.11.3",
    "grunt-contrib-uglify": "0.10.1",
    "grunt-contrib-watch": "0.6.1",
    "grunt-karma": "0.12.1",
    "grunt-modernizr": "1.0.1",
    "grunt-ng-annotate": "1.0.1",
    "grunt-ng-constant": "1.1.0",
    "grunt-rev": "0.1.0",
    "grunt-sass": "1.1.0",
    "grunt-svgmin": "3.1.0",
    "grunt-text-replace": "0.4.0",
    "grunt-usemin": "3.1.1",
    "grunt-angular-templates":"0.5.7",
    "load-grunt-tasks": "3.3.0",
    "grunt-karma": "0.12.1",
    "time-grunt": "1.2.2",
    "grunt-sass": "1.1.0",
    "event-stream": "3.3.2",
    "grunt-wiredep": "2.0.0",
    "jasmine-core": "2.3.4",
    "js-yaml": "^3.9.1",
    "jshint-stylish": "2.1.0",
    "karma-script-launcher": "0.1.0",
    "karma": "0.13.19",
    "karma-chrome-launcher": "0.2.1",
    "karma-coverage": "0.5.3",
    "karma-html2js-preprocessor": "0.1.0",
    "karma-jasmine": "0.3.6",
    "karma-requirejs": "0.2.2",
    "karma-phantomjs-launcher": "0.2.1",
    "phantomjs": "1.9.18",
    "karma": "0.13.19",
    "karma-coverage": "0.5.3",
    "karma-jenkins-reporter": "0.0.2",
    "generator-jhipster": "2.27.1",
    "karma-phantomjs-launcher": "0.2.1",
    "karma-requirejs": "0.2.2",
    "karma-script-launcher": "0.1.0",
    "load-grunt-tasks": "3.3.0",
    "lodash": "3.10.1",
    "phantomjs": "1.9.18",
    "requirejs": "2.1",
    "time-grunt": "1.2.2",
    "wiredep": "2.2.2",
    "xml2js": "0.4.15",
    "yo": ">=1.3.0",
    "requirejs": "2.1",
    "jasmine-core": "2.3.4",
    "zeparser": "0.0.7",
    "wiredep": "2.2.2"
    "zeparser": "0.0.7"
  },
  "engines": {
    "node": "^0.12 || ^4.2"