예제 #1
0
        private string getSelectClause(string docClass)
        {
            //Build a SELECT clause that includes all properties (fields) for the specified Document Class
            StringBuilder sb    = new StringBuilder("\"DAV:displayname\", \"DAV:href\"");
            MetaDatas     metas = GetMetaData(docClass);

            foreach (MetaData md in metas)
            {
                sb.Append(", \"" + XmlConvert.EncodeName(md.Property) + "\"");
            }
            return(sb.ToString());
        }
예제 #2
0
        public MetaDatas GetMetaData()
        {
            //Retrieve document class metadata
            MetaDatas metas = null;

            try {
                metas = new MetaDatas();
                System.Xml.XmlDataDocument xmlMeta = new System.Xml.XmlDataDocument();
                xmlMeta.DataSet.ReadXml(System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath + "\\App_Data\\metadata.xml");
                for (int i = 0; i < xmlMeta.DataSet.Tables["MetaDataTable"].Rows.Count; i++)
                {
                    MetaData md = new MetaData(xmlMeta.DataSet.Tables["MetaDataTable"].Rows[i]["ClassName"].ToString(), xmlMeta.DataSet.Tables["MetaDataTable"].Rows[i]["Property"].ToString());
                    metas.Add(md);
                }
            }
            catch (Exception ex) { throw new ApplicationException("Unexpected error in GetMetaData().", ex); }
            return(metas);
        }
예제 #3
0
        public MetaDatas GetMetaData(string className)
        {
            //Retrieve document class metadata for the specified className
            MetaDatas metas = null;

            try {
                metas = new MetaDatas();
                MetaDatas _metas = GetMetaData();
                foreach (MetaData md in _metas)
                {
                    if (md.ClassName == className)
                    {
                        metas.Add(md);
                    }
                }
            }
            catch (ApplicationException ex) { throw ex; }
            catch (Exception ex) { throw new ApplicationException("Unexpected error in GetMetaData(string).", ex); }
            return(metas);
        }