Search in sources :

Example 11 with ContentTypeName

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;
}
Also used : Content(com.enonic.xp.content.Content) ContentTypeName(com.enonic.xp.schema.content.ContentTypeName)

Aggregations

ContentTypeName (com.enonic.xp.schema.content.ContentTypeName)11 Content (com.enonic.xp.content.Content)4 MediaInfo (com.enonic.xp.media.MediaInfo)4 CreateAttachment (com.enonic.xp.attachment.CreateAttachment)3 Media (com.enonic.xp.content.Media)2 UpdateContentParams (com.enonic.xp.content.UpdateContentParams)2 ContentType (com.enonic.xp.schema.content.ContentType)2 Test (org.junit.jupiter.api.Test)2 BucketAggregation (com.enonic.xp.aggregation.BucketAggregation)1 PublicApi (com.enonic.xp.annotation.PublicApi)1 ApplicationRelativeResolver (com.enonic.xp.app.ApplicationRelativeResolver)1 Attachment (com.enonic.xp.attachment.Attachment)1 AttachmentValidationError (com.enonic.xp.content.AttachmentValidationError)1 ContentAccessException (com.enonic.xp.content.ContentAccessException)1 ContentDataValidationException (com.enonic.xp.content.ContentDataValidationException)1 ContentDependencies (com.enonic.xp.content.ContentDependencies)1 ContentDependenciesAggregation (com.enonic.xp.content.ContentDependenciesAggregation)1 ContentEditor (com.enonic.xp.content.ContentEditor)1 ContentId (com.enonic.xp.content.ContentId)1 ContentIndexPath (com.enonic.xp.content.ContentIndexPath)1