Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ContentInternal<T>

Internal class representation of a Content instance.

Type parameters

Hierarchy

  • ContentInternal

Index

Constructors

constructor

Properties

AllowedChildTypes

CheckedOutTo

CreatedBy

EffectiveAllowedChildTypes

EffectiveAllowedChildTypes: ContentListReferenceField<ContentType>

Optional Id

Id: undefined | number

ModifiedBy

Optional Name

Name: undefined | string

Owner

Optional ParentId

ParentId: undefined | number

Optional Path

Path: undefined | string

Versions

Workspace

Accessors

IsDirty

  • get IsDirty(): boolean

IsOperationInProgress

  • get IsOperationInProgress(): boolean

IsSaved

  • get IsSaved(): boolean

IsValid

  • get IsValid(): boolean

ParentContentPath

  • get ParentContentPath(): string
  • Returns the parent content's Path in an Entity format e.g. for the 'Child' content '/Root/Parent/Child' you will get '/Root/('Parent')'

    Returns string

ParentPath

  • get ParentPath(): string
  • Returns the parent content's Path in a Collection format e.g. for the 'Child' content '/Root/Parent/Child' you will get '/Root/Parent'

    throws

    if no Path is specified or the content is not saved yet.

    Returns string

SavedFields

  • get SavedFields(): T

Type

  • get Type(): string
  • set Type(newType: string): void

Methods

Actions

  • Actions(scenario?: undefined | string): Observable<ActionModel[]>
  • Method that returns actions of a content.

    Parameters

    • Optional scenario: undefined | string

    Returns Observable<ActionModel[]>

    Returns an RxJS observable that you can subscribe of in your code.

    content.GetActions('ListItem')
      .subscribe(response => {
           console.log(response);
       },
       error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value));
    

AddAllowedChildTypes

  • AddAllowedChildTypes(contentTypes: string[]): Observable<Object>
  • Adds the given content types to the Allowed content Type list.

    params

    contentTypes {string[]} A list of the case sensitive content type names.

    Parameters

    • contentTypes: string[]

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let setAllowedChildTypes = content.AddAllowedChildTypes(['Folder','ContentList']]);
    setAllowedChildTypes.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

AddMembers

  • AddMembers(contentIds: number[]): Observable<Object>
  • Administrators can add new members to a group using this action. The list of new members can be provided using the 'contentIds' parameter (list of user or group ids).

    params

    contentIds {number[]} List of the member ids.

    Parameters

    • contentIds: number[]

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let addMembers = content.AddMembers([ 123, 456, 789 ]);
    addMembers.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

Approve

  • Approve(): Observable<Object>
  • Performs an approve operation on a content, the equivalent of calling Approve() on the Content instance in .NET. Also checks whether the content handler of the subject content inherits GenericContent (otherwise it does not support this operation). This action has no parameters.

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let approveContent = content.Approve();
    approveContent.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

CheckIn

  • CheckIn(checkInComments?: undefined | string): Observable<Object>
  • Checkins a content item in the Content Repository.

    params

    checkInComments {string=}

    Parameters

    • Optional checkInComments: undefined | string

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let checkinContent = content.Checkin();
    checkinContent.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

CheckPreviews

  • CheckPreviews(generateMissing?: undefined | true | false): Observable<Object>
  • Returns the number of currently existing preview images. If necessary, it can make sure that all preview images are generated and available for a document. @ params generateMissing {boolean=}

    Parameters

    • Optional generateMissing: undefined | true | false

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let checkPreviews = content.CheckPreviews(true);
    checkPreviews.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

CheckedOutBy

  • Method that returns the user who checked-out the content.

    Parameters

    • Optional options: IODataParams<User>

      Object with the possible ODATA parameters like select, expand, etc.

    Returns Observable<SavedContent<User>>

    Returns an RxJS observable that you can subscribe of in your code.

    content.CheckedOutBy({select: ['FullName']})
         .subscribe(
             response => {
                 console.log(response);
             },
             error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value));
    

Checkout

  • Checkout(): Observable<Object>
  • Checkouts a content item in the Content Repository.

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let checkoutContent = content.Checkout();
    checkoutContent.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

Children

  • Method that returns the children of a content.

    Calls the method [FetchContent]{@link ODataApi.FetchContent} with the content id and the given OData options. If you leave the options undefined only the Id and the Type fields will be in the response. These two fields are always the part of the reponse whether they're added or not to the options as selectable.

    Parameters

    • Optional options: IODataParams<Content>

      Object with the possible ODATA parameters like select, expand, etc.

    Returns Observable<SavedContent[]>

    Returns an RxJS observable that you can subscribe of in your code.

    let children = content.Children({select: ['DisplayName']});
    children.subscribe({
     next: response => {
         console.log(response);
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

CopyTo

  • CopyTo(path: string): Observable<Object>
  • Copies one content to another container by a given path.

    params

    Path {string}

    Parameters

    • path: string

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let copyContent = content.CopyTo('/Root/Sites/Default_Site/NewsDemo/Internal');
    copyContent.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

CreateQuery

Creator

  • Method that returns creator of a content.

    Parameters

    • Optional options: IODataParams<User>

      JSON object with the possible ODATA parameters like select, expand, etc.

    Returns Observable<SavedContent<User>>

    Returns an RxJS observable that you can subscribe of in your code.

    content.Creator({select: ['FullName']})
         .subscribe(
             response => {
                 console.log(response);
             },
             error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value));
    

Delete

  • Delete(permanently?: undefined | true | false): Observable<void>
  • Deletes a content item from the Content Repository (by default the Content is moved to the Trash).

    Parameters

    • Optional permanently: undefined | true | false

      Determines if the Content should be deleted permanently or moved to the Trash.

    Returns Observable<void>

    Returns an RxJS observable that you can subscribe of in your code.

    content.Delete(false)
         subscribe( response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error));
    

Finalize

  • Finalize(): Observable<Object>
  • Closes a Multistep saving operation and sets the saving state of a content to Finalized. Can be invoked only on content that are not already finalized.

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let finalize = content.FinalizeContent(true);
    finalize.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

ForceUndoCheckout

  • ForceUndoCheckout(): Observable<Object>
  • Performs a force undo check out operation on a content item in the Content Repository.

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let forceUndoCheckoutContent = content.ForceUndoCheckout();
    forceUndoCheckoutContent.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

GetActions

  • GetActions(scenario?: undefined | string): Observable<ActionModel[]>

GetAllowedChildTypes

  • Method that returns allowed child type list of a content.

    Parameters

    • Optional options: IODataParams<ContentType>

      JSON object with the possible ODATA parameters like select, expand, etc.

    Returns Observable<SavedContent<ContentType>[]>

    Returns an RxJS observable with the content types of the allowed child types

    content.GetAllowedChildTypes()
      .subscribe({
          response => {
            console.log(response);
          },
          error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value));
    

GetAllowedChildTypesFromCTD

  • GetAllowedChildTypesFromCTD(): Observable<Object>
  • Returns the list of the AllowedChildTypes which are set on the current Content.

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let getAllowedChildTypesFromCTD = content.GetAllowedChildTypesFromCTD();
    getAllowedChildTypesFromCTD.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

GetAllowedUsers

  • GetAllowedUsers(permissions: string[]): Observable<Object>
  • Returns a content collection that represents users who have enough permissions to a requested resource. The permissions effect on the user and through direct or indirect group membership too. The function parameter is a permission name list that must contain at least one item.

    params

    permissions {string[]} related permission list. Item names are case sensitive. In most cases only one item is used (e.g. "See" or "Save" etc.) but you can pass any permission type name (e.g. ["Open","Save","Custom02"]).

    Parameters

    • permissions: string[]

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let getAllowedUsers = content.GetAllowedUsers(["Open", "RunApplication"]);
    getAllowedUsers.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

GetChanges

  • GetChanges(): T

GetEffectiveAllowedChildTypes

  • Method that returns effective allowed child type list of a content.

    Parameters

    Returns Observable<(ContentType & ISavedContent)[]>

    Returns an RxJS observable that you can subscribe of in your code.

    content.GetEffectiveAllowedChildTypes()
      .subscribe({
          response => {
            console.log(response);
          },
          error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value));
    

GetExistingPreviewImagesForOData

  • GetExistingPreviewImagesForOData(): Observable<Object>
  • Returns the list of existing preview images (only the first consecutive batch) as objects with a few information (image path, dimensions). It does not generate any new images.

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let getExistingPreviewImagesForOData = content.GetExistingPreviewImagesForOData();
    getExistingPreviewImagesForOData.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

GetFields

  • GetFields(skipEmpties?: undefined | true | false): T
  • Returns all Fields based on the Schema, that can be used for API calls (e.g. POSTing a new content)

    Parameters

    • Optional skipEmpties: undefined | true | false

    Returns T

GetFullPath

  • GetFullPath(): string
  • Returns the full Path for the current content

    throws

    if the Content is not saved yet, or hasn't got an Id or Path defined

    Returns string

GetOwner

  • Method that returns owner of a content.

    Parameters

    • Optional options: IODataParams<User>

      Object with the possible ODATA parameters like select, expand, etc.

    Returns Observable<SavedContent<User>>

    an observable that will be updated with the Owner user.

    content.GetOwner({select: ['FullName']})
         .subscribe(
             response => {
                 console.log(response);
             },
             error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value));
    

GetPageCount

  • GetPageCount(): Observable<Object>
  • Returns the number of pages in a document. If there is no information about page count on the content, it starts a preview generation task to determine the page count.

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let getPageCount = content.GetPageCount();
    getPageCount.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

GetParentGroups

  • GetParentGroups(directOnly: boolean): Observable<Object>
  • Returns a content collection that represents groups where the given user or group is member directly or indirectly. This function can be used only on a resource content that is Group or User or any inherited type. If the value of the "directOnly" parameter is false, all indirect members are listed.

    params

    directOnly {boolean} If the value of the "directOnly" parameter is false, all indirect members are listed.

    Parameters

    • directOnly: boolean

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let getParentGroups = content.GetParentGroups(["Open", "RunApplication"]);
    getParentGroups.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

GetPermission

  • GetPermission(identity?: undefined | string): Observable<Object>
  • Gets permissions for the requested content. If no identity is given, all the permission entries will be returned.

    Required permissions to call this action: See permissions.

    params

    identity {string=} path of the identity whose permissions must be returned (user, group or organizational unit)

    Parameters

    • Optional identity: undefined | string

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let getPermissions = content.GetPermission('/Root/Sites/Default_Site/workspaces/Project/budapestprojectworkspace/Groups/Members');
    getPermissions.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

GetPreviewImagesForOData

  • GetPreviewImagesForOData(): Observable<Object>
  • Returns the full list of preview images as content items. This method synchronously generates all missing preview images.

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let getPreviewImagesForOData = content.GetPreviewImagesForOData();
    getPreviewImagesForOData.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

GetQueries

  • GetQueries(onlyPublic?: boolean): Observable<Object>
  • Gets Query content that are relevant in the current context. The result set will contain two types of content:

    • Public queries: query content in the Queries content list of the current workspace.
    • Private queries: query content in the Queries content list under the profile of the current user
    params

    onlyPublic {boolean} if true, only public queries are returned from the current workspace.

    Parameters

    • Default value onlyPublic: boolean = true

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let getQueries = content.GetQueries(true);
    getQueries.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

GetRelatedIdentities

  • Identity list that contains every users/groups/organizational units that have any permission setting (according to permission level) in the subtree of the context content.

    params

    level {Security.PermissionLevel} The value is "AllowedOrDenied". "Allowed" or "Denied" are not implemented yet.

    params

    kind {Security.IdentityKind} The value can be: All, Users, Groups, OrganizationalUnits, UsersAndGroups, UsersAndOrganizationalUnits, GroupsAndOrganizationalUnits

    Parameters

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let getRelatedIdentities = content.GetRelatedIdentities("AllowedOrDenied", "Groups");
    getRelatedIdentities.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

GetRelatedIdentitiesByPermissions

  • This structure is designed for getting tree of content that are permitted or denied for groups/organizational units in the selected subtree. The result content are not in a paged list: they are organized in a tree.

    params

    level {Security.PermissionLevel} The value is "AllowedOrDenied". "Allowed" or "Denied" are not implemented yet.

    params

    kind {Security.IdentityKind} The value can be: All, Users, Groups, OrganizationalUnits, UsersAndGroups, UsersAndOrganizationalUnits, GroupsAndOrganizationalUnits

    params

    permissions {string[]} related permission list. Item names are case sensitive. In most cases only one item is used (e.g. "See" or "Save" etc.) but you can pass any permission type name (e.g. ["Open","Save","Custom02"]).

    Parameters

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let getRelatedIdentitiesByPermissions = content.GetRelatedIdentitiesByPermissions("AllowedOrDenied", "Groups", ["RunApplication"]);
    getRelatedIdentitiesByPermissions.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

GetRelatedItems

  • GetRelatedItems(level: PermissionLevel, explicitOnly: boolean, member: string, permissions: string[]): Observable<Object>
  • Content list that have explicite/effective permission setting for the selected user in the current subtree.

    params

    level {Security.PermissionLevel} The value is "AllowedOrDenied". "Allowed" or "Denied" are not implemented yet.

    params

    explicitOnly {boolean} The value "true" is required because "false" is not implemented yet.

    params

    member {string} Fully qualified path of the selected identity (e.g. /Root/IMS/BuiltIn/Portal/Visitor).

    params

    permissions {string[]} related permission list. Item names are case sensitive. In most cases only one item is used (e.g. "See" or "Save" etc.) but you can pass any permission type name (e.g. ["Open","Save","Custom02"]).

    Parameters

    • level: PermissionLevel
    • explicitOnly: boolean
    • member: string
    • permissions: string[]

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let getRelatedItems = content.GetRelatedItems("AllowedOrDenied", true, "/Root/IMS/BuiltIn/Portal/EveryOne", ["RunApplication"]);
    getRelatedItems.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

GetRelatedItemsOneLevel

  • GetRelatedItemsOneLevel(level: PermissionLevel, member: string, permissions: string[]): Observable<Object>
  • This structure is designed for getting tree of content that are permitted or denied for groups/organizational units in the selected subtree. The result content are not in a paged list: they are organized in a tree.

    params

    level {Security.PermissionLevel} The value is "AllowedOrDenied". "Allowed" or "Denied" are not implemented yet.

    params

    member {string} Fully qualified path of the selected identity (e.g. /Root/IMS/BuiltIn/Portal/Visitor).

    params

    permissions {string[]} related permission list. Item names are case sensitive. In most cases only one item is used (e.g. "See" or "Save" etc.) but you can pass any permission type name (e.g. ["Open","Save","Custom02"]).

    Parameters

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let getRelatedItemsOneLevel = content.GetRelatedItemsOneLevel("AllowedOrDenied", "/Root/IMS/BuiltIn/Portal/Visitor", ["Open", "RunApplication"]);
    getRelatedItemsOneLevel.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

GetRelatedPermissions

  • GetRelatedPermissions(level: PermissionLevel, explicitOnly: boolean, member: string, includedTypes?: string[]): Observable<Object>
  • Permission list of the selected identity with the count of related content. 0 indicates that this permission has no related content so the GUI does not have to display it as a tree node

    params

    level {Security.PermissionLevel} The value is "AllowedOrDenied". "Allowed" or "Denied" are not implemented yet.

    params

    explicitOnly {boolean} The value "true" is required because "false" is not implemented yet.

    params

    member {string} Fully qualified path of the selected identity (e.g. /Root/IMS/BuiltIn/Portal/Visitor).

    params

    includedTypes {string[]} An item can increment the counters if its type or any ancestor type is found in the 'includedTypes'. Null means filtering off. If the array is empty, there is no element that increases the counters. This filter can reduce the execution speed dramatically so do not use if it is possible.

    Parameters

    • level: PermissionLevel
    • explicitOnly: boolean
    • member: string
    • Optional includedTypes: string[]

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let getRelatedPermissions = content.GetRelatedPermissions("AllowedOrDenied", true, "/Root/IMS/BuiltIn/Portal/EveryOne", null);
    getRelatedPermissions.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

GetRepository

GetSchema

GetVersions

  • Returns the list of versions.

    Calls the method [GetContent]{@link ODataApi.GetContent} with the content id and the given OData options. If you leave the options undefined only the Id and the Type fields will be in the response. These two fields are always the part of the reponse whether they're added or not to the options as selectable.

    Parameters

    • Optional options: IODataParams<T>

      JSON object with the possible ODATA parameters like select, expand, etc.

    Returns Observable<SavedContent<T>[]>

    Returns an RxJS observable that you can subscribe of in your code.

    let versions = content.GetVersions();
    versions.subscribe({
     next: response => {
         console.log(response);
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

GetWorkspace

  • Returns the current Workspace.

    Calls the method [GetContent]{@link ODataApi.GetContent} with the content id and the given OData options. If you leave the options undefined only the Id and the Type fields will be in the response. These two fields are always the part of the reponse whether they're added or not to the options as selectable.

    Parameters

    • Optional options: IODataParams<Workspace>

      Object with the possible ODATA parameters like select, expand, etc.

    Returns Observable<SavedContent<Workspace>>

    Returns an RxJS observable that you can subscribe of in your code.

    let currentWorkspace = content.GetWorkspace();
    currentWorkspace.subscribe({
     next: response => {
         console.log(response);
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

HasPermission

  • HasPermission(permissions: ("Approve" | "Publish" | "SetPermissions" | "See" | "Preview" | "PreviewWithoutWatermark" | "PreviewWithoutRedaction" | "Open" | "OpenMinor" | "Save" | "ForceCheckin" | "AddNew" | "Delete" | "RecallOldVersion" | "DeleteOldVersion" | "SeePermissions" | "RunApplication" | "ManageListsAndWorkspaces" | "TakeOwnership" | "Custom01" | "Custom02" | "Custom03" | "Custom04" | "Custom05" | "Custom06" | "Custom07" | "Custom08" | "Custom09" | "Custom10" | "Custom11" | "Custom12" | "Custom13" | "Custom14" | "Custom15" | "Custom16" | "Custom17" | "Custom18" | "Custom19" | "Custom20" | "Custom21" | "Custom22" | "Custom23" | "Custom24" | "Custom25" | "Custom26" | "Custom27" | "Custom28" | "Custom29" | "Custom30" | "Custom31" | "Custom32")[], identity?: User | Group): Observable<boolean>
  • Gets if the given user (or if it is not given than the current user) has the specified permissions for the requested content.

    Required permissions to call this action: See permissions.

    params

    permissions {string[]} list of permission names (e.g. Open, Save)

    params

    user {string} [CurrentUser] path of the user

    Parameters

    • permissions: ("Approve" | "Publish" | "SetPermissions" | "See" | "Preview" | "PreviewWithoutWatermark" | "PreviewWithoutRedaction" | "Open" | "OpenMinor" | "Save" | "ForceCheckin" | "AddNew" | "Delete" | "RecallOldVersion" | "DeleteOldVersion" | "SeePermissions" | "RunApplication" | "ManageListsAndWorkspaces" | "TakeOwnership" | "Custom01" | "Custom02" | "Custom03" | "Custom04" | "Custom05" | "Custom06" | "Custom07" | "Custom08" | "Custom09" | "Custom10" | "Custom11" | "Custom12" | "Custom13" | "Custom14" | "Custom15" | "Custom16" | "Custom17" | "Custom18" | "Custom19" | "Custom20" | "Custom21" | "Custom22" | "Custom23" | "Custom24" | "Custom25" | "Custom26" | "Custom27" | "Custom28" | "Custom29" | "Custom30" | "Custom31" | "Custom32")[]
    • Optional identity: User | Group

    Returns Observable<boolean>

    Returns an RxJS observable that you can subscribe of in your code.

    let hasPermission = content.HasPermission(['AddNew', 'Save']);
    hasPermission.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

IsAncestorOf

IsChildOf

IsDescendantOf

IsParentOf

Modifier

  • Method that returns last modifier of a content.

    Parameters

    • Optional options: IODataParams<User>

      Object with the possible ODATA parameters like select, expand, etc.

    Returns Observable<SavedContent<User>>

    Returns an RxJS observable that you can subscribe of in your code.

    content.Modifier({select: ['FullName']})
         .subscribe(
             response => {
                 console.log(response);
             },
             error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value));
    

MoveTo

  • MoveTo(toPath: string): Observable<Object>
  • Copies one content to another container by a given path.

    params

    Path {string}

    Parameters

    • toPath: string

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let moveContent = content.MoveTo('/Root/Sites/Default_Site/NewsDemo/Internal');
    moveContent.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

PreviewAvailable

  • PreviewAvailable(page: number): Observable<Object>
  • Gets information about a preview image generated for a specific page in a document. It returns with the path and the dimensions (width/height) of the image. If the image does not exist yet, it returns with an empty object but it starts a background task to generate that image if a valid page count number was determined'’’. If page count is -1 you need to call GetPageCount action first. It is OK to call this method periodically for checking if an image is already available.

    params

    page {number}

    Parameters

    • page: number

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let previewAvailable = content.PreviewAvailable(2);
    previewAvailable.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

Publish

  • Publish(): Observable<Object>
  • Performs a publish operation on a content, the equivalent of calling Publish() on the Content instance in .NET. Also checks whether the content handler of the subject content inherits GenericContent (otherwise it does not support this operation). This action has no parameters.

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let publishContent = content.Publish();
    publishContent.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

RebuildIndex

  • RebuildIndex(recursive?: undefined | true | false, rebuildLevel?: undefined | number): Observable<Object>
  • These actions perform an indexing operation on a single content or a whole subtree.

    params

    recursive {boolean=}

    params

    rebuildLevel {number=}

    Parameters

    • Optional recursive: undefined | true | false
    • Optional rebuildLevel: undefined | number

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let rebuildIndex = content.RebuildIndex(true);
    rebuildIndex.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

RebuildIndexSubtree

  • RebuildIndexSubtree(): Observable<Object>
  • Performs a full reindex operation on the content and the whole subtree.

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let rebuildIndexSubtree = content.RebuildIndexSubtree();
    rebuildIndexSubtree.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

RefreshIndexSubtree

  • RefreshIndexSubtree(): Observable<Object>
  • Refreshes the index document of the content and the whole subtree using the already existing index data stored in the database.

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let refreshIndexSubtree = content.RefreshIndexSubtree();
    refreshIndexSubtree.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

RegeneratePreviews

  • RegeneratePreviews(): Observable<Object>
  • It clears all existing preview images for a document and starts a task for generating new ones. This can be useful in case the preview status of a document has been set to 'error' before for some reason and you need to force the system to re-generate preview images.

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let regeneratePreviews = content.RegeneratePreviews();
    regeneratePreviews.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

Reject

  • Reject(rejectReason?: undefined | string): Observable<Object>
  • Performs a reject operation on a content, the equivalent of calling Reject() on the Content instance in .NET. Also checks whether the content handler of the subject content inherits GenericContent (otherwise it does not support this operation). The reject reason can be supplied in an optional parameter called rejectReason.

    params

    rejectReason {string}

    Parameters

    • Optional rejectReason: undefined | string

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let rejectContent = content.Reject();
    rejectContent.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

Reload

  • Reload(actionName?: "edit" | "view"): Observable<SavedContent<T>>
  • Reloads every field and reference of the content, based on the specified View from the Schema

    throws

    if the Content is not saved yet or no Id or Path is provided

    Parameters

    • Optional actionName: "edit" | "view"

    Returns Observable<SavedContent<T>>

    An observable whitch will be updated with the reloaded Content

ReloadFields

  • ReloadFields(...fields: keyof T[]): Observable<SavedContent<T>>
  • Reloads the specified fields and references of the content

    throws

    if the Content is not saved yet or no Id or Path is provided

    Parameters

    • Rest ...fields: keyof T[]

      List of the fields to be loaded

    Returns Observable<SavedContent<T>>

    An observable whitch will be updated with the Content

RemoveAllowedChildTypes

  • RemoveAllowedChildTypes(contentTypes: string[]): Observable<Object>
  • Removes the given content types from the Allowed content Type list. If the list after removing and the list on the matching CTD are the same, the local list will be removed.

    params

    contentTypes {string[]} A list of the case sensitive content type names.

    Parameters

    • contentTypes: string[]

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let removeAllowedChildTypes = content.RemoveAllowedChildTypes(['Folder','ContentList']]);
    removeAllowedChildTypes.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

RemoveMembers

  • RemoveMembers(contentIds: number[]): Observable<Object>
  • Administrators can remove members from a group using this action. The list of removable members can be provided using the 'contentIds' parameter (list of user or group ids).

    params

    contentIds {number[]} List of the member ids.

    Parameters

    • contentIds: number[]

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let removeMembers = content.RemoveMembers([ 123, 456, 789 ]);
    removeMembers.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

Rename

  • Rename(newDisplayName: string, newName?: undefined | string): Observable<SavedContent<T>>
  • Modifies the DisplayName or the DisplayName and the Name of a content item in the Content Repository.

    Parameters

    • newDisplayName: string
    • Optional newName: undefined | string

      New name of the content.

    Returns Observable<SavedContent<T>>

    Returns an RxJS observable that you can subscribe of in your code.

    content.Rename('New Title')
           .subscribe(response => {
               console.log(response);
           }, error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value));
    

Restore

  • Restore(destination?: undefined | string, newname?: undefined | true | false): Observable<Object>
  • Restores a deleted content from the Trash. You can call this action only on a TrashBag content that contains the deleted content itself.

    params

    destination {string=} Path of the target container, where the deleted content will be restored. If it is not provided, the system uses the original path stored on the trash bag content.

    params

    newname {boolean=} whether to generate a new name automatically if a content with the same name already exists in the desired container (e.g. mydocument(1).docx).

    Parameters

    • Optional destination: undefined | string
    • Optional newname: undefined | true | false

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let restoreContent = content.Restore();
    restoreContent.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

RestoreVersion

  • RestoreVersion(version: string): Observable<Object>
  • Restores an old version of the content. Also checks whether the content handler of the subject content inherits GenericContent (otherwise it does not support this operation). This action has a single parameter called version where the caller can specify which old version to restore.

    params

    version {string} Old version to restore.

    Parameters

    • version: string

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let restoreVersion = content.RestoreVersion();
    restoreVersion.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

Save

  • Save(fields?: T, override?: undefined | true | false): Observable<SavedContent<T>>
  • Saves the content with its given modified fields to the Content Repository.

    Parameters

    • Optional fields: T

      Optional - The fields to be saved. If not provided, the changed fields will be saved

    • Optional override: undefined | true | false

      Determines whether clear the fields that are not given (true) or leave them and modify only the given fields (false).

    Returns Observable<SavedContent<T>>

    Returns an RxJS observable that you can subscribe of in your code.

     //Set Index field's value to 2 and clear the rest of the fields.
    content.Save({'Index':2}, true)
           .subscribe(response => {
               console.log(response);
           },
           error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value));
    
    // Update the Description field only
    content.Description = 'New description text';
    content.Save() //Set Index field's value to 2 and clear the rest of the fields.
           .subscribe(response => {
               console.log(response);
           },
           error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value));
    

SaveQuery

  • SaveQuery(query: string, displayName: string, queryType: QueryType): Observable<Object>
  • Creates or modifies a {Query} content. Use this action instead of creating query content directly using the basic OData create method, because query content can be saved under a workspace or to the user's profile as a private query.

    params

    query {string} Query text, composed in Query Builder or written manually (see Query syntax for more details).

    params

    displayName {string} Desired display name for the query content. Can be empty.

    params

    queryType {ComplexTypes.SavedQueryType} [Public] Type of the saved query. If an empty value is posted, the default is Public.

    Parameters

    • query: string
    • displayName: string
    • queryType: QueryType

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let saveQuery = content.SaveQuery({
       'query':'DisplayName:Africa',
       'displayName': 'My query',
       'queryType': 'Private'
    });
    saveQuery.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

SetPermissions

  • Sets permissions on the requested content. You can add or remove permissions for one ore more users or groups using this action or even break/unbreak permission inheritance.

    Parameters

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let setPermissions = content.SetPermissions({inheritance:"break"});
    setPermissions.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

Stringify

  • Stringify(): string

TakeLockOver

  • TakeLockOver(userId?: undefined | number): Observable<Object>
  • Lets administrators take over the lock of a checked out document from another user. A new locker user can be provided using the 'user' parameter (user path or id as string). If left empty, the current user will take the lock.

    params

    userId {number=}

    Parameters

    • Optional userId: undefined | number

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let takeLockOver = content.TakeLockOver(true);
    takeLockOver.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

TakeOwnership

  • TakeOwnership(userOrGroup?: undefined | string): Observable<Object>
  • Users who have TakeOwnership permission for the current content can modify the Owner of this content.

    params

    userOrGroup {string} path or the id of the new owner (that can be a Group or a User). The input parameter also supports empty or null string, in this case the new owner will be the current user.

    Parameters

    • Optional userOrGroup: undefined | string

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let takeOwnerShip = content.TakeOwnership({'userGroup':'/Root/IMS/BuiltIn/Portal/Admin'});
    takeOwnerShip.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

UndoCheckout

  • UndoCheckout(): Observable<Object>
  • Performs an undo check out operation on a content item in the Content Repository.

    Returns Observable<Object>

    Returns an RxJS observable that you can subscribe of in your code.

    let undoCheckoutContent = content.UndoCheckout();
    undoCheckoutContent.subscribe({
     next: response => {
         console.log('success');
     },
     error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
     complete: () => console.log('done'),
    });
    

UploadFile

UploadFromDropEvent

UploadText

Protected updateLastSavedFields

  • updateLastSavedFields(newFields: T): void

Static Create

  • Creates a Content object by the given type and options Object that hold the field values.

    Type parameters

    Parameters

    • options: T

      Object for initial fields and values

    • newContent: object

      The Content Type definition

    • repository: BaseRepository

      the Repository instance

    Returns Content<T>

    var content = SenseNet.Content.Create({ DisplayName: 'My folder' }, ContentTypes.Folder); // content is an instance of the ContentTypes.Folder with the DisplayName 'My folder'
    

Generated using TypeDoc