fix demo folder document list

This commit is contained in:
Eugenio Romano
2016-08-31 14:09:04 +01:00
parent 21486c110a
commit 1f6898d043
3 changed files with 99 additions and 94 deletions

View File

@@ -38,100 +38,107 @@ import {
selector: 'alfresco-documentlist-demo', selector: 'alfresco-documentlist-demo',
template: ` template: `
<label for="ticket"><b>Insert a valid access ticket / ticket:</b></label><br> <label for="ticket"><b>Insert a valid access ticket / ticket:</b></label><br>
<input id="ticket" type="text" size="48" (change)="updateTicket();documentList.reload()" [(ngModel)]="ticket"><br> <input id="ticket" type="text" size="48" (change)="updateTicket(); documentList.reload()" [(ngModel)]="ticket"><br>
<label for="host"><b>Insert the ip of your Alfresco instance:</b></label><br> <label for="host"><b>Insert the ip of your Alfresco instance:</b></label><br>
<input id="host" type="text" size="48" (change)="updateHost();documentList.reload()" [(ngModel)]="ecmHost"><br><br> <input id="host" type="text" size="48" (change)="updateHost(); documentList.reload()" [(ngModel)]="ecmHost"><br><br>
<div *ngIf="!authenticated" style="color:#FF2323"> <div *ngIf="!authenticated" style="color:#FF2323">
Authentication failed to ip {{ host }} with user: admin, admin, you can still try to add a valid ticket to perform Authentication failed to ip {{ ecmHost }} with user: admin, admin, you can still try to add a valid ticket to perform
operations. operations.
</div> </div>
<hr> <hr>
<div class="container" *ngIf="authenticated"> <alfresco-document-list-breadcrumb
[currentFolderPath]="currentPath"
<alfresco-document-list-breadcrumb [target]="documentList">
[currentFolderPath]="currentPath" </alfresco-document-list-breadcrumb>
[target]="documentList"> <alfresco-document-list
</alfresco-document-list-breadcrumb> #documentList
<alfresco-document-list [currentFolderPath]="currentPath"
#documentList [contextMenuActions]="true"
[currentFolderPath]="currentPath" [contentActions]="true"
[contextMenuActions]="true" (folderChange)="onFolderChanged($event)">
[contentActions]="true" <!--
[multiselect]="true" <empty-folder-content>
(folderChange)="onFolderChanged($event)"> <template>
<h1>Sorry, no content here</h1>
</template>
</empty-folder-content>
-->
<content-columns>
<content-column key="$thumbnail" type="image"></content-column>
<content-column
title="{{'DOCUMENT_LIST.COLUMNS.DISPLAY_NAME' | translate}}"
key="name"
sortable="true"
class="full-width ellipsis-cell">
</content-column>
<!-- <!--
<empty-folder-content> <content-column
<template> title="Type"
<h1>Sorry, no content here</h1> source="content.mimeType">
</template> </content-column>
</empty-folder-content>
--> -->
<content-columns> <content-column
<content-column key="$thumbnail" type="image"></content-column> title="{{'DOCUMENT_LIST.COLUMNS.CREATED_BY' | translate}}"
<content-column key="createdByUser.displayName"
title="{{'DOCUMENT_LIST.COLUMNS.DISPLAY_NAME' | translate}}" sortable="true"
key="name" class="desktop-only">
sortable="true" </content-column>
class="full-width ellipsis-cell"> <content-column
</content-column> title="{{'DOCUMENT_LIST.COLUMNS.CREATED_ON' | translate}}"
<content-column key="createdAt"
title="{{'DOCUMENT_LIST.COLUMNS.CREATED_BY' | translate}}" type="date"
key="createdByUser.displayName" format="medium"
sortable="true" sortable="true"
class="desktop-only"> class="desktop-only">
</content-column> </content-column>
<content-column </content-columns>
title="{{'DOCUMENT_LIST.COLUMNS.CREATED_ON' | translate}}"
key="createdAt"
type="date"
format="medium"
sortable="true"
class="desktop-only">
</content-column>
</content-columns>
<content-actions>
<!-- folder actions -->
<content-action
target="folder"
title="{{'DOCUMENT_LIST.ACTIONS.FOLDER.SYSTEM_1' | translate}}"
handler="system1">
</content-action>
<content-action
target="folder"
title="{{'DOCUMENT_LIST.ACTIONS.FOLDER.CUSTOM' | translate}}"
(execute)="myFolderAction1($event)">
</content-action>
<content-action
target="folder"
title="{{'DOCUMENT_LIST.ACTIONS.FOLDER.DELETE' | translate}}"
handler="delete">
</content-action>
<!-- document actions --> <content-actions>
<content-action <!-- folder actions -->
target="document" <content-action
title="{{'DOCUMENT_LIST.ACTIONS.DOCUMENT.DOWNLOAD' | translate}}" target="folder"
handler="download"> title="{{'DOCUMENT_LIST.ACTIONS.FOLDER.SYSTEM_1' | translate}}"
</content-action> handler="system1">
<content-action </content-action>
target="document" <content-action
title="{{'DOCUMENT_LIST.ACTIONS.DOCUMENT.SYSTEM_2' | translate}}" target="folder"
handler="system2"> title="{{'DOCUMENT_LIST.ACTIONS.FOLDER.CUSTOM' | translate}}"
</content-action> (execute)="myFolderAction1($event)">
<content-action </content-action>
target="document" <content-action
title="{{'DOCUMENT_LIST.ACTIONS.DOCUMENT.CUSTOM' | translate}}" target="folder"
(execute)="myCustomAction1($event)"> title="{{'DOCUMENT_LIST.ACTIONS.FOLDER.DELETE' | translate}}"
</content-action> handler="delete">
<content-action </content-action>
target="document" <!-- document actions -->
title="{{'DOCUMENT_LIST.ACTIONS.DOCUMENT.DELETE' | translate}}" <content-action
handler="delete"> target="document"
</content-action> title="{{'DOCUMENT_LIST.ACTIONS.DOCUMENT.DOWNLOAD' | translate}}"
</content-actions> handler="download">
</alfresco-document-list> </content-action>
<content-action
target="document"
title="{{'DOCUMENT_LIST.ACTIONS.DOCUMENT.SYSTEM_2' | translate}}"
handler="system2">
</content-action>
<content-action
target="document"
title="{{'DOCUMENT_LIST.ACTIONS.DOCUMENT.CUSTOM' | translate}}"
(execute)="myCustomAction1($event)">
</content-action>
<content-action
target="document"
title="{{'DOCUMENT_LIST.ACTIONS.DOCUMENT.DELETE' | translate}}"
handler="delete">
</content-action>
<content-action
target="folder"
title="Activiti: View Form"
(execute)="viewActivitiForm($event)">
</content-action>
</content-actions>
</alfresco-document-list>
<context-menu-holder></context-menu-holder> <context-menu-holder></context-menu-holder>
</div>
`, `,
styles: [':host > .container {padding: 10px}'], styles: [':host > .container {padding: 10px}'],
directives: [DOCUMENT_LIST_DIRECTIVES, CONTEXT_MENU_DIRECTIVES], directives: [DOCUMENT_LIST_DIRECTIVES, CONTEXT_MENU_DIRECTIVES],
@@ -141,15 +148,13 @@ import {
class DocumentListDemo implements OnInit { class DocumentListDemo implements OnInit {
currentPath: string = '/'; currentPath: string = '/';
authenticated: boolean; authenticated: boolean = false;
ecmHost: string = 'http://devproducts-platform.alfresco.me'; ecmHost: string = 'http://devproducts-platform.alfresco.me';
ticket: string; ticket: string;
constructor( constructor(private authService: AlfrescoAuthenticationService, private settingsService: AlfrescoSettingsService,
private authService: AlfrescoAuthenticationService, private settingsService: AlfrescoSettingsService, translation: AlfrescoTranslationService, private documentActions: DocumentActionsService) {
translation: AlfrescoTranslationService, private documentActions: DocumentActionsService) {
settingsService.ecmHost = this.ecmHost; settingsService.ecmHost = this.ecmHost;
settingsService.setProviders('ECM'); settingsService.setProviders('ECM');

View File

@@ -29,9 +29,9 @@ import {
selector: 'my-app', selector: 'my-app',
template: ` template: `
<label for="ticket"><b>Insert a valid access ticket / ticket:</b></label><br> <label for="ticket"><b>Insert a valid access ticket / ticket:</b></label><br>
<input id="ticket" type="text" size="48" (change)="updateTicket();documentList.reload()" [(ngModel)]="ticket"><br> <input id="ticket" type="text" size="48" (change)="updateTicket()" [(ngModel)]="ticket"><br>
<label for="host"><b>Insert the ip of your Alfresco instance:</b></label><br> <label for="host"><b>Insert the ip of your Alfresco instance:</b></label><br>
<input id="host" type="text" size="48" (change)="updateHost();documentList.reload()" [(ngModel)]="ecmHost"><br><br> <input id="host" type="text" size="48" (change)="updateHost()" [(ngModel)]="ecmHost"><br><br>
<div *ngIf="!authenticated" style="color:#FF2323"> <div *ngIf="!authenticated" style="color:#FF2323">
Authentication failed to ip {{ ecmHost }} with user: admin, admin, you can still try to add a valid ticket to perform Authentication failed to ip {{ ecmHost }} with user: admin, admin, you can still try to add a valid ticket to perform
operations. operations.

View File

@@ -32,9 +32,9 @@ import { WEBSCRIPTCOMPONENT } from 'ng2-alfresco-webscript';
selector: 'alfresco-webscript-demo', selector: 'alfresco-webscript-demo',
template: ` template: `
<label for="ticket"><b>Insert a valid access ticket / ticket:</b></label><br> <label for="ticket"><b>Insert a valid access ticket / ticket:</b></label><br>
<input id="ticket" type="text" size="48" (change)="updateTicket();documentList.reload()" [(ngModel)]="ticket"><br> <input id="ticket" type="text" size="48" (change)="updateTicket()" [(ngModel)]="ticket"><br>
<label for="host"><b>Insert the ip of your Alfresco instance:</b></label><br> <label for="host"><b>Insert the ip of your Alfresco instance:</b></label><br>
<input id="host" type="text" size="48" (change)="updateHost();documentList.reload()" [(ngModel)]="ecmHost"><br><br> <input id="host" type="text" size="48" (change)="updateHost()" [(ngModel)]="ecmHost"><br><br>
<div *ngIf="!authenticated" style="color:#FF2323"> <div *ngIf="!authenticated" style="color:#FF2323">
Authentication failed to ip {{ ecmHost }} with user: admin, admin, you can still try to add a valid ticket to perform Authentication failed to ip {{ ecmHost }} with user: admin, admin, you can still try to add a valid ticket to perform
operations. operations.