com.flexive.shared.structure
Class FxType

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

public class FxType
extends AbstractSelectableObjectWithLabel
implements java.io.Serializable, SelectableObjectWithLabel, SelectableObjectWithName

Type definition

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

Field Summary
protected  ACL ACL
           
protected  java.util.List<FxGroupAssignment> assignedGroups
           
protected  java.util.List<FxPropertyAssignment> assignedProperties
           
static java.lang.String AUDIO
          Name of the audio type for storing audio file formats (mimetypes audio/*)
protected  boolean autoVersion
           
protected  TypeCategory category
           
static java.lang.String CONTACTDATA
          Name of the account contact data type
protected  boolean containsFlatStorageAssignments
           
protected  ACL defaultInstanceACL
           
protected  java.util.List<FxType> derivedTypes
           
static java.lang.String DOCUMENT
          Name of the document type for storing typical document file formats (application mime types: PDF, Word, Excel, ...)
static java.lang.String DOCUMENTFILE
          Name of the ROOT document type for storing (binary) file formats
static java.lang.String FOLDER
          Name of the folder data type.
protected  long historyAge
           
protected  FxReference icon
           
protected  long id
           
static java.lang.String IMAGE
          Name of the image type for storing image file formats (mimetypes image/*)
protected  boolean includedInSupertypeQueries
           
protected  FxString label
           
protected  LanguageMode language
           
protected  LifeCycleInfo lifeCycleInfo
           
protected  int maxRelDestination
           
protected  int maxRelSource
           
protected  long maxVersions
           
protected  TypeMode mode
           
protected  boolean multipleContentACLs
           
protected  java.lang.String name
           
protected  java.util.List<FxStructureOption> options
           
protected  FxType parent
           
protected  byte permissions
           
protected  java.util.List<FxTypeRelation> relations
           
static java.lang.String ROOT
          ROOT type name.
static long ROOT_ID
          Root type ID.
protected  java.util.List<FxAssignment> scriptedAssignments
           
protected  java.util.Map<FxScriptEvent,long[]> scriptMapping
           
protected  TypeState state
           
protected  TypeStorageMode storageMode
           
protected  boolean trackHistory
           
protected  java.util.List<FxProperty> uniqueProperties
           
static java.lang.String VIDEO
          Name of the video type for storing video file formats (mimetypes video/*)
protected  Workflow workflow
           
 
Constructor Summary
FxType(long id, ACL acl, ACL defaultInstanceACL, Workflow workflow, java.lang.String name, FxString label, FxType parent, TypeStorageMode storageMode, TypeCategory category, TypeMode mode, LanguageMode language, TypeState state, byte permissions, boolean multipleContentACLs, boolean includedInSupertypeQueries, boolean trackHistory, long historyAge, long maxVersions, boolean autoVersion, int maxRelSource, int maxRelDestination, LifeCycleInfo lifeCycleInfo, java.util.List<FxType> derivedTypes, java.util.List<FxTypeRelation> relations, java.util.List<FxStructureOption> options)
          [fleXive] internal constructor for FxTypes, do not used this outside the flexive core!
 
Method Summary
protected  void addDerivedTypes(java.util.Collection<FxType> result)
          Add the derived types (direct and through transitive dependency) of this type to the result list.
 FxTypeEdit asEditable()
          Get this FxType as editable
 java.lang.String buildXPathPrefix(FxPK pk)
          Build an XPath prefix for addressing an instance in XPath's
 FxGroupData createEmptyData(java.lang.String xpPrefix)
          Create an empty FxData hierarchy for a new FxContent starting with a virtual root group.
 FxGroupData createRandomData(FxPK pk, FxEnvironment env, java.util.Random rnd, int maxMultiplicity)
          Create a base group with random data
 ACL getACL()
          Get the ACL of this type
 java.util.List<FxAssignment> getAllAssignments()
          Get all assignments (groups and properties) that are attached to a type
 java.util.List<FxPropertyAssignment> getAllProperties()
          Get all property assignments that are attached to the type's root or to a group attached to the type.
 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
 FxAssignment getAssignment(java.lang.String parentXPath)
          Get the assignment for the given XPath
 java.util.List<FxPropertyAssignment> getAssignmentsForDataType(FxDataType dataType)
          Get a list of all FxPropertyAssignments connected to this type that are of the given FxDataType.
 java.util.List<FxPropertyAssignment> getAssignmentsForProperty(long propertyId)
          Get a list of all FxPropertyAssignments connected to this type that are assigned to the requested property
 byte getBitCodedPermissions()
          Get the permissions set for this type bit coded
 TypeCategory getCategory()
          Get the category of this FxType (System, User, ...)
 java.util.List<FxAssignment> getConnectedAssignments(java.lang.String parentXPath)
          Get all assignments directly connected to the given XPath
 ACL getDefaultInstanceACL()
          Get the default instance ACL for this type.
 java.util.List<FxType> getDerivedTypes()
          Get all FxTypes that are derived from this Type
 java.util.List<FxType> getDerivedTypes(boolean transitive, boolean includeOwnType)
          Get all FxTypes that are derived from this type.
 java.lang.String getDisplayName()
          Returrn a localized, human-readable name for the type.
 FxGroupAssignment getGroupAssignment(java.lang.String parentXPath)
          Get the FxGroupAssignment for the given XPath.
 long getHistoryAge()
          Get how many days history is tracked (0 = forever)
 FxReference getIcon()
          Get the preview icon of this type.
 long getId()
          Internal id of this FxType
 java.util.List<FxStructureOption> getInheritedOptions()
          Retrieve the List of options which are inherited by derived types
 FxString getLabel()
          Return the localized label of the object.
 LanguageMode getLanguage()
          How are languages handled? (None, Single, Multiple, ...)
 LifeCycleInfo getLifeCycleInfo()
          Get information about changes
 FxPropertyAssignment getMainBinaryAssignment()
          Determines the property assignment that should be treated as the main binary content for this type.
 java.util.List<FxPropertyAssignment> getMandatoryAssignments(FxDataType datatype)
          Returns the mandatory assignments of the given type.
 int getMaxRelDestination()
          How many destination instances may be related to this instance in total? (infinte = <0)
 int getMaxRelSource()
          How many source instances may be related to this instance in total? (infinte = <0)
 long getMaxVersions()
          Get how many versions of instances are kept (-1 = infinite, 0 = none)
 FxMimeTypeWrapper getMimeType()
          Retrieve the mime types for a given FxType
 TypeMode getMode()
          Is this FxType defining a content or relation?
 java.lang.String getName()
          Get the name of this FxType
 FxStructureOption getOption(java.lang.String key)
          Get an option entry for the given key, if the key is invalid or not found a FxTypeStructureOption object will be returned with set set to false, overridable set to false and value set to an empty String.
 java.util.List<FxStructureOption> getOptions()
          Get a (unmodifiable) list of all options set for this group
 FxType getParent()
          If this FxType is derived from another FxType get the 'super' FxType
 FxPropertyAssignment getPropertyAssignment(java.lang.String parentXPath)
          Get the FxPropertyAssignment for the given XPath.
 java.util.List<FxTypeRelation> getRelations()
          Get all possible relation combinations
 java.util.List<FxAssignment> getScriptedAssignments(FxScriptEvent event)
          Get a list with all assignments that have scripts assigned for the given script type
 java.util.Set<FxScriptEvent> getScriptEvents()
          Get a Set of all events that have script mappings for this type
 long[] getScriptMapping(FxScriptEvent event)
          Get the script id's that are mapped to this type for the requested script type
 TypeState getState()
          Get the state of this type
 TypeStorageMode getStorageMode()
          Get how is data stored internally.
 java.util.List<FxProperty> getUniqueProperties()
          Get all properties used in this type that have a unique constraint set
 Workflow getWorkflow()
          Getter for the assigned Workflow
 boolean hasAssignment(java.lang.String xPath)
          Check if the requested assignment exists for this type
 boolean hasDefaultInstanceACL()
          Is a default instance ACL defined for this type?
 boolean hasMimeType(java.lang.String mimeType)
          Checks if a given mime type is set for the FxType The given String parameter can either be a main type of a mimetype ("e.g." "image" or "image/") or a fully qualified mime type including the subtype, e.g.
 boolean hasOption(java.lang.String key)
          Check if an option is set for the requested key
 boolean hasScriptedAssignments()
          Do scripted assignments exists for this type?
 boolean hasScriptMapping(FxScriptEvent event)
          Does this type have mappings for the requested script event type?
 boolean hasUniqueProperties()
          Do unique properties for this type exist?
 boolean isAutoVersion()
          Should new versions be automatically created when data changed?
 boolean isContainsFlatStorageAssignments()
          Does this type contain assignments that are stored in a flat storage?
 boolean isDerived()
          Is this FxType derived from another?
 boolean isDerivedFrom(long typeId)
          Is this FxType derived from the given type?
 boolean isDerivedFrom(java.lang.String typeName)
          Is this FxType derived from the given type?
 boolean isIncludedInSupertypeQueries()
          Should this type be included in supertype queries?
 boolean isMimeTypeSet()
          Convenience method to check if ANY mime type was set for this FxType
 boolean isMultipleContentACLs()
          Allow multiple ACLs for a content of this type?
 boolean isRelation()
          Is this type a relation?
 boolean isTrackHistory()
          Track history of changes?
 boolean isUseInstancePermissions()
          Use content instance permissions?
 boolean isUsePermissions()
          Use permissions at all?
 boolean isUsePropertyPermissions()
          Use property permissions?
 boolean isUseStepPermissions()
          Use step permissions?
 boolean isUseTypePermissions()
          Use type permissions?
 boolean isXPathValid(java.lang.String XPath, boolean checkProperty)
          Check if the given XPath is valid for this type
 void reloadWorkflow(FxEnvironment environment)
          Reload this types workflow, internal method, called from the StructureLoader upon Workflow changes
 void resolveReferences(FxEnvironment fxStructure)
          Resolve references after initial loading
 java.lang.String toString()
          
 
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

ROOT_ID

public static final long ROOT_ID
Root type ID.

See Also:
Constant Field Values

ROOT

public static final java.lang.String ROOT
ROOT type name.

Since:
3.1
See Also:
Constant Field Values

CONTACTDATA

public static final java.lang.String CONTACTDATA
Name of the account contact data type

See Also:
Constant Field Values

FOLDER

public static final java.lang.String FOLDER
Name of the folder data type.

See Also:
Constant Field Values

DOCUMENTFILE

public static final java.lang.String DOCUMENTFILE
Name of the ROOT document type for storing (binary) file formats

See Also:
Constant Field Values

DOCUMENT

public static final java.lang.String DOCUMENT
Name of the document type for storing typical document file formats (application mime types: PDF, Word, Excel, ...)

See Also:
Constant Field Values

IMAGE

public static final java.lang.String IMAGE
Name of the image type for storing image file formats (mimetypes image/*)

Since:
3.1.1
See Also:
Constant Field Values

AUDIO

public static final java.lang.String AUDIO
Name of the audio type for storing audio file formats (mimetypes audio/*)

Since:
3.1.2
See Also:
Constant Field Values

VIDEO

public static final java.lang.String VIDEO
Name of the video type for storing video file formats (mimetypes video/*)

Since:
3.1.2
See Also:
Constant Field Values

id

protected long id

ACL

protected ACL ACL

defaultInstanceACL

protected ACL defaultInstanceACL

workflow

protected Workflow workflow

name

protected java.lang.String name

label

protected FxString label

parent

protected FxType parent

storageMode

protected TypeStorageMode storageMode

category

protected TypeCategory category

mode

protected TypeMode mode

language

protected LanguageMode language

state

protected TypeState state

permissions

protected byte permissions

trackHistory

protected boolean trackHistory

historyAge

protected long historyAge

maxVersions

protected long maxVersions

autoVersion

protected boolean autoVersion

maxRelSource

protected int maxRelSource

maxRelDestination

protected int maxRelDestination

multipleContentACLs

protected boolean multipleContentACLs

includedInSupertypeQueries

protected boolean includedInSupertypeQueries

lifeCycleInfo

protected LifeCycleInfo lifeCycleInfo

containsFlatStorageAssignments

protected boolean containsFlatStorageAssignments

derivedTypes

protected java.util.List<FxType> derivedTypes

relations

protected java.util.List<FxTypeRelation> relations

assignedProperties

protected java.util.List<FxPropertyAssignment> assignedProperties

uniqueProperties

protected java.util.List<FxProperty> uniqueProperties

assignedGroups

protected java.util.List<FxGroupAssignment> assignedGroups

scriptedAssignments

protected java.util.List<FxAssignment> scriptedAssignments

scriptMapping

protected java.util.Map<FxScriptEvent,long[]> scriptMapping

icon

protected FxReference icon

options

protected java.util.List<FxStructureOption> options
Constructor Detail

FxType

public FxType(long id,
              ACL acl,
              ACL defaultInstanceACL,
              Workflow workflow,
              java.lang.String name,
              FxString label,
              FxType parent,
              TypeStorageMode storageMode,
              TypeCategory category,
              TypeMode mode,
              LanguageMode language,
              TypeState state,
              byte permissions,
              boolean multipleContentACLs,
              boolean includedInSupertypeQueries,
              boolean trackHistory,
              long historyAge,
              long maxVersions,
              boolean autoVersion,
              int maxRelSource,
              int maxRelDestination,
              LifeCycleInfo lifeCycleInfo,
              java.util.List<FxType> derivedTypes,
              java.util.List<FxTypeRelation> relations,
              java.util.List<FxStructureOption> options)
[fleXive] internal constructor for FxTypes, do not used this outside the flexive core!

Parameters:
id - type id
acl - type ACL
defaultInstanceACL - optional default ACL to assign for new instances
workflow - the types workflow
name - name
label - label
parent - parent type
storageMode - storage mode
category - type category
mode - type mode
language - language mode
state - type state
permissions - permissions to use (bit coded)
multipleContentACLs - does this type support multiple acls for instances?
includedInSupertypeQueries - include this type in super type queries?
trackHistory - track history?
historyAge - max. age of history to keep
maxVersions - max. number of versions to keep for instances of this type
autoVersion - automatically create a new version when contents changed during a save operation
maxRelSource - max. number of relation sources
maxRelDestination - max. number of relation destination
lifeCycleInfo - life cycle info for the type
derivedTypes - list of types derived from this type
relations - list of relations this type is affiliated with
options - type options
Method Detail

getCategory

public TypeCategory getCategory()
Get the category of this FxType (System, User, ...)

Returns:
the category.

getId

public long getId()
Internal id of this FxType

Specified by:
getId in interface SelectableObject
Returns:
the internal id of this FxType

getACL

public ACL getACL()
Get the ACL of this type

Returns:
ACL of this type

hasDefaultInstanceACL

public boolean hasDefaultInstanceACL()
Is a default instance ACL defined for this type?

Returns:
if a default instance ACL is defined for this type
Since:
3.1.1

getDefaultInstanceACL

public ACL getDefaultInstanceACL()
Get the default instance ACL for this type. If no default instance ACL is assigned, return the global default instance ACL

Returns:
default instance ACL for this type
Since:
3.1.1

getWorkflow

public Workflow getWorkflow()
Getter for the assigned Workflow

Returns:
Workflow

reloadWorkflow

public void reloadWorkflow(FxEnvironment environment)
Reload this types workflow, internal method, called from the StructureLoader upon Workflow changes

Parameters:
environment - environment with updated workflows

getLanguage

public LanguageMode getLanguage()
How are languages handled? (None, Single, Multiple, ...)

Returns:
how languages are handled

getState

public TypeState getState()
Get the state of this type

Returns:
TypeState

getMode

public TypeMode getMode()
Is this FxType defining a content or relation?

Returns:
mode (Content or Relation)

getName

public java.lang.String getName()
Get the name of this FxType

Specified by:
getName in interface SelectableObjectWithName
Returns:
name

getLabel

public FxString getLabel()
Return the localized label of the object.

Specified by:
getLabel in interface ObjectWithLabel
Returns:
the localized label for the object.

getDisplayName

public java.lang.String getDisplayName()
Returrn a localized, human-readable name for the type.

Returns:
a localized, human-readable name for the type.

isRelation

public boolean isRelation()
Is this type a relation?

Returns:
if this type is a relation

isDerived

public boolean isDerived()
Is this FxType derived from another?

Returns:
if this FxType is derived from another
See Also:
getParent()

isDerivedFrom

public boolean isDerivedFrom(long typeId)
Is this FxType derived from the given type?

Parameters:
typeId - the parent type
Returns:
true if this type is derived (direct or transitive) from typeId or when this type's ID is typeId
Since:
3.1

isDerivedFrom

public boolean isDerivedFrom(java.lang.String typeName)
Is this FxType derived from the given type?

Parameters:
typeName - the type name
Returns:
true if this type is derived (direct or transitive) from typeName or when the typeName refers to this type
Since:
3.1

getParent

public FxType getParent()
If this FxType is derived from another FxType get the 'super' FxType

Returns:
FxType this one is derived from or null

getDerivedTypes

public java.util.List<FxType> getDerivedTypes()
Get all FxTypes that are derived from this Type

Returns:
Iterator of all directly derived types

getDerivedTypes

public java.util.List<FxType> getDerivedTypes(boolean transitive,
                                              boolean includeOwnType)
Get all FxTypes that are derived from this type.

Parameters:
transitive - if transitive dependencies (derived types of derived types) should be resolved
includeOwnType - if the own type should be included (as first element)
Returns:
all FxTypes that are derived from this type.
Since:
3.1

addDerivedTypes

protected void addDerivedTypes(java.util.Collection<FxType> result)
Add the derived types (direct and through transitive dependency) of this type to the result list.

Parameters:
result - the result list to be populated
Since:
3.1

getStorageMode

public TypeStorageMode getStorageMode()
Get how is data stored internally.

Returns:
how data is stored internally

isUsePermissions

public boolean isUsePermissions()
Use permissions at all?

Returns:
if permissions are used at all
Since:
3.1

isUseInstancePermissions

public boolean isUseInstancePermissions()
Use content instance permissions?

Returns:
if content instance permissions are used
Since:
3.1

isUsePropertyPermissions

public boolean isUsePropertyPermissions()
Use property permissions?

Returns:
if property permissions are used
Since:
3.1

isUseStepPermissions

public boolean isUseStepPermissions()
Use step permissions?

Returns:
if step permissions are used
Since:
3.1

isUseTypePermissions

public boolean isUseTypePermissions()
Use type permissions?

Returns:
if type permissions are used
Since:
3.1

isMultipleContentACLs

public boolean isMultipleContentACLs()
Allow multiple ACLs for a content of this type?

Returns:
true if multiple content ACLs are allowed
Since:
3.1

isIncludedInSupertypeQueries

public boolean isIncludedInSupertypeQueries()
Should this type be included in supertype queries?

Returns:
true if this type be included in supertype queries
Since:
3.1

isTrackHistory

public boolean isTrackHistory()
Track history of changes?

Returns:
if history of changes is tracked

getHistoryAge

public long getHistoryAge()
Get how many days history is tracked (0 = forever)

Returns:
how many days history is tracked (0 = forever)

getMaxVersions

public long getMaxVersions()
Get how many versions of instances are kept (-1 = infinite, 0 = none)

Returns:
how many versions of instances are kept (-1 = infinite, 0 = none)

isAutoVersion

public boolean isAutoVersion()
Should new versions be automatically created when data changed?

Returns:
automatically create a new version if data changed

getMaxRelSource

public int getMaxRelSource()
How many source instances may be related to this instance in total? (infinte = <0)

Returns:
how many source instances may be related to this instance in total? (infinte = <0)

getMaxRelDestination

public int getMaxRelDestination()
How many destination instances may be related to this instance in total? (infinte = <0)

Returns:
how many destination instances may be related to this instance in total? (infinte = <0)

getLifeCycleInfo

public LifeCycleInfo getLifeCycleInfo()
Get information about changes

Returns:
information about changes

getAssignedGroups

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

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

Returns:
all property assignments that are attached to the type's root

getAllProperties

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

Returns:
all property assignments for the type
Since:
3.1

getAllAssignments

public java.util.List<FxAssignment> getAllAssignments()
Get all assignments (groups and properties) that are attached to a type

Returns:
all assignments for the type

hasUniqueProperties

public boolean hasUniqueProperties()
Do unique properties for this type exist?

Returns:
if unique properties for this type exist

getUniqueProperties

public java.util.List<FxProperty> getUniqueProperties()
Get all properties used in this type that have a unique constraint set

Returns:
all properties used in this type that have a unique constraint set

getRelations

public java.util.List<FxTypeRelation> getRelations()
Get all possible relation combinations

Returns:
possible relation combinations

hasScriptMapping

public boolean hasScriptMapping(FxScriptEvent event)
Does this type have mappings for the requested script event type?

Parameters:
event - requested script event type
Returns:
if mappings exist

hasScriptedAssignments

public boolean hasScriptedAssignments()
Do scripted assignments exists for this type?

Returns:
if scripted assignments exist for this type

getScriptedAssignments

public java.util.List<FxAssignment> getScriptedAssignments(FxScriptEvent event)
Get a list with all assignments that have scripts assigned for the given script type

Parameters:
event - script event
Returns:
list with all assignments that have scripts assigned for the given script type

getScriptMapping

public long[] getScriptMapping(FxScriptEvent event)
Get the script id's that are mapped to this type for the requested script type

Parameters:
event - requested script event
Returns:
mappings or null if mapping does not exist for this type

getScriptEvents

public java.util.Set<FxScriptEvent> getScriptEvents()
Get a Set of all events that have script mappings for this type

Returns:
Set of all events that have script mappings for this type

getBitCodedPermissions

public byte getBitCodedPermissions()
Get the permissions set for this type bit coded

Returns:
bit coded permissions

getIcon

public FxReference getIcon()
Get the preview icon of this type. The icon can be empty if not defined. Version is ignored and always the max version.

Returns:
preview icon (can be empty)

resolveReferences

public void resolveReferences(FxEnvironment fxStructure)
                       throws FxNotFoundException
Resolve references after initial loading

Parameters:
fxStructure - structure for references
Throws:
FxNotFoundException - on errors

createEmptyData

public FxGroupData createEmptyData(java.lang.String xpPrefix)
Create an empty FxData hierarchy for a new FxContent starting with a virtual root group.

Parameters:
xpPrefix - XPath prefix like "FxType name[@pk=..]"
Returns:
empty FxData hierarchy

createRandomData

public FxGroupData createRandomData(FxPK pk,
                                    FxEnvironment env,
                                    java.util.Random rnd,
                                    int maxMultiplicity)
Create a base group with random data

Parameters:
pk - primary key of instance that uses this random data
env - environment
rnd - Random to use
maxMultiplicity - the maximum multiplicity for groups
Returns:
random data

getAssignment

public FxAssignment getAssignment(java.lang.String parentXPath)
Get the assignment for the given XPath

Parameters:
parentXPath - desired XPath
Returns:
FxAssignment

hasAssignment

public boolean hasAssignment(java.lang.String xPath)
Check if the requested assignment exists for this type

Parameters:
xPath - xpath of the assignment
Returns:
assignment exists
Since:
3.1

getPropertyAssignment

public FxPropertyAssignment getPropertyAssignment(java.lang.String parentXPath)
Get the FxPropertyAssignment for the given XPath. This is a convenience method calling internally getAssignment and casting the result to FxPropertyAssignment if appropriate, else throws an FxInvalidParameterException if the assignment is a group.

Parameters:
parentXPath - desired XPath
Returns:
FxAssignment

getMainBinaryAssignment

public FxPropertyAssignment getMainBinaryAssignment()
Determines the property assignment that should be treated as the main binary content for this type. Currently this is the first binary assignment that has a minimum multiplicity of 1, or if none exists the first binary assignment.

However, parent group multiplicities are not yet taken into account.

Returns:
the property assignment that should be treated as the main binary content for this type, or null if no such assignment exists
Since:
3.1

getMandatoryAssignments

public java.util.List<FxPropertyAssignment> getMandatoryAssignments(FxDataType datatype)
Returns the mandatory assignments of the given type.

Parameters:
datatype - data type to check for
Returns:
the mandatory assignments of the given type.
Since:
3.1

getGroupAssignment

public FxGroupAssignment getGroupAssignment(java.lang.String parentXPath)
Get the FxGroupAssignment for the given XPath. This is a convenience method calling internally getAssignment and casting the result to FxGroupAssignment if appropriate, else throws an FxInvalidParameterException if the assignment is a property.

Parameters:
parentXPath - desired XPath
Returns:
FxAssignment

getAssignmentsForProperty

public java.util.List<FxPropertyAssignment> getAssignmentsForProperty(long propertyId)
Get a list of all FxPropertyAssignments connected to this type that are assigned to the requested property

Parameters:
propertyId - requested property id
Returns:
list of all FxPropertyAssignments connected to this type that are assigned to the requested property

getAssignmentsForDataType

public java.util.List<FxPropertyAssignment> getAssignmentsForDataType(FxDataType dataType)
Get a list of all FxPropertyAssignments connected to this type that are of the given FxDataType.

Parameters:
dataType - the data type
Returns:
list of all FxPropertyAssignments connected to this type that are of the given data type

getConnectedAssignments

public java.util.List<FxAssignment> getConnectedAssignments(java.lang.String parentXPath)
Get all assignments directly connected to the given XPath

Parameters:
parentXPath - desired XPath
Returns:
ArrayList of FxAssignment

isXPathValid

public boolean isXPathValid(java.lang.String XPath,
                            boolean checkProperty)
Check if the given XPath is valid for this type

Parameters:
XPath - the XPath to check
checkProperty - should the XPath point to a property?
Returns:
if the XPath is valid or not

isContainsFlatStorageAssignments

public boolean isContainsFlatStorageAssignments()
Does this type contain assignments that are stored in a flat storage?

Returns:
type contains assignments that are stored in a flat storage

toString

public java.lang.String toString()

Overrides:
toString in class AbstractSelectableObjectWithLabel

asEditable

public FxTypeEdit asEditable()
Get this FxType as editable

Returns:
FxTypeEdit

buildXPathPrefix

public java.lang.String buildXPathPrefix(FxPK pk)
Build an XPath prefix for addressing an instance in XPath's

Parameters:
pk - primary key of the instance
Returns:
XPath prefix like "FxType name[@pk=..]"

hasOption

public boolean hasOption(java.lang.String key)
Check if an option is set for the requested key

Parameters:
key - option key
Returns:
if an option is set for the requested key
Since:
3.1

getOption

public FxStructureOption getOption(java.lang.String key)
Get an option entry for the given key, if the key is invalid or not found a FxTypeStructureOption object will be returned with set set to false, overridable set to false and value set to an empty String.

Parameters:
key - option key
Returns:
the found option or an object that indicates that the option is not set
Since:
3.1

getOptions

public java.util.List<FxStructureOption> getOptions()
Get a (unmodifiable) list of all options set for this group

Returns:
(unmodifiable) list of all options set for this group
Since:
3.1

getInheritedOptions

public java.util.List<FxStructureOption> getInheritedOptions()
Retrieve the List of options which are inherited by derived types

Returns:
(modifiable) list of all options inherited by derived types
Since:
3.1

getMimeType

public FxMimeTypeWrapper getMimeType()
Retrieve the mime types for a given FxType

Returns:
return the mime types for a given FxType as a FxMimeType obj., or null if none are set
Since:
3.1

isMimeTypeSet

public boolean isMimeTypeSet()
Convenience method to check if ANY mime type was set for this FxType

Returns:
true if a mime type was set
Since:
3.1

hasMimeType

public boolean hasMimeType(java.lang.String mimeType)
Checks if a given mime type is set for the FxType The given String parameter can either be a main type of a mimetype ("e.g." "image" or "image/") or a fully qualified mime type including the subtype, e.g. "image/png" or "audio/wav".

Parameters:
mimeType - the mime type's type or the fully qualified mime type as a String parameter
Returns:
returns true if the given mime type matches the mime types configured for this FxType