Esempio n. 1
0
 public IDocument CreateDocumentFromSource(IObjectId source, IDictionary<string, object> properties, VersioningState? versioningState)
 {
     return CreateDocumentFromSource(source, properties, versioningState, null, null, null, Session.DefaultContext);
 }
Esempio n. 2
0
        // operations

        public IDocument Copy(IObjectId targetFolderId, IDictionary<string, object> properties, VersioningState? versioningState,
                IList<IPolicy> policies, IList<IAce> addAces, IList<IAce> removeAces, IOperationContext context)
        {

            IObjectId newId = Session.CreateDocumentFromSource(this, properties, targetFolderId, versioningState, policies, addAces, removeAces);

            // if no context is provided the object will not be fetched
            if (context == null || newId == null)
            {
                return null;
            }
            // get the new object
            IDocument newDoc = Session.GetObject(newId, context) as IDocument;
            if (newDoc == null)
            {
                throw new CmisRuntimeException("Newly created object is not a document! New id: " + newId);
            }

            return newDoc;
        }
Esempio n. 3
0
        public override NCMIS.ObjectModel.CmisObject CreateDocument(string repositoryId, NCMIS.ObjectModel.CmisProperties properties, string folderId, NCMIS.ObjectModel.ContentStream contentStream, VersioningState versioningState, string[] policies, NCMIS.AccessControl.AccessControlList addACEs, NCMIS.AccessControl.AccessControlList removeACEs)
        {
            DocumentObjectService documentService = (DocumentObjectService)ObjectService.GetService(typeof(ContentBase));

            return(documentService.CreateDocument(repositoryId, properties, folderId, contentStream));
        }
Esempio n. 4
0
 public IDocument CreateDocument(IDictionary<string, object> properties, IContentStream contentStream, VersioningState? versioningState)
 {
     return CreateDocument(properties, contentStream, versioningState, null, null, null, Session.DefaultContext);
 }
Esempio n. 5
0
        public IObjectId CreateDocumentFromSource(IObjectId source, IDictionary<string, object> properties, IObjectId folderId,
            VersioningState? versioningState, IList<IPolicy> policies, IList<IAce> addAces, IList<IAce> removeAces)
        {
            if (source == null || source.Id == null)
            {
                throw new ArgumentException("Source must be set!");
            }

            // get the type of the source document
            IObjectType type = null;
            if (source is ICmisObject)
            {
                type = ((ICmisObject)source).ObjectType;
            }
            else
            {
                ICmisObject sourceObj = GetObject(source);
                type = sourceObj.ObjectType;
            }

            if (type.BaseTypeId != BaseTypeId.CmisDocument)
            {
                throw new ArgumentException("Source object must be a document!");
            }

            string newId = Binding.GetObjectService().CreateDocumentFromSource(RepositoryId, source.Id,
                ObjectFactory.ConvertProperties(properties, type,
                (versioningState == VersioningState.CheckedOut ? CreateAndCheckoutUpdatability : CreateUpdatability)),
                (folderId == null ? null : folderId.Id),
                versioningState, ObjectFactory.ConvertPolicies(policies), ObjectFactory.ConvertAces(addAces),
                ObjectFactory.ConvertAces(removeAces), null);

            return newId == null ? null : CreateObjectId(newId);
        }
Esempio n. 6
0
 public IObjectId CreateDocumentFromSource(IObjectId source, IDictionary<string, object> properties, IObjectId folderId,
         VersioningState? versioningState)
 {
     return CreateDocumentFromSource(source, properties, folderId, versioningState, null, null, null);
 }
Esempio n. 7
0
 public IObjectId CreateDocument(IDictionary<string, object> properties, IObjectId folderId, IContentStream contentStream,
     VersioningState? versioningState)
 {
     return CreateDocument(properties, folderId, contentStream, versioningState, null, null, null);
 }
Esempio n. 8
0
        // create

        public IObjectId CreateDocument(IDictionary<string, object> properties, IObjectId folderId, IContentStream contentStream,
            VersioningState? versioningState, IList<IPolicy> policies, IList<IAce> addAces, IList<IAce> removeAces)
        {
            if (properties == null || properties.Count == 0)
            {
                throw new ArgumentException("Properties must not be empty!");
            }

            string newId = Binding.GetObjectService().CreateDocument(RepositoryId, ObjectFactory.ConvertProperties(properties, null,
                (versioningState == VersioningState.CheckedOut ? CreateAndCheckoutUpdatability : CreateUpdatability)),
                (folderId == null ? null : folderId.Id), contentStream, versioningState, ObjectFactory.ConvertPolicies(policies),
                ObjectFactory.ConvertAces(addAces), ObjectFactory.ConvertAces(removeAces), null);

            return newId == null ? null : CreateObjectId(newId);
        }
Esempio n. 9
0
 public override string CreateDocumentFromSource(string repositoryId, string sourceId, NCMIS.ObjectModel.CmisProperties properties, string folderId, VersioningState? versioningState, string[] policies, NCMIS.AccessControl.AccessControlList addACEs, NCMIS.AccessControl.AccessControlList removeACEs)
 {
     DocumentObjectService documentService = (DocumentObjectService)ObjectService.GetService(typeof(ContentBase));
     return documentService.CopyDocument(repositoryId, sourceId, properties, folderId);
 }
Esempio n. 10
0
 public override NCMIS.ObjectModel.CmisObject CreateDocument(string repositoryId, NCMIS.ObjectModel.CmisProperties properties, string folderId, NCMIS.ObjectModel.ContentStream contentStream, VersioningState versioningState, string[] policies, NCMIS.AccessControl.AccessControlList addACEs, NCMIS.AccessControl.AccessControlList removeACEs)
 {
     DocumentObjectService documentService = (DocumentObjectService)ObjectService.GetService(typeof(ContentBase));
     return documentService.CreateDocument(repositoryId, properties, folderId, contentStream);
 }
Esempio n. 11
0
        public string CreateDocumentFromSource(string repositoryId, string sourceId, IProperties properties, string folderId,
            VersioningState? versioningState, IList<string> policies, IAcl addAces, IAcl removeAces, IExtensionsData extension)
        {
            ObjectServicePortClient port = Provider.GetObjectService();

            try
            {
                cmisExtensionType cmisExtension = Converter.ConvertExtension(extension);

                string objectId = port.createDocumentFromSource(repositoryId, sourceId, Converter.Convert(properties), folderId,
                    (enumVersioningState?)CmisValue.CmisToSerializerEnum(versioningState), Converter.ConvertList(policies),
                    Converter.Convert(addAces), Converter.Convert(removeAces), ref cmisExtension);

                Converter.ConvertExtension(cmisExtension, extension);

                return objectId;
            }
            catch (FaultException<cmisFaultType> fe)
            {
                throw ConvertException(fe);
            }
            catch (Exception e)
            {
                throw new CmisRuntimeException("Error: " + e.Message, e);
            }
        }