Beispiel #1
0
 public getAllVersionsResponse(cmisObjectType[] objects)
 {
     this.objects = objects;
 }
Beispiel #2
0
 public static cmisObjectType TocmisObjectType(TextContent textContent, IEnumerable<Category> categories)
 {
     cmisObjectType cmisObject = new cmisObjectType();
     cmisObject.properties = ToCmisPropertiesType(textContent, categories);
     return cmisObject;
 }
Beispiel #3
0
 public getAppliedPoliciesResponse(cmisObjectType[] objects)
 {
     this.objects = objects;
 }
Beispiel #4
0
 public getObjectOfLatestVersionResponse(cmisObjectType @object)
 {
     this.@object = @object;
 }
Beispiel #5
0
 public getObjectByPathResponse(cmisObjectType @object)
 {
     this.@object = @object;
 }
Beispiel #6
0
 public getFolderParentResponse(cmisObjectType @object)
 {
     this.@object = @object;
 }
Beispiel #7
0
        private static cmisObjectType ToCmisObject(Kooboo.CMS.Content.Models.TextFolder textFolder)
        {
            var hasSchema = !string.IsNullOrEmpty(textFolder.SchemaName);
            var cmisObject = new cmisObjectType();
            cmisObject.allowableActions = new cmisAllowableActionsType()
            {
                canAddObjectToFolder = hasSchema,
                canApplyACL = false,
                canApplyPolicy = false,
                canCancelCheckOut = false,
                canCheckIn = false,
                canCheckOut = false,
                canCreateDocument = hasSchema,
                canCreateFolder = true,
                canCreateRelationship = hasSchema,
                canDeleteContentStream = true,
                canDeleteObject = hasSchema,
                canDeleteTree = false,
                canGetACL = false,
                canGetAllVersions = false,
                canGetAppliedPolicies = false,
                canGetChildren = true,
                canGetContentStream = false,
                canGetDescendants = false,
                canGetFolderParent = true,
                canGetFolderTree = true,
                canGetObjectParents = false,
                canGetObjectRelationships = false,
                canGetProperties = false,
                canGetRenditions = false,
                canMoveObject = false,
                canRemoveObjectFromFolder = false,
                canRemovePolicy = false,
                canSetContentStream = false,
                canUpdateProperties = false
            };
            cmisObject.changeEventInfo = null;
            cmisObject.exactACL = false;
            cmisObject.policyIds = null;
            cmisObject.rendition = null;

            cmisObject.properties = new cmisPropertiesType();
            var properties = new List<cmisProperty>();
            properties.Add(new cmisPropertyId()
            {
                displayName = "Id",
                localName = "Id",
                propertyDefinitionId = CmisPropertyDefinitionId.ObjectId,
                queryName = "Id",
                value = new string[] { textFolder.FriendlyName }
            });
            properties.Add(new cmisPropertyString()
            {
                displayName = "Name",
                localName = "Name",
                propertyDefinitionId = CmisPropertyDefinitionId.Name,
                queryName = "Name",
                value = new string[] { textFolder.FriendlyName }
            });
            properties.Add(new cmisPropertyString()
            {
                displayName = "DisplayName",
                localName = "DisplayName",
                queryName = "DisplayName",
                value = new string[] { textFolder.DisplayName }
            });
            properties.Add(new cmisPropertyDateTime()
            {
                displayName = "UtcCreationDate",
                localName = "UtcCreationDate",
                propertyDefinitionId = CmisPropertyDefinitionId.CreationDate,
                queryName = "UtcCreationDate",
                value = new DateTime[] { textFolder.UtcCreationDate }
            });
            properties.Add(new cmisPropertyString()
            {
                displayName = "UserId",
                localName = "UserId",
                propertyDefinitionId = CmisPropertyDefinitionId.CreatedBy,
                queryName = "UserId",
                value = new string[] { textFolder.UserId }
            });
            properties.Add(new cmisPropertyBoolean()
            {
                displayName = "EnablePaging",
                localName = "EnablePaging",
                queryName = "EnablePaging",
                value = new bool[] { textFolder.EnablePaging == null ? true : textFolder.EnablePaging.Value }
            });
            properties.Add(new cmisPropertyBoolean()
            {
                displayName = "Sortable",
                localName = "Sortable",
                queryName = "Sortable",
                value = new bool[] { textFolder.Sortable == null ? true : textFolder.Sortable.Value }
            });
            properties.Add(new cmisPropertyString()
            {
                displayName = "SchemaName",
                localName = "SchemaName",
                queryName = "SchemaName",
                value = new string[] { textFolder.SchemaName }
            });
            properties.Add(new cmisPropertyBoolean()
            {
                displayName = "Hidden",
                localName = "Hidden",
                queryName = "Hidden",
                value = new bool[] { textFolder.Hidden == null ? false : textFolder.Hidden.Value }
            });
            properties.Add(new cmisPropertyInteger()
            {
                displayName = "PageSize",
                localName = "PageSize",
                queryName = "PageSize",
                value = new string[] { textFolder.PageSize.ToString() }
            });
            cmisObject.properties.Items = properties.ToArray();
            return cmisObject;
        }
Beispiel #8
0
 public getFolderParentResponse GetFolderParent(getFolderParentRequest request)
 {
     var textFolder = ModelHelper.GetTextFolder(request.repositoryId, request.folderId);
     if (textFolder.Parent != null)
     {
         return new getFolderParentResponse(ToCmisObject(((Kooboo.CMS.Content.Models.TextFolder)textFolder.Parent).AsActual()));
     }
     else
     {
         var cmisObject = new cmisObjectType();
         cmisObject.properties = new cmisPropertiesType();
         cmisObject.properties.Items = new cmisProperty[]{
             new cmisPropertyId()
             {
                 displayName = "Id",
                 localName = "Id",
                 propertyDefinitionId = CmisPropertyDefinitionId.ObjectId,
                 queryName = "Id",
                 value = new string[] { "/" }
             }
         };
         return new getFolderParentResponse(cmisObject);
     }
 }
Beispiel #9
0
 public static cmisObjectType TocmisObjectType(TextContent textContent)
 {
     cmisObjectType cmisObject = new cmisObjectType();
     cmisObject.properties = ToCmisPropertiesType(textContent);
     return cmisObject;
 }