Beispiel #1
0
        public void AddChildDocument(IsxDocument child)
        {
            m_doc.CompoundDocumentState = CompoundDocumentState.COMPOUND_DOCUMENT;
            m_doc.Save(RefreshMode.REFRESH);
            IDocument p8Child = Factory.Document.FetchInstance(m_doc.GetObjectStore(), child.ID, null);

            IComponentRelationship cr = Factory.ComponentRelationship.CreateInstance(m_doc.GetObjectStore(), null);
            cr.ChildComponent = p8Child;
            cr.ParentComponent = m_doc;
            cr.ComponentPreventDelete = ComponentPreventDeleteAction.PREVENT_CHILD_DELETE;
            cr.ComponentRelationshipType = ComponentRelationshipType.DYNAMIC_CR;
            cr.VersionBindType = VersionBindType.LATEST_MAJOR_VERSION;
            cr.CopyToReservation = false;

            cr.Save(RefreshMode.REFRESH);
        }
Beispiel #2
0
        public void AddDocument(IsxDocument doc)
        {
            IDocument p8doc = Factory.Document.FetchInstance(m_fld.GetObjectStore(), doc.ID, null);
            
            //m_fld.File(p8doc, FileNet.Api.Constants.AutoUniqueName.AUTO_UNIQUE, p8doc.Name, FileNet.Api.Constants.DefineSecurityParentage.DO_NOT_DEFINE_SECURITY_PARENTAGE);
            //m_fld.Save(FileNet.Api.Constants.RefreshMode.REFRESH);

            IDynamicReferentialContainmentRelationship rcr = Factory.DynamicReferentialContainmentRelationship.CreateInstance(m_fld.GetObjectStore(), null, AutoUniqueName.AUTO_UNIQUE,
                       DefineSecurityParentage.DO_NOT_DEFINE_SECURITY_PARENTAGE);

            rcr.Tail = m_fld;
            rcr.Head = p8doc;
            rcr.ContainmentName = Guid.NewGuid().ToString();
            rcr.Save(RefreshMode.REFRESH);
        }