Esempio n. 1
0
 public Component(IComponent component)
 {
     this.dd4t = component;
     this.schema = new Schema(dd4t.Schema);
     this.fields = new FieldSet(dd4t.Fields);
     this.metadataFields = new FieldSet(dd4t.MetadataFields);
     this.multimedia = new MultimediaData(dd4t.Multimedia);
 }
Esempio n. 2
0
        private ExStoreRtnCodes readData <TE, TD, TF>(ISchemaData <TE, TD, TF> schemaData)
            where TE : Enum
            where TD : SchemaDataDictionaryBase <TE>
            where TF : SchemaDictionaryBase <TE>
        {
            foreach (KeyValuePair <TE, ISchemaFieldDef <TE> > kvp in schemaData.Fields)
            {
                TE     key       = kvp.Value.Key;
                string fieldName = kvp.Value.Name;

                Field f = exData.Schema.GetField(fieldName);
                if (f == null)
                {
                    return(ExStoreRtnCodes.XRC_FAIL);
                }

                Type t = f.ValueType;
                if (t == null)
                {
                    return(ExStoreRtnCodes.XRC_FAIL);
                }


                if (t?.Equals(typeof(string)) ?? false)
                {
                    schemaData.Add(key, exData.Entity.Get <string>(fieldName));
                }
                else if (t?.Equals(typeof(double)) ?? false)
                {
                    schemaData.Add(key, exData.Entity.Get <double>(fieldName));
                }
                else if (t?.Equals(typeof(bool)) ?? false)
                {
                    schemaData.Add(key, exData.Entity.Get <bool>(fieldName));
                }
                else
                {
                    schemaData.Add(key, exData.Entity.Get <string>(fieldName));
                }
            }

            return(ExStoreRtnCodes.XRC_GOOD);
        }
Esempio n. 3
0
 public Field(IField field)
 {
     this.field = field;
     this.embeddedSchema = field.EmbeddedSchema != null ? new Schema(field.EmbeddedSchema)
         : null;
     this.fieldType = field.FieldType.ToString();
     this.xpath = field.XPath;
     this.name = field.Name;
     this.keywords = field.Keywords != null ? field.Keywords.Select(x => new Keyword(x, field.CategoryName) as IKeywordData).ToList()
         : null;
 }
Esempio n. 4
0
 public ContentPresentationData(IFieldsData content, ISchemaData schema, ITemplateData template)
 {
     this.content = content;
     this.schema = schema;
     this.template = template;
     publicationId = template.PublicationId;
 }