Merge branch 'Development'
# Conflicts: # dmp-backend/src/main/java/rest/entities/DMPs.java # dmp-backend/src/main/java/rest/entities/DataRepositories.java # dmp-backend/src/main/java/rest/entities/DatasetProfiles.java # dmp-backend/src/main/java/rest/entities/Datasets.java # dmp-backend/src/main/java/rest/entities/DmpProfiles.java # dmp-backend/src/main/java/rest/entities/Organisations.java # dmp-backend/src/main/java/rest/entities/Projects.java # dmp-backend/src/main/java/rest/entities/Registries.java # dmp-backend/src/main/java/rest/entities/Researchers.java # dmp-backend/src/main/java/rest/entities/Services.java # dmp-backend/src/main/java/rest/entities/Users.java # dmp-frontend/src/app/app.component.ts # dmp-frontend/src/app/login/googgle-sign-in/googgle-sign-in.component.ts # dmp-frontend/src/assets/custom.js # dmp-frontend/src/index.html
This commit is contained in:
commit
bfc6b63067
|
@ -1 +1,20 @@
|
|||
dmp-frontend/dist.7z
|
||||
.idea/
|
||||
*.iml
|
||||
dmp-backend/src/main/ui-resources/static/vendor.bundle.js.map
|
||||
dmp-backend/src/main/ui-resources/static/vendor.bundle.js
|
||||
dmp-backend/src/main/ui-resources/static/unauthorized.module.chunk.js.map
|
||||
dmp-backend/src/main/ui-resources/static/unauthorized.module.chunk.js
|
||||
dmp-backend/src/main/ui-resources/static/styles.bundle.js.map
|
||||
dmp-backend/src/main/ui-resources/static/styles.bundle.js
|
||||
dmp-backend/src/main/ui-resources/static/polyfills.bundle.js.map
|
||||
dmp-backend/src/main/ui-resources/static/polyfills.bundle.js
|
||||
dmp-backend/src/main/ui-resources/static/main.bundle.js.map
|
||||
dmp-backend/src/main/ui-resources/static/main.bundle.js
|
||||
dmp-backend/src/main/ui-resources/static/lang/en.json
|
||||
dmp-backend/src/main/ui-resources/static/inline.bundle.js.map
|
||||
dmp-backend/src/main/ui-resources/static/inline.bundle.js
|
||||
dmp-backend/src/main/ui-resources/static/index.html
|
||||
dmp-backend/src/main/ui-resources/static/favicon.ico
|
||||
dmp-backend/src/main/ui-resources/static/assets/lang/en.json
|
||||
dmp-frontend/new 3.xml
|
||||
|
|
|
@ -1241,6 +1241,7 @@
|
|||
"requires": {
|
||||
"anymatch": "1.3.2",
|
||||
"async-each": "1.0.1",
|
||||
"fsevents": "1.1.3",
|
||||
"glob-parent": "2.0.0",
|
||||
"inherits": "2.0.3",
|
||||
"is-binary-path": "1.0.1",
|
||||
|
@ -2964,6 +2965,910 @@
|
|||
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
|
||||
"dev": true
|
||||
},
|
||||
"fsevents": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.3.tgz",
|
||||
"integrity": "sha512-WIr7iDkdmdbxu/Gh6eKEZJL6KPE74/5MEsf2whTOFNxbIoIixogroLdKYqB6FDav4Wavh/lZdzzd3b2KxIXC5Q==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"nan": "2.7.0",
|
||||
"node-pre-gyp": "0.6.39"
|
||||
},
|
||||
"dependencies": {
|
||||
"abbrev": {
|
||||
"version": "1.1.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"ajv": {
|
||||
"version": "4.11.8",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"co": "4.6.0",
|
||||
"json-stable-stringify": "1.0.1"
|
||||
}
|
||||
},
|
||||
"ansi-regex": {
|
||||
"version": "2.1.1",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
},
|
||||
"aproba": {
|
||||
"version": "1.1.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"are-we-there-yet": {
|
||||
"version": "1.1.4",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"delegates": "1.0.0",
|
||||
"readable-stream": "2.2.9"
|
||||
}
|
||||
},
|
||||
"asn1": {
|
||||
"version": "0.2.3",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"assert-plus": {
|
||||
"version": "0.2.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"asynckit": {
|
||||
"version": "0.4.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"aws-sign2": {
|
||||
"version": "0.6.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"aws4": {
|
||||
"version": "1.6.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"balanced-match": {
|
||||
"version": "0.4.2",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
},
|
||||
"bcrypt-pbkdf": {
|
||||
"version": "1.0.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"tweetnacl": "0.14.5"
|
||||
}
|
||||
},
|
||||
"block-stream": {
|
||||
"version": "0.0.9",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"inherits": "2.0.3"
|
||||
}
|
||||
},
|
||||
"boom": {
|
||||
"version": "2.10.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"hoek": "2.16.3"
|
||||
}
|
||||
},
|
||||
"brace-expansion": {
|
||||
"version": "1.1.7",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"balanced-match": "0.4.2",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"buffer-shims": {
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
},
|
||||
"caseless": {
|
||||
"version": "0.12.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"co": {
|
||||
"version": "4.6.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"code-point-at": {
|
||||
"version": "1.1.0",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
},
|
||||
"combined-stream": {
|
||||
"version": "1.0.5",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"delayed-stream": "1.0.0"
|
||||
}
|
||||
},
|
||||
"concat-map": {
|
||||
"version": "0.0.1",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
},
|
||||
"console-control-strings": {
|
||||
"version": "1.1.0",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
},
|
||||
"core-util-is": {
|
||||
"version": "1.0.2",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
},
|
||||
"cryptiles": {
|
||||
"version": "2.0.5",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"boom": "2.10.1"
|
||||
}
|
||||
},
|
||||
"dashdash": {
|
||||
"version": "1.14.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"assert-plus": "1.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"assert-plus": {
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"debug": {
|
||||
"version": "2.6.8",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"ms": "2.0.0"
|
||||
}
|
||||
},
|
||||
"deep-extend": {
|
||||
"version": "0.4.2",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"delayed-stream": {
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
},
|
||||
"delegates": {
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"detect-libc": {
|
||||
"version": "1.0.2",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"ecc-jsbn": {
|
||||
"version": "0.1.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"jsbn": "0.1.1"
|
||||
}
|
||||
},
|
||||
"extend": {
|
||||
"version": "3.0.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"extsprintf": {
|
||||
"version": "1.0.2",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
},
|
||||
"forever-agent": {
|
||||
"version": "0.6.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"form-data": {
|
||||
"version": "2.1.4",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"asynckit": "0.4.0",
|
||||
"combined-stream": "1.0.5",
|
||||
"mime-types": "2.1.15"
|
||||
}
|
||||
},
|
||||
"fs.realpath": {
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
},
|
||||
"fstream": {
|
||||
"version": "1.0.11",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"graceful-fs": "4.1.11",
|
||||
"inherits": "2.0.3",
|
||||
"mkdirp": "0.5.1",
|
||||
"rimraf": "2.6.1"
|
||||
}
|
||||
},
|
||||
"fstream-ignore": {
|
||||
"version": "1.0.5",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"fstream": "1.0.11",
|
||||
"inherits": "2.0.3",
|
||||
"minimatch": "3.0.4"
|
||||
}
|
||||
},
|
||||
"gauge": {
|
||||
"version": "2.7.4",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"aproba": "1.1.1",
|
||||
"console-control-strings": "1.1.0",
|
||||
"has-unicode": "2.0.1",
|
||||
"object-assign": "4.1.1",
|
||||
"signal-exit": "3.0.2",
|
||||
"string-width": "1.0.2",
|
||||
"strip-ansi": "3.0.1",
|
||||
"wide-align": "1.1.2"
|
||||
}
|
||||
},
|
||||
"getpass": {
|
||||
"version": "0.1.7",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"assert-plus": "1.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"assert-plus": {
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"glob": {
|
||||
"version": "7.1.2",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fs.realpath": "1.0.0",
|
||||
"inflight": "1.0.6",
|
||||
"inherits": "2.0.3",
|
||||
"minimatch": "3.0.4",
|
||||
"once": "1.4.0",
|
||||
"path-is-absolute": "1.0.1"
|
||||
}
|
||||
},
|
||||
"graceful-fs": {
|
||||
"version": "4.1.11",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
},
|
||||
"har-schema": {
|
||||
"version": "1.0.5",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"har-validator": {
|
||||
"version": "4.2.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"ajv": "4.11.8",
|
||||
"har-schema": "1.0.5"
|
||||
}
|
||||
},
|
||||
"has-unicode": {
|
||||
"version": "2.0.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"hawk": {
|
||||
"version": "3.1.3",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"boom": "2.10.1",
|
||||
"cryptiles": "2.0.5",
|
||||
"hoek": "2.16.3",
|
||||
"sntp": "1.0.9"
|
||||
}
|
||||
},
|
||||
"hoek": {
|
||||
"version": "2.16.3",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
},
|
||||
"http-signature": {
|
||||
"version": "1.1.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"assert-plus": "0.2.0",
|
||||
"jsprim": "1.4.0",
|
||||
"sshpk": "1.13.0"
|
||||
}
|
||||
},
|
||||
"inflight": {
|
||||
"version": "1.0.6",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"once": "1.4.0",
|
||||
"wrappy": "1.0.2"
|
||||
}
|
||||
},
|
||||
"inherits": {
|
||||
"version": "2.0.3",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
},
|
||||
"ini": {
|
||||
"version": "1.3.4",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"is-fullwidth-code-point": {
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"number-is-nan": "1.0.1"
|
||||
}
|
||||
},
|
||||
"is-typedarray": {
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"isarray": {
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
},
|
||||
"isstream": {
|
||||
"version": "0.1.2",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"jodid25519": {
|
||||
"version": "1.0.2",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"jsbn": "0.1.1"
|
||||
}
|
||||
},
|
||||
"jsbn": {
|
||||
"version": "0.1.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"json-schema": {
|
||||
"version": "0.2.3",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"json-stable-stringify": {
|
||||
"version": "1.0.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"jsonify": "0.0.0"
|
||||
}
|
||||
},
|
||||
"json-stringify-safe": {
|
||||
"version": "5.0.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"jsonify": {
|
||||
"version": "0.0.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"jsprim": {
|
||||
"version": "1.4.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"assert-plus": "1.0.0",
|
||||
"extsprintf": "1.0.2",
|
||||
"json-schema": "0.2.3",
|
||||
"verror": "1.3.6"
|
||||
},
|
||||
"dependencies": {
|
||||
"assert-plus": {
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"mime-db": {
|
||||
"version": "1.27.0",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
},
|
||||
"mime-types": {
|
||||
"version": "2.1.15",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"mime-db": "1.27.0"
|
||||
}
|
||||
},
|
||||
"minimatch": {
|
||||
"version": "3.0.4",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"brace-expansion": "1.1.7"
|
||||
}
|
||||
},
|
||||
"minimist": {
|
||||
"version": "0.0.8",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
},
|
||||
"mkdirp": {
|
||||
"version": "0.5.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"minimist": "0.0.8"
|
||||
}
|
||||
},
|
||||
"ms": {
|
||||
"version": "2.0.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"node-pre-gyp": {
|
||||
"version": "0.6.39",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"detect-libc": "1.0.2",
|
||||
"hawk": "3.1.3",
|
||||
"mkdirp": "0.5.1",
|
||||
"nopt": "4.0.1",
|
||||
"npmlog": "4.1.0",
|
||||
"rc": "1.2.1",
|
||||
"request": "2.81.0",
|
||||
"rimraf": "2.6.1",
|
||||
"semver": "5.3.0",
|
||||
"tar": "2.2.1",
|
||||
"tar-pack": "3.4.0"
|
||||
}
|
||||
},
|
||||
"nopt": {
|
||||
"version": "4.0.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"abbrev": "1.1.0",
|
||||
"osenv": "0.1.4"
|
||||
}
|
||||
},
|
||||
"npmlog": {
|
||||
"version": "4.1.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"are-we-there-yet": "1.1.4",
|
||||
"console-control-strings": "1.1.0",
|
||||
"gauge": "2.7.4",
|
||||
"set-blocking": "2.0.0"
|
||||
}
|
||||
},
|
||||
"number-is-nan": {
|
||||
"version": "1.0.1",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
},
|
||||
"oauth-sign": {
|
||||
"version": "0.8.2",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"object-assign": {
|
||||
"version": "4.1.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"once": {
|
||||
"version": "1.4.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"wrappy": "1.0.2"
|
||||
}
|
||||
},
|
||||
"os-homedir": {
|
||||
"version": "1.0.2",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"os-tmpdir": {
|
||||
"version": "1.0.2",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"osenv": {
|
||||
"version": "0.1.4",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"os-homedir": "1.0.2",
|
||||
"os-tmpdir": "1.0.2"
|
||||
}
|
||||
},
|
||||
"path-is-absolute": {
|
||||
"version": "1.0.1",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
},
|
||||
"performance-now": {
|
||||
"version": "0.2.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"process-nextick-args": {
|
||||
"version": "1.0.7",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
},
|
||||
"punycode": {
|
||||
"version": "1.4.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"qs": {
|
||||
"version": "6.4.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"rc": {
|
||||
"version": "1.2.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"deep-extend": "0.4.2",
|
||||
"ini": "1.3.4",
|
||||
"minimist": "1.2.0",
|
||||
"strip-json-comments": "2.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"minimist": {
|
||||
"version": "1.2.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"readable-stream": {
|
||||
"version": "2.2.9",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"buffer-shims": "1.0.0",
|
||||
"core-util-is": "1.0.2",
|
||||
"inherits": "2.0.3",
|
||||
"isarray": "1.0.0",
|
||||
"process-nextick-args": "1.0.7",
|
||||
"string_decoder": "1.0.1",
|
||||
"util-deprecate": "1.0.2"
|
||||
}
|
||||
},
|
||||
"request": {
|
||||
"version": "2.81.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"aws-sign2": "0.6.0",
|
||||
"aws4": "1.6.0",
|
||||
"caseless": "0.12.0",
|
||||
"combined-stream": "1.0.5",
|
||||
"extend": "3.0.1",
|
||||
"forever-agent": "0.6.1",
|
||||
"form-data": "2.1.4",
|
||||
"har-validator": "4.2.1",
|
||||
"hawk": "3.1.3",
|
||||
"http-signature": "1.1.1",
|
||||
"is-typedarray": "1.0.0",
|
||||
"isstream": "0.1.2",
|
||||
"json-stringify-safe": "5.0.1",
|
||||
"mime-types": "2.1.15",
|
||||
"oauth-sign": "0.8.2",
|
||||
"performance-now": "0.2.0",
|
||||
"qs": "6.4.0",
|
||||
"safe-buffer": "5.0.1",
|
||||
"stringstream": "0.0.5",
|
||||
"tough-cookie": "2.3.2",
|
||||
"tunnel-agent": "0.6.0",
|
||||
"uuid": "3.0.1"
|
||||
}
|
||||
},
|
||||
"rimraf": {
|
||||
"version": "2.6.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"glob": "7.1.2"
|
||||
}
|
||||
},
|
||||
"safe-buffer": {
|
||||
"version": "5.0.1",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
},
|
||||
"semver": {
|
||||
"version": "5.3.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"set-blocking": {
|
||||
"version": "2.0.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"signal-exit": {
|
||||
"version": "3.0.2",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"sntp": {
|
||||
"version": "1.0.9",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"hoek": "2.16.3"
|
||||
}
|
||||
},
|
||||
"sshpk": {
|
||||
"version": "1.13.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"asn1": "0.2.3",
|
||||
"assert-plus": "1.0.0",
|
||||
"bcrypt-pbkdf": "1.0.1",
|
||||
"dashdash": "1.14.1",
|
||||
"ecc-jsbn": "0.1.1",
|
||||
"getpass": "0.1.7",
|
||||
"jodid25519": "1.0.2",
|
||||
"jsbn": "0.1.1",
|
||||
"tweetnacl": "0.14.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"assert-plus": {
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"string-width": {
|
||||
"version": "1.0.2",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"code-point-at": "1.1.0",
|
||||
"is-fullwidth-code-point": "1.0.0",
|
||||
"strip-ansi": "3.0.1"
|
||||
}
|
||||
},
|
||||
"string_decoder": {
|
||||
"version": "1.0.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"safe-buffer": "5.0.1"
|
||||
}
|
||||
},
|
||||
"stringstream": {
|
||||
"version": "0.0.5",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"strip-ansi": {
|
||||
"version": "3.0.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-regex": "2.1.1"
|
||||
}
|
||||
},
|
||||
"strip-json-comments": {
|
||||
"version": "2.0.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"tar": {
|
||||
"version": "2.2.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"block-stream": "0.0.9",
|
||||
"fstream": "1.0.11",
|
||||
"inherits": "2.0.3"
|
||||
}
|
||||
},
|
||||
"tar-pack": {
|
||||
"version": "3.4.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"debug": "2.6.8",
|
||||
"fstream": "1.0.11",
|
||||
"fstream-ignore": "1.0.5",
|
||||
"once": "1.4.0",
|
||||
"readable-stream": "2.2.9",
|
||||
"rimraf": "2.6.1",
|
||||
"tar": "2.2.1",
|
||||
"uid-number": "0.0.6"
|
||||
}
|
||||
},
|
||||
"tough-cookie": {
|
||||
"version": "2.3.2",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"punycode": "1.4.1"
|
||||
}
|
||||
},
|
||||
"tunnel-agent": {
|
||||
"version": "0.6.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"safe-buffer": "5.0.1"
|
||||
}
|
||||
},
|
||||
"tweetnacl": {
|
||||
"version": "0.14.5",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"uid-number": {
|
||||
"version": "0.0.6",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
},
|
||||
"uuid": {
|
||||
"version": "3.0.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"verror": {
|
||||
"version": "1.3.6",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"extsprintf": "1.0.2"
|
||||
}
|
||||
},
|
||||
"wide-align": {
|
||||
"version": "1.1.2",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"string-width": "1.0.2"
|
||||
}
|
||||
},
|
||||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"fstream": {
|
||||
"version": "1.0.11",
|
||||
"resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz",
|
||||
|
|
|
@ -17,4 +17,12 @@
|
|||
|
||||
.cursor{
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.hide{
|
||||
display:none;
|
||||
}
|
||||
|
||||
.show {
|
||||
display:block;
|
||||
}
|
|
@ -39,7 +39,8 @@
|
|||
</div><!-- /.container-fluid -->
|
||||
</nav>
|
||||
|
||||
<main-window [ngClass]="{false:'invisible'}[tokenService.isLoggedIn() == true]"></main-window>
|
||||
<!-- <form-comp></form-comp>-->
|
||||
<main-window [ngClass]="{false:'invisible'}[tokenService.isLoggedIn() == true]"></main-window>
|
||||
|
||||
<app-main-sign-in [ngClass]="{true:'invisible'}[tokenService.isLoggedIn() == true]"></app-main-sign-in>
|
||||
|
||||
|
|
|
@ -1,9 +1,19 @@
|
|||
import { CheckBoxComponent } from './components/checkbox/checkbox-component';
|
||||
import { FreeTextData } from './models/DataField/FreeTextData';
|
||||
import { BooleanDecisionComponent } from './components/booleanDecision/booleanDecision-component';
|
||||
import { FreeTextComponent } from './components/freetext/freetext-component';
|
||||
import { TextAreaComponent } from './components/textarea/textarea-component';
|
||||
import { RadioBoxComponent } from './components/radiobox/radiobox-component';
|
||||
import { WordlistComponent } from './components/wordlist/wordlist-component';
|
||||
import { AutocompleteComponent } from './components/autocomplete/autocomplete-component';
|
||||
import { ComboboxComponent } from './components/combobox/combobox-component';
|
||||
|
||||
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { NgModule } from '@angular/core';
|
||||
//import { HttpModule, Http, Response, RequestOptions, RequestMethod, Headers, URLSearchParams } from '@angular/http';
|
||||
import { HttpClientModule, HttpClient, HTTP_INTERCEPTORS } from '@angular/common/http';
|
||||
import { HttpModule} from '@angular/http';
|
||||
import { HttpModule } from '@angular/http';
|
||||
import { DataTableModule } from "angular2-datatable";
|
||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { DialogService } from "ng2-bootstrap-modal";
|
||||
|
@ -27,7 +37,7 @@ import { DatarepoService } from './services/datarepo-service';
|
|||
import { GlobalInterceptor } from './services/interceptor';
|
||||
import { Toolbox } from './services/toolbox';
|
||||
|
||||
import { DataFilterPipe } from './pipes/data-filter.pipe';
|
||||
import { DataFilterPipe } from './pipes/data-filter.pipe';
|
||||
import { DatasetProfileTableFilterPipe } from './pipes/datasetprofile-table-filter.pipe';
|
||||
import { DmpTableFilterPipe } from './pipes/dmp-table-filter.pipe';
|
||||
import { ServiceTableFilterPipe } from './pipes/service-table-filter.pipe';
|
||||
|
@ -61,6 +71,15 @@ import { DatareposEditorComponent } from './managers/datarepos-editor/datarepos-
|
|||
import { DatasetprofileEditorComponent } from './managers/datasetprofile-editor/datasetprofile-editor.component';
|
||||
import { DatasetProfileGUIEditorComponent } from './dataset-profile-gui-editor/dataset-profile-gui-editor.component';
|
||||
|
||||
import { FieldFormComponent } from './dataset-profile-form/field-form/field-form.component';
|
||||
import { FormComponent } from './dataset-profile-form/form/form.component';
|
||||
import { GroupFieldFormComponent } from './dataset-profile-form/groupfield-form/groupfield-form.component';
|
||||
import { RuleFormComponent } from './dataset-profile-form/rule-component/rule.component';
|
||||
import { SectionFormComponent } from './dataset-profile-form/section-form/section-form.component';
|
||||
import { PageFormComponent } from './dataset-profile-form/page-form/page-component';
|
||||
import { CompositeFieldFormComponent } from './dataset-profile-form/compositefield-form/compositefield-form.component';
|
||||
|
||||
|
||||
|
||||
|
||||
@NgModule({
|
||||
|
@ -75,9 +94,20 @@ import { DatasetProfileGUIEditorComponent } from './dataset-profile-gui-editor/d
|
|||
ServiceTableFilterPipe,
|
||||
ResearcherTableFilterPipe,
|
||||
DatarepoTableFilterPipe,
|
||||
|
||||
|
||||
AppComponent,
|
||||
GooggleSignInComponent,
|
||||
FieldFormComponent,
|
||||
FormComponent,
|
||||
GroupFieldFormComponent,
|
||||
RuleFormComponent,
|
||||
SectionFormComponent,
|
||||
PageFormComponent,
|
||||
CompositeFieldFormComponent,
|
||||
ComboboxComponent,
|
||||
AutocompleteComponent,
|
||||
WordlistComponent,
|
||||
RadioBoxComponent,
|
||||
DatasetsViewerComponent,
|
||||
ProfileEditorComponent,
|
||||
PropertiesEditorComponent,
|
||||
|
@ -94,7 +124,11 @@ import { DatasetProfileGUIEditorComponent } from './dataset-profile-gui-editor/d
|
|||
ResearcherEditorComponent,
|
||||
DatareposEditorComponent,
|
||||
DatasetprofileEditorComponent,
|
||||
DatasetProfileGUIEditorComponent
|
||||
DatasetProfileGUIEditorComponent,
|
||||
TextAreaComponent,
|
||||
CheckBoxComponent,
|
||||
BooleanDecisionComponent,
|
||||
FreeTextComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
|
@ -109,13 +143,13 @@ import { DatasetProfileGUIEditorComponent } from './dataset-profile-gui-editor/d
|
|||
AppRouting
|
||||
],
|
||||
providers: [{
|
||||
provide: HTTP_INTERCEPTORS,
|
||||
useClass: GlobalInterceptor,
|
||||
multi: true,
|
||||
},
|
||||
DatasetsServiceService, TokenService, DmpsServiceService, ResearcherService,
|
||||
DialogService, DatasetProfileService, ProjectService, OrganisationService, DatarepoService,
|
||||
DmpProfileService, RegistryService, ServiceService, NativeLoginService, HttpModule, Toolbox, HttpClient, RestBase],
|
||||
provide: HTTP_INTERCEPTORS,
|
||||
useClass: GlobalInterceptor,
|
||||
multi: true,
|
||||
},
|
||||
DatasetsServiceService, TokenService, DmpsServiceService, ResearcherService,
|
||||
DialogService, DatasetProfileService, ProjectService, OrganisationService, DatarepoService,
|
||||
DmpProfileService, RegistryService, ServiceService, NativeLoginService, HttpModule, Toolbox, HttpClient, RestBase],
|
||||
bootstrap: [AppComponent]
|
||||
})
|
||||
export class AppModule { }
|
||||
|
|
|
@ -12,7 +12,7 @@ declare function simple_notifier(type: string, title: string, message:string): a
|
|||
})
|
||||
export class ProfileEditorComponent implements OnInit {
|
||||
|
||||
@Input('profileID') profileID: string = null;
|
||||
public profileID: string = null;
|
||||
|
||||
profile : any = new Array();
|
||||
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
export enum ValidationTypes {
|
||||
None = 0,
|
||||
Required = 1
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
<div [formGroup]="form">
|
||||
<div formGroupName="data" class="form-row">
|
||||
<div class="form-group col-md-12" >
|
||||
<label>Label</label>
|
||||
<input type="string" class="form-control" formControlName="label">
|
||||
</div>
|
||||
<div class="form-group col-md-12" >
|
||||
<label>Url</label>
|
||||
<input type="string" class="form-control" formControlName="url">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
|
@ -0,0 +1,23 @@
|
|||
import { AutocompleteData } from '../../models/DataField/AutocompleteData';
|
||||
import { Field } from '../../models/DataSetProfile/Field';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { FormArray } from '@angular/forms/src/model';
|
||||
|
||||
@Component({
|
||||
selector: 'autocomplete-component',
|
||||
templateUrl: './autocomplete-component.html'
|
||||
})
|
||||
export class AutocompleteComponent implements OnInit{
|
||||
@Input() dataModel: Field;
|
||||
@Input() form: FormGroup;
|
||||
private data:AutocompleteData = new AutocompleteData();
|
||||
|
||||
ngOnInit(){
|
||||
this.data.type= "autocomplete";
|
||||
let autocomplete: AutocompleteData = new AutocompleteData();
|
||||
//this.dataModel.data = new JsonSerializer<AutocompleteData>().fromJSONObject(this.data,AutocompleteData);
|
||||
//(<FormArray>this.form.get("data")).push(autocomplete.buildForm());
|
||||
this.form.addControl("data", this.data.buildForm());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
<div [formGroup]="form">
|
||||
<div formGroupName="data" class="form-row">
|
||||
<div class="form-group col-md-12" >
|
||||
<label>Label</label>
|
||||
<input type="string" class="form-control" formControlName="label">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
|
@ -0,0 +1,19 @@
|
|||
import { Field } from '../../models/DataSetProfile/Field';
|
||||
import { BooleanDecisionData } from '../../models/DataField/BooleanDecisionData';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { FormArray } from '@angular/forms/src/model';
|
||||
|
||||
@Component({
|
||||
selector: 'booleanDecision-component',
|
||||
templateUrl: './booleanDecision-component.html'
|
||||
})
|
||||
export class BooleanDecisionComponent implements OnInit{
|
||||
@Input() dataModel: Field;
|
||||
@Input() form: FormGroup;
|
||||
private data:BooleanDecisionData = new BooleanDecisionData();
|
||||
|
||||
ngOnInit(){
|
||||
this.form.addControl("data", this.data.buildForm());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
<div [formGroup]="form">
|
||||
<div formGroupName="data" class="form-row">
|
||||
<div class="form-group col-md-12" >
|
||||
<label>Label</label>
|
||||
<input type="string" class="form-control" formControlName="label">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
|
@ -0,0 +1,20 @@
|
|||
import { Field } from '../../models/DataSetProfile/Field';
|
||||
import { CheckBoxData } from '../../models/DataField/CheckBoxData';
|
||||
import { BooleanDecisionData } from '../../models/DataField/BooleanDecisionData';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { FormArray } from '@angular/forms/src/model';
|
||||
|
||||
@Component({
|
||||
selector: 'checkbox-component',
|
||||
templateUrl: './checkbox-component.html'
|
||||
})
|
||||
export class CheckBoxComponent implements OnInit{
|
||||
@Input() dataModel: Field;
|
||||
@Input() form: FormGroup;
|
||||
private data:CheckBoxData = new CheckBoxData();
|
||||
|
||||
ngOnInit(){
|
||||
this.form.addControl("data", this.data.buildForm());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
<div class="form-group col-md-12">
|
||||
<label>Type of Combobox</label>
|
||||
<select class="form-control" [(ngModel)]="type" (change)= "onchangeCombo($event)">
|
||||
<option *ngFor="let option of options" [value]="option.value">{{option.value}}</option>
|
||||
</select>
|
||||
<div class="form-row" [ngSwitch]="type">
|
||||
<div *ngSwitchCase="'autocomplete'">
|
||||
<autocomplete-component [form]="form" [dataModel]="dataModel"></autocomplete-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row" [ngSwitch]="type">
|
||||
<div *ngSwitchCase="'wordlist'">
|
||||
<wordlist-component [form]="form" [dataModel]="dataModel"></wordlist-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,25 @@
|
|||
import { Field } from '../../models/DataSetProfile/Field';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'combobox-component',
|
||||
templateUrl: './combobox-component.html'
|
||||
})
|
||||
export class ComboboxComponent implements OnInit{
|
||||
@Input() dataModel: Field;
|
||||
@Input() form: FormGroup;
|
||||
type: string;
|
||||
options = [{id:"autocomplete", value: "autocomplete"}, {id:"wordlist", value: "wordlist"}];
|
||||
|
||||
ngOnInit(){
|
||||
if (this.dataModel.data){
|
||||
this.type = this.form.get("data").get("type").value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
onchangeCombo(){
|
||||
if (this.form.get("data")) this.form.removeControl("data");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
<div [formGroup]="form">
|
||||
<div formGroupName="data" class="form-row">
|
||||
<div class="form-group col-md-12" >
|
||||
<label>Label</label>
|
||||
<input type="string" class="form-control" formControlName="label">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
|
@ -0,0 +1,21 @@
|
|||
import { Field } from '../../models/DataSetProfile/Field';
|
||||
import { FreeTextData } from '../../models/DataField/FreeTextData';
|
||||
import { CheckBoxData } from '../../models/DataField/CheckBoxData';
|
||||
import { BooleanDecisionData } from '../../models/DataField/BooleanDecisionData';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { FormArray } from '@angular/forms/src/model';
|
||||
|
||||
@Component({
|
||||
selector: 'freetext-component',
|
||||
templateUrl: './freetext-component.html'
|
||||
})
|
||||
export class FreeTextComponent implements OnInit{
|
||||
@Input() dataModel: Field;
|
||||
@Input() form: FormGroup;
|
||||
private data:FreeTextData = new FreeTextData();
|
||||
|
||||
ngOnInit(){
|
||||
this.form.addControl("data", this.data.buildForm());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
<div [formGroup]="form" class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label>Label</label>
|
||||
<input type="string" class="form-control" formControlName="label">
|
||||
</div>
|
||||
<div formGroupName="data">
|
||||
<div formArrayName="options">
|
||||
<div *ngFor="let option of form.get('data').get('options').controls index as i">
|
||||
<div [formGroupName]="i">
|
||||
<div class="form-group col-md-6">
|
||||
<label>Label</label>
|
||||
<input type="text" class="form-control" formControlName="label">
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label>Value</label>
|
||||
<input type="text" class="form-control" formControlName="value">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<a (click)="addNewRow(form)" style="cursor: pointer">
|
||||
Add +
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
|
@ -0,0 +1,32 @@
|
|||
import { FormGroup } from '@angular/forms';
|
||||
import { Field } from '../../models/DataSetProfile/Field';
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { RadioBoxData } from '../../models/DataField/RadioBoxData';
|
||||
import { FormArray } from '@angular/forms/src/model';
|
||||
import { ListingItem } from '../../models/Commons/ListingItem';
|
||||
import { JsonSerializer } from '../../utilities/JsonSerializer';
|
||||
|
||||
@Component({
|
||||
selector: 'radiobox-component',
|
||||
templateUrl: './radiobox-component.html'
|
||||
})
|
||||
export class RadioBoxComponent implements OnInit{
|
||||
@Input() dataModel: Field;
|
||||
@Input() form: FormGroup;
|
||||
private data: RadioBoxData = new RadioBoxData();
|
||||
private options = new Array<ListingItem>();
|
||||
|
||||
ngOnInit(){
|
||||
if (this.form.get("data")) this.form.removeControl("data");
|
||||
this.form.addControl("data", this.data.buildForm());
|
||||
this.addNewRow();
|
||||
}
|
||||
|
||||
addNewRow(){
|
||||
let radioListOptions:ListingItem = new ListingItem();
|
||||
(<FormArray>this.form.get("data").get("options")).push(radioListOptions.buildForm());
|
||||
this.data.options = [];
|
||||
this.data.options.push(radioListOptions);
|
||||
this.dataModel.data = new JsonSerializer<RadioBoxData>().fromJSONObject(this.data,RadioBoxData);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
<div [formGroup]="form">
|
||||
<div formGroupName="data" class="form-row">
|
||||
<div class="form-group col-md-12" >
|
||||
<label>Label</label>
|
||||
<input type="string" class="form-control" formControlName="label">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
|
@ -0,0 +1,22 @@
|
|||
import { Field } from '../../models/DataSetProfile/Field';
|
||||
import { TextArea } from '../../models/DataField/TextArea';
|
||||
import { FreeTextData } from '../../models/DataField/FreeTextData';
|
||||
import { CheckBoxData } from '../../models/DataField/CheckBoxData';
|
||||
import { BooleanDecisionData } from '../../models/DataField/BooleanDecisionData';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { FormArray } from '@angular/forms/src/model';
|
||||
|
||||
@Component({
|
||||
selector: 'textarea-component',
|
||||
templateUrl: './textarea-component.html'
|
||||
})
|
||||
export class TextAreaComponent implements OnInit{
|
||||
@Input() dataModel: Field;
|
||||
@Input() form: FormGroup;
|
||||
private data:TextArea = new TextArea();
|
||||
|
||||
ngOnInit(){
|
||||
this.form.addControl("data", this.data.buildForm());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
<div [formGroup]="form" class="form-row">
|
||||
<div formGroupName="data">
|
||||
<div class="form-group col-md-12" >
|
||||
<label>Label</label>
|
||||
<input type="string" class="form-control" formControlName="label">
|
||||
</div>
|
||||
<div formArrayName="options">
|
||||
<div *ngFor="let option of form.get('data').get('options').controls index as i">
|
||||
<div [formGroupName]="i">
|
||||
<div class="form-group col-md-6">
|
||||
<label>Label</label>
|
||||
<input type="text" class="form-control" formControlName="label">
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label>Value</label>
|
||||
<input type="text" class="form-control" formControlName="value">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<a (click)="addNewRow(form)" style="cursor: pointer">
|
||||
Add +
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
|
@ -0,0 +1,34 @@
|
|||
import { FormGroup } from '@angular/forms';
|
||||
import { Field } from '../../models/DataSetProfile/Field';
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { WordListData } from '../../models/DataField/WordListData';
|
||||
import { FormArray } from '@angular/forms/src/model';
|
||||
import { ListingItem } from '../../models/Commons/ListingItem';
|
||||
import { JsonSerializer } from '../../utilities/JsonSerializer';
|
||||
|
||||
@Component({
|
||||
selector: 'wordlist-component',
|
||||
templateUrl: './wordlist-component.html'
|
||||
})
|
||||
export class WordlistComponent implements OnInit{
|
||||
@Input() dataModel: Field;
|
||||
@Input() form: FormGroup;
|
||||
private data: WordListData = new WordListData();
|
||||
private options = new Array<ListingItem>();
|
||||
|
||||
ngOnInit(){
|
||||
this.data.type = "wordlist";
|
||||
// if (this.form.get("data")) this.form.removeControl("data");
|
||||
this.form.addControl("data", this.data.buildForm());
|
||||
if(!this.dataModel.data)
|
||||
this.addNewRow();
|
||||
}
|
||||
|
||||
addNewRow(){
|
||||
let wordListOptions:ListingItem = new ListingItem();
|
||||
(<FormArray>this.form.get("data").get("options")).push(wordListOptions.buildForm());
|
||||
this.data.options = [];
|
||||
this.data.options.push(wordListOptions);
|
||||
this.dataModel.data = new JsonSerializer<WordListData>().fromJSONObject(this.data,WordListData);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
<div>
|
||||
<label>
|
||||
<input type="checkbox" [(ngModel)]="isComposite" (ngModelChange)="onIsCompositeChange(isComposite)" /> Composite Field</label>
|
||||
<label>
|
||||
<input type="checkbox" [(ngModel)]="isMultiplicityEnabled" (ngModelChange)="onIsMultiplicityEnabledChange(isMultiplicityEnabled)"
|
||||
/> Multiplicity</label>
|
||||
<div [formGroup]="form">
|
||||
<label>
|
||||
<input type="checkbox" formControlName="hasCommentField" /> Comment</label>
|
||||
<div class="row">
|
||||
<div class="form-group col-md-12">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<label>FieldSet Label</label>
|
||||
<input data-toggle="tooltip" title="tooltip on second input!" type="text" class="form-control" formControlName="title">
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label>Description</label>
|
||||
<input type="text" class="form-control" formControlName="description">
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label>ExtendedDescription</label>
|
||||
<input type="text" class="form-control" formControlName="extendedDescription">
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="isMultiplicityEnabled" formGroupName="multiplicity">
|
||||
<div>
|
||||
<h5 style="margin-left:15px; font-weight:bold;">Multiplicity</h5>
|
||||
<div class="col-md-2">
|
||||
<label>Min</label>
|
||||
<input type="number" class="form-control" formControlName="min">
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<label>Max</label>
|
||||
<input type="number" class="form-control" formControlName="max">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="isComposite" class="col-md-4">
|
||||
<label>Ordinal</label>
|
||||
<input type="number" class="form-control" formControlName="ordinal">
|
||||
</div>
|
||||
<div *ngIf="isComposite" class="col-md-4">
|
||||
<label>Id</label>
|
||||
<input type="string" class="form-control" formControlName="id">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<field-form *ngIf="!isComposite" [form]="form.get('fields').get(''+0)" [dataModel]="dataModel.fields[0]" [showMultiplicity]="false"
|
||||
[indexPath]="indexPath + 'f' + 0"></field-form>
|
||||
|
||||
<div *ngIf="isComposite" class="panel-group" style="margin-top:10px;">
|
||||
<div *ngFor="let field of dataModel.fields let i=index;" class="panel panel-default">
|
||||
<div class="panel-heading clearfix">
|
||||
<a *ngIf="form.get('fields').get(''+i).get('title').value" data-toggle="collapse" href="#{{indexPath + 'f' + i}}" class="panel-title pull-left"
|
||||
style="padding-top: 7.5px;">{{i + 1}}. {{form.get('fields').get(''+i).get('title').value}}</a>
|
||||
<a *ngIf="!form.get('fields').get(''+i).get('title').value" data-toggle="collapse" href="#{{indexPath + 'f' + i}}" class="panel-title pull-left"
|
||||
style="padding-top: 7.5px;">{{i + 1}}. Child Field {{i + 1}}</a>
|
||||
<div class="btn-group pull-right">
|
||||
<button type="button" class="btn btn-sm" style="margin-left:5px;" (click)="DeleteField(i);">
|
||||
<span class="glyphicon glyphicon-erase"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="{{indexPath + 'f' + i}}" class="panel-collapse collapse in">
|
||||
<div class="panel-body">
|
||||
<field-form [form]="form.get('fields').get(''+i)" [dataModel]="field" [indexPath]="indexPath + 'f' + i"></field-form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="isComposite">
|
||||
<a (click)="addNewField()" style="cursor: pointer">
|
||||
Add Child Field +
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
|
@ -0,0 +1,57 @@
|
|||
import { Component, Input } from '@angular/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { FieldSet } from 'app/models/DataSetProfile/FieldSet';
|
||||
import { Field } from 'app/models/DataSetProfile/Field';
|
||||
import { FormArray, FormControl } from '@angular/forms/src/model';
|
||||
|
||||
@Component({
|
||||
selector: 'compositefield-form',
|
||||
templateUrl: './compositefield-form.component.html',
|
||||
styleUrls: []
|
||||
})
|
||||
|
||||
export class CompositeFieldFormComponent {
|
||||
@Input() form: FormGroup;
|
||||
@Input() dataModel: FieldSet;
|
||||
@Input() indexPath: string;
|
||||
|
||||
isComposite: boolean = false;
|
||||
isMultiplicityEnabled: boolean = false;
|
||||
|
||||
constructon() { }
|
||||
|
||||
ngOnInit() {
|
||||
//this.addNewField();
|
||||
if(this.form.get("multiplicity"))
|
||||
if (this.form.get("multiplicity").value.min >1 || this.form.get("multiplicity").value.max >1 )
|
||||
this.isMultiplicityEnabled= true;
|
||||
this.isComposite = this.dataModel.fields.length > 1;
|
||||
}
|
||||
|
||||
onIsCompositeChange(isComposite: boolean) {
|
||||
if (!isComposite && (<FormArray>this.form.get("fields")).length > 1) {
|
||||
for(let i = 0; i < (<FormArray>this.form.get("fields")).length - 1; i++) {
|
||||
(<FormArray>this.form.get("fields")).removeAt(1);
|
||||
}
|
||||
this.dataModel.fields.splice(1);
|
||||
}
|
||||
}
|
||||
|
||||
onIsMultiplicityEnabledChange(isMultiplicityEnabled: boolean) {
|
||||
if (!isMultiplicityEnabled) {
|
||||
(<FormControl>this.form.get('multiplicity').get("min")).setValue(0);
|
||||
(<FormControl>this.form.get('multiplicity').get("max")).setValue(0);
|
||||
}
|
||||
}
|
||||
|
||||
addNewField() {
|
||||
let field: Field = new Field();
|
||||
this.dataModel.fields.push(field);
|
||||
(<FormArray>this.form.get("fields")).push(field.buildForm());
|
||||
}
|
||||
|
||||
DeleteField(index) {
|
||||
this.dataModel.fields.splice(index, 1);
|
||||
(<FormArray>this.form.get("fields")).removeAt(index);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,120 @@
|
|||
<div>
|
||||
<div [formGroup]="form">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<label>Id</label>
|
||||
<input type="text" class="form-control" formControlName="id">
|
||||
</div>
|
||||
<div class="form-row col-md-6">
|
||||
<div formGroupName="viewStyle">
|
||||
<div class="form-group">
|
||||
<label>View style</label>
|
||||
<select class="form-control" formControlName="renderStyle">
|
||||
<option value="textarea">textarea</option>
|
||||
<option value="booleanDecision">booleanDecision</option>
|
||||
<option value='combobox'>combobox</option>
|
||||
<option value="checkBox">checkBox</option>
|
||||
<option value="freetext">freetext</option>
|
||||
<option value="radiobox">radiobox</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form" [ngSwitch]="form.get('viewStyle').get('renderStyle').value">
|
||||
<div *ngSwitchCase="'combobox'">
|
||||
<combobox-component [form]="form" [dataModel]="dataModel"></combobox-component>
|
||||
</div>
|
||||
<div *ngSwitchCase="'radiobox'">
|
||||
<radiobox-component [form]="form" [dataModel]="dataModel"></radiobox-component>
|
||||
</div>
|
||||
<div *ngSwitchCase="'freetext'">
|
||||
<freetext-component [form]="form" [dataModel]="dataModel"></freetext-component>
|
||||
</div>
|
||||
<div *ngSwitchCase="'textarea'">
|
||||
<textarea-component [form]="form" [dataModel]="dataModel"></textarea-component>
|
||||
</div>
|
||||
<div *ngSwitchCase="'booleanDecision'">
|
||||
<booleanDecision-component [form]="form" [dataModel]="dataModel"></booleanDecision-component>
|
||||
</div>
|
||||
<div *ngSwitchCase="'checkBox'">
|
||||
<checkbox-component [form]="form" [dataModel]="dataModel"></checkbox-component>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<label>description</label>
|
||||
<input type="text" class="form-control" formControlName="description">
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label>extendedDescription</label>
|
||||
<input type="text" class="form-control" formControlName="extendedDescription">
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="row">
|
||||
<div *ngIf="isFieldMultiplicityEnabled" formGroupName="multiplicity">
|
||||
<div class="form-group">
|
||||
<h5 style="margin-left:15px; font-weight:bold;">Multiplicity</h5>
|
||||
<div class="col-md-2">
|
||||
<label>Min</label>
|
||||
<input type="number" class="form-control" formControlName="min">
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<label>Max</label>
|
||||
<input type="number" class="form-control" formControlName="max">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
<label>Ordinal</label>
|
||||
<input type="number" class="form-control" formControlName="ordinal">
|
||||
</div>
|
||||
<div formGroupName="defaultValue">
|
||||
<div class="form-group col-md-5">
|
||||
<label>Default Value</label>
|
||||
<input type="text" class="form-control" formControlName="value">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-5">
|
||||
<label>Validation</label>
|
||||
<div formArrayName="validations">
|
||||
<div *ngFor="let validation of form.controls.validations.controls; let i=index">
|
||||
<select class="form-control" [formControlName]="i">
|
||||
<option *ngFor= "let option of validationsOptions" [value]="option.key">{{option.value}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<label *ngIf="showMultiplicity">
|
||||
<input type="checkbox" [(ngModel)]="isFieldMultiplicityEnabled" (ngModelChange)="onIsFieldMultiplicityEnabledChange(isFieldMultiplicityEnabled)"
|
||||
/> Multiplicity</label>
|
||||
|
||||
<div class="panel-group" style="margin-top:10px;">
|
||||
<div *ngFor="let rule of dataModel.visible.rules let i=index;" class="panel panel-default">
|
||||
<div class="panel-heading clearfix">
|
||||
<a data-toggle="collapse" href="#{{indexPath + 'r' + i}}" class="panel-title pull-left" style="padding-top: 7.5px;">{{i + 1}}. Rule {{i + 1}}</a>
|
||||
|
||||
<div class="btn-group pull-right">
|
||||
<button type="button" class="btn btn-sm" style="margin-left:5px;" (click)="DeleteRule(i);">
|
||||
<span class="glyphicon glyphicon-erase"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="{{indexPath + 'r' + i}}" class="panel-collapse collapse in">
|
||||
<div class="panel-body">
|
||||
<rule-form [form]="form.get('visible').get('rules').get(''+i)" [dataModel]="rule"></rule-form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<a (click)="addNewRule()" style="cursor: pointer">
|
||||
Add Rule +
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
|
@ -0,0 +1,53 @@
|
|||
import { Field } from '../../models/DataSetProfile/Field';
|
||||
import { Rule } from '../../models/DataSetProfile/Rule';
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { FormGroup, FormControl, FormArray } from '@angular/forms';
|
||||
import { ValidationTypes } from 'app/common/validationTypes';
|
||||
|
||||
@Component({
|
||||
selector: 'field-form',
|
||||
templateUrl: './field-form.component.html',
|
||||
styleUrls: []
|
||||
})
|
||||
|
||||
export class FieldFormComponent {
|
||||
@Input() form: FormGroup;
|
||||
@Input() dataModel: Field;
|
||||
@Input() showMultiplicity: boolean = true;
|
||||
@Input() indexPath: string;
|
||||
validationsOptions: Array<any>;
|
||||
isFieldMultiplicityEnabled: boolean = false;
|
||||
|
||||
constructon() {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
if (this.form.get("multiplicity"))
|
||||
if (this.form.get("multiplicity").value.min > 1 || this.form.get("multiplicity").value.max > 1)
|
||||
this.isFieldMultiplicityEnabled = true;
|
||||
this.validationsOptions = [{ key: 0, value: ValidationTypes[0] }, { key: 1, value: ValidationTypes[1] }]
|
||||
// this.addNewRule();
|
||||
}
|
||||
|
||||
onIsFieldMultiplicityEnabledChange(isFieldMultiplicityEnabled: boolean) {
|
||||
if (!isFieldMultiplicityEnabled) {
|
||||
(<FormControl>this.form.get('multiplicity').get("min")).setValue(0);
|
||||
(<FormControl>this.form.get('multiplicity').get("max")).setValue(0);
|
||||
}
|
||||
}
|
||||
|
||||
addNewRule() {
|
||||
let rule: Rule = new Rule();
|
||||
this.dataModel.visible.rules.push(rule);
|
||||
(<FormArray>this.form.get("visible").get("rules")).push(rule.buildForm());
|
||||
}
|
||||
|
||||
DeleteRule(index) {
|
||||
this.dataModel.visible.rules.splice(index, 1);
|
||||
(<FormArray>this.form.get("visible").get("rules")).removeAt(index);
|
||||
}
|
||||
|
||||
onchangeCombo() {
|
||||
debugger;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
<div class="container">
|
||||
<div style="background-color: #f5f5f5;border: 1px solid #e3e3e3;padding: 24px;">
|
||||
<form novalidate [formGroup]="form" (ngSubmit)="onSubmit()">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-12">
|
||||
<label>Label</label>
|
||||
<input type="text" class="form-control" formControlName="label">
|
||||
<div *ngIf="form.get('label').invalid && (form.get('label').dirty || form.get('label').touched)">
|
||||
<div *ngIf="form.get('label').errors.required" class="alert alert-danger">
|
||||
Label is required.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel-group" style="margin-top:10px;">
|
||||
<div *ngFor="let section of dataModel.sections; let i=index;" class="panel panel-default">
|
||||
<div class="panel-heading clearfix">
|
||||
<a *ngIf="form.get('sections').get(''+i).get('title').value" data-toggle="collapse" href="#{{'s' + i}}" class="panel-title pull-left"
|
||||
style="padding-top: 7.5px;">{{i + 1}}. {{form.get('sections').get(''+i).get('title').value}}</a>
|
||||
<a *ngIf="!form.get('sections').get(''+i).get('title').value" data-toggle="collapse" href="#{{'s' + i}}" class="panel-title pull-left"
|
||||
style="padding-top: 7.5px;">{{i + 1}}. Section {{i + 1}}</a>
|
||||
<div class="btn-group pull-right">
|
||||
<button type="button" class="btn btn-sm" style="margin-left:5px;" (click)="DeleteSection(i);">
|
||||
<span class="glyphicon glyphicon-erase"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="{{'s' + i}}" class="panel-collapse collapse in">
|
||||
<div class="panel-body">
|
||||
<section-form [form]="form.get('sections').get(''+i)" [dataModel]="section" [indexPath]="'s' + i"></section-form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel-group" style="margin-top:10px;">
|
||||
<div *ngFor="let page of dataModel.pages; let i=index;" class="panel panel-default">
|
||||
<div class="panel-heading clearfix">
|
||||
<a *ngIf="form.get('pages').at(i).get('title').value" data-toggle="collapse" href="#{{'p' + i}}" class="panel-title pull-left"
|
||||
style="padding-top: 7.5px;">{{i + 1}}.{{form.get('pages').at(i).get('title').value}}</a>
|
||||
<a *ngIf="!form.get('pages').at(i).get('title').value" data-toggle="collapse" href="#{{'p' + i}}" class="panel-title pull-left"
|
||||
style="padding-top: 7.5px;">{{i + 1}}. Page{{i + 1}}</a>
|
||||
<div class="btn-group pull-right">
|
||||
<button type="button" class="btn btn-sm" style="margin-left:5px;" (click)="DeletePage(i);">
|
||||
<span class="glyphicon glyphicon-erase"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="{{'p' + i}}" class="panel-collapse collapse in">
|
||||
<div class="panel-body">
|
||||
<page-form [form]="form.get('pages').at(i)" [dataModel]="page"></page-form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="margin-top:20px; padding-left: 15px;" class="row">
|
||||
<a (click)="addSection()" style="cursor: pointer">
|
||||
Add Section +
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div style="margin-top:20px; padding-left: 15px;" class="row">
|
||||
<a (click)="addPage()" style="cursor: pointer">
|
||||
Add Page +
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<button class="btn btn-primary" style="margin-top:20px;" type="submit" [disabled]="!form.valid">Save</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,94 @@
|
|||
import { Section } from '../../models/DataSetProfile/Section';
|
||||
import { JsonSerializer } from '../../utilities/JsonSerializer';
|
||||
import { DatasetProfileService } from '../../services/dataset-profile.service';
|
||||
import { RestBase } from '../../services/rest-base';
|
||||
import { DatasetProfileModel } from '../../models/DataSetProfile/DatasetProfileModel';
|
||||
import { Page } from '../../models/DataSetProfile/Page';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormGroup, FormControl } from '@angular/forms';
|
||||
import { SectionFormComponent } from '../section-form/section-form.component';
|
||||
import { FormArray } from '@angular/forms/src/model';
|
||||
import { Router, ActivatedRoute, ParamMap, Params } from '@angular/router';
|
||||
import { PageFormComponent } from '../page-form/page-component'
|
||||
|
||||
@Component({
|
||||
selector: 'form-comp',
|
||||
templateUrl: './form.component.html',
|
||||
styleUrls: []
|
||||
})
|
||||
|
||||
export class FormComponent {
|
||||
|
||||
dataModel: DatasetProfileModel;
|
||||
form: FormGroup;
|
||||
private profileID: string;
|
||||
|
||||
constructor(public restBase: RestBase, private datasetProfileService: DatasetProfileService, private route: ActivatedRoute) {
|
||||
this.profileID = route.snapshot.params['id'];
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this.dataModel = new JsonSerializer<DatasetProfileModel>().fromJSONObject(new DatasetProfileModel(), DatasetProfileModel);
|
||||
this.form = this.dataModel.buildForm();
|
||||
if (this.profileID) {
|
||||
this.datasetProfileService.getDatasetProfileById(this.profileID).subscribe((data) => {
|
||||
|
||||
this.dataModel = new JsonSerializer<DatasetProfileModel>().fromJSONObject(data, DatasetProfileModel);
|
||||
this.form = this.dataModel.buildForm();
|
||||
});
|
||||
}
|
||||
else{
|
||||
|
||||
this.addSection();
|
||||
this.addPage(0);
|
||||
}
|
||||
|
||||
// this.dataModel = new JsonSerializer<DatasetProfileModel>().fromJSONObject(TestModel, DatasetProfileModel);
|
||||
// this.form = this.dataModel.buildForm();
|
||||
}
|
||||
|
||||
onIsMultiplicityEnabledChange(isMultiplicityEnabled: boolean) {
|
||||
if (!isMultiplicityEnabled) {
|
||||
(<FormControl>this.form.get('multiplicity').get("min")).setValue(0);
|
||||
(<FormControl>this.form.get('multiplicity').get("max")).setValue(0);
|
||||
}
|
||||
}
|
||||
|
||||
addSection() {
|
||||
let section: Section = new Section();
|
||||
this.dataModel.sections.push(section);
|
||||
(<FormArray>this.form.get("sections")).push(section.buildForm());
|
||||
}
|
||||
|
||||
addPage(number) {
|
||||
let page: Page = new Page(this.dataModel.pages.length);
|
||||
this.dataModel.pages.push(page);
|
||||
(<FormArray>this.form.get("pages")).push(page.buildForm());
|
||||
}
|
||||
|
||||
DeleteSection(index) {
|
||||
this.dataModel.sections.splice(index,1);
|
||||
(<FormArray>this.form.get("sections")).removeAt(index)
|
||||
}
|
||||
|
||||
DeletePage(index) {
|
||||
this.dataModel.pages.splice(index, 1);
|
||||
(<FormArray>this.form.get("pages")).removeAt(index)
|
||||
}
|
||||
|
||||
createForm(data) {
|
||||
return this.restBase.post("/admin/addDmp", data);
|
||||
}
|
||||
updateForm(id,data) {
|
||||
return this.restBase.post("/admin/addDmp/"+id, data);
|
||||
}
|
||||
onSubmit() {
|
||||
let data = this.form.value;
|
||||
|
||||
if(this.profileID) this.updateForm(this.profileID, data).subscribe();
|
||||
else this.createForm(data).subscribe();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
<div>
|
||||
<!-- <div [formGroup]="form">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-5">
|
||||
<label>Title</label>
|
||||
<input type="text" class="form-control" formControlName="title">
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
<label>Id</label>
|
||||
<input type="text" class="form-control" formControlName="id">
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
<label>Ordinal</label>
|
||||
<input type="text" class="form-control" formControlName="ordinal">
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label class="radio control-label">Default Visibility</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" [value]="true" formControlName="defaultVisibility"> true
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" [value]="false" formControlName="defaultVisibility"> false
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<label>Description</label>
|
||||
<input type="text" class="form-control" formControlName="description">
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label>ExtendedDescription</label>
|
||||
<input type="text" class="form-control" formControlName="extendedDescription">
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="panel-group" style="margin-top:10px;">
|
||||
<div *ngFor="let field of dataModel.compositeFields let i=index;" class="panel panel-default">
|
||||
<div class="panel-heading clearfix">
|
||||
<!-- <a *ngIf="form.get('compositeFields').get(''+i).get('title').value" data-toggle="collapse" href="#{{'compositeFieldCollapse' + i}}"
|
||||
class="panel-title pull-left" style="padding-top: 7.5px;">{{i + 1}}. {{form.get('compositeFields').get(''+i).get('title').value}}</a>
|
||||
<a *ngIf="!form.get('compositeFields').get(''+i).get('title').value" data-toggle="collapse" href="#{{'compositeFieldCollapse' + i}}"
|
||||
class="panel-title pull-left" style="padding-top: 7.5px;">{{i + 1}}. Field {{i + 1}}</a> -->
|
||||
<a data-toggle="collapse" href="#{{indexPath + 'cf' + i}}"
|
||||
class="panel-title pull-left" style="padding-top: 7.5px;">{{i + 1}}. Field {{i + 1}}</a>
|
||||
|
||||
<div class="btn-group pull-right">
|
||||
<button type="button" class="btn btn-sm" style="margin-left:5px;" (click)="DeleteFieldSet(i);">
|
||||
<span class="glyphicon glyphicon-erase"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="{{indexPath + 'cf' + i}}" class="panel-collapse collapse in">
|
||||
<div class="panel-body">
|
||||
<compositefield-form [form]="form.get('compositeFields').get(''+i)" [dataModel]="field" [indexPath]="indexPath + 'cf' + i"></compositefield-form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div>
|
||||
<a (click)="addNewFieldSet()" style="cursor: pointer">
|
||||
Add Field +
|
||||
</a>
|
||||
</div> -->
|
||||
</div>
|
|
@ -0,0 +1,43 @@
|
|||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { FieldGroup } from 'app/models/DataSetProfile/FieldGroup';
|
||||
import { FieldSet } from 'app/models/DataSetProfile/FieldSet';
|
||||
import { FormArray } from '@angular/forms/src/model';
|
||||
import { Field } from 'app/models/DataSetProfile/Field';
|
||||
|
||||
@Component({
|
||||
selector: 'groupfield-form',
|
||||
templateUrl: './groupfield-form.component.html',
|
||||
styleUrls: []
|
||||
})
|
||||
|
||||
export class GroupFieldFormComponent {
|
||||
@Input() form: FormGroup;
|
||||
@Input() dataModel: FieldGroup;
|
||||
@Input() indexPath: string;
|
||||
|
||||
constructor(){}
|
||||
|
||||
ngOnInit(){
|
||||
//this.addNewField();
|
||||
}
|
||||
|
||||
addNewFieldSet(){
|
||||
let compositeField: FieldSet = new FieldSet();
|
||||
|
||||
let field: Field = new Field(); //create field at the same time
|
||||
compositeField.fields.push(field);
|
||||
//(<FormArray>this.form.get("compositeFields").get("fields")).push(field.buildForm());
|
||||
|
||||
|
||||
this.dataModel.compositeFields.push(compositeField);
|
||||
(<FormArray>this.form.get("compositeFields")).push(compositeField.buildForm());
|
||||
|
||||
}
|
||||
|
||||
DeleteFieldSet(index){
|
||||
this.dataModel.compositeFields.splice(index, 1);
|
||||
(<FormArray>this.form.get("compositeFields")).removeAt(index);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
<div>
|
||||
<div [formGroup]="form" class="row">
|
||||
<div class="col-md-4">
|
||||
<label>Title</label>
|
||||
<input type="text" class="form-control" formControlName="title">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,18 @@
|
|||
import { Component, Input, Output, EventEmitter } from '@angular/core';
|
||||
import { FormGroup } from '@angular/forms'
|
||||
import { Page } from 'app/models/DataSetProfile/Page'
|
||||
|
||||
@Component({
|
||||
selector: 'page-form',
|
||||
templateUrl: './page-component.html',
|
||||
styleUrls: []
|
||||
})
|
||||
|
||||
export class PageFormComponent {
|
||||
@Input() form: FormGroup;
|
||||
@Input() dataModel: Page;
|
||||
|
||||
TargetValidation() {
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
<div>
|
||||
<div [formGroup]="form">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label>Rule Type</label>
|
||||
<select class="form-control" formControlName="ruleType">
|
||||
<option>field value</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label>Target</label>
|
||||
<input type="text" class="form-control" placeholder="field id" formControlName="target" (change)="TargetValidation()">
|
||||
</div>
|
||||
<!-- <div class="form-group col-md-4">
|
||||
<label>Rule style</label>
|
||||
<select class="form-control">
|
||||
<option>boolean</option>
|
||||
<option>checked</option>
|
||||
<option>unchecked</option>
|
||||
<option>dropdown value</option>
|
||||
</select>
|
||||
</div> -->
|
||||
<!-- <div class="form-group col-md-6">
|
||||
<label>Value Type</label>
|
||||
<input type="text" class="form-control" formControlName="valueType">
|
||||
</div> -->
|
||||
<div class="form-group col-md-12">
|
||||
<label>Value</label>
|
||||
<input type="text" class="form-control" formControlName="value">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,18 @@
|
|||
import { Component, Input, Output, EventEmitter } from '@angular/core';
|
||||
import { FormGroup } from '@angular/forms'
|
||||
import { Rule } from 'app/models/DataSetProfile/Rule'
|
||||
|
||||
@Component({
|
||||
selector: 'rule-form',
|
||||
templateUrl: './rule.component.html',
|
||||
styleUrls: []
|
||||
})
|
||||
|
||||
export class RuleFormComponent {
|
||||
@Input() form: FormGroup;
|
||||
@Input() dataModel: FormGroup;
|
||||
|
||||
TargetValidation(){
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
.section-container {
|
||||
background-color: #f5f5f5;
|
||||
border: 1px solid #e3e3e3;
|
||||
padding: 24px;
|
||||
}
|
|
@ -0,0 +1,124 @@
|
|||
<div class="section-container">
|
||||
<div class="row" [formGroup]="form">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-4">
|
||||
<label>Title</label>
|
||||
<input type="text" class="form-control" formControlName="title">
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
<label>Id</label>
|
||||
<input type="text" class="form-control" formControlName="id">
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
<label>Ordinal</label>
|
||||
<input type="number" class="form-control" formControlName="ordinal">
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
<label>Page</label>
|
||||
<select class="form-control" formControlName="page">
|
||||
<option *ngFor="let pageGroup of form.root.get('pages').controls;" [value]="pageGroup.get('id').value">{{pageGroup.get('title').value}}</option>
|
||||
</select>
|
||||
<div *ngIf="form.get('page').invalid && (form.get('page').dirty || form.get('page').touched)" class="alert alert-danger">Page is required</div>
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
<label class="radio control-label">Default Visibility</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" [value]="true" formControlName="defaultVisibility"> true
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" [value]="false" formControlName="defaultVisibility"> false
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="dataModel.sections.length > 0" class="panel-group" style="margin-top:10px;">
|
||||
<div *ngFor="let section of dataModel.sections; let i=index;" class="panel panel-default">
|
||||
<div class="panel-heading clearfix">
|
||||
<a *ngIf="form.get('sections').get(''+i).get('title').value" data-toggle="collapse" href="#{{indexPath + 's' + i}}" class="panel-title pull-left"
|
||||
style="padding-top: 7.5px;">{{i + 1}}. {{form.get('sections').get(''+i).get('title').value}}</a>
|
||||
<a *ngIf="!form.get('sections').get(''+i).get('title').value" data-toggle="collapse" href="#{{indexPath + 's' + i}}" class="panel-title pull-left"
|
||||
style="padding-top: 7.5px;">{{i + 1}}. Section {{i + 1}}</a>
|
||||
<div class="btn-group pull-right">
|
||||
<button type="button" class="btn btn-sm" style="margin-left:5px;" (click)="DeleteSectionInSection(i);">
|
||||
<span class="glyphicon glyphicon-erase"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="{{indexPath + 's' + i}}" class="panel-collapse collapse in">
|
||||
<div class="panel-body">
|
||||
<section-form [form]="form.get('sections').get(''+i)" [dataModel]="section" [indexPath]="indexPath + 's' + i"></section-form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <div *ngFor="let fieldGroup of dataModel.fieldGroups let i=index;">
|
||||
<groupfield-form [form]="form.get('fieldGroups').get(''+i)" [dataModel]="fieldGroup" [indexPath]="indexPath + 'g' + i"></groupfield-form>
|
||||
</div> -->
|
||||
|
||||
<div class="panel-group" style="margin-top:10px;">
|
||||
<div *ngFor="let field of dataModel.fieldSets let i=index;" class="panel panel-default">
|
||||
<div class="panel-heading clearfix">
|
||||
<!-- <a *ngIf="form.get('compositeFields').get(''+i).get('title').value" data-toggle="collapse" href="#{{'compositeFieldCollapse' + i}}"
|
||||
class="panel-title pull-left" style="padding-top: 7.5px;">{{i + 1}}. {{form.get('compositeFields').get(''+i).get('title').value}}</a>
|
||||
<a *ngIf="!form.get('compositeFields').get(''+i).get('title').value" data-toggle="collapse" href="#{{'compositeFieldCollapse' + i}}"
|
||||
class="panel-title pull-left" style="padding-top: 7.5px;">{{i + 1}}. Field {{i + 1}}</a> -->
|
||||
<a data-toggle="collapse" href="#{{indexPath + 'cf' + i}}"
|
||||
class="panel-title pull-left" style="padding-top: 7.5px;">{{i + 1}}. Field {{i + 1}}</a>
|
||||
|
||||
<div class="btn-group pull-right">
|
||||
<button type="button" class="btn btn-sm" style="margin-left:5px;" (click)="DeleteFieldSet(i);">
|
||||
<span class="glyphicon glyphicon-erase"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="{{indexPath + 'cf' + i}}" class="panel-collapse collapse in">
|
||||
<div class="panel-body">
|
||||
<compositefield-form [form]="form.get('fieldSets').get(''+i)" [dataModel]="field" [indexPath]="indexPath + 'cf' + i"></compositefield-form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--
|
||||
<div *ngIf="dataModel.fieldGroups" class="panel-group" style="margin-top:10px;">
|
||||
<div *ngFor="let fieldGroup of dataModel.fieldGroups let i=index;" class="panel panel-default">
|
||||
<div class="panel-heading clearfix">
|
||||
<a *ngIf="form.get('fieldGroups').get(''+i).get('title').value" data-toggle="collapse" href="#{{indexPath + 'g' + i}}" class="panel-title pull-left"
|
||||
style="padding-top: 7.5px;">{{i + 1}}. {{form.get('fieldGroups').get(''+i).get('title').value}}</a>
|
||||
<a *ngIf="!form.get('fieldGroups').get(''+i).get('title').value" data-toggle="collapse" href="#{{indexPath + 'g' + i}}" class="panel-title pull-left"
|
||||
style="padding-top: 7.5px;">{{i + 1}}. Group {{i + 1}}</a>
|
||||
<div class="btn-group pull-right">
|
||||
<button type="button" class="btn btn-sm" style="margin-left:5px;" (click)="DeleteFieldGroup(i);">
|
||||
<span class="glyphicon glyphicon-erase"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="{{indexPath + 'g' + i}}" class="panel-collapse collapse in">
|
||||
<div class="panel-body">
|
||||
<groupfield-form [form]="form.get('fieldGroups').get(''+i)" [dataModel]="fieldGroup" [indexPath]="indexPath + 'g' + i"></groupfield-form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- <div>
|
||||
<a (click)="addGroupField()" style="cursor: pointer">
|
||||
Add Group +
|
||||
</a>
|
||||
</div> -->
|
||||
<div>
|
||||
<a (click)="addField()" style="cursor: pointer">
|
||||
Add Field +
|
||||
</a>
|
||||
</div>
|
||||
<div>
|
||||
<a (click)="addSectioninSection()" style="cursor: pointer">
|
||||
Add Section +
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,79 @@
|
|||
import { Component, OnInit, Input, ViewEncapsulation } from '@angular/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { Section } from 'app/models/DataSetProfile/Section';
|
||||
import { FieldGroup } from 'app/models/DataSetProfile/FieldGroup';
|
||||
import { FormArray } from '@angular/forms/src/model';
|
||||
import { DatasetProfileModel } from 'app/models/DataSetProfile/DatasetProfileModel';
|
||||
import { FieldSet } from 'app/models/DataSetProfile/FieldSet';
|
||||
import { Field } from 'app/models/DataSetProfile/Field';
|
||||
import { Page } from 'app/models/DataSetProfile/Page';
|
||||
import { JsonSerializer } from 'app/utilities/JsonSerializer';
|
||||
|
||||
@Component({
|
||||
selector: 'section-form',
|
||||
templateUrl: './section-form.component.html',
|
||||
styleUrls: ['./section-form.component.css'],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
|
||||
export class SectionFormComponent {
|
||||
@Input() form: FormGroup;
|
||||
@Input() dataModel: Section;
|
||||
@Input() indexPath: string;
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
var self = this;
|
||||
|
||||
this.form.root.get("pages").valueChanges.subscribe(function(value) {
|
||||
self.keepPageSelectionValid(value);
|
||||
});
|
||||
}
|
||||
|
||||
// addGroupField() {
|
||||
// let fieldGroup: FieldGroup = new FieldGroup();
|
||||
// if (this.dataModel.fieldGroups)
|
||||
// this.dataModel.fieldGroups.push(fieldGroup);
|
||||
// (<FormArray>this.form.get("fieldGroups")).push(fieldGroup.buildForm());
|
||||
// }
|
||||
|
||||
addField() {
|
||||
let fieldSet: FieldSet = new FieldSet();
|
||||
let field: Field = new Field();
|
||||
//let fieldGroup: FieldGroup = new FieldGroup();
|
||||
fieldSet.fields.push(field);
|
||||
//fieldGroup.compositeFields.push(fieldSet);
|
||||
if (this.dataModel.fieldSets)
|
||||
this.dataModel.fieldSets.push(fieldSet);
|
||||
(<FormArray>this.form.get("fieldSets")).push(fieldSet.buildForm());
|
||||
}
|
||||
|
||||
// DeleteFieldGroup(index) {
|
||||
// this.dataModel.fieldGroups.splice(index, 1);
|
||||
// (<FormArray>this.form.get("fieldGroups")).removeAt(index)
|
||||
// }
|
||||
|
||||
addSectioninSection() {
|
||||
let section: Section = new Section();
|
||||
this.dataModel.sections.push(section);
|
||||
(<FormArray>this.form.get("sections")).push(section.buildForm());
|
||||
}
|
||||
|
||||
DeleteSectionInSection(index) {
|
||||
this.dataModel.sections.splice(index);
|
||||
(<FormArray>this.form.get("sections")).removeAt(index);
|
||||
}
|
||||
|
||||
DeleteFieldSet(index){
|
||||
this.dataModel.fieldSets.splice(index, 1);
|
||||
(<FormArray>this.form.get("fieldSets")).removeAt(index);
|
||||
}
|
||||
|
||||
keepPageSelectionValid(pagesJson: Array<any>) {
|
||||
let selectedPage = this.form.get("page").value as number;
|
||||
let pages: Array<Page> = new JsonSerializer<Page>().fromJSONArray(pagesJson, Page);
|
||||
if (!isNaN(selectedPage) && pages.find(elem => elem.id === selectedPage) === undefined)
|
||||
this.form.get("page").reset();
|
||||
}
|
||||
}
|
|
@ -12,7 +12,7 @@
|
|||
<h3 class="panel-title">Manage Datasets</h3>
|
||||
</div>
|
||||
<div class="col col-xs-6 text-right">
|
||||
<button type="button" class="btn btn-sm btn-primary btn-create" data-toggle="modal" data-target="#newdataset-modal-container">Create New</button>
|
||||
<button type="button" class="btn btn-sm btn-primary btn-create" data-toggle="modal" data-target="#newdataset-modal-container" >Create New</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -23,7 +23,7 @@ export class GooggleSignInComponent implements OnInit, AfterViewInit {
|
|||
ngOnInit() {
|
||||
}
|
||||
|
||||
private clientId:string = '1010962018903-glegmqudqtl1lub0150vacopbu06lgsg.apps.googleusercontent.com';
|
||||
private clientId:string = '524432312250-sc9qsmtmbvlv05r44onl6l93ia3k9deo.apps.googleusercontent.com';
|
||||
|
||||
private scope = [
|
||||
'profile',
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<div class="col-sm-6 col-md-4 col-md-offset-4">
|
||||
<h1 class="text-center login-title"></h1>
|
||||
<div class="account-wall">
|
||||
<img class="profile-img" src="/assets/icons/user-icon.png">
|
||||
<img class="profile-img" src="/admin-ui/assets/icons/user-icon.png">
|
||||
<form class="form-signin" [formGroup]="nativeLoginForm">
|
||||
<input type="text" class="form-control" [(ngModel)]="creds.username" formControlName="username" placeholder="Username or Email" required autofocus>
|
||||
<input type="password" class="form-control" [(ngModel)]="creds.password" formControlName="password" placeholder="Password" required>
|
||||
|
|
|
@ -13,23 +13,30 @@
|
|||
<span class="glyphicon glyphicon-refresh"></span>
|
||||
</button>
|
||||
</th>
|
||||
<th>
|
||||
<button type="button" class="btn btn-sm btn-primary btn-create" data-toggle="modal" data-target="#newdataset-modal-container" [routerLink]="['/form']">Create New</button>
|
||||
</th>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th [ngClass]="{true:'visible', false:'invisible'}[showIDs]"><mfDefaultSorter by="id">ID</mfDefaultSorter></th>
|
||||
<!-- <th [ngClass]="{true:'visible', false:'invisible'}[showIDs]"><mfDefaultSorter by="id">ID</mfDefaultSorter></th> -->
|
||||
<th><mfDefaultSorter by="label">Label</mfDefaultSorter></th>
|
||||
<th><mfDefaultSorter by="ruleset">Ruleset</mfDefaultSorter></th>
|
||||
<th><mfDefaultSorter by="viewstyle">Viewstyle</mfDefaultSorter></th>
|
||||
<th><mfDefaultSorter by="definition">Definition</mfDefaultSorter></th>
|
||||
<th><mfDefaultSorter by="created">Created</mfDefaultSorter></th>
|
||||
<th><mfDefaultSorter by="description">Description</mfDefaultSorter></th>
|
||||
<th><mfDefaultSorter by="status">Status</mfDefaultSorter></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="grayout-empty-table" *ngIf="!mf.data[0]" [contextMenu]="basicMenu" [contextMenuSubject]="datasetProfile"> <td colspan="5">No elements</td></tr>
|
||||
<tr *ngFor="let datasetProfile of mf.data" class="hover" [contextMenu]="basicMenu" [contextMenuSubject]="datasetProfile">
|
||||
<td [ngClass]="{true:'visible', false:'invisible'}[showIDs]">{{datasetProfile.id}}</td>
|
||||
<!-- <td [ngClass]="{true:'visible', false:'invisible'}[showIDs]">{{datasetProfile.id}}</td> -->
|
||||
<td>{{datasetProfile?.label}}</td>
|
||||
<td>{{datasetProfile?.ruleset?.label}}</td>
|
||||
<td>{{datasetProfile?.viewstyle?.label}}</td>
|
||||
<td>{{datasetProfile?.definition}}</td>
|
||||
<td>{{datasetProfile?.created}}</td>
|
||||
<td>{{datasetProfile?.description}}</td>
|
||||
<td>{{datasetProfile?.status}}</td>
|
||||
<td><button type="button" class="btn btn-sm btn-primary btn-create" data-toggle="modal" data-target="#newdataset-modal-container" [routerLink]="['/form/'+datasetProfile.id]">Go</button></td>
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
|
|
|
@ -69,7 +69,7 @@ export class DatasetprofileEditorComponent implements OnInit {
|
|||
this.tableVisible = false;
|
||||
this.editorVisible = true;
|
||||
if(datasetProfileID == null){
|
||||
this.editingDatasetProfile = {id: null, label: "", ruleset: "", viewstyle: "", definition: "" };
|
||||
this.editingDatasetProfile = {id: null, label: "", created: "", description: "", status: "" };
|
||||
}
|
||||
else{
|
||||
this.editingDatasetProfile = this.tableData.filter((datasetProfile) => datasetProfile.id === datasetProfileID)[0];
|
||||
|
@ -79,7 +79,7 @@ export class DatasetprofileEditorComponent implements OnInit {
|
|||
|
||||
getAllDatasetProfiles(showNotification : boolean){
|
||||
this.datasetProfileService.fetchAllDatasetProfiles().subscribe( (data) => {
|
||||
this.tableData = data;
|
||||
this.tableData = data.payload;
|
||||
if(showNotification)
|
||||
simple_notifier("info",null,"Refreshed the table");
|
||||
});
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
import { FormBuilder } from '@angular/forms';
|
||||
export abstract class BaseModel{
|
||||
public formBuilder:FormBuilder = new FormBuilder();
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
import { FormGenerator } from '../interfaces/FormGenerator';
|
||||
import { Serializable } from '../interfaces/Serializable';
|
||||
import { FormGroup, FormBuilder } from '@angular/forms'
|
||||
export class ListingItem implements Serializable<ListingItem>, FormGenerator<FormGroup>{
|
||||
public label: string;
|
||||
public value: string;
|
||||
|
||||
fromJSONObject(item: any): ListingItem {
|
||||
this.label = item.label;
|
||||
this.value = item.value;
|
||||
return this;
|
||||
}
|
||||
|
||||
buildForm(): FormGroup {
|
||||
return new FormBuilder().group({
|
||||
label: [this.label],
|
||||
value: [this.value]
|
||||
})
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
import { DataField } from './DataField';
|
||||
import { FormGroup } from '@angular/forms'
|
||||
|
||||
export class AutocompleteData extends DataField<AutocompleteData>{
|
||||
|
||||
public type:string;
|
||||
public url:string;
|
||||
|
||||
buildForm():FormGroup{
|
||||
return this.formBuilder.group({
|
||||
label:[this.label],
|
||||
type:[this.type],
|
||||
url:[this.url]
|
||||
})
|
||||
}
|
||||
|
||||
fromJSONObject(item:any):AutocompleteData{
|
||||
this.type = item.type;
|
||||
this.url = item.url;
|
||||
this.label = item.label;
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
import { DataField } from './DataField';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
export class BooleanDecisionData extends DataField<BooleanDecisionData>{
|
||||
|
||||
buildForm():FormGroup{
|
||||
let formGroup = this.formBuilder.group({
|
||||
label:this.label
|
||||
});
|
||||
return formGroup;
|
||||
}
|
||||
|
||||
fromJSONObject(item:any):BooleanDecisionData{
|
||||
this.label = item.label
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
import { DataField } from './DataField';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
export class CheckBoxData extends DataField<CheckBoxData>{
|
||||
|
||||
buildForm():FormGroup{
|
||||
let formGroup = this.formBuilder.group({
|
||||
label:this.label
|
||||
});
|
||||
return formGroup;
|
||||
}
|
||||
|
||||
fromJSONObject(item:any):CheckBoxData{
|
||||
this.label = item.label
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
import { BaseModel } from '../BaseModel';
|
||||
import { FormGenerator } from '../interfaces/FormGenerator';
|
||||
import { Serializable } from '../interfaces/Serializable';
|
||||
import { FormGroup } from '@angular/forms'
|
||||
export abstract class DataField<T> extends BaseModel implements Serializable<T>,FormGenerator<FormGroup>{
|
||||
public label:string;
|
||||
|
||||
buildForm():FormGroup{
|
||||
throw new Error("Build Form Is not not correctly overriden");
|
||||
}
|
||||
|
||||
fromJSONObject(item:any):T{
|
||||
throw new Error("From Json Object is not correctly overriden")
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
import { DataField } from './DataField';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
export class FreeTextData extends DataField<FreeTextData>{
|
||||
|
||||
buildForm():FormGroup{
|
||||
let formGroup = this.formBuilder.group({
|
||||
label:this.label
|
||||
});
|
||||
return formGroup;
|
||||
}
|
||||
|
||||
fromJSONObject(item:any):FreeTextData{
|
||||
this.label = item.label
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
import { JsonSerializer } from '../../utilities/JsonSerializer';
|
||||
import { DataField } from './DataField';
|
||||
import { ListingItem } from '../Commons/ListingItem';
|
||||
import { FormGroup } from '@angular/forms'
|
||||
|
||||
export class RadioBoxData extends DataField<RadioBoxData>{
|
||||
public options:Array<ListingItem>;
|
||||
|
||||
buildForm():FormGroup{
|
||||
let formGroup = this.formBuilder.group({
|
||||
label:[this.label]
|
||||
});
|
||||
let optionsFormArray = new Array<FormGroup>();
|
||||
if (this.options) {
|
||||
this.options.forEach(item => {
|
||||
let form: FormGroup = item.buildForm();
|
||||
optionsFormArray.push(form)
|
||||
})
|
||||
}
|
||||
formGroup.addControl('options', this.formBuilder.array(optionsFormArray));
|
||||
return formGroup;
|
||||
}
|
||||
|
||||
fromJSONObject(item:any):RadioBoxData{
|
||||
this.options = new JsonSerializer<ListingItem>().fromJSONArray(item.options,ListingItem);
|
||||
this.label = item.label
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
import { DataField } from './DataField';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
export class TextArea extends DataField<TextArea>{
|
||||
|
||||
buildForm(): FormGroup {
|
||||
let formGroup = this.formBuilder.group({
|
||||
label: this.label
|
||||
});
|
||||
return formGroup;
|
||||
}
|
||||
|
||||
fromJSONObject(item: any): TextArea {
|
||||
this.label = item.label
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
import { JsonSerializer } from '../../utilities/JsonSerializer';
|
||||
import { ListingItem } from '../Commons/ListingItem';
|
||||
import { DataField } from './DataField';
|
||||
import { FormGroup } from '@angular/forms'
|
||||
|
||||
export class WordListData extends DataField<WordListData>{
|
||||
public type:string;
|
||||
public options:Array<ListingItem>;
|
||||
buildForm():FormGroup{
|
||||
let formGroup = this.formBuilder.group({
|
||||
type:[this.type],
|
||||
label:[this.label]
|
||||
});
|
||||
let optionsFormArray = new Array<FormGroup>();
|
||||
if (this.options) {
|
||||
this.options.forEach(item => {
|
||||
let form: FormGroup = item.buildForm();
|
||||
optionsFormArray.push(form)
|
||||
})
|
||||
}
|
||||
formGroup.addControl('options', this.formBuilder.array(optionsFormArray));
|
||||
|
||||
return formGroup;
|
||||
}
|
||||
|
||||
fromJSONObject(item:any):WordListData{
|
||||
this.type = item.type;
|
||||
this.options = new JsonSerializer<ListingItem>().fromJSONArray(item.options,ListingItem);
|
||||
this.label = item.label;
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
import { BaseModel } from '../BaseModel';
|
||||
import { FormBuilder, FormGroup, FormControl, Validators } from '@angular/forms';
|
||||
import { FormGenerator } from '../interfaces/FormGenerator';
|
||||
import { JsonSerializer } from 'app/utilities/JsonSerializer';
|
||||
import { Section } from './Section';
|
||||
import { Serializable } from '../interfaces/Serializable';
|
||||
import { Page } from "./Page";
|
||||
|
||||
export class DatasetProfileModel extends BaseModel implements Serializable<DatasetProfileModel>,FormGenerator<FormGroup>{
|
||||
|
||||
public sections: Array<Section> = new Array<Section>();
|
||||
public pages: Array<Page> = new Array<Page>();
|
||||
public label: string;
|
||||
|
||||
fromJSONObject(item:any):DatasetProfileModel{
|
||||
this.sections = new JsonSerializer<Section>().fromJSONArray(item.sections, Section);
|
||||
this.pages = new JsonSerializer<Page>().fromJSONArray(item.pages, Page);
|
||||
this.label = item.label;
|
||||
return this;
|
||||
}
|
||||
|
||||
buildForm():FormGroup{
|
||||
let formGroup: FormGroup = new FormBuilder().group({});
|
||||
|
||||
let sectionsFormArray = new Array<FormGroup>();
|
||||
this.sections.forEach(item => {
|
||||
let form: FormGroup = item.buildForm();
|
||||
sectionsFormArray.push(form)
|
||||
})
|
||||
formGroup.addControl('sections', this.formBuilder.array(sectionsFormArray));
|
||||
|
||||
let pagesFormArray = new Array<FormGroup>();
|
||||
// this.pages.forEach(item => {
|
||||
// let form: FormGroup = item.buildForm();
|
||||
// pagesFormArray.push(form)
|
||||
// })
|
||||
formGroup.addControl('pages', this.formBuilder.array(pagesFormArray));
|
||||
|
||||
formGroup.addControl('label', new FormControl(this.label, Validators.required));
|
||||
return formGroup;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
import { BaseModel } from '../BaseModel';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { FormGenerator } from '../interfaces/FormGenerator';
|
||||
import { Serializable } from '../interfaces/Serializable';
|
||||
|
||||
export class DefaultValue extends BaseModel implements Serializable<DefaultValue>,FormGenerator<FormGroup>{
|
||||
public type:string;
|
||||
public value:string;
|
||||
|
||||
fromJSONObject(item:any):DefaultValue{
|
||||
this.type = item.type;
|
||||
this.value = item.value;
|
||||
return this;
|
||||
}
|
||||
|
||||
buildForm():FormGroup{
|
||||
let formGroup = this.formBuilder.group({
|
||||
type: [this.type],
|
||||
value: [this.value]
|
||||
|
||||
});
|
||||
return formGroup;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
import { BooleanDecisionData } from '../DataField/BooleanDecisionData';
|
||||
import { FreeTextData } from '../DataField/FreeTextData';
|
||||
import { TextArea } from '../DataField/TextArea';
|
||||
import { CheckBoxData } from '../DataField/CheckBoxData';
|
||||
import { RadioBoxData } from '../DataField/RadioBoxData';
|
||||
import { WordListData } from '../DataField/WordListData';
|
||||
import { AutocompleteData } from '../DataField/AutocompleteData';
|
||||
import { DataField } from '../DataField/DataField';
|
||||
import { BaseModel } from '../BaseModel';
|
||||
import { FormGroup, FormArray, FormControl } from '@angular/forms';
|
||||
import { FormGenerator } from '../interfaces/FormGenerator';
|
||||
import { JsonSerializer } from 'app/utilities/JsonSerializer';
|
||||
import { Serializable } from '../interfaces/Serializable';
|
||||
import { Rule } from './Rule';
|
||||
import { Multiplicity } from './Multiplicity';
|
||||
import { DefaultValue } from './DefaultValue';
|
||||
import { ViewStyle } from './ViewStyle';
|
||||
import { Visibility } from './Visibility';
|
||||
import { ValidationTypes } from 'app/common/validationTypes';
|
||||
|
||||
export class Field extends BaseModel implements Serializable<Field>, FormGenerator<FormGroup>{
|
||||
|
||||
public id: string;
|
||||
public title: string;
|
||||
public defaultValue: DefaultValue = new DefaultValue;
|
||||
public viewStyle: ViewStyle = new ViewStyle();
|
||||
public page: number;
|
||||
//public multiplicity: Multiplicity = new Multiplicity();
|
||||
public ordinal: number;
|
||||
public visible: Visibility = new Visibility();
|
||||
public data: DataField<any>;
|
||||
public validations: Array<ValidationTypes>;
|
||||
|
||||
fromJSONObject(item: any): Field {
|
||||
this.id = item.id;
|
||||
this.title = item.title;
|
||||
this.defaultValue = new JsonSerializer<DefaultValue>().fromJSONObject(item.defaultValue, DefaultValue);
|
||||
this.page = item.page;
|
||||
// this.multiplicity = new JsonSerializer<Multiplicity>().fromJSONObject(item.multiplicity, Multiplicity);
|
||||
this.ordinal = item.ordinal;
|
||||
this.validations = item.validations;
|
||||
this.viewStyle = new JsonSerializer<ViewStyle>().fromJSONObject(item.viewStyle, ViewStyle);
|
||||
this.visible = new JsonSerializer<Visibility>().fromJSONObject(item.visible, Visibility);
|
||||
if (item.data) {
|
||||
if (this.viewStyle.renderStyle === "combobox") {
|
||||
if (item.data.type === "autocomplete") this.data = new JsonSerializer<AutocompleteData>().fromJSONObject(item.data, AutocompleteData);
|
||||
if (item.data.type === "wordlist") this.data = new JsonSerializer<WordListData>().fromJSONObject(item.data, WordListData);
|
||||
} else {
|
||||
if (this.viewStyle.renderStyle === "radiobox") this.data = new JsonSerializer<RadioBoxData>().fromJSONObject(item.data, RadioBoxData);
|
||||
if (this.viewStyle.renderStyle === "checkBox") this.data = new JsonSerializer<CheckBoxData>().fromJSONObject(item.data, CheckBoxData);
|
||||
if (this.viewStyle.renderStyle === "textarea") this.data = new JsonSerializer<TextArea>().fromJSONObject(item.data, TextArea);
|
||||
if (this.viewStyle.renderStyle === "freetext") this.data = new JsonSerializer<FreeTextData>().fromJSONObject(item.data, FreeTextData);
|
||||
if (this.viewStyle.renderStyle === "booleanDecision") this.data = new JsonSerializer<BooleanDecisionData>().fromJSONObject(item.data, BooleanDecisionData);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
buildForm(): FormGroup {
|
||||
let formGroup = this.formBuilder.group({
|
||||
id: [this.id],
|
||||
title: [this.title],
|
||||
page: [this.page],
|
||||
ordinal: [this.ordinal]
|
||||
});
|
||||
|
||||
const arr = new FormArray([
|
||||
new FormControl(ValidationTypes.None)
|
||||
]);
|
||||
|
||||
//formGroup.addControl("multiplicity", this.multiplicity.buildForm());
|
||||
formGroup.addControl("validations", arr);
|
||||
formGroup.addControl("defaultValue", this.defaultValue.buildForm());
|
||||
formGroup.addControl("viewStyle", this.viewStyle.buildForm());
|
||||
formGroup.addControl("visible", this.visible.buildForm());
|
||||
//formGroup.addControl("data",this.data? this.data.buildForm():this.formBuilder.group({}));
|
||||
if (this.data) formGroup.addControl("data", this.data.buildForm());
|
||||
|
||||
return formGroup;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
import { FieldSet } from './FieldSet';
|
||||
import { BaseModel } from '../BaseModel';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { FormGenerator } from '../interfaces/FormGenerator';
|
||||
import { Validation } from '../Validation';
|
||||
import { Rule } from './Rule';
|
||||
import { JsonSerializer } from 'app/utilities/JsonSerializer';
|
||||
import { Serializable } from '../interfaces/Serializable';
|
||||
import { Field } from './Field';
|
||||
|
||||
export class FieldGroup extends BaseModel implements Serializable<FieldGroup>, FormGenerator<FormGroup>{
|
||||
public id: string;
|
||||
public title: string;
|
||||
public section: string;
|
||||
public value: string;
|
||||
public description: string;
|
||||
public extendedDescription: string;
|
||||
public defaultVisibility: boolean;
|
||||
public page: number;
|
||||
public ordinal: number;
|
||||
public compositeFields: Array<FieldSet> = new Array<FieldSet>();
|
||||
|
||||
fromJSONObject(item: any): FieldGroup {
|
||||
this.id = item.id;
|
||||
this.title = item.title;
|
||||
this.value = item.value;
|
||||
this.description = item.description;
|
||||
this.extendedDescription = item.extendedDescription;
|
||||
this.defaultVisibility = item.defaultVisibility;
|
||||
this.page = item.page;
|
||||
this.ordinal = item.ordinal;
|
||||
this.compositeFields = new JsonSerializer<FieldSet>().fromJSONArray(item.compositeFields, FieldSet);
|
||||
return this;
|
||||
}
|
||||
|
||||
buildForm(): FormGroup {
|
||||
let formGroup: FormGroup = this.formBuilder.group({
|
||||
id: [this.id],
|
||||
title: [this.title],
|
||||
value: [this.value],
|
||||
description: [this.description],
|
||||
extendedDescription: [this.extendedDescription],
|
||||
defaultVisibility: [this.defaultVisibility],
|
||||
page: [this.page],
|
||||
ordinal: [this.ordinal]
|
||||
});
|
||||
let compositeFieldsFormArray = new Array<FormGroup>();
|
||||
if (this.compositeFields) {
|
||||
this.compositeFields.forEach(item => {
|
||||
let form: FormGroup = item.buildForm();
|
||||
compositeFieldsFormArray.push(form)
|
||||
})
|
||||
}
|
||||
formGroup.addControl('compositeFields', this.formBuilder.array(compositeFieldsFormArray));
|
||||
|
||||
if( !formGroup.controls["defaultVisibility"].value) formGroup.controls["defaultVisibility"].setValue(true);
|
||||
|
||||
return formGroup;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
import { JsonSerializer } from '../../utilities/JsonSerializer';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { Serializable } from '../interfaces/Serializable';
|
||||
import { BaseModel } from '../BaseModel';
|
||||
import {Field} from './Field'
|
||||
import {Multiplicity} from './Multiplicity'
|
||||
|
||||
export class FieldSet extends BaseModel implements Serializable<FieldSet> {
|
||||
public fields:Array<Field> = new Array<Field>();
|
||||
public id:string;
|
||||
public ordinal:number;
|
||||
public multiplicity: Multiplicity = new Multiplicity();
|
||||
public title:string;
|
||||
public description:string;
|
||||
public extendedDescription:string;
|
||||
public hasCommentField:boolean;
|
||||
|
||||
fromJSONObject(item:any):FieldSet{
|
||||
|
||||
this.fields = new JsonSerializer<Field>().fromJSONArray(item.fields,Field);
|
||||
this.multiplicity = new JsonSerializer<Multiplicity>().fromJSONObject(item.multiplicity, Multiplicity);
|
||||
this.id = item.id;
|
||||
this.ordinal = item.ordinal;
|
||||
this.title = item.title;
|
||||
this.description = item.description;
|
||||
this.extendedDescription = item.extendedDescription;
|
||||
this.hasCommentField = item.hasCommentField;
|
||||
return this;
|
||||
}
|
||||
|
||||
buildForm():FormGroup{
|
||||
let formGroup = this.formBuilder.group({
|
||||
id:[this.id],
|
||||
ordinal:[this.ordinal],
|
||||
title:[this.title],
|
||||
description: [this.description],
|
||||
extendedDescription:[this.extendedDescription],
|
||||
hasCommentField:[this.hasCommentField]
|
||||
});
|
||||
|
||||
let fieldsFormArray = new Array<FormGroup>();
|
||||
this.fields.forEach(item => {
|
||||
let form: FormGroup = item.buildForm();
|
||||
fieldsFormArray.push(form)
|
||||
})
|
||||
formGroup.addControl('fields', this.formBuilder.array(fieldsFormArray));
|
||||
formGroup.addControl("multiplicity", this.multiplicity.buildForm());
|
||||
|
||||
return formGroup;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
import { BaseModel } from '../BaseModel';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { FormGenerator } from '../interfaces/FormGenerator';
|
||||
import { Serializable } from '../interfaces/Serializable';
|
||||
export class Multiplicity extends BaseModel implements Serializable<Multiplicity>,FormGenerator<FormGroup>{
|
||||
public min:number;
|
||||
public max:string;
|
||||
|
||||
fromJSONObject(item:any):Multiplicity{
|
||||
this.min = item.min;
|
||||
this.max = item.max;
|
||||
return this;
|
||||
}
|
||||
|
||||
buildForm():FormGroup{
|
||||
let formGroup = this.formBuilder.group({
|
||||
min: [this.min],
|
||||
max: [this.max]
|
||||
|
||||
});
|
||||
return formGroup;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
import { BaseModel } from '../BaseModel';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { FormGenerator } from '../interfaces/FormGenerator';
|
||||
import { Serializable } from '../interfaces/Serializable';
|
||||
|
||||
export class Page extends BaseModel implements Serializable<Page>, FormGenerator<FormGroup>{
|
||||
public title: string;
|
||||
public id: number;
|
||||
|
||||
constructor(id?: number) {
|
||||
super();
|
||||
if (isNaN(id)) this.id = 0;
|
||||
else this.id = id;
|
||||
}
|
||||
|
||||
fromJSONObject(item: any): Page {
|
||||
this.title = item.title;
|
||||
this.id = item.id;
|
||||
return this;
|
||||
}
|
||||
|
||||
buildForm(): FormGroup {
|
||||
let formGroup = this.formBuilder.group({
|
||||
title: [this.title],
|
||||
id: [this.id]
|
||||
|
||||
});
|
||||
return formGroup;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
import { BaseModel } from '../BaseModel';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { FormGenerator } from '../interfaces/FormGenerator';
|
||||
import { Serializable } from '../interfaces/Serializable';
|
||||
export class Rule extends BaseModel implements Serializable<Rule>,FormGenerator<FormGroup>{
|
||||
public sourceField:string;
|
||||
public target:string;
|
||||
public value: string;
|
||||
public ruleType: string;
|
||||
public ruleStyle: string;
|
||||
public valueType: string;
|
||||
|
||||
fromJSONObject(item:any):Rule{
|
||||
this.sourceField = item.sourceField;
|
||||
this.target = item.target;
|
||||
this.value = item.value;
|
||||
this.ruleType = item.ruleType;
|
||||
this.ruleStyle = item.ruleStyle;
|
||||
this.valueType = item.valueType;
|
||||
return this;
|
||||
}
|
||||
|
||||
buildForm():FormGroup{
|
||||
let formGroup = this.formBuilder.group({
|
||||
sourceField: [this.sourceField],
|
||||
target: [this.target],
|
||||
ruleStyle: [this.ruleStyle],
|
||||
value: [this.value],
|
||||
ruleType: [this.ruleType],
|
||||
valueType: [this.valueType]
|
||||
});
|
||||
return formGroup;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
import { JsonSerializer } from '../../utilities/JsonSerializer';
|
||||
import { FieldSet } from './FieldSet';
|
||||
import { BaseModel } from '../BaseModel';
|
||||
import { FormGenerator } from '../interfaces/FormGenerator';
|
||||
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { Serializable } from '../interfaces/Serializable';
|
||||
import { FieldGroup } from './FieldGroup';
|
||||
|
||||
export class Section extends BaseModel implements Serializable<Section>, FormGenerator<FormGroup>{
|
||||
public sections: Array<Section> = new Array<Section>();
|
||||
//public fieldGroups: Array<FieldGroup> = new Array<FieldGroup>();
|
||||
public defaultVisibility: boolean;
|
||||
public page: number;
|
||||
public id: string
|
||||
public title: string
|
||||
public description: string;
|
||||
public ordinal: number;
|
||||
public fieldSets: Array<FieldSet> = new Array<FieldSet>();
|
||||
|
||||
fromJSONObject(item: any): Section {
|
||||
this.sections = new JsonSerializer<Section>().fromJSONArray(item.sections, Section);
|
||||
//this.fieldGroups = new JsonSerializer<FieldGroup>().fromJSONArray(item.fieldGroups, FieldGroup);
|
||||
this.page = item.page;
|
||||
this.defaultVisibility = item.defaultVisibility;
|
||||
this.id = item.id;
|
||||
this.title = item.title;
|
||||
this.description = item.description;
|
||||
this.ordinal = item.ordinal;
|
||||
this.fieldSets = new JsonSerializer<FieldSet>().fromJSONArray(item.fieldSets, FieldSet);
|
||||
return this;
|
||||
}
|
||||
|
||||
buildForm(): FormGroup {
|
||||
let formGroup: FormGroup = new FormBuilder().group({});
|
||||
let sectionsFormArray = new Array<FormGroup>();
|
||||
if (this.sections) {
|
||||
this.sections.forEach(item => {
|
||||
let form: FormGroup = item.buildForm();
|
||||
sectionsFormArray.push(form)
|
||||
})
|
||||
}
|
||||
// let fieldGroupsFormArray = new Array<FormGroup>();
|
||||
// if (this.fieldGroups) {
|
||||
// this.fieldGroups.forEach(item => {
|
||||
// let form: FormGroup = item.buildForm();
|
||||
// fieldGroupsFormArray.push(form)
|
||||
// })
|
||||
// }
|
||||
let compositeFieldsFormArray = new Array<FormGroup>();
|
||||
if (this.fieldSets) {
|
||||
this.fieldSets.forEach(item => {
|
||||
let form: FormGroup = item.buildForm();
|
||||
compositeFieldsFormArray.push(form)
|
||||
})
|
||||
}
|
||||
|
||||
formGroup.addControl('sections', this.formBuilder.array(sectionsFormArray));
|
||||
// formGroup.addControl('fieldGroups', this.formBuilder.array(fieldGroupsFormArray));
|
||||
formGroup.addControl('fieldSets', this.formBuilder.array(compositeFieldsFormArray));
|
||||
formGroup.addControl('defaultVisibility', new FormControl(this.defaultVisibility));
|
||||
formGroup.addControl('page', new FormControl(this.page, [Validators.required]));
|
||||
formGroup.addControl('id', new FormControl(this.id));
|
||||
formGroup.addControl('title', new FormControl(this.title));
|
||||
formGroup.addControl('description', new FormControl(this.description));
|
||||
formGroup.addControl('ordinal', new FormControl(this.ordinal));
|
||||
|
||||
if( !formGroup.controls["defaultVisibility"].value) formGroup.controls["defaultVisibility"].setValue(true);
|
||||
|
||||
return formGroup;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
import { BaseModel } from '../BaseModel';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { FormGenerator } from '../interfaces/FormGenerator';
|
||||
import { Serializable } from '../interfaces/Serializable';
|
||||
|
||||
export class ViewStyle extends BaseModel implements Serializable<ViewStyle>,FormGenerator<FormGroup>{
|
||||
public cssClass:string;
|
||||
public renderStyle:string;
|
||||
|
||||
fromJSONObject(item:any):ViewStyle{
|
||||
this.cssClass = item.cssClass;
|
||||
this.renderStyle = item.renderStyle;
|
||||
return this;
|
||||
}
|
||||
|
||||
buildForm():FormGroup{
|
||||
let formGroup = this.formBuilder.group({
|
||||
cssClass: [this.cssClass],
|
||||
renderStyle: [this.renderStyle]
|
||||
|
||||
});
|
||||
return formGroup;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
import { BaseModel } from '../BaseModel';
|
||||
import { Rule } from "./Rule";
|
||||
import { FormGenerator } from "../interfaces/FormGenerator";
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { Serializable } from '../interfaces/Serializable';
|
||||
import { JsonSerializer } from 'app/utilities/JsonSerializer';
|
||||
|
||||
export class Visibility extends BaseModel implements Serializable<Visibility>, FormGenerator<FormGroup>{
|
||||
public rules: Array<Rule> = new Array<Rule>();
|
||||
public style:string;
|
||||
|
||||
fromJSONObject(item:any):Visibility{
|
||||
this.rules = new JsonSerializer<Rule>().fromJSONArray(item.rules, Rule);
|
||||
this.style = item.style;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
buildForm():FormGroup{
|
||||
let formGroup = this.formBuilder.group({
|
||||
style:[this.style]
|
||||
})
|
||||
|
||||
let rulesFormArray = new Array<FormGroup>();
|
||||
if (this.rules){
|
||||
this.rules.forEach(rule =>{
|
||||
let form:FormGroup = rule.buildForm();
|
||||
rulesFormArray.push(form);
|
||||
});
|
||||
}
|
||||
|
||||
formGroup.addControl("rules", this.formBuilder.array(rulesFormArray));
|
||||
|
||||
return formGroup;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
import { BaseModel } from './BaseModel';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { FormGenerator } from './interfaces/FormGenerator';
|
||||
import { Serializable } from './interfaces/Serializable';
|
||||
export class Validation extends BaseModel implements Serializable<Validation>,FormGenerator<FormGroup>{
|
||||
public type:string;
|
||||
public value:string;
|
||||
|
||||
fromJSONObject(item:any):Validation{
|
||||
this.type = item.type;
|
||||
this.value = item.value;
|
||||
return this;
|
||||
}
|
||||
|
||||
buildForm():FormGroup{
|
||||
return this.formBuilder.group({
|
||||
type: [this.type],
|
||||
value: [this.value],
|
||||
});
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
import { BaseModel } from './BaseModel';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { FormGenerator } from './interfaces/FormGenerator';
|
||||
import { Serializable } from './interfaces/Serializable';
|
||||
|
||||
export class Data extends BaseModel implements Serializable<Data>,FormGenerator<FormGroup>{
|
||||
public type:string;
|
||||
public url:string;
|
||||
|
||||
fromJSONObject(item:any):Data{
|
||||
this.type = item.type;
|
||||
this.url = item.url;
|
||||
return this;
|
||||
}
|
||||
|
||||
buildForm():FormGroup{
|
||||
let formGroup = this.formBuilder.group({
|
||||
type: [this.type],
|
||||
url: [this.url]
|
||||
});
|
||||
return formGroup;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
import { AbstractControl } from '@angular/forms';
|
||||
export interface FormGenerator<T extends AbstractControl>{
|
||||
buildForm():T
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
export interface Serializable<T> {
|
||||
fromJSONObject(item: Object): T;
|
||||
}
|
|
@ -1,3 +1,4 @@
|
|||
import { FormComponent } from './dataset-profile-form/form/form.component';
|
||||
import { ModuleWithProviders } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
|
@ -74,9 +75,18 @@ export const routes: Routes = [
|
|||
{
|
||||
path: 'main',
|
||||
component: MainWindowComponent
|
||||
},
|
||||
{
|
||||
path: 'form/:id',
|
||||
component: FormComponent
|
||||
},
|
||||
{
|
||||
path: 'form',
|
||||
component: FormComponent
|
||||
}
|
||||
|
||||
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
|
|
@ -17,11 +17,11 @@ export class DatasetProfileService implements OnInit {
|
|||
}
|
||||
|
||||
fetchAllDatasetProfiles(){
|
||||
return this.restBase.get("datasetprofile/getAll");
|
||||
return this.restBase.get("datasetprofiles/getAll");
|
||||
}
|
||||
|
||||
getDatasetProfileById(datasetProfileID){
|
||||
return this.restBase.get("datasetprofile/"+datasetProfileID);
|
||||
return this.restBase.get("admin/get//"+datasetProfileID);
|
||||
}
|
||||
|
||||
createDatasetProfile(datasetProfile){
|
||||
|
|
|
@ -18,10 +18,10 @@ export class RestBase {
|
|||
/*
|
||||
*/
|
||||
protocol: string = "http";
|
||||
hostname: string = "dionysus.di.uoa.gr";
|
||||
port: number = 7070;
|
||||
webappname: string = "dmp-backend";
|
||||
restpath: string = "rest";
|
||||
hostname: string = "dl043.madgik.di.uoa.gr";
|
||||
port: number = 8080;
|
||||
webappname: string = "";
|
||||
restpath: string = "";
|
||||
|
||||
/*
|
||||
protocol: string = "http";
|
||||
|
|
|
@ -0,0 +1,243 @@
|
|||
export const TestModel = {
|
||||
"sections": [
|
||||
{
|
||||
"id": "sumData",
|
||||
"defaultVisibility": "true",
|
||||
"page": "1",
|
||||
"title": "1 Data Summary",
|
||||
"description": " Fill in the fields to describe your data model ",
|
||||
"sections": [],
|
||||
"fieldGroups":
|
||||
[
|
||||
{
|
||||
"id": "dataSummaryGroup",
|
||||
"defaultVisibility": "true",
|
||||
"page": "1",
|
||||
"title": "Data Summary",
|
||||
"description": "",
|
||||
"extendedDescription": "",
|
||||
"compositeFields": [
|
||||
{
|
||||
"multiplicity":{
|
||||
"min":0,
|
||||
"max":3
|
||||
},
|
||||
"fields":
|
||||
[
|
||||
{
|
||||
"id": "dataSummary",
|
||||
"defaultVisibility": "true",
|
||||
"title": "",
|
||||
"description": "",
|
||||
"extendedDescription": "",
|
||||
"viewStyle": "checkBox",
|
||||
"rules":[
|
||||
{
|
||||
"ruleType":"fieldValue",
|
||||
"target":"metadataStandarsA211",
|
||||
"ruleStyle":"boolean",
|
||||
"value":"true",
|
||||
"valueType":"boolean"
|
||||
},
|
||||
{
|
||||
"ruleType":"fieldValue",
|
||||
"target":"freeOfChargeGroupCommentA213",
|
||||
"ruleStyle":"boolean",
|
||||
"value":"true",
|
||||
"valueType":"boolean"
|
||||
},
|
||||
{
|
||||
"ruleType":"fieldValue",
|
||||
"target":"standardisedVocabulariesA212",
|
||||
"ruleStyle":"boolean",
|
||||
"value":"true",
|
||||
"valueType":"boolean"
|
||||
}
|
||||
],
|
||||
"multiplicity":{
|
||||
"min":0,
|
||||
"max":1
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "fairData",
|
||||
"ordinal": "2",
|
||||
"defaultVisibility": "true",
|
||||
"page": "1",
|
||||
"title": "2 Fair Data",
|
||||
"sections": [
|
||||
{
|
||||
"id": "dataMetadata",
|
||||
"defaultVisibility": "true",
|
||||
"page": "1",
|
||||
"title": "2.1 Making data findable, including provisions for metadata",
|
||||
"sections": [],
|
||||
"fieldGroups": [
|
||||
{
|
||||
"id": "FindDataMetadataGroup",
|
||||
"section": "dataMetadata",
|
||||
"defaultVisibility": "true",
|
||||
"page": "1",
|
||||
"title": "Making data findable, including provisions for metadata",
|
||||
"description": "Making data findable, including provisions for metadata",
|
||||
"extendedDescription": "FieldGroup Description",
|
||||
"compositeFields": [
|
||||
{
|
||||
"fields":
|
||||
[
|
||||
{
|
||||
"id": "useMetadataQ211",
|
||||
"defaultVisibility": "true",
|
||||
"title": "Q2.1.1 Will you use metadata to describe the data?",
|
||||
"description": "User can select from a list of metadata standards. If they cannot find the standard in the list provided then they should choose \"not listed\". Selecting this will result in a field in which the user can insert the URL to the description of the metadata scheme used. A \"comments\" box should exist to allow users to add comments. They may select more than one metadata standard. They may specify more than one URL when selecting \"not listed\". They are also presented with a field in which to specify the location of the metadata service. Users can select the \"no metadata\" button to specify no metadata will be used to describe the data.",
|
||||
"extendedDescription": "FieldGroup Description",
|
||||
"viewStyle": "booleanDesicion",
|
||||
"rules":[
|
||||
{
|
||||
"ruleType":"fieldValue",
|
||||
"target":"noMetadata",
|
||||
"ruleStyle":"boolean",
|
||||
"value":"true",
|
||||
"valueType":"boolean"
|
||||
}
|
||||
],
|
||||
"multiplicity":{
|
||||
"min":0,
|
||||
"max":1
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"fields":
|
||||
[
|
||||
{
|
||||
"id": "metadataStandarsA211",
|
||||
"defaultVisibility": "false",
|
||||
"title": "Metadata standards",
|
||||
"description": "The data will be described by metadata that follows the metadata standards described in <url1>, <url2>, ? The data will be described by metadata that follows the metadata schema described in <not-listed-url1>, <not-listed-url2>. The metadata will be stored in the service located at <metadata-repo-url>",
|
||||
"extendedDescription": "",
|
||||
"viewStyle": "combobox",
|
||||
"rules":[],
|
||||
"multiplicity":{
|
||||
"min":0,
|
||||
"max":1
|
||||
}
|
||||
}]
|
||||
},
|
||||
{
|
||||
"fields":
|
||||
[
|
||||
{
|
||||
"id": "notlistedA211",
|
||||
"defaultVisibility": "false",
|
||||
"title": "Not listed",
|
||||
"description": "",
|
||||
"extendedDescription": "",
|
||||
"viewStyle": "checkBox",
|
||||
"rules":[
|
||||
{
|
||||
"ruleType":"fieldValue",
|
||||
"target":"",
|
||||
"ruleStyle":"boolean",
|
||||
"value":"",
|
||||
"valueType":"boolean"
|
||||
}
|
||||
],
|
||||
"multiplicity":{
|
||||
"min":0,
|
||||
"max":1
|
||||
}
|
||||
}]
|
||||
},
|
||||
{
|
||||
"fields":
|
||||
[
|
||||
{
|
||||
"id": "notlistedUrlA211",
|
||||
"defaultVisibility": "false",
|
||||
"title": "Url",
|
||||
"description": "URL to the description of the metadata scheme used",
|
||||
"extendedDescription": "",
|
||||
"viewStyle": "freetext",
|
||||
"rules":[
|
||||
{
|
||||
"ruleType":"fieldValue",
|
||||
"target":"",
|
||||
"ruleStyle":"boolean",
|
||||
"value":"",
|
||||
"valueType":"boolean"
|
||||
}
|
||||
],
|
||||
"multiplicity":{
|
||||
"min":0,
|
||||
"max":1
|
||||
}
|
||||
}]
|
||||
},
|
||||
{
|
||||
"fields":
|
||||
[
|
||||
{
|
||||
"id": "notlistedCommentA211",
|
||||
"defaultVisibility": "false",
|
||||
"title": "Comments",
|
||||
"description": "",
|
||||
"extendedDescription": "",
|
||||
"viewStyle": "freetext",
|
||||
"rules":[
|
||||
{
|
||||
"ruleType":"fieldValue",
|
||||
"target":"",
|
||||
"ruleStyle":"boolean",
|
||||
"value":"",
|
||||
"valueType":"boolean"
|
||||
}
|
||||
],
|
||||
"multiplicity":{
|
||||
"min":0,
|
||||
"max":1
|
||||
}
|
||||
}]
|
||||
},
|
||||
{
|
||||
"fields":
|
||||
[
|
||||
{
|
||||
"id": "noMetadata",
|
||||
"defaultVisibility": "false",
|
||||
"title": "The data will not be described by any metadata.",
|
||||
"description": "",
|
||||
"extendedDescription": "",
|
||||
"viewStyle": "checkBox",
|
||||
"rules":[
|
||||
{
|
||||
"ruleType":"fieldValue",
|
||||
"target":"",
|
||||
"ruleStyle":"boolean",
|
||||
"value":"",
|
||||
"valueType":"boolean"
|
||||
}
|
||||
],
|
||||
"multiplicity":{
|
||||
"min":0,
|
||||
"max":1
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
import { Serializable } from '../models/interfaces/Serializable';
|
||||
export class JsonSerializer<T extends Serializable<T>>{
|
||||
|
||||
public fromJSONArray(items: any[], type: { new(): T; }): T[] {
|
||||
if(!items)return null;
|
||||
const objectList: T[] = new Array<T>();
|
||||
for (let i = 0; i < items.length; i++) {
|
||||
objectList.push(new type().fromJSONObject(items[i]))
|
||||
}
|
||||
return objectList;
|
||||
}
|
||||
|
||||
public fromJSONObject(item: any, type: { new(): T; }): T {
|
||||
if(!item)return null;
|
||||
return new type().fromJSONObject(item);
|
||||
}
|
||||
}
|
|
@ -3,7 +3,7 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>DmpAdmin</title>
|
||||
<base href="/">
|
||||
<base href="/admin-ui/">
|
||||
<meta name="csrf-token" content="2c64def7de30197c40276fe1a7ea874ca8871f70be7d7dc3305465a4d5c565e4">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
@ -27,17 +27,17 @@
|
|||
|
||||
|
||||
<!-- XML to json and vice versa lib -->
|
||||
<script src="assets/xml2json.min.js"></script>
|
||||
<script src="/admin-ui/assets/xml2json.min.js"></script>
|
||||
|
||||
<!-- Json formatter lib -->
|
||||
<link rel="stylesheet" type="text/css" href="assets/jquery.json-viewer.css">
|
||||
<script src="assets/jquery.json-viewer.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/admin-ui/assets/jquery.json-viewer.css">
|
||||
<script src="/admin-ui/assets/jquery.json-viewer.js"></script>
|
||||
|
||||
<!-- lib 4 pretty-printing xml and json -->
|
||||
<script src="assets/vkbeautify.0.99.00.js"></script>
|
||||
<script src="/admin-ui/assets/vkbeautify.0.99.00.js"></script>
|
||||
|
||||
<!-- Nice BS notifications -->
|
||||
<script src="assets/bootstrap-notify.min.js"></script>
|
||||
<script src="/admin-ui/assets/bootstrap-notify.min.js"></script>
|
||||
|
||||
<!-- that's google sign in library -->
|
||||
<script src="https://apis.google.com/js/platform.js"></script>
|
||||
|
@ -47,8 +47,8 @@
|
|||
|
||||
|
||||
<!-- my custom global code and css -->
|
||||
<link rel="stylesheet" type="text/css" href="assets/custom.css">
|
||||
<script src="assets/custom.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/admin-ui/assets/custom.css">
|
||||
<script src="/admin-ui/assets/custom.js"></script>
|
||||
|
||||
|
||||
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
{
|
||||
{
|
||||
"compileOnSave": false,
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist/out-tsc",
|
||||
"baseUrl": "src",
|
||||
"sourceMap": true,
|
||||
"declaration": false,
|
||||
"moduleResolution": "node",
|
||||
|
|
|
@ -1,3 +1,2 @@
|
|||
eclipse.preferences.version=1
|
||||
encoding//src/main/java=UTF-8
|
||||
encoding//src/test/java=UTF-8
|
||||
|
|
|
@ -1,339 +1,223 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>dmp-backend</groupId>
|
||||
<artifactId>dmp-backend</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<packaging>war</packaging>
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
|
||||
<properties>
|
||||
<project.http.version>1.19.0</project.http.version>
|
||||
<project.oauth.version>1.19.0</project.oauth.version>
|
||||
|
||||
<dmp-backend-commons.version>0.0.1-SNAPSHOT</dmp-backend-commons.version>
|
||||
<org.springframework.version>4.3.8.RELEASE</org.springframework.version>
|
||||
<!-- <org.springframework.security.version>3.2.10.RELEASE</org.springframework.security.version> -->
|
||||
<org.springframework.security.version>4.2.3.RELEASE</org.springframework.security.version>
|
||||
<com.sun.jersey.version>1.19.1</com.sun.jersey.version>
|
||||
<org.apache.tomcat.tomcat-jdbc.version>7.0.35</org.apache.tomcat.tomcat-jdbc.version>
|
||||
|
||||
<hibernate.version>5.2.11.Final</hibernate.version>
|
||||
|
||||
<commons-codec.version>1.9</commons-codec.version>
|
||||
<org.junit.version>4.11</org.junit.version>
|
||||
<log4j.version>1.2.17</log4j.version>
|
||||
<slf4j.version>1.7.12</slf4j.version>
|
||||
<jetty.version>9.0.7.v20131107</jetty.version> <!-- Adapt this to a version found on http://repo.maven.apache.org/maven2/org/eclipse/jetty/jetty-maven-plugin/ -->
|
||||
<logback.version>1.1.1</logback.version>
|
||||
<javax.inject.version>1</javax.inject.version>
|
||||
<javax.servlet.servlet-api.version>3.0.1</javax.servlet.servlet-api.version>
|
||||
<!-- <jcloverslf4j.version>1.7.6</jcloverslf4j.version> -->
|
||||
</properties>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>dmp-backend</groupId>
|
||||
<artifactId>dmp-backend</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<packaging>war</packaging>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>1.5.9.RELEASE</version>
|
||||
</parent>
|
||||
<properties>
|
||||
<project.http.version>1.19.0</project.http.version>
|
||||
<project.oauth.version>1.19.0</project.oauth.version>
|
||||
|
||||
<dmp-backend-commons.version>0.0.1-SNAPSHOT</dmp-backend-commons.version>
|
||||
<org.springframework.version>4.3.8.RELEASE</org.springframework.version>
|
||||
<!-- <org.springframework.eu.eudat.security.version>3.2.10.RELEASE</org.springframework.eu.eudat.security.version> -->
|
||||
<org.springframework.security.version>4.2.3.RELEASE</org.springframework.security.version>
|
||||
<com.sun.jersey.version>1.19.1</com.sun.jersey.version>
|
||||
<org.apache.tomcat.tomcat-jdbc.version>7.0.35</org.apache.tomcat.tomcat-jdbc.version>
|
||||
<com.fasterxml.jackson>2.8.4</com.fasterxml.jackson>
|
||||
|
||||
<hibernate.version>5.2.11.Final</hibernate.version>
|
||||
|
||||
<commons-codec.version>1.9</commons-codec.version>
|
||||
<org.junit.version>4.11</org.junit.version>
|
||||
<log4j.version>1.2.17</log4j.version>
|
||||
<slf4j.version>1.7.12</slf4j.version>
|
||||
<jetty.version>9.0.7.v20131107
|
||||
</jetty.version> <!-- Adapt this to a version found on http://repo.maven.apache.org/maven2/org/eclipse/jetty/jetty-maven-plugin/ -->
|
||||
<logback.version>1.1.1</logback.version>
|
||||
<javax.inject.version>1</javax.inject.version>
|
||||
<javax.servlet.servlet-api.version>3.0.1</javax.servlet.servlet-api.version>
|
||||
<!-- <jcloverslf4j.version>1.7.6</jcloverslf4j.version> -->
|
||||
</properties>
|
||||
|
||||
|
||||
<dependencies>
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.json</groupId>
|
||||
<artifactId>json</artifactId>
|
||||
<version>20160810</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-core</artifactId>
|
||||
<version>${hibernate.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-c3p0</artifactId>
|
||||
<version>${hibernate.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/com.google.api-client/google-api-client -->
|
||||
<dependency>
|
||||
<groupId>com.google.api-client</groupId>
|
||||
<artifactId>google-api-client</artifactId>
|
||||
<version>1.23.0</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/com.jayway.jsonpath/json-path -->
|
||||
<dependency>
|
||||
<groupId>com.jayway.jsonpath</groupId>
|
||||
<artifactId>json-path</artifactId>
|
||||
<version>2.4.0</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- <dependency> -->
|
||||
<!-- <groupId>dmp-backend</groupId> -->
|
||||
<!-- <artifactId>dmp-backend-commons</artifactId> -->
|
||||
<!-- <version>${dmp-backend-commons.version}</version> -->
|
||||
<!-- </dependency> -->
|
||||
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.dataformat/jackson-dataformat-xml -->
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
||||
<artifactId>jackson-dataformat-xml</artifactId>
|
||||
<version>2.9.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-web</artifactId>
|
||||
<version>4.2.3.RELEASE</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-core</artifactId>
|
||||
<version>${hibernate.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-c3p0</artifactId>
|
||||
<version>${hibernate.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- g/a spring -->
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>${javax.servlet.servlet-api.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-core</artifactId>
|
||||
<version>${org.springframework.version}</version>
|
||||
</dependency>
|
||||
<!-- g/a spring -->
|
||||
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-aop</artifactId>
|
||||
<version>${org.springframework.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-tx</artifactId>
|
||||
<version>${org.springframework.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context-support</artifactId>
|
||||
<version>${org.springframework.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-mail</artifactId>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
|
||||
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-annotations</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- MY SPRING -->
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-annotations</artifactId>
|
||||
<version>2.9.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-orm</artifactId>
|
||||
<version>${org.springframework.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-webmvc</artifactId>
|
||||
<version>${org.springframework.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Spring Security -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-core</artifactId>
|
||||
<version>${org.springframework.security.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-web</artifactId>
|
||||
<version>${org.springframework.security.version}</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.springframework/spring-context -->
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
<version>4.3.10.RELEASE</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-config</artifactId>
|
||||
<version>${org.springframework.security.version}</version>
|
||||
</dependency>
|
||||
<!-- guava eu.eudat.cache -->
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>23.0</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.springframework/spring-context-support -->
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context-support</artifactId>
|
||||
<version>4.0.0.RELEASE</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>jstl</artifactId>
|
||||
<version>1.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-fileupload</groupId>
|
||||
<artifactId>commons-fileupload</artifactId>
|
||||
<version>1.2.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/junit/junit -->
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Jackson core and databind -->
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-annotations</artifactId>
|
||||
<version>2.8.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-core</artifactId>
|
||||
<version>2.8.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>2.8.4</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||
<artifactId>jackson-datatype-hibernate5</artifactId>
|
||||
<version>2.8.4</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
<!-- Json <-> XML transformations -->
|
||||
|
||||
<dependency>
|
||||
<groupId>org.json</groupId>
|
||||
<artifactId>json</artifactId>
|
||||
<version>20160810</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<version>9.1-901.jdbc4</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>2.7.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- facebook Login -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.social</groupId>
|
||||
<artifactId>spring-social-facebook</artifactId>
|
||||
<version>2.0.3.RELEASE</version>
|
||||
</dependency>
|
||||
|
||||
<!-- linkedin Login -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.social</groupId>
|
||||
<artifactId>spring-social-linkedin</artifactId>
|
||||
<version>1.0.0.RELEASE</version>
|
||||
</dependency>
|
||||
|
||||
<!-- tweeter login-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.social</groupId>
|
||||
<artifactId>spring-social-twitter</artifactId>
|
||||
<version>1.1.2.RELEASE</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- tomcat jdbc -->
|
||||
<dependency>
|
||||
<groupId>org.apache.tomcat</groupId>
|
||||
<artifactId>tomcat-jdbc</artifactId>
|
||||
<version>${org.apache.tomcat.tomcat-jdbc.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- FOR TESTING -->
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>${org.junit.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
<version>2.8.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Various libs -->
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.5</version>
|
||||
</dependency>
|
||||
|
||||
<!-- PostGreSql base libs dependencies -->
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<version>9.4.1212</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<!-- LogBack dependencies -->
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/ui-resources</directory>
|
||||
<excludes>
|
||||
<exclude>node_modules/**</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>${log4j.version}</version>
|
||||
</dependency>
|
||||
<plugins>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
<version>${commons-codec.version}</version>
|
||||
</dependency>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jcl-over-slf4j</artifactId>
|
||||
<version>${slf4j.version}</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<version>${slf4j.version}</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>${log4j.version}</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.jayway.jsonpath</groupId>
|
||||
<artifactId>json-path</artifactId>
|
||||
<version>2.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Json Web Tokens -->
|
||||
|
||||
<!-- <dependency> -->
|
||||
<!-- <groupId>io.jsonwebtoken</groupId> -->
|
||||
<!-- <artifactId>jjwt</artifactId> -->
|
||||
<!-- <version>0.7.0</version> -->
|
||||
<!-- </dependency> -->
|
||||
</plugins>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.apis</groupId>
|
||||
<artifactId>google-api-services-oauth2</artifactId>
|
||||
<version>v2-rev75-1.19.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.http-client</groupId>
|
||||
<artifactId>google-http-client-jackson2</artifactId>
|
||||
<version>${project.http.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.oauth-client</groupId>
|
||||
<artifactId>google-oauth-client-jetty</artifactId>
|
||||
<version>${project.oauth.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- Spring Security -->
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-web</artifactId>
|
||||
<version>${org.springframework.security.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-config</artifactId>
|
||||
<version>${org.springframework.security.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-tx</artifactId>
|
||||
<version>${org.springframework.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- guava cache -->
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>23.0</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- Various libs -->
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.5</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.1</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>2.10</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>analyze</id>
|
||||
<goals>
|
||||
<goal>analyze-only</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<failOnWarning>false</failOnWarning>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
|
||||
</build>
|
||||
</build>
|
||||
</project>
|
|
@ -1,31 +0,0 @@
|
|||
package checks;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
import javax.servlet.ServletContextEvent;
|
||||
import javax.servlet.ServletContextListener;
|
||||
|
||||
public class EnvironmentChecker implements ServletContextListener {
|
||||
|
||||
@Override
|
||||
public void contextDestroyed(ServletContextEvent arg0) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void contextInitialized(ServletContextEvent arg0) {
|
||||
try{
|
||||
MessageDigest.getInstance("SHA-256");
|
||||
System.out.println("SHA-256 algorithm found, as expected!");
|
||||
}
|
||||
catch(NoSuchAlgorithmException ex) {
|
||||
System.out.println("\n\n\n\nSEVERE ERROR: COULD NOT FIND WITHIN JVM THE SHA-256 ALGORITHM. PLEASE UPDATE THE JRE TO A VERSION >= 1.7\n\n\n\n");
|
||||
//shutting down the webapp should also be considered
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
package configs;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.converter.HttpMessageConverter;
|
||||
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
|
||||
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
|
||||
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
||||
import com.fasterxml.jackson.datatype.hibernate5.Hibernate5Module;
|
||||
import com.fasterxml.jackson.datatype.hibernate5.Hibernate5Module.Feature;
|
||||
|
||||
@Configuration
|
||||
@EnableWebMvc
|
||||
public class WebConfiguration extends WebMvcConfigurerAdapter {
|
||||
|
||||
@Override
|
||||
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
|
||||
|
||||
Hibernate5Module module = new Hibernate5Module();
|
||||
module.enable(Feature.SERIALIZE_IDENTIFIER_FOR_LAZY_NOT_LOADED_OBJECTS);
|
||||
ObjectMapper objectMapper = new ObjectMapper()
|
||||
// .setSerializationInclusion(Include.NON_NULL)
|
||||
// .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
|
||||
.registerModule(new Hibernate5Module())
|
||||
;
|
||||
|
||||
converters.add(new MappingJackson2HttpMessageConverter(objectMapper));
|
||||
|
||||
System.out.println("Using custom json serializer loaded with module Hibernate5Module");
|
||||
|
||||
}
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
package controller;
|
||||
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
import dao.entities.DMPDao;
|
||||
|
||||
@Controller
|
||||
public class UIController {
|
||||
|
||||
@Autowired private DMPDao dMPDao;
|
||||
|
||||
@RequestMapping(value = "/home", method = RequestMethod.GET)
|
||||
public String printWelcome(ModelMap model) {
|
||||
model.addAttribute("DMPs", dMPDao.getAll());
|
||||
return "home";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
package dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import dao.Dao;
|
||||
import entities.DMP;
|
||||
import entities.Organisation;
|
||||
import entities.Project;
|
||||
import entities.responses.IDLabelPair;
|
||||
|
||||
public interface DMPDao extends Dao<DMP, UUID> {
|
||||
|
||||
public List<UUID> listAllIDs();
|
||||
|
||||
List<IDLabelPair> listAllIDsLabels();
|
||||
|
||||
List<DMP> getDMPsOfUser(String userID);
|
||||
|
||||
}
|
|
@ -1,64 +0,0 @@
|
|||
package dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.persistence.TypedQuery;
|
||||
|
||||
import org.hibernate.query.Query;
|
||||
|
||||
import dao.JpaDao;
|
||||
import entities.DMP;
|
||||
import entities.Project;
|
||||
import entities.UserInfo;
|
||||
import entities.responses.IDLabelPair;
|
||||
|
||||
public class DMPDaoImpl extends JpaDao<DMP, UUID> implements DMPDao {
|
||||
|
||||
public DMP loadDetails(DMP t) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UUID> listAllIDs() {
|
||||
String queryString = "SELECT dmp.id FROM DMP dmp where dmp.status>=0";
|
||||
TypedQuery<UUID> typedQuery = entityManager.createQuery(queryString, UUID.class);
|
||||
return typedQuery.getResultList();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<IDLabelPair> listAllIDsLabels() {
|
||||
String queryString = "SELECT dmp.id, dmp.label FROM DMP dmp where dmp.status>=0";
|
||||
Query query = (Query) entityManager.createQuery(queryString);
|
||||
List<Object[]> rows = query.list();
|
||||
return rows.stream().map(row -> {
|
||||
return new IDLabelPair(row[0].toString(), row[1].toString());
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DMP> getDMPsOfUser(String userID) {
|
||||
|
||||
String queryString = "select dmp from DMP dmp where dmp.creator.id=:userid and dmp.status >= 0";
|
||||
TypedQuery<DMP> typedQuery = entityManager.createQuery(queryString, DMP.class);
|
||||
typedQuery.setParameter("userid", UUID.fromString(userID));
|
||||
try {
|
||||
return typedQuery.getResultList();
|
||||
}
|
||||
catch(Exception ex) { //no need to distinguish between exceptions for the moment
|
||||
ex.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import dao.Dao;
|
||||
import entities.DMPProfile;
|
||||
import entities.responses.IDLabelPair;
|
||||
|
||||
public interface DMPProfileDao extends Dao<DMPProfile, UUID> {
|
||||
|
||||
List<UUID> listAllIDs();
|
||||
|
||||
List<IDLabelPair> listAllIDsLabels();
|
||||
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
package dao.entities;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import dao.Dao;
|
||||
import entities.DMPResearcher;
|
||||
import entities.Researcher;
|
||||
|
||||
public interface DMPResearcherDao extends Dao<DMPResearcher, UUID> {
|
||||
|
||||
|
||||
Researcher getResearcherByEmail(String email);
|
||||
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import dao.Dao;
|
||||
import entities.DataRepository;
|
||||
import entities.responses.IDLabelPair;
|
||||
|
||||
public interface DataRepositoryDao extends Dao<DataRepository, UUID> {
|
||||
|
||||
List<UUID> listAllIDs();
|
||||
|
||||
List<IDLabelPair> listAllIDsLabels();
|
||||
|
||||
}
|
|
@ -1,42 +0,0 @@
|
|||
package dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.persistence.TypedQuery;
|
||||
|
||||
import org.hibernate.query.Query;
|
||||
|
||||
import dao.JpaDao;
|
||||
import entities.DataRepository;
|
||||
import entities.responses.IDLabelPair;
|
||||
|
||||
public class DataRepositoryDaoImpl extends JpaDao<DataRepository, UUID> implements DataRepositoryDao {
|
||||
|
||||
public DataRepository loadDetails(DataRepository t) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UUID> listAllIDs() {
|
||||
String queryString = "SELECT dataRepository.id FROM DataRepository dataRepository";
|
||||
TypedQuery<UUID> typedQuery = entityManager.createQuery(queryString, UUID.class);
|
||||
return typedQuery.getResultList();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<IDLabelPair> listAllIDsLabels() {
|
||||
String queryString = "SELECT dataRepository.id, dataRepository.label FROM DataRepository dataRepository";
|
||||
Query query = (Query) entityManager.createQuery(queryString);
|
||||
List<Object[]> rows = query.list();
|
||||
return rows.stream().map(row -> {
|
||||
return new IDLabelPair(row[0].toString(), row[1].toString());
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
package dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import dao.Dao;
|
||||
import entities.Dataset;
|
||||
import entities.responses.IDLabelPair;
|
||||
|
||||
public interface DatasetDao extends Dao<Dataset, UUID> {
|
||||
|
||||
|
||||
public List<UUID> listAllIDs();
|
||||
|
||||
List<IDLabelPair> listAllIDsLabels();
|
||||
|
||||
List<Dataset> getDatasetsOfDmp(UUID dmpID);
|
||||
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
package dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.persistence.Query;
|
||||
import javax.persistence.TypedQuery;
|
||||
import javax.transaction.Transactional;
|
||||
|
||||
import dao.JpaDao;
|
||||
import entities.Dataset;
|
||||
import entities.responses.IDLabelPair;
|
||||
|
||||
public class DatasetDaoImpl extends JpaDao<Dataset, UUID> implements DatasetDao {
|
||||
|
||||
public Dataset loadDetails(Dataset t) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UUID> listAllIDs() {
|
||||
String queryString = "SELECT dataset.id FROM Dataset dataset where dataset.status>=0";
|
||||
TypedQuery<UUID> typedQuery = entityManager.createQuery(queryString, UUID.class);
|
||||
return typedQuery.getResultList();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<IDLabelPair> listAllIDsLabels() {
|
||||
String queryString = "SELECT dataset.id, dataset.label FROM Dataset dataset where dataset.status>=0";
|
||||
Query query = (Query) entityManager.createQuery(queryString);
|
||||
List<Object[]> rows = query.getResultList();
|
||||
return rows.stream().map(row -> {
|
||||
return new IDLabelPair(row[0].toString(), row[1].toString());
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Dataset> getDatasetsOfDmp(UUID dmpID) {
|
||||
String queryString = "FROM Dataset dataset where dataset.dmp.id=:dmpID and dataset.status>=0";
|
||||
Query query = (Query) entityManager.createQuery(queryString);
|
||||
query.setParameter("dmpID", dmpID);
|
||||
List<Dataset> datasets = (List<Dataset>) query.getResultList();
|
||||
return datasets;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import dao.Dao;
|
||||
import entities.DatasetProfile;
|
||||
import entities.responses.IDLabelPair;
|
||||
|
||||
public interface DatasetProfileDao extends Dao<DatasetProfile, UUID> {
|
||||
|
||||
public List<UUID> listAllIDs();
|
||||
|
||||
List<IDLabelPair> listAllIDsLabels();
|
||||
|
||||
|
||||
}
|
|
@ -1,42 +0,0 @@
|
|||
package dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.persistence.Query;
|
||||
import javax.persistence.TypedQuery;
|
||||
|
||||
import dao.JpaDao;
|
||||
import entities.DatasetProfile;
|
||||
import entities.responses.IDLabelPair;
|
||||
|
||||
public class DatasetProfileDaoImpl extends JpaDao<DatasetProfile, UUID> implements DatasetProfileDao {
|
||||
|
||||
|
||||
public DatasetProfile loadDetails(DatasetProfile t) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UUID> listAllIDs() {
|
||||
String queryString = "SELECT dp.id FROM DatasetProfile dp";
|
||||
TypedQuery<UUID> typedQuery = entityManager.createQuery(queryString, UUID.class);
|
||||
return typedQuery.getResultList();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<IDLabelPair> listAllIDsLabels() {
|
||||
String queryString = "SELECT dp.id, dp.label FROM DatasetProfile dp";
|
||||
Query query = (Query) entityManager.createQuery(queryString);
|
||||
List<Object[]> rows = query.getResultList();
|
||||
return rows.stream().map(row -> {
|
||||
return new IDLabelPair(row[0].toString(), row[1].toString());
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
package dao.entities;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import dao.Dao;
|
||||
import entities.DatasetProfileRuleset;
|
||||
|
||||
public interface DatasetProfileRulesetDao extends Dao<DatasetProfileRuleset, UUID> {
|
||||
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
package dao.entities;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import dao.Dao;
|
||||
import entities.DatasetProfileViewstyle;
|
||||
|
||||
public interface DatasetProfileViewstyleDao extends Dao<DatasetProfileViewstyle, UUID> {
|
||||
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
package dao.entities;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import dao.Dao;
|
||||
import entities.DatasetRegistry;
|
||||
|
||||
public interface DatasetRegistryDao extends Dao<DatasetRegistry, UUID> {
|
||||
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
package dao.entities;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import dao.Dao;
|
||||
import entities.DatasetService;
|
||||
|
||||
public interface DatasetServiceDao extends Dao<DatasetService, UUID> {
|
||||
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import dao.Dao;
|
||||
import entities.Organisation;
|
||||
import entities.responses.IDLabelPair;
|
||||
|
||||
public interface OrganisationDao extends Dao<Organisation, UUID> {
|
||||
|
||||
public List<UUID> listAllIDs();
|
||||
|
||||
List<IDLabelPair> listAllIDsLabels();
|
||||
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import dao.Dao;
|
||||
import entities.Project;
|
||||
import entities.responses.IDLabelPair;
|
||||
|
||||
public interface ProjectDao extends Dao<Project, UUID> {
|
||||
|
||||
public List<UUID> listAllIDs();
|
||||
|
||||
public List<IDLabelPair> listAllIDsLabels();
|
||||
|
||||
public List<Project> getProjectsOfUser(String userID);
|
||||
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
package dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.persistence.TypedQuery;
|
||||
|
||||
import org.hibernate.query.Query;
|
||||
|
||||
import dao.JpaDao;
|
||||
import entities.DMP;
|
||||
import entities.Project;
|
||||
import entities.responses.IDLabelPair;
|
||||
|
||||
public class ProjectDaoImpl extends JpaDao<Project, UUID> implements ProjectDao {
|
||||
|
||||
public Project loadDetails(Project t) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UUID> listAllIDs() {
|
||||
String queryString = "SELECT project.id FROM Project project";
|
||||
TypedQuery<UUID> typedQuery = entityManager.createQuery(queryString, UUID.class);
|
||||
return typedQuery.getResultList();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<IDLabelPair> listAllIDsLabels() {
|
||||
String queryString = "SELECT project.id, project.label FROM Project project";
|
||||
Query query = (Query) entityManager.createQuery(queryString);
|
||||
List<Object[]> rows = query.list();
|
||||
return rows.stream().map(row -> {
|
||||
return new IDLabelPair(row[0].toString(), row[1].toString());
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
public List<Project> getProjectsOfUser(String userID){
|
||||
|
||||
String queryString = "select p from Project p where p.creationUser.id=:userid and project.status >= 0";
|
||||
TypedQuery<Project> typedQuery = entityManager.createQuery(queryString, Project.class);
|
||||
typedQuery.setParameter("userid", UUID.fromString(userID));
|
||||
try {
|
||||
return typedQuery.getResultList();
|
||||
}
|
||||
catch(Exception ex) { //no need to distinguish between exceptions for the moment
|
||||
ex.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import dao.Dao;
|
||||
import entities.Registry;
|
||||
import entities.Researcher;
|
||||
import entities.responses.IDLabelPair;
|
||||
|
||||
public interface RegistryDao extends Dao<Registry, UUID> {
|
||||
|
||||
List<UUID> listAllIDs();
|
||||
|
||||
List<IDLabelPair> listAllIDsLabels();
|
||||
|
||||
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import dao.Dao;
|
||||
import entities.Researcher;
|
||||
import entities.responses.IDLabelPair;
|
||||
|
||||
public interface ResearcherDao extends Dao<Researcher, UUID> {
|
||||
|
||||
List<UUID> listAllIDs();
|
||||
|
||||
List<IDLabelPair> listAllIDsLabels();
|
||||
|
||||
Researcher getResearcherByEmail(String email);
|
||||
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import dao.Dao;
|
||||
import entities.Service;
|
||||
import entities.responses.IDLabelPair;
|
||||
|
||||
public interface ServiceDao extends Dao<Service, UUID> {
|
||||
|
||||
List<UUID> listAllIDs();
|
||||
|
||||
List<IDLabelPair> listAllIDsLabels();
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue