Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Alfresco study37 alfresco_ng2_components

4,341 views

Published on

Alfresco angular2 componentsについて説明しました

Published in: Technology
  • Be the first to comment

Alfresco study37 alfresco_ng2_components

  1. 1. see https://github.com/Alfresco/alfresco-ng2-components/blob/master/INTRODUCTION.md
  2. 2. 1/2
  3. 3. 2/2
  4. 4. Alfresco angular2 components alfresco ng2 alfresco activiti
  5. 5. - Alfresco - <!— CORS filter filter mapping —> <!-- CORS Filter Mappings Begin —> <!-- <filter-mapping> <filter-name>CORS</filter-name> <url-pattern>/api/*</url-pattern> <url-pattern>/service/*</url-pattern> $ cp ~/…/enablecores-1.0.jar modules/platform - tomcat/webapps/alfresco/WEB-INF/web.xml
  6. 6. - - $ npm install -g yo $ npm install -g generator-ng2-alfresco-app
  7. 7. $ yo ng2-alfresco-app … cd <application name> $ npm install $ npm start
  8. 8. export class FilesComponent implements OnInit { // currentPath: string = ‘/Sites/swsdp/ documentLibrary’; currentPath: string = ‘/‘; rootFolderId: string = '-root-'; vi app/components/files/files.component.ts
  9. 9. Dirty hack! … getNodePath(node: MinimalNodeEntity): string { if (node) { let pathWithCompanyHome = node.entry.path.name; // return pathWithCompanyHome.replace('/Company Home', '') + '/' + node.entry.name; return pathWithCompanyHome.replace('/ ', '') + '/' + node.entry.name; } return null; } vi node_modules/ng2-alfresco-documentlist/src/components/ document-list.ts
  10. 10. 1/2 … <content-action target="folder" title="Activiti: View Form" (execute)="viewActivitiForm($event)"> </content-action> <content-action target="document" title="send comment" (execute)="sendComment($event)"> </content-action> </content-actions> </alfresco-document-list> vi app/components/files/files.component.html
  11. 11. 2/2 … myCustomAction1(event) { alert('Custom document action for ' + event.value.entry.name); } sendComment(event) { var commentBody = new this.auth.alfrescoApi.core.CommentBody(); commentBody['content'] = "This is comment from ng2"; this.auth.alfrescoApi.core.commentsApi.addComment(event.value.entry .id,commentBody); alert('send comment'); } vi app/components/files/files.component.ts
  12. 12. alfresco-js-api ng2-alfresco- core ng2-alfresco- login ng2-alfresco- search ng2-alfresco- documentList UI

×