mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
@@ -0,0 +1,56 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export class ContentActionModel {
|
||||
icon: string;
|
||||
title: string;
|
||||
handler: ContentActionHandler;
|
||||
execute: Function;
|
||||
target: string;
|
||||
permission: string;
|
||||
disableWithNoPermission: boolean = false;
|
||||
disabled: boolean = false;
|
||||
|
||||
constructor(obj?: any) {
|
||||
if (obj) {
|
||||
this.icon = obj.icon;
|
||||
this.title = obj.title;
|
||||
this.handler = obj.handler;
|
||||
this.execute = obj.execute;
|
||||
this.target = obj.target;
|
||||
this.permission = obj.permission;
|
||||
this.disableWithNoPermission = obj.disableWithNoPermission;
|
||||
this.disabled = obj.disabled;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export type ContentActionHandler = (obj: any, target?: any, permission?: string) => any;
|
||||
|
||||
export class DocumentActionModel extends ContentActionModel {
|
||||
constructor(json?: any) {
|
||||
super(json);
|
||||
this.target = 'document';
|
||||
}
|
||||
}
|
||||
|
||||
export class FolderActionModel extends ContentActionModel {
|
||||
constructor(json?: any) {
|
||||
super(json);
|
||||
this.target = 'folder';
|
||||
}
|
||||
}
|
@@ -0,0 +1,84 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// note: contains only limited subset of available fields
|
||||
|
||||
import { MinimalNodeEntity, MinimalNodeEntryEntity } from 'alfresco-js-api';
|
||||
|
||||
export class NodePaging {
|
||||
list: NodePagingList;
|
||||
}
|
||||
|
||||
export class NodePagingList {
|
||||
pagination: Pagination;
|
||||
entries: NodeMinimalEntry[];
|
||||
}
|
||||
|
||||
export class NodeMinimalEntry implements MinimalNodeEntity {
|
||||
entry: NodeMinimal;
|
||||
}
|
||||
|
||||
export class Pagination {
|
||||
count: number;
|
||||
hasMoreItems: boolean;
|
||||
totalItems: number;
|
||||
skipCount: number;
|
||||
maxItems: number;
|
||||
}
|
||||
|
||||
export class NodeMinimal implements MinimalNodeEntryEntity {
|
||||
id: string;
|
||||
parentId: string;
|
||||
name: string;
|
||||
nodeType: string;
|
||||
isFolder: boolean;
|
||||
isFile: boolean;
|
||||
modifiedAt: Date;
|
||||
modifiedByUser: UserInfo;
|
||||
createdAt: Date;
|
||||
createdByUser: UserInfo;
|
||||
content: ContentInfo;
|
||||
path: PathInfoEntity;
|
||||
properties: NodeProperties = {};
|
||||
}
|
||||
|
||||
export class UserInfo {
|
||||
displayName: string;
|
||||
id: string;
|
||||
}
|
||||
|
||||
export class ContentInfo {
|
||||
mimeType: string;
|
||||
mimeTypeName: string;
|
||||
sizeInBytes: number;
|
||||
encoding: string;
|
||||
}
|
||||
|
||||
export class PathInfoEntity {
|
||||
elements: PathElementEntity[];
|
||||
isComplete: boolean;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export class PathElementEntity {
|
||||
id: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface NodeProperties {
|
||||
[key: string]: any;
|
||||
}
|
@@ -0,0 +1,32 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { PermissionsEnum } from '@alfresco/core';
|
||||
|
||||
export class PermissionStyleModel {
|
||||
css: string;
|
||||
permission: PermissionsEnum;
|
||||
isFolder: boolean = true;
|
||||
isFile: boolean = true;
|
||||
|
||||
constructor(css: string, permission: PermissionsEnum, isFile: boolean = true, isFolder: boolean = true) {
|
||||
this.css = css;
|
||||
this.permission = permission;
|
||||
this.isFile = isFile;
|
||||
this.isFolder = isFolder;
|
||||
}
|
||||
}
|
@@ -0,0 +1,30 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export class PermissionModel {
|
||||
type: string;
|
||||
action: string;
|
||||
permission: string;
|
||||
|
||||
constructor(obj?: any) {
|
||||
if (obj) {
|
||||
this.type = obj.type || null;
|
||||
this.action = obj.action || null;
|
||||
this.permission = obj.permission || null;
|
||||
}
|
||||
}
|
||||
}
|
261
lib/content-services/document-list/models/preset.model.ts
Normal file
261
lib/content-services/document-list/models/preset.model.ts
Normal file
@@ -0,0 +1,261 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export let presetsDefaultModel = {
|
||||
'-trashcan-': [
|
||||
{
|
||||
key: '$thumbnail',
|
||||
type: 'image',
|
||||
srTitle: 'ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL',
|
||||
sortable: false
|
||||
},
|
||||
{
|
||||
key: 'name',
|
||||
type: 'text',
|
||||
title: 'ADF-DOCUMENT-LIST.LAYOUT.NAME',
|
||||
cssClass: 'full-width ellipsis-cell',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
key: 'path',
|
||||
type: 'location',
|
||||
title: 'ADF-DOCUMENT-LIST.LAYOUT.LOCATION',
|
||||
format: this.locationFormat,
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
key: 'content.sizeInBytes',
|
||||
type: 'fileSize',
|
||||
title: 'ADF-DOCUMENT-LIST.LAYOUT.SIZE',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
key: 'archivedAt',
|
||||
type: 'date',
|
||||
title: 'ADF-DOCUMENT-LIST.LAYOUT.DELETED_ON',
|
||||
format: 'timeAgo',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
key: 'archivedByUser.displayName',
|
||||
type: 'text',
|
||||
title: 'ADF-DOCUMENT-LIST.LAYOUT.DELETED_BY',
|
||||
sortable: true
|
||||
}
|
||||
],
|
||||
'-sites-': [
|
||||
{
|
||||
key: '$thumbnail',
|
||||
type: 'image',
|
||||
srTitle: 'ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL',
|
||||
sortable: false
|
||||
},
|
||||
{
|
||||
key: 'title',
|
||||
type: 'text',
|
||||
title: 'ADF-DOCUMENT-LIST.LAYOUT.NAME',
|
||||
cssClass: 'full-width ellipsis-cell',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
key: 'visibility',
|
||||
type: 'text',
|
||||
title: 'ADF-DOCUMENT-LIST.LAYOUT.STATUS',
|
||||
sortable: true
|
||||
}
|
||||
],
|
||||
'-mysites-': [
|
||||
{
|
||||
key: '$thumbnail',
|
||||
type: 'image',
|
||||
srTitle: 'ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL',
|
||||
sortable: false
|
||||
},
|
||||
{
|
||||
key: 'title',
|
||||
type: 'text',
|
||||
title: 'ADF-DOCUMENT-LIST.LAYOUT.NAME',
|
||||
cssClass: 'full-width ellipsis-cell',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
key: 'visibility',
|
||||
type: 'text',
|
||||
title: 'ADF-DOCUMENT-LIST.LAYOUT.STATUS',
|
||||
sortable: true
|
||||
}
|
||||
],
|
||||
'-favorites-': [
|
||||
{
|
||||
key: '$thumbnail',
|
||||
type: 'image',
|
||||
srTitle: 'ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL',
|
||||
sortable: false
|
||||
},
|
||||
{
|
||||
key: 'name',
|
||||
type: 'text',
|
||||
title: 'ADF-DOCUMENT-LIST.LAYOUT.NAME',
|
||||
cssClass: 'full-width ellipsis-cell',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
key: 'path',
|
||||
type: 'location',
|
||||
title: 'ADF-DOCUMENT-LIST.LAYOUT.LOCATION',
|
||||
format: this.locationFormat,
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
key: 'content.sizeInBytes',
|
||||
type: 'fileSize',
|
||||
title: 'ADF-DOCUMENT-LIST.LAYOUT.SIZE',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
key: 'modifiedAt',
|
||||
type: 'date',
|
||||
title: 'ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_ON',
|
||||
format: 'timeAgo',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
key: 'modifiedByUser.displayName',
|
||||
type: 'text',
|
||||
title: 'ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_BY',
|
||||
sortable: true
|
||||
}
|
||||
],
|
||||
'-recent-': [
|
||||
{
|
||||
key: '$thumbnail',
|
||||
type: 'image',
|
||||
srTitle: 'ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL',
|
||||
sortable: false
|
||||
},
|
||||
{
|
||||
key: 'name',
|
||||
type: 'text',
|
||||
title: 'ADF-DOCUMENT-LIST.LAYOUT.NAME',
|
||||
cssClass: 'full-width ellipsis-cell',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
key: 'path',
|
||||
type: 'location',
|
||||
title: 'ADF-DOCUMENT-LIST.LAYOUT.LOCATION',
|
||||
cssClass: 'ellipsis-cell',
|
||||
format: this.locationFormat,
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
key: 'content.sizeInBytes',
|
||||
type: 'fileSize',
|
||||
title: 'ADF-DOCUMENT-LIST.LAYOUT.SIZE',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
key: 'modifiedAt',
|
||||
type: 'date',
|
||||
title: 'ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_ON',
|
||||
format: 'timeAgo',
|
||||
sortable: true
|
||||
}
|
||||
],
|
||||
'-sharedlinks-': [
|
||||
{
|
||||
key: '$thumbnail',
|
||||
type: 'image',
|
||||
srTitle: 'ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL',
|
||||
sortable: false
|
||||
},
|
||||
{
|
||||
key: 'name',
|
||||
type: 'text',
|
||||
title: 'ADF-DOCUMENT-LIST.LAYOUT.NAME',
|
||||
cssClass: 'full-width ellipsis-cell',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
key: 'path',
|
||||
type: 'location',
|
||||
title: 'ADF-DOCUMENT-LIST.LAYOUT.LOCATION',
|
||||
cssClass: 'ellipsis-cell',
|
||||
format: this.locationFormat,
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
key: 'content.sizeInBytes',
|
||||
type: 'fileSize',
|
||||
title: 'ADF-DOCUMENT-LIST.LAYOUT.SIZE',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
key: 'modifiedAt',
|
||||
type: 'date',
|
||||
title: 'ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_ON',
|
||||
format: 'timeAgo',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
key: 'modifiedByUser.displayName',
|
||||
type: 'text',
|
||||
title: 'ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_BY',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
key: 'sharedByUser.displayName',
|
||||
type: 'text',
|
||||
title: 'ADF-DOCUMENT-LIST.LAYOUT.SHARED_BY',
|
||||
sortable: true
|
||||
}
|
||||
],
|
||||
'default': [
|
||||
{
|
||||
key: '$thumbnail',
|
||||
type: 'image',
|
||||
srTitle: 'ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL',
|
||||
sortable: false
|
||||
},
|
||||
{
|
||||
key: 'name',
|
||||
type: 'text',
|
||||
title: 'ADF-DOCUMENT-LIST.LAYOUT.NAME',
|
||||
cssClass: 'full-width ellipsis-cell',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
key: 'content.sizeInBytes',
|
||||
type: 'fileSize',
|
||||
title: 'ADF-DOCUMENT-LIST.LAYOUT.SIZE',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
key: 'modifiedAt',
|
||||
type: 'date',
|
||||
title: 'ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_ON',
|
||||
format: 'timeAgo',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
key: 'modifiedByUser.displayName',
|
||||
type: 'text',
|
||||
title: 'ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_BY',
|
||||
sortable: true
|
||||
}
|
||||
]
|
||||
};
|
Reference in New Issue
Block a user