diff --git a/.travis.yml b/.travis.yml index 38bd43820e..871656636c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,8 +17,6 @@ before_install: - export CHROME_BIN=/usr/bin/google-chrome - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start - - (cd ng2-components/ng2-alfresco-core; npm version patch; sed -i "s/0\\.0\\.0-PLACEHOLDER/^0.1.0/g" package.json; npm install; npm link) - env: matrix: - MODULE=ng2-alfresco-core @@ -28,11 +26,56 @@ env: - MODULE=ng2-alfresco-search - MODULE=ng2-alfresco-upload - MODULE=ng2-alfresco-viewer + - MODULE=ng2-alfresco-webscript + - MODULE=ng2-activiti-form + - MODULE=ng2-activiti-tasklist + - MODULE=ng2-activiti-processlist before_script: - - cd ng2-components/$MODULE; npm version patch; sed -i "s/0\\.0\\.0-PLACEHOLDER/^0.1.0/g" package.json; npm install; npm link ng2-alfresco-core; npm run travis + - if ([ "$MODULE" != "ng2-alfresco-core" ]); then + (cd ng2-components/ng2-alfresco-core; npm install; npm link); + fi + - if ([ "$MODULE" == "ng2-alfresco-documentlist" ] || [ "$MODULE" == "ng2-alfresco-webscript" ] || [ "$MODULE" == "ng2-activiti-processlist" ] || [ "$MODULE" == "ng2-activiti-tasklist" ]); then + (cd ng2-components/ng2-alfresco-datatable; npm link ng2-alfresco-core; npm install; npm link); + fi + - if ([ "$MODULE" == "ng2-activiti-tasklist" ] || [ "$MODULE" == "ng2-activiti-processlist" ]); then + (cd ng2-components/ng2-activiti-form; npm link ng2-alfresco-core; npm install; npm link); + fi + - if ([ "$MODULE" == "ng2-activiti-processlist" ]); then + (cd ng2-components/ng2-activiti-tasklist; npm link ng2-alfresco-core; npm link ng2-alfresco-datatable; npm link ng2-activiti-form; npm install; npm link); + fi + - cd ng2-components/$MODULE; + - if ([ "$MODULE" != "ng2-alfresco-core" ]); then + npm link ng2-alfresco-core; + fi + - if ([ "$MODULE" == "ng2-alfresco-documentlist" ] || [ "$MODULE" == "ng2-alfresco-webscript" ] || [ "$MODULE" == "ng2-activiti-processlist" ] || [ "$MODULE" == "ng2-activiti-tasklist" ]); then + npm link ng2-alfresco-datatable; + fi + - if ([ "$MODULE" == "ng2-activiti-tasklist" ]); then + npm link ng2-activiti-form; + fi + - if ([ "$MODULE" == "ng2-activiti-processlist" ]); then + npm link ng2-activiti-tasklist; + fi + - npm install; + - npm run travis - ls -ltrh ./node_modules/ script: npm run test # Send coverage data to Coveralls after_success: - - "cat ./coverage/report/lcov.info | ./node_modules/coveralls/bin/coveralls.js --verbose" + - bash <(curl -s https://codecov.io/bash) + +cache: + directories: + - demo-shell-ng2/node_modules + - ng2-components/ng2-activiti-form/node_modules + - ng2-components/ng2-activiti-processlist/node_modules + - ng2-components/ng2-activiti-tasklist/node_modules + - ng2-components/ng2-alfresco-core/node_modules + - ng2-components/ng2-alfresco-datatable/node_modules + - ng2-components/ng2-alfresco-documentlist/node_modules + - ng2-components/ng2-alfresco-login/node_modules + - ng2-components/ng2-alfresco-search/node_modules + - ng2-components/ng2-alfresco-upload/node_modules + - ng2-components/ng2-alfresco-viewer/node_modules + - ng2-components/ng2-alfresco-webscript/node_modules diff --git a/PREREQUISITES.md b/PREREQUISITES.md index a14302fa9a..7687ee6ec4 100644 --- a/PREREQUISITES.md +++ b/PREREQUISITES.md @@ -2,9 +2,13 @@ The [Angular 2](https://angular.io/) based application development framework requires the following: -- An Alfresco Platform Repository to talk to, which has [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) enabled. +- An Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer) to talk to, which has [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) enabled. - [Node.js](https://nodejs.org/en/) JavaScript runtime. - [npm](https://www.npmjs.com/) package manager for JavaScript. + +**Verify that you are running at least node `v5.x.x` and npm `3.x.x`** +by running `node -v` and `npm -v` in a terminal/console window. +Older versions produce errors. ## Installing Alfresco @@ -25,9 +29,18 @@ The web client that we are building with the application development framework w So we need to tell the Alfresco server that any request that comes in from this custom web client should be allowed access to the Content Repository. This is done by enabling CORS. -To enable CORS in the Alfresco Platform do the following: +To enable CORS in the Alfresco Platform do one of the following: -Modify *tomcat/webapps/alfresco/WEB-INF/web.xml* and uncomment the following section and update +**Download and install the enable CORS module** + +This is the easiest way, add the [enablecors](https://artifacts.alfresco.com/nexus/service/local/repositories/releases/content/org/alfresco/enablecors/1.0/enablecors-1.0.jar) +platform module JAR to the *$ALF_INSTALL_DIR/modules/platform* directory and restart the server. + +Note. by default the CORS filter that is enabled will allow any orgin. + +**Manually update the web.xml file** + +Modify *$ALF_INSTALL_DIR/tomcat/webapps/alfresco/WEB-INF/web.xml* and uncomment the following section and update `cors.allowOrigin` to `http://localhost:3000`: ``` diff --git a/README.md b/README.md index a087e86b10..18ef46855f 100644 --- a/README.md +++ b/README.md @@ -3,12 +3,16 @@ [](https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
-
+
+
-
-
+
+
+
+
+
@@ -55,6 +59,7 @@ The following is a list of some of the components that you can use when building
- [Viewer](ng2-components/ng2-alfresco-viewer/README.md)
- [Login](ng2-components/ng2-alfresco-login/README.md)
- [Upload](ng2-components/ng2-alfresco-upload/README.md)
+- [Webscript viewer](ng2-components/ng2-alfresco-webscript/README.md)
You can browse all the components at the following [page](http://devproducts.alfresco.com/).
@@ -81,4 +86,13 @@ To generate your Alfresco Angular 2 application you can use the following Yeoman
- [Yeoman Generator Angular 2 Alfresco application](https://github.com/Alfresco/generator-ng2-alfresco-app)
+## Amazon AWS Elastic Beanstalk fast deploy
+
+
+
diff --git a/appveyor.yml b/appveyor.yml
new file mode 100644
index 0000000000..6487d8bafb
--- /dev/null
+++ b/appveyor.yml
@@ -0,0 +1,53 @@
+# Test against this version of Node.js
+branches:
+ only:
+ - master
+
+environment:
+ nodejs_version: "5"
+
+ matrix:
+ - COMPONENT_NAME: ng2-alfresco-core
+ - COMPONENT_NAME: ng2-alfresco-datatable
+ - COMPONENT_NAME: ng2-alfresco-documentlist
+ - COMPONENT_NAME: ng2-alfresco-login
+ - COMPONENT_NAME: ng2-alfresco-search
+ - COMPONENT_NAME: ng2-alfresco-upload
+ - COMPONENT_NAME: ng2-alfresco-viewer
+ - COMPONENT_NAME: ng2-alfresco-webscript
+ - COMPONENT_NAME: ng2-activiti-form
+ - COMPONENT_NAME: ng2-activiti-tasklist
+ - COMPONENT_NAME: ng2-activiti-processlist
+
+# Install scripts. (runs after repo cloning)
+install:
+ # Get the latest stable version of Node.js or io.js
+ - ps: Install-Product node $env:nodejs_version
+ # install module
+ - IF %COMPONENT_NAME% NEQ ng2-alfresco-core (cd ng2-components/ng2-alfresco-core && npm install && npm link && cd ../../)
+ - IF %COMPONENT_NAME% EQU ng2-alfresco-documentlist (cd ng2-components/ng2-alfresco-datatable && npm link ng2-alfresco-core && npm install && npm link && cd ../../)
+ - IF %COMPONENT_NAME% EQU ng2-activiti-processlist (cd ng2-components/ng2-alfresco-datatable && npm link ng2-alfresco-core && npm install && npm link && cd ../../)
+ - IF %COMPONENT_NAME% EQU ng2-activiti-processlist (cd ng2-components/ng2-activiti-form && npm link ng2-alfresco-core && npm install && npm link && cd ../../)
+ - IF %COMPONENT_NAME% EQU ng2-activiti-processlist (cd ng2-components/ng2-activiti-tasklist && npm link ng2-alfresco-core && npm link ng2-alfresco-datatable && npm link ng2-activiti-form && npm install && npm link && cd ../../)
+ - IF %COMPONENT_NAME% EQU ng2-activiti-tasklist (cd ng2-components/ng2-alfresco-datatable && npm link ng2-alfresco-core && npm install && npm link && cd ../../)
+ - IF %COMPONENT_NAME% EQU ng2-activiti-tasklist (cd ng2-components/ng2-activiti-form && npm link ng2-alfresco-core && npm install && npm link && cd ../../)
+ - IF %COMPONENT_NAME% EQU ng2-alfresco-webscript (cd ng2-components/ng2-alfresco-datatable && npm link ng2-alfresco-core && npm install && npm link && cd ../../)
+ - cd ng2-components/%COMPONENT_NAME%
+ - IF %COMPONENT_NAME% NEQ ng2-alfresco-core (npm link ng2-alfresco-core)
+ - IF %COMPONENT_NAME% EQU ng2-alfresco-documentlist (npm link ng2-alfresco-datatable)
+ - IF %COMPONENT_NAME% EQU ng2-activiti-processlist (npm link ng2-alfresco-datatable)
+ - IF %COMPONENT_NAME% EQU ng2-activiti-processlist (npm link ng2-activiti-tasklist)
+ - IF %COMPONENT_NAME% EQU ng2-activiti-tasklist (npm link ng2-alfresco-datatable && npm link ng2-activiti-form)
+ - IF %COMPONENT_NAME% EQU ng2-alfresco-webscript (npm link ng2-alfresco-datatable)
+ - npm install
+
+# Post-install test scripts.
+test_script:
+ # Output useful info for debugging.
+ - node --version
+ - npm --version
+ # run tests
+ - npm test
+
+# Don't actually build.
+build: off
diff --git a/demo-shell-ng2/.ebextensions/deploy_npm.config b/demo-shell-ng2/.ebextensions/deploy_npm.config
new file mode 100644
index 0000000000..7abdb9c83f
--- /dev/null
+++ b/demo-shell-ng2/.ebextensions/deploy_npm.config
@@ -0,0 +1,18 @@
+files:
+ "/opt/elasticbeanstalk/hooks/appdeploy/pre/50npm.sh" :
+ mode: "000775"
+ owner: root
+ group: root
+ content: |
+ #!/bin/bash
+ function error_exit
+ {
+ eventHelper.py --msg "$1" --severity ERROR
+ exit $2
+ }
+
+ export HOME=/home/ec2-user
+ echo "export home"
+
+ sudo curl -sL https://rpm.nodesource.com/setup_6.x | sudo -E bash -
+ sudo yum install -y nodejs
diff --git a/demo-shell-ng2/.gitignore b/demo-shell-ng2/.gitignore
index fd79f1c9c2..964913e5ef 100644
--- a/demo-shell-ng2/.gitignore
+++ b/demo-shell-ng2/.gitignore
@@ -4,4 +4,8 @@ bower_components/
app/**/*.js
app/**/*.js.map
.idea
-dist/
\ No newline at end of file
+dist/
+
+# docker files
+docker-compose.yml
+Dockerfile
diff --git a/demo-shell-ng2/app.js b/demo-shell-ng2/app.js
new file mode 100644
index 0000000000..f897a59bcc
--- /dev/null
+++ b/demo-shell-ng2/app.js
@@ -0,0 +1,77 @@
+var port = process.env.PORT || 3000,
+ http = require('http'),
+ fs = require('fs'),
+ url = require('url'),
+ mime = require('mime'),
+ html = fs.readFileSync('index.html');
+
+var log = function(entry) {
+ fs.appendFileSync('/tmp/sample-app.log', new Date().toISOString() + ' - ' + entry + '\n');
+};
+
+var server = http.createServer(function (req, res) {
+
+ // Parse the request containing file name
+ var pathname = url.parse(req.url).pathname;
+
+ // Print the name of the file for which request is made.
+ console.log("Request for " + pathname + " received.");
+
+ if (req.method === 'POST') {
+ var body = '';
+
+ req.on('data', function(chunk) {
+ body += chunk;
+ });
+
+ req.on('end', function() {
+ if (req.url === '/') {
+ log('Received message: ' + body);
+ } else if (req.url = '/scheduled') {
+ log('Received task ' + req.headers['x-aws-sqsd-taskname'] + ' scheduled at ' + req.headers['x-aws-sqsd-scheduled-at']);
+ }
+
+ res.writeHead(200, 'OK', {'Content-Type': 'text/plain'});
+ res.end();
+ });
+ } else {
+ var filename = pathname.substr(1);
+ if(filename === '' || filename.indexOf('.') === -1){
+ filename = 'index.html';
+ }
+ // Read the requested file content from file system
+ fs.readFile(filename, function (err, data) {
+ if (err) {
+ console.log(err, filename);
+ // HTTP Status: 404 : NOT FOUND
+ // Content Type: text/plain
+ res.writeHead(404, {'Content-Type': 'text/html'});
+ }else{
+ //Page found
+ // HTTP Status: 200 : OK
+ // Content Type: text/plain
+ var type = mime.lookup(filename);
+ console.log('type',type);
+ if (!res.getHeader('content-type')) {
+ var charset = mime.charsets.lookup(type);
+ res.setHeader('Content-Type', type + (charset ? '; charset=' + charset : ''));
+ }
+ if(type.indexOf('image') > -1 || type.indexOf('font') > -1){
+ var img = fs.readFileSync(pathname.substr(1));
+ res.end(img, 'binary');
+ }else{
+ res.write(data.toString());
+ }
+ // Write the content of the file to response body
+ }
+ // Send the response body
+ res.end();
+ });
+ }
+});
+
+// Listen on port 3000, IP defaults to 127.0.0.1
+server.listen(port);
+
+// Put a friendly message on the terminal
+console.log('Server running at http://127.0.0.1:' + port + '/');
diff --git a/demo-shell-ng2/app/app.component.html b/demo-shell-ng2/app/app.component.html
index 0447a85c1c..c5d2a1d1e7 100644
--- a/demo-shell-ng2/app/app.component.html
+++ b/demo-shell-ng2/app/app.component.html
@@ -12,11 +12,13 @@
@@ -30,8 +32,8 @@
+ +
-+ +
-+ +
+ ++ +
+ ++ +
++ +
+
-
+
-
-
+
+
+
+
+
@@ -25,12 +29,25 @@
{{form.values | json}}
+
+ {{form.json | json}}
+