Obtaining creation contexts

You need a creation context to define immutable properties of a resource that you create. You can use the creation context builder factory to generate multiple such creation contexts without having to implement those interfaces directly.

The creation context builder factory can do both of the following:

You can only combine creation contexts that have not already been combined by using the creation context builder.
Example 1 - Obtaining a simple creation context:

// obtain creation context builder
final CreationContextBuilderFactory builder = CreationContextBuilderFactory.getInstance();
 
// obtain creation context
final CreationContext creationContext = builder.newIdentifiableCreationContext(objectID);

Example 2 - Obtaining a combined creation context:

// obtain creation context builder
final CreationContextBuilderFactory builder = CreationContextBuilderFactory.getInstance();
 
// obtain combined creation context
final CreationContext creationContext = builder.combine(new CreationContext [] 
     {builder.newContentPageCreationContext(true), builder.newIdentifiableCreationContext(objectID)});

The following list describes creation contexts that you can create by using the creation context builder factory:
ContentPageCreationContext


DerivedContentPageCreationContext


IdentifiableCreationContext


PortletDefinitionCloningContext


PortletEntityCreationContext


Parent

Create resources

 


+

Search Tips   |   Advanced Search