Beispiel #1
0
        public Dictionary <string, DocumentPropertyMetaData> GetDocumentPropertyMetaData()
        {
            Dictionary <string, DocumentPropertyMetaData> propertyMetaData = null;
            IItemEnumerable <IQueryResult> qr = CMISQuery.SelectDocumentsByKey("");

            foreach (IQueryResult hit in qr)
            {
                if (propertyMetaData == null)
                {
                    propertyMetaData = this.GetDocumentPropertyMetaData(hit);
                }
                else
                {
                    break;
                }
            }
            return(propertyMetaData);
        }
Beispiel #2
0
        /// <summary>
        /// the key links a document to a cm instance
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public DocumentList GetDocumentsByKey(string key)
        {
            List <DocumentInfo>         documents       = new List <DocumentInfo>();
            Dictionary <string, string> propertiesByKey = new Dictionary <string, string>();
            Dictionary <string, DocumentPropertyMetaData> propertyMetaData = null;
            IItemEnumerable <IQueryResult> qr = CMISQuery.SelectDocumentsByKey(key);

            foreach (IQueryResult hit in qr)
            {
                DocumentInfo doc = new DocumentInfo(hit["d.cmis:objectId"].FirstValue.ToString(), hit["d.cmis:name"].FirstValue.ToString());
                doc.Properties = this.GetProperties(hit);
                documents.Add(doc);
                if (propertyMetaData == null)
                {
                    propertyMetaData = this.GetDocumentPropertyMetaData(hit);
                }
            }

            return(new DocumentList
            {
                Documents = documents,
                DocumentPropertyMetaData = propertyMetaData
            });
        }