示例#1
0
 public override string perform(cmisTypeDefinitionType typeDefinition)
 {
     if (typeDefinition.creatable && typeDefinition.fileable && !typeDefinition.versionable)
     {
         return(typeDefinition.id);
     }
     return(null);
 }
 public virtual string perform(cmisTypeDefinitionType typeDefinition)
 {
     if (null != typeDefinition)
     {
         if (contains((typeDefinition as cmisTypeRelationshipDefinitionType).allowedSourceTypes, sourceTypeId) &&
             contains((typeDefinition as cmisTypeRelationshipDefinitionType).allowedTargetTypes, targetTypeId))
         {
             ids.Add(typeDefinition.id);
         }
     }
     return(null);
 }
        public void testGetTypeDefinition()
        {
            RepositoryServicePortClient client = repositoryServiceClient;

            cmisTypeDefinitionType[] types = assertGetTypeChildrenResponse(client, 10, 0);
            string typeId = types[new Random().Next(types.Length)].id;

            Assert.IsNotNull(typeId, "typeId is null");
            Assert.IsTrue(typeId.Length > 1, "typeId is empty");
            logger.log("Getting TypeDefinition for typeId=" + typeId);
            logger.log("[RepositoryService->getTypeDefinition]");

            cmisTypeDefinitionType response = client.getTypeDefinition(getAndAssertRepositoryId(), typeId, null);

            Assert.IsNotNull(response.id, "cmisTypeDefinitionType->typeId is null");
            Assert.IsNotNull(response.Items, "cmisTypeDefinitionType->Items is null");
            Assert.IsTrue(response.Items.Length > 1, "response->Items is empty");
            logger.log("TypeDefinition was successfully received, count of PropertyDefinitionTypes=" + response.Items.Length);
        }
 public override void initialize(string testName)
 {
     if (arePoliciesAllowed())
     {
         string typeId = getAndAssertPolicyControllableTypeId();
         if (null != typeId)
         {
             cmisExtensionType  extension  = new cmisExtensionType();
             cmisPropertiesType properties = FileableObject.addPropertyToObject(null, NAME_PROPERTY, FileableObject.generateObjectName(true, "Policy"));
             FileableObject.addPropertyToObject(properties, TYPE_ID_PROPERTY, getAndAssertPolicyTypeId());
             policyId = objectServiceClient.createPolicy(getAndAssertRepositoryId(), properties, getAndAssertRootFolder(), null, null, null, ref extension);
         }
         if (null != typeId)
         {
             cmisTypeDefinitionType typeDefinition = getAndAssertTypeDefinition(typeId);
             policyControllableObject = createAndAssertObject(typeDefinition is cmisTypeFolderDefinitionType, getAndAssertRootFolder(), typeId);
         }
         else
         {
             policyControllableObject = createAndAssertObject(getAndAssertRootFolder(), null);
         }
     }
 }
 public virtual string perform(cmisTypeDefinitionType typeDefinition)
 {
     if (null != typeDefinition)
     {
         if (contains((typeDefinition as cmisTypeRelationshipDefinitionType).allowedSourceTypes, sourceTypeId)
             && contains((typeDefinition as cmisTypeRelationshipDefinitionType).allowedTargetTypes, targetTypeId))
         {
             ids.Add(typeDefinition.id);
         }
     }
     return null;
 }
 public virtual string perform(cmisTypeDefinitionType typeDefinition)
 {
     return null;
 }
 public override string perform(cmisTypeDefinitionType typeDefinition)
 {
     if (typeDefinition.creatable)
     {
         int currentPower = 1;
         currentPower += (typeDefinition.fileable) ? (1) : (0);
         currentPower += (typeDefinition.controllablePolicy) ? (2) : (0);
         currentPower += (typeDefinition.controllableACL) ? (2) : (0);
         if (currentPower > previousPower)
         {
             previousPower = currentPower;
             return typeDefinition.id;
         }
         return null;
     }
     return null;
 }
 public override string perform(cmisTypeDefinitionType typeDefinition)
 {
     if (typeDefinition.creatable && typeDefinition.fileable && !allowedTypeIds.Contains(typeDefinition.id))
     {
         return typeDefinition.id;
     }
     return null;
 }
            public override string perform(cmisTypeDefinitionType typeDefinition)
            {
                cmisTypeRelationshipDefinitionType relationshipType = (cmisTypeRelationshipDefinitionType)typeDefinition;
                if (relationshipType.creatable)
                {
                    string sourceType = getDocumentOrFolderCreatebleType(relationshipType.allowedSourceTypes);
                    string targetType = getDocumentOrFolderCreatebleType(relationshipType.allowedTargetTypes);

                    if ((sourceType == null) && isValueNotSet(relationshipType.allowedSourceTypes))
                    {
                        sourceType = documentTypeId;
                    }

                    if ((targetType == null) && isValueNotSet(relationshipType.allowedTargetTypes))
                    {
                        targetType = documentTypeId;
                    }

                    if ((sourceType != null) && (targetType != null))
                    {
                        relationshipSourceTypeId = sourceType;
                        relationshipTargetTypeId = targetType;
                        return typeDefinition.id;
                    }
                }
                return null;
            }
示例#10
0
 public override string perform(cmisTypeDefinitionType typeDefinition)
 {
     cmisTypePolicyDefinitionType convertedType = (cmisTypePolicyDefinitionType)typeDefinition;
     return (typeDefinition.creatable) ? (typeDefinition.id) : (null);
 }
示例#11
0
 public override string perform(cmisTypeDefinitionType typeDefinition)
 {
     cmisTypeDocumentDefinitionType documentType = (cmisTypeDocumentDefinitionType)typeDefinition;
     int currentTypeIndex = getTypeIndex(documentType);
     if (currentTypeIndex > maxIndex)
     {
         maxIndex = currentTypeIndex;
         return documentType.id;
     }
     return null;
 }
示例#12
0
 private static string assertBaseTypeSearch(string baseTypeId, cmisTypeDefinitionType typeDef, Type expectedType, string baseObject)
 {
     if ((null != baseTypeId) && typeDef.GetType().Equals(expectedType))
     {
         Assert.Fail("Get Type Children response contains more than 1 Base " + baseObject + " Type Definition");
     }
     return (typeDef.GetType().Equals(expectedType)) ? (typeDef.id) : (baseTypeId);
 }
 public override string perform(cmisTypeDefinitionType typeDefinition)
 {
     if (typeDefinition.creatable && typeDefinition.fileable && !typeDefinition.versionable)
     {
         return typeDefinition.id;
     }
     return null;
 }