use of com.enonic.xp.schema.content.ContentTypeName in project xp by enonic.
the class ContentDataSerializer method fromData.
public Content.Builder<?> fromData(final PropertySet contentAsSet) {
final ContentTypeName contentTypeName = ContentTypeName.from(contentAsSet.getString(ContentPropertyNames.TYPE));
final Content.Builder<?> builder = Content.create(contentTypeName);
builder.displayName(contentAsSet.getString(DISPLAY_NAME));
builder.valid(contentAsSet.getBoolean(VALID) != null ? contentAsSet.getBoolean(ContentPropertyNames.VALID) : false);
builder.data(contentAsSet.getSet(DATA).toTree());
extractUserInfo(contentAsSet, builder);
extractOwner(contentAsSet, builder);
extractLanguage(contentAsSet, builder);
extractExtradata(contentAsSet, builder);
extractPage(contentAsSet, builder);
extractAttachments(contentAsSet, builder);
extractPublishInfo(contentAsSet, builder);
extractProcessedReferences(contentAsSet, builder);
extractWorkflowInfo(contentAsSet, builder);
extractInherit(contentAsSet, builder);
extractOriginProject(contentAsSet, builder);
extractValidationErrors(contentAsSet, builder);
extractOriginalName(contentAsSet, builder);
extractOriginalParentPath(contentAsSet, builder);
extractArchivedTime(contentAsSet, builder);
extractArchivedBy(contentAsSet, builder);
return builder;
}
Aggregations