login substitute new implementation

This commit is contained in:
Eugenio Romano
2016-06-29 00:37:54 +01:00
parent f2f6ffc254
commit 35d245bbaa
6 changed files with 12 additions and 20 deletions

View File

@@ -14,7 +14,8 @@ var map = {
var packages = { var packages = {
'app': { main: 'main.js', defaultExtension: 'js' }, 'app': { main: 'main.js', defaultExtension: 'js' },
'rxjs': { defaultExtension: 'js' }, 'rxjs': { defaultExtension: 'js' },
'alfresco-js-api' : { main: 'alfresco-js-api.js', defaultExtension: 'js' },
'ng2-translate': { defaultExtension: 'js' } 'ng2-translate': { defaultExtension: 'js' }
}; };

View File

@@ -15,6 +15,7 @@ module.exports = function (config) {
{pattern: 'node_modules/rxjs/**/*.map', included: false, watched: false}, {pattern: 'node_modules/rxjs/**/*.map', included: false, watched: false},
{pattern: 'node_modules/@angular/**/*.js', included: false, watched: false}, {pattern: 'node_modules/@angular/**/*.js', included: false, watched: false},
{pattern: 'node_modules/@angular/**/*.map', included: false, watched: false}, {pattern: 'node_modules/@angular/**/*.map', included: false, watched: false},
{pattern: 'node_modules/alfresco-js-api/dist/alfresco-js-api.js', included: true, watched: false},
{pattern: 'karma-test-shim.js', included: true, watched: true}, {pattern: 'karma-test-shim.js', included: true, watched: true},

View File

@@ -6,19 +6,15 @@
"scripts": { "scripts": {
"clean": "rimraf dist node_modules typings", "clean": "rimraf dist node_modules typings",
"typings": "typings install", "typings": "typings install",
"build": "npm run tslint && typings install && rimraf dist && tsc && npm run copytemplates && license-check", "build": "npm run tslint && typings install && rimraf dist && tsc && license-check",
"build:w": "npm run tslint && typings install && rimraf dist && npm run watch-task",
"watch-task": "concurrently \"npm run tsc:w\" \"license-check\"",
"tslint": "npm run tslint-src && npm run tslint-root", "tslint": "npm run tslint-src && npm run tslint-root",
"tslint-src": "tslint -c tslint.json src/{,**/}**.ts", "tslint-src": "tslint -c tslint.json src/{,**/}**.ts",
"tslint-root": "tslint -c tslint.json *.ts", "tslint-root": "tslint -c tslint.json *.ts",
"copytemplates": "npm run copy-html-css && npm run copy-i18n",
"copy-html-css": "cpx \"./src/**/*.{html,css}\" ./dist/src",
"copy-html-css:w": "cpx \"./src/**/*.{html,css}\" ./dist/src -w",
"copy-i18n": "cpx \"./i18n/**/*.json\" ./dist/i18n",
"copy-i18n:w": "cpx \"./i18n/**/*.json\" ./dist/i18n -w",
"copy-images": "cpx \"./src/**/*.{png,jpg,gif,svg}\" ./dist/src",
"copy-images:w": "cpx \"./src/**/*.{png,jpg,gif,svg}\" ./dist/src -w",
"licensecheck": "license-check", "licensecheck": "license-check",
"tsc": "tsc", "tsc": "tsc",
"tsc:w": "tsc -w",
"pretest": "npm run build", "pretest": "npm run build",
"test": "karma start karma.conf.js --reporters mocha,coverage --single-run", "test": "karma start karma.conf.js --reporters mocha,coverage --single-run",
"test-browser": "karma start karma.conf.js --reporters kjhtml ", "test-browser": "karma start karma.conf.js --reporters kjhtml ",
@@ -54,6 +50,7 @@
"alfresco" "alfresco"
], ],
"dependencies": { "dependencies": {
"alfresco-js-api": "0.1.0",
"@angular/common": "2.0.0-rc.3", "@angular/common": "2.0.0-rc.3",
"@angular/compiler": "2.0.0-rc.3", "@angular/compiler": "2.0.0-rc.3",
"@angular/core": "2.0.0-rc.3", "@angular/core": "2.0.0-rc.3",

View File

@@ -18,15 +18,11 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { AlfrescoAuthenticationService } from './AlfrescoAuthenticationService.service'; import { AlfrescoAuthenticationService } from './AlfrescoAuthenticationService.service';
import { AlfrescoSettingsService } from './AlfrescoSettingsService.service';
@Injectable() @Injectable()
export class AlfrescoContentService { export class AlfrescoContentService {
constructor( constructor(private authService: AlfrescoAuthenticationService) {
private settings: AlfrescoSettingsService,
private authService: AlfrescoAuthenticationService
) {
} }
/** /**
@@ -35,8 +31,7 @@ export class AlfrescoContentService {
* @returns {string} URL address. * @returns {string} URL address.
*/ */
getDocumentThumbnailUrl(document: any) { getDocumentThumbnailUrl(document: any) {
return this.settings.getApiBaseUrl() + '/nodes/' + document.entry.id + this.authService.alfrescoApi.getDocumentThumbnailUrl(document.entry.id);
'/renditions/doclib/content' + '?attachment=false&alf_ticket=' + this.authService.getToken();
} }
/** /**
@@ -45,7 +40,6 @@ export class AlfrescoContentService {
* @returns {string} URL address. * @returns {string} URL address.
*/ */
getContentUrl(document: any) { getContentUrl(document: any) {
return this.settings.getApiBaseUrl() + '/nodes/' + document.entry.id + this.authService.alfrescoApi.getContentUrl(document.entry.id);
'/content' + '?attachment=false&alf_ticket=' + this.authService.getToken();
} }
} }

View File

@@ -20,7 +20,7 @@
<script src="node_modules/systemjs/dist/system.src.js"></script> <script src="node_modules/systemjs/dist/system.src.js"></script>
<!-- Additional Alfresco libraries --> <!-- Additional Alfresco libraries -->
<script src="node_modules/alfresco-js-api/bundle.js"></script> <script src="node_modules/alfresco-js-api/dist/alfresco-js-api.js"></script>
<script src="systemjs.config.js"></script> <script src="systemjs.config.js"></script>
<script> <script>

View File

@@ -92,7 +92,6 @@ export class AlfrescoLoginComponent {
this.form.valueChanges.subscribe(data => this.onValueChanged(data)); this.form.valueChanges.subscribe(data => this.onValueChanged(data));
// this.onValueChanged(null);
} }
/** /**