Example #1
0
        private cmisTypeDefinitionType ToTypeDefinition(Kooboo.CMS.Content.Models.Schema schema, bool includePropertyDefinitions)
        {
            cmisTypeDefinitionType typeDefinition = new cmisTypeDocumentDefinitionType();

            //typeDefinition.baseId = BaseObjectTypeId.CmisDocument;
            typeDefinition.controllableACL    = false;
            typeDefinition.controllablePolicy = false;
            typeDefinition.creatable          = true;
            typeDefinition.description        = null;
            typeDefinition.displayName        = schema.Name;
            typeDefinition.fileable           = true;
            typeDefinition.fulltextIndexed    = false;
            typeDefinition.id = schema.Name;
            typeDefinition.includedInSupertypeQuery = false;
            typeDefinition.localName      = schema.Repository.Name;
            typeDefinition.localNamespace = null;
            typeDefinition.parentId       = null;
            typeDefinition.queryable      = true;
            typeDefinition.queryName      = schema.Name;
            //typeDefinition.ContentStreamAllowed = ContentStreamAllowed.Allowed;
            if (includePropertyDefinitions)
            {
                typeDefinition.Items = DefaultDefinitionTypes(schema).Concat(schema.AllColumns.Select(it => ToPropertyDefinition(schema, it)).Where(it => it != null)).ToArray();
            }

            return(typeDefinition);
        }
 private static int getTypeIndex(cmisTypeDocumentDefinitionType documentType)
 {
     int result = 0;
     if (documentType.creatable)
     {
         result += 1000000;
     }
     if (documentType.fileable)
     {
         result += 100000;
     }
     if (documentType.versionable)
     {
         result += 10000;
     }
     bool contentStreamAllowed = enumContentStreamAllowed.allowed.Equals(documentType.contentStreamAllowed) || enumContentStreamAllowed.required.Equals(documentType.contentStreamAllowed);
     if (contentStreamAllowed)
     {
         result += 1000;
     }
     if (documentType.queryable)
     {
         result += 100;
     }
     if (documentType.controllableACL)
     {
         result += 10;
     }
     if (documentType.controllablePolicy)
     {
         result += 10;
     }
     return result;
 }