alfresco-ng2-components/docs/document-library.model.md

2.7 KiB

Document Library model

Defines classes for use with the Content Services node API.

Details

ADF provides several services that give higher-level access to underlying Alfresco JS Api functionality. The classes defined below are used in some of these services to access the Content Services nodes API. You can use these services to access the nodes (ie, documents and folders) of a repository using their associated ID strings. See Nodes Api service for more detail about the usage of these classes.

Node information

These classes contain basic information about nodes (see Item information below for more detail about some of the properties). For example, this is used by the Document List component to supply a data context for each row of the list. The Nodes Api service has methods for getting the full information for a node ID string.

class NodeMinimalEntry implements MinimalNodeEntity {
    entry: NodeMinimal;
}

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 = {};
}

interface NodeProperties {
    [key: string]: any;
}

Paging

These classes are used to handle a list of nodes, such as the contents of a folder node. For example, the node property of the Document List component contains the node whose contents are currently shown in the document list.

class NodePaging {
    list: NodePagingList;
}

class NodePagingList {
    pagination: Pagination;
    entries: NodeMinimalEntry[];
}

class Pagination {
    count: number;
    hasMoreItems: boolean;
    totalItems: number;
    skipCount: number;
    maxItems: number;
}

Item information

These classes hold information about specific items related to a node.

class UserInfo {
    displayName: string;
    id: string;
}

class ContentInfo {
    mimeType: string;
    mimeTypeName: string;
    sizeInBytes: number;
    encoding: string;
}

class PathInfoEntity {
    elements: PathElementEntity[];
    isComplete: boolean;
    name: string;
}

class PathElementEntity {
    id: string;
    name: string;
}

See also