Exemplo n.º 1
0
        private void ConstructProperty(ObjectBuilderBase objectBuilder, Object @object, Member member, DataType dataType)
        {
            Property property = this.propertyRepository.WithObjectIdAndMemberId(@object.Id, member.Id);

            if (dataType.StorageDataType == StorageDataType.Integer)
            {
                objectBuilder.BuildIntegerProperty(member.Code, property.IntegerValue);
            }

            else if (dataType.StorageDataType == StorageDataType.Decimal)
            {
                objectBuilder.BuildDecimalProperty(member.Code, property.DecimalValue);
            }

            if (dataType.StorageDataType == StorageDataType.String)
            {
                if (member.IsPropertyLocalizable == true)
                {
                    objectBuilder.BuildStringProperty(member.Code, this.GetLocalizationValuesByCultureCodes(property));
                }

                else
                {
                    objectBuilder.BuildStringProperty(member.Code, this.GetLocalizationValue(property));
                }
            }

            if (dataType.StorageDataType == StorageDataType.DateTime)
            {
                objectBuilder.BuildDateTimeProperty(member.Code, property.DateTimeValue);
            }
        }
Exemplo n.º 2
0
        public void ConstructObject(ObjectBuilderBase objectBuilder, SerializedObject serializedObject)
        {
            foreach (SerializedProperty serializedProperty in JsonConvert.DeserializeObject <IEnumerable <SerializedProperty> >(serializedObject.SerializedProperties))
            {
                if (serializedProperty.Member.PropertyDataTypeStorageDataType == StorageDataType.Integer)
                {
                    objectBuilder.BuildIntegerProperty(serializedProperty.Member.Code, serializedProperty.IntegerValue);
                }

                else if (serializedProperty.Member.PropertyDataTypeStorageDataType == StorageDataType.Decimal)
                {
                    objectBuilder.BuildDecimalProperty(serializedProperty.Member.Code, serializedProperty.DecimalValue);
                }

                if (serializedProperty.Member.PropertyDataTypeStorageDataType == StorageDataType.String)
                {
                    Member   member   = this.memberRepository.WithClassIdAndCode(serializedObject.ClassId, serializedProperty.Member.Code);
                    Property property = this.propertyRepository.WithObjectIdAndMemberId(serializedObject.ObjectId, member.Id);

                    objectBuilder.BuildStringProperty(serializedProperty.Member.Code, this.GetLocalizationValuesByCultureCodes(property));
                }

                if (serializedProperty.Member.PropertyDataTypeStorageDataType == StorageDataType.DateTime)
                {
                    objectBuilder.BuildDateTimeProperty(serializedProperty.Member.Code, serializedProperty.DateTimeValue);
                }
            }
        }
Exemplo n.º 3
0
        private void ConstructProperty(ObjectBuilderBase objectBuilder, Object @object, Member member)
        {
            Property property = this.propertyRepository.WithObjectIdAndMemberId(@object.Id, member.Id);
            IDictionary <Culture, Localization> localizationsByCultures = new Dictionary <Culture, Localization>();

            foreach (Culture culture in CultureManager.GetCultures(this.requestHandler.Storage))
            {
                localizationsByCultures.Add(culture, this.localizationRepository.WithDictionaryIdAndCultureId(property.HtmlId, culture.Id));
            }

            objectBuilder.BuildProperty(@object, member, property, localizationsByCultures);
        }
Exemplo n.º 4
0
        public void ConstructObject(ObjectBuilderBase objectBuilder, Object @object)
        {
            objectBuilder.BuildBasics(@object);

            Class @class = this.classRepository.WithKey(@object.ClassId);

            foreach (Member member in this.memberRepository.FilteredByClassIdInlcudingParent(@class.Id))
            {
                if (member.PropertyDataTypeId != null)
                {
                    this.ConstructProperty(objectBuilder, @object, member);
                }

                else if (member.RelationClassId != null)
                {
                    this.ConstructRelation(objectBuilder, @object, member);
                }
            }
        }
Exemplo n.º 5
0
 private void ConstructRelation(ObjectBuilderBase objectBuilder, Object @object, Member member)
 {
     // TODO: implement relations processing
 }