com.flexive.shared.structure
Class FxTypeEdit

java.lang.Object
  extended by com.flexive.shared.AbstractSelectableObjectWithLabel
      extended by com.flexive.shared.structure.FxType
          extended by com.flexive.shared.structure.FxTypeEdit
All Implemented Interfaces:
ObjectWithLabel, SelectableObject, SelectableObjectWithLabel, java.io.Serializable

public class FxTypeEdit
extends FxType
implements java.io.Serializable

FxType used for structure editing

Author:
Markus Plesser (markus.plesser@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
See Also:
Serialized Form

Field Summary
protected  boolean changed
           
 
Fields inherited from class com.flexive.shared.structure.FxType
ACL, assignedGroups, assignedProperties, category, CONTACTDATA, derivedTypes, description, FOLDER, historyAge, icon, id, language, lifeCycleInfo, maxRelDestination, maxRelSource, maxVersions, mode, name, parent, permissions, relations, ROOT_ID, scriptedAssignments, scriptMapping, state, storageMode, trackHistory, uniqueProperties, workflow
 
Constructor Summary
FxTypeEdit(FxType type)
          Create a new FxTypeEdit instance for editing and updating an existing FxType
 
Method Summary
 FxTypeEdit addRelation(FxTypeRelation relation)
          Add or update a relation
static FxTypeEdit createNew(java.lang.String name)
          Create a new FxTypeEdit instance for creating a new FxType
static FxTypeEdit createNew(java.lang.String name, FxString description, ACL acl)
          Create a new FxTypeEdit instance for creating a new FxType
static FxTypeEdit createNew(java.lang.String name, FxString description, ACL acl, FxType parent)
          Create a new FxTypeEdit instance for creating a new FxType
static FxTypeEdit createNew(java.lang.String name, FxString description, ACL acl, Workflow workflow, FxType parent, boolean enableParentAssignments, TypeStorageMode storageMode, TypeCategory category, TypeMode mode, LanguageMode language, TypeState state, byte permissions, boolean trackHistory, long historyAge, long maxVersions, int maxRelSource, int maxRelDestination)
          Create a new FxTypeEdit instance for creating a new FxType
static FxTypeEdit createNew(java.lang.String name, FxType parentType)
          Create a new FxTypeEdit instance for creating a new FxType
static FxTypeEdit createNew(java.lang.String name, long parentTypeId)
          Create a new FxTypeEdit instance for creating a new FxType
 java.util.List<FxTypeRelation> getAddedRelations()
          Get a list of all FxTypeRelations that have been added
 java.util.List<FxGroupAssignment> getAssignedGroups()
          Get all group assignments that are attached to the type's root
 java.util.List<FxPropertyAssignment> getAssignedProperties()
          Get all property assignments that are attached to the type's root
 java.util.List<FxTypeRelation> getRemovedRelations()
          Get a list of all FxTypeRelations that have been removed
 java.util.List<FxTypeRelation> getUpdatedRelations()
          Get a list of all FxTypeRelations that have been updated
 boolean isChanged()
          Have changes been made?
 boolean isEnableParentAssignments()
          Enable parent assignments if creating a derived type? This method has no effect if editing an existing type!
 boolean isNew()
          Is this a new type or updating an existing type?
 boolean isRemoveInstancesWithRelationTypes()
          If FxTypeRelation entries are removed, remove all affected instances?
 void removeRelation(FxTypeRelation relation)
          Remove a relation
 FxTypeEdit setACL(ACL ACL)
          Assign a new ACL
 FxTypeEdit setCategory(TypeCategory category)
          Set the types category (user, system)
 FxTypeEdit setDescription(FxString description)
          Set the types description
 FxTypeEdit setEnableParentAssignments(boolean enableParentAssignments)
          Enable parent assignments if creating a derived type? This method has no effect if editing an existing type!
 FxTypeEdit setHistoryAge(long historyAge)
          Set the max.
 FxTypeEdit setIcon(FxReference icon)
          Set the preview icon of this type
 FxTypeEdit setLanguage(LanguageMode language)
          Set the language mode to use for this type
 void setLifeCycleInfo(LifeCycleInfo lifeCycleInfo)
          Set the LifeCycleInfo - this can only be assigned when there is no LifeCycleInfo available (which is when it is null)
 FxTypeEdit setMaxRelDestination(int maxRelDestination)
          Set the max.
 FxTypeEdit setMaxRelSource(int maxRelSource)
          Set the max.
 FxTypeEdit setMaxVersions(long maxVersions)
          Set the max.
 FxTypeEdit setMode(TypeMode mode)
          Set this type's mode.
 FxTypeEdit setName(java.lang.String name)
          Set the name of this type
 FxTypeEdit setPermissions(byte permissions)
          Set the bit coded permissions of this type
 void setRemoveInstancesWithRelationTypes(boolean removeInstancesWithRelationTypes)
          Set if affected instances should be removed if FxTypeRelations are removed
 FxTypeEdit setState(TypeState state)
          Set the state of this type
 FxTypeEdit setTrackHistory(boolean trackHistory)
          Track history for this type
 FxTypeEdit setUseInstancePermissions(boolean use)
          Set usage of instance permissions
 FxTypeEdit setUsePropertyPermissions(boolean use)
          Set usage of property permissions
 FxTypeEdit setUseStepPermissions(boolean use)
          Set usage of step permissions
 FxTypeEdit setUseTypePermissions(boolean use)
          Set usage of type permissions
 FxTypeEdit setWorkflow(Workflow workflow)
          Set the workflow to use
 void updateRelation(FxTypeRelation relation)
          Add or update a relation
 
Methods inherited from class com.flexive.shared.structure.FxType
asEditable, buildXPathPrefix, createEmptyData, createRandomData, getACL, getAssignment, getAssignmentsForDataType, getAssignmentsForProperty, getBitCodedPermissions, getCategory, getConnectedAssignments, getDerivedTypes, getDescription, getDisplayName, getGroupAssignment, getHistoryAge, getIcon, getId, getLabel, getLanguage, getLifeCycleInfo, getMaxRelDestination, getMaxRelSource, getMaxVersions, getMode, getName, getParent, getPropertyAssignment, getRelations, getScriptedAssignments, getScriptEvents, getScriptMapping, getState, getStorageMode, getUniqueProperties, getWorkflow, hasScriptedAssignments, hasScriptMapping, hasUniqueProperties, isDerived, isRelation, isTrackHistory, isXPathValid, reloadWorkflow, resolveReferences, toString, useInstancePermissions, usePermissions, usePropertyPermissions, useStepPermissions, useTypePermissions
 
Methods inherited from class com.flexive.shared.AbstractSelectableObjectWithLabel
equals, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

changed

protected boolean changed
Constructor Detail

FxTypeEdit

public FxTypeEdit(FxType type)
Create a new FxTypeEdit instance for editing and updating an existing FxType

Parameters:
type - the FxType to edit
Method Detail

createNew

public static FxTypeEdit createNew(java.lang.String name)
Create a new FxTypeEdit instance for creating a new FxType

Parameters:
name - name of the type
Returns:
FxTypeEdit instance for creating a new FxType

createNew

public static FxTypeEdit createNew(java.lang.String name,
                                   FxType parentType)
Create a new FxTypeEdit instance for creating a new FxType

Parameters:
name - name of the type
parentType - the parent type ID
Returns:
FxTypeEdit instance for creating a new FxType
Since:
3.0.3

createNew

public static FxTypeEdit createNew(java.lang.String name,
                                   long parentTypeId)
Create a new FxTypeEdit instance for creating a new FxType

Parameters:
name - name of the type
parentTypeId - the parent type ID
Returns:
FxTypeEdit instance for creating a new FxType
Since:
3.0.3

createNew

public static FxTypeEdit createNew(java.lang.String name,
                                   FxString description,
                                   ACL acl)
Create a new FxTypeEdit instance for creating a new FxType

Parameters:
name - name of the type
description - description
acl - type ACL
Returns:
FxTypeEdit instance for creating a new FxType

createNew

public static FxTypeEdit createNew(java.lang.String name,
                                   FxString description,
                                   ACL acl,
                                   FxType parent)
Create a new FxTypeEdit instance for creating a new FxType

Parameters:
name - name of the type
description - description
acl - type ACL
parent - parent type or null if not derived
Returns:
FxTypeEdit instance for creating a new FxType

createNew

public static FxTypeEdit createNew(java.lang.String name,
                                   FxString description,
                                   ACL acl,
                                   Workflow workflow,
                                   FxType parent,
                                   boolean enableParentAssignments,
                                   TypeStorageMode storageMode,
                                   TypeCategory category,
                                   TypeMode mode,
                                   LanguageMode language,
                                   TypeState state,
                                   byte permissions,
                                   boolean trackHistory,
                                   long historyAge,
                                   long maxVersions,
                                   int maxRelSource,
                                   int maxRelDestination)
Create a new FxTypeEdit instance for creating a new FxType

Parameters:
name - name of the type
description - description
acl - type ACL
workflow - workflow to use
parent - parent type or null if not derived
enableParentAssignments - if parent is not null enable all derived assignments from the parent?
storageMode - the storage mode
category - category mode (system, user)
mode - type mode (content, relation)
language - language mode
state - type state (active, locked, etc)
permissions - permissions bit coded
trackHistory - track history
historyAge - max. age of the history to track
maxVersions - max. number of versions to keep, if < 0 unlimited
maxRelSource - max. number of instance related as source
maxRelDestination - max. number of instance related as destination
Returns:
FxTypeEdit instance for creating a new FxType

setLifeCycleInfo

public void setLifeCycleInfo(LifeCycleInfo lifeCycleInfo)
Set the LifeCycleInfo - this can only be assigned when there is no LifeCycleInfo available (which is when it is null)

Parameters:
lifeCycleInfo - the lifeCycleInfo to assign if the current is null

isNew

public boolean isNew()
Is this a new type or updating an existing type?

Returns:
new or existing type?

isRemoveInstancesWithRelationTypes

public boolean isRemoveInstancesWithRelationTypes()
If FxTypeRelation entries are removed, remove all affected instances?

Returns:
remove all affected instances if FxTypeRelation entries are removed?

setRemoveInstancesWithRelationTypes

public void setRemoveInstancesWithRelationTypes(boolean removeInstancesWithRelationTypes)
Set if affected instances should be removed if FxTypeRelations are removed

Parameters:
removeInstancesWithRelationTypes - if affected instances should be removed if FxTypeRelations are removed

isEnableParentAssignments

public boolean isEnableParentAssignments()
Enable parent assignments if creating a derived type? This method has no effect if editing an existing type!

Returns:
are parent assignments enabled?

setEnableParentAssignments

public FxTypeEdit setEnableParentAssignments(boolean enableParentAssignments)
Enable parent assignments if creating a derived type? This method has no effect if editing an existing type!

Parameters:
enableParentAssignments - are parent assignments enabled?
Returns:
the type itself, useful for chained calls

setACL

public FxTypeEdit setACL(ACL ACL)
Assign a new ACL

Parameters:
ACL - ACL to assign for this type
Returns:
the type itself, useful for chained calls

setWorkflow

public FxTypeEdit setWorkflow(Workflow workflow)
Set the workflow to use

Parameters:
workflow - the workflow to use
Returns:
the type itself, useful for chained calls

setName

public FxTypeEdit setName(java.lang.String name)
Set the name of this type

Parameters:
name - the name of this type
Returns:
the type itself, useful for chained calls

setDescription

public FxTypeEdit setDescription(FxString description)
Set the types description

Parameters:
description - description
Returns:
the type itself, useful for chained calls

setCategory

public FxTypeEdit setCategory(TypeCategory category)
Set the types category (user, system)

Parameters:
category - the category to set
Returns:
the type itself, useful for chained calls

setMode

public FxTypeEdit setMode(TypeMode mode)
Set this type's mode. Setting does not check anything, if the requested mode is really available and possible is determined during saving

Parameters:
mode - requested mode
Returns:
this

setLanguage

public FxTypeEdit setLanguage(LanguageMode language)
Set the language mode to use for this type

Parameters:
language - language mode to use
Returns:
the type itself, useful for chained calls

setState

public FxTypeEdit setState(TypeState state)
Set the state of this type

Parameters:
state - the state of this type
Returns:
the type itself, useful for chained calls

setIcon

public FxTypeEdit setIcon(FxReference icon)
Set the preview icon of this type

Parameters:
icon - the (optional) preview icon of this type
Returns:
the type itself, useful for chained calls

setPermissions

public FxTypeEdit setPermissions(byte permissions)
Set the bit coded permissions of this type

Parameters:
permissions - bit coded permissions
Returns:
the type itself, useful for chained calls

setUseInstancePermissions

public FxTypeEdit setUseInstancePermissions(boolean use)
Set usage of instance permissions

Parameters:
use - use instance permissions?
Returns:
the type itself, useful for chained calls

setUsePropertyPermissions

public FxTypeEdit setUsePropertyPermissions(boolean use)
Set usage of property permissions

Parameters:
use - use property permissions?
Returns:
the type itself, useful for chained calls

setUseStepPermissions

public FxTypeEdit setUseStepPermissions(boolean use)
Set usage of step permissions

Parameters:
use - use step permissions?
Returns:
the type itself, useful for chained calls

setUseTypePermissions

public FxTypeEdit setUseTypePermissions(boolean use)
Set usage of type permissions

Parameters:
use - use type permissions?
Returns:
the type itself, useful for chained calls

setTrackHistory

public FxTypeEdit setTrackHistory(boolean trackHistory)
Track history for this type

Parameters:
trackHistory - track history?
Returns:
the type itself, useful for chained calls

setHistoryAge

public FxTypeEdit setHistoryAge(long historyAge)
Set the max. age of history entries

Parameters:
historyAge - max. age of history entries
Returns:
the type itself, useful for chained calls

setMaxVersions

public FxTypeEdit setMaxVersions(long maxVersions)
Set the max. number of versions to keep, if negative unlimited

Parameters:
maxVersions - max. number of versions to keep, if negative unlimited
Returns:
the type itself, useful for chained calls

setMaxRelSource

public FxTypeEdit setMaxRelSource(int maxRelSource)
Set the max. number related source instances for this type, if negative unlimited

Parameters:
maxRelSource - max. number related source instances for this type, if negative or zero unlimited
Returns:
the type itself, useful for chained calls

setMaxRelDestination

public FxTypeEdit setMaxRelDestination(int maxRelDestination)
Set the max. number related destination instances for this type, if negative or zero unlimited

Parameters:
maxRelDestination - max. number related destination instances for this type, if negative unlimited
Returns:
the type itself, useful for chained calls

getRemovedRelations

public java.util.List<FxTypeRelation> getRemovedRelations()
Get a list of all FxTypeRelations that have been removed

Returns:
list of all FxTypeRelations that have been removed

getAddedRelations

public java.util.List<FxTypeRelation> getAddedRelations()
Get a list of all FxTypeRelations that have been added

Returns:
list of all FxTypeRelations that have been added

getUpdatedRelations

public java.util.List<FxTypeRelation> getUpdatedRelations()
Get a list of all FxTypeRelations that have been updated

Returns:
list of all FxTypeRelations that have been updated

addRelation

public FxTypeEdit addRelation(FxTypeRelation relation)
                       throws FxInvalidParameterException
Add or update a relation

Parameters:
relation - the relation to add or update
Returns:
this
Throws:
FxInvalidParameterException - if the relation is invalid.

updateRelation

public void updateRelation(FxTypeRelation relation)
                    throws FxInvalidParameterException
Add or update a relation

Parameters:
relation - the relation to add or update
Throws:
FxInvalidParameterException - if the relation is invalid.

removeRelation

public void removeRelation(FxTypeRelation relation)
Remove a relation

Parameters:
relation - the relation to remove

getAssignedGroups

public java.util.List<FxGroupAssignment> getAssignedGroups()
Get all group assignments that are attached to the type's root

Overrides:
getAssignedGroups in class FxType
Returns:
all group assignments that are attached to the type's root

getAssignedProperties

public java.util.List<FxPropertyAssignment> getAssignedProperties()
Get all property assignments that are attached to the type's root

Overrides:
getAssignedProperties in class FxType
Returns:
all property assignments that are attached to the type's root

isChanged

public boolean isChanged()
Have changes been made?

Returns:
changes made