Skip to content

Commit

Permalink
update to ADF 1.9.0, make use of the new posibility of registering ha…
Browse files Browse the repository at this point in the history
…ndlers for actions to the DocumentActionService
  • Loading branch information
Mikel Asla committed Jan 15, 2018
1 parent 5fb2345 commit 0371527
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 62 deletions.
2 changes: 1 addition & 1 deletion .happypack/cache--ts.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"context":{"loaders":[{"path":"/home/mikel/workspaces/bee/2017-global-hackaton/ng2-alfresco-aos-editonline/node_modules/ts-loader/index.js","query":"?{\"happyPackMode\":true,\"compilerOptions\":{\"paths\":{}}}"}],"external":{}},"mtimes":{"/home/mikel/workspaces/bee/2017-global-hackaton/ng2-alfresco-aos-editonline/index.ts":{"mtime":1506419077092,"compiledPath":"/home/mikel/workspaces/bee/2017-global-hackaton/ng2-alfresco-aos-editonline/.happypack/s--1670148620","error":null},"/home/mikel/workspaces/bee/2017-global-hackaton/ng2-alfresco-aos-editonline/src/services/aos-edit-online-service.ts":{"mtime":1506530962545,"compiledPath":"/home/mikel/workspaces/bee/2017-global-hackaton/ng2-alfresco-aos-editonline/.happypack/s-264985988","error":null}}}
{"context":{"loaders":[{"path":"/home/mikel/workspaces/bee/2017-global-hackaton/ng2-alfresco-aos-editonline/node_modules/ts-loader/index.js","query":"?{\"happyPackMode\":true,\"compilerOptions\":{\"paths\":{}}}"}],"external":{}},"mtimes":{"/home/mikel/workspaces/bee/2017-global-hackaton/ng2-alfresco-aos-editonline/index.ts":{"mtime":1506419077092,"compiledPath":"/home/mikel/workspaces/bee/2017-global-hackaton/ng2-alfresco-aos-editonline/.happypack/s--1670148620","error":null},"/home/mikel/workspaces/bee/2017-global-hackaton/ng2-alfresco-aos-editonline/src/services/aos-edit-online-service.ts":{"mtime":1508149581492,"compiledPath":"/home/mikel/workspaces/bee/2017-global-hackaton/ng2-alfresco-aos-editonline/.happypack/s-264985988","error":null}}}
1 change: 1 addition & 0 deletions .happypack/s-264985988
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ var AOSEditOnlineService = AOSEditOnlineService_1 = (function () {
this.notificationService = notificationService;
this.documentActionService = documentActionService;
this.translationService = translationService;
documentActionService.setHandler('aos-edit-online', this.onActionEditOnlineAos.bind(this));
}
AOSEditOnlineService.prototype.onActionEditOnlineAos = function (nodeId) {
var _this = this;
Expand Down
2 changes: 1 addition & 1 deletion .happypack/s-264985988.map

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ Install the **ng2-alfresco-aos-editonline** module into your ADF application
npm install ng2-alfresco-aos-editonline --save
```


## Compatibility Matrix

| package version | ADF version |
| --- | --- |
| 0.1.5 | 1.8.0 |
| 0.1.6 | 1.9.0 |

## Basic usage

1. Generate a example ADF application and install the module
Expand All @@ -80,8 +88,6 @@ $ npm install
$ npm install ng2-alfresco-aos-editonline --save
```

**NOTE:** make sure your generator is up to date before creating new projects (tested with 1.8.0)

1. Add the module to your application

Edit the root module on your application to add the **ng2-alfresco-aos-editonline** module
Expand Down
24 changes: 14 additions & 10 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
import { NgModule, ModuleWithProviders } from '@angular/core';
import { CommonModule } from '@angular/common';

import { CoreModule, TRANSLATION_PROVIDER } from 'ng2-alfresco-core';
import { AOSEditOnlineService } from './src/services/aos-edit-online-service';
export * from './src/services/aos-edit-online-service';

@NgModule({
imports: [CommonModule],
imports: [CoreModule],
declarations: [],
providers: [AOSEditOnlineService],
providers:
[
AOSEditOnlineService,
{
provide: TRANSLATION_PROVIDER,
multi: true,
useValue: {
name: 'ng2-alfresco-aos-editonline',
source: 'assets/ng2-alfresco-aos-editonline'
}
}
],
exports: []
})
export class Ng2AlfrescoAosEditonlineModule {
static forRoot(opts: any = {}): ModuleWithProviders {

return {
ngModule: Ng2AlfrescoAosEditonlineModule,
providers: [AOSEditOnlineService]
};
}
}
Binary file added ng2-alfresco-aos-editonline.webm
Binary file not shown.
83 changes: 41 additions & 42 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,80 +22,79 @@
"url": "https://github.com/keensoft/ng2-alfresco-aos-editonline/issues"
},
"dependencies": {
"@angular/animations": "4.2.5",
"@angular/cdk": "2.0.0-beta.8",
"@angular/common": "4.2.5",
"@angular/compiler": "4.2.5",
"@angular/core": "4.2.5",
"@angular/forms": "4.2.5",
"@angular/http": "4.2.5",
"@angular/material": "2.0.0-beta.8",
"@angular/platform-browser": "4.2.5",
"@angular/platform-browser-dynamic": "4.2.5",
"@angular/router": "4.2.5",
"@angular/animations": "4.3.6",
"@angular/cdk": "2.0.0-beta.10",
"@angular/common": "4.3.6",
"@angular/compiler": "4.3.6",
"@angular/compiler-cli": "4.3.6",
"@angular/core": "4.3.6",
"@angular/flex-layout": "2.0.0-beta.9",
"@angular/forms": "4.3.6",
"@angular/http": "4.3.6",
"@angular/material": "2.0.0-beta.10",
"@angular/platform-browser": "4.3.6",
"@angular/platform-browser-dynamic": "4.3.6",
"@angular/router": "4.3.6",
"@ngx-translate/core": "7.0.0",
"alfresco-js-api": "1.8.0",
"alfresco-js-api": "1.9.0",
"chart.js": "2.5.0",
"core-js": "2.4.1",
"hammerjs": "2.0.8",
"moment": "2.15.1",
"ng2-alfresco-core": "1.8.0",
"ng2-alfresco-datatable": "1.8.0",
"ng2-alfresco-documentlist": "1.8.0",
"reflect-metadata": "0.1.10",
"custom-event-polyfill": "^0.3.0",
"dialog-polyfill": "0.4.7",
"element.scrollintoviewifneeded-polyfill": "1.0.1",
"intl": "1.2.5",
"material-design-lite": "1.2.1",
"minimatch": "3.0.4",
"moment": "2.15.1",
"ng2-alfresco-core": "1.9.0",
"ng2-alfresco-datatable": "1.9.0",
"ng2-alfresco-documentlist": "1.9.0",
"ng2-charts": "1.6.0",
"pdfjs-dist": "1.5.404",
"raphael": "2.2.7",
"reflect-metadata": "0.1.9",
"rxjs": "5.1.0",
"systemjs": "0.19.27",
"zone.js": "0.7.6"
"web-animations-js": "2.3.1",
"zone.js": "0.8.12"
},
"devDependencies": {
"@types/hammerjs": "2.0.34",
"@types/jasmine": "2.5.35",
"@types/node": "6.0.45",
"adf-tslint-rules": "0.0.3",
"angular2-template-loader": "0.6.2",
"autoprefixer": "6.5.4",
"codelyzer": "3.1.2",
"copy-webpack-plugin": "4.0.1",
"css-loader": "0.23.1",
"css-to-string-loader": "0.1.2",
"cssnano": "3.8.1",
"css-loader": "0.26.1",
"extract-text-webpack-plugin": "2.0.0-rc.3",
"file-loader": "0.11.1",
"fork-ts-checker-webpack-plugin": "0.2.3",
"happypack": "3.0.0",
"file-loader": "0.10.0",
"fork-ts-checker-webpack-plugin": "0.2.4",
"happypack": "^4.0.0-beta.1",
"html-loader": "0.4.4",
"html-webpack-plugin": "2.28.0",
"istanbul-instrumenter-loader": "0.2.0",
"jasmine-ajax": "3.2.0",
"jasmine-core": "2.4.1",
"karma": "0.13.22",
"karma-chrome-launcher": "~1.0.1",
"jasmine-core": "2.5.2",
"karma": "1.7.0",
"karma-chrome-launcher": "2.0.0",
"karma-coverage": "1.1.1",
"karma-jasmine": "~1.0.2",
"karma-jasmine": "1.1.0",
"karma-jasmine-ajax": "0.1.13",
"karma-jasmine-html-reporter": "0.2.0",
"karma-mocha-reporter": "2.2.2",
"karma-remap-istanbul": "0.6.0",
"karma-sourcemap-loader": "0.3.7",
"karma-systemjs": "0.16.0",
"karma-webpack": "2.0.3",
"loader-utils": "1.1.0",
"merge-stream": "1.0.1",
"loader-utils": "^1.1.0",
"node-sass": "4.5.3",
"null-loader": "0.1.1",
"package-json-merge": "0.0.1",
"raw-loader": "0.5.1",
"remap-istanbul": "0.6.3",
"rimraf": "2.6.1",
"run-sequence": "1.2.2",
"sass-loader": "6.0.5",
"script-loader": "0.7.0",
"source-map-loader": "0.1.6",
"sourcemap-istanbul-instrumenter-loader": "0.2.0",
"style-loader": "0.13.1",
"systemjs-builder": "0.15.34",
"to-string-loader": "1.1.5",
"traceur": "0.0.91",
"ts-loader": "2.2.1",
"ts-node": "1.7.0",
"tslint": "5.5.0",
"tslint-loader": "3.5.3",
"typescript": "2.3.4",
Expand Down
16 changes: 10 additions & 6 deletions src/services/aos-edit-online-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@ import {
AlfrescoApiService,
AlfrescoAuthenticationService,
NotificationService,
AlfrescoSettingsService,
AppConfigService,
AlfrescoContentService,
AlfrescoTranslationService
} from 'ng2-alfresco-core';
import { DocumentActionsService, NodeActionsService, DocumentListService, ContentActionHandler, ContentActionModel, PermissionModel } from 'ng2-alfresco-documentlist';
import { DocumentActionsService } from 'ng2-alfresco-documentlist';
import { MinimalNodeEntity } from 'alfresco-js-api';

@Injectable()
export class AOSEditOnlineService {

static ECM_HOST_CONFIG_KEY = 'ecmHost';
static AOS_EDITONLINE_ACTION_HANDLER_KEY: string = 'aos-editonline';
static MS_PROTOCOL_NAMES: any = {
'doc': 'ms-word',
Expand Down Expand Up @@ -47,12 +48,14 @@ export class AOSEditOnlineService {
constructor(
private alfrescoApiService: AlfrescoApiService,
private alfrescoAuthenticationService: AlfrescoAuthenticationService,
private alfrescoSettingsService: AlfrescoSettingsService,
private appConfigService: AppConfigService,
private notificationService: NotificationService,
private documentActionService: DocumentActionsService,
private translationService: AlfrescoTranslationService
) {

documentActionService.setHandler(
'aos-edit-online',
this.onActionEditOnlineAos.bind(this));
}

onActionEditOnlineAos(nodeId: string): Observable<boolean> {
Expand Down Expand Up @@ -136,9 +139,10 @@ export class AOSEditOnlineService {
path = path + element.name + '/';
}

let url = this.alfrescoSettingsService.ecmHost + '/alfresco/aos' + path + '/' + node.name;
let ecmHost = this.appConfigService.get<string>(AOSEditOnlineService.ECM_HOST_CONFIG_KEY);
let url = ecmHost + '/alfresco/aos' + path + '/' + node.name;
if (encodeURI(url).length > 256) {
url = this.alfrescoSettingsService.ecmHost + '/alfresco/aos/' + '_aos_nodeid' + '/' + node.id + '/' + node.name;
url = ecmHost + '/alfresco/aos/' + '_aos_nodeid' + '/' + node.id + '/' + node.name;
}
return url;
}
Expand Down

0 comments on commit 0371527

Please sign in to comment.