com.uwyn.rife.cmf
Class ContentInfo

java.lang.Object
  extended by com.uwyn.rife.site.Validation
      extended by com.uwyn.rife.cmf.ContentInfo
All Implemented Interfaces:
Constrained, ConstrainedPropertyListener, Validated, ValidatedConstrained, Cloneable
Direct Known Subclasses:
DatabaseContentInfo

public class ContentInfo
extends Validation

This class represents all the information that is stored in the backend about a certain Content instance.

The setters of this class are only present to make it possible for the back-ends to automatically populate the information.

Since:
1.0
Version:
$Revision: 3634 $
Author:
Geert Bevin (gbevin[remove] at uwyn dot com)

Constructor Summary
ContentInfo()
          Instantiates a new ContentInfo instance.
 
Method Summary
 void activateValidation()
          This method is called at least once and maximum once when any method related to Validated rules, subjects and group or Constrained properties are used.
 String getAttribute(String name)
          Retrieves the value of a named content attribute.
 Map<String,String> getAttributes()
          Retrieves the attributes map of the stored Content instance.
 Timestamp getCreated()
          Retrieves the moment when the Content instance was stored.
 String getFormattedSize()
          Retrieves the size of the stored Content instance as a formatted string.
 String getMimeType()
          Retrieves the mime type of the stored Content instance.
 String getName()
          Retrieves the name of the stored Content instance.
 String getOptimalPath()
          Retrieves the path of the stored Content instance in the most optimal form for usage in the cmf.
 String getPath()
          Retrieves the path of the stored Content instance.
 Map<String,String> getProperties()
          Retrieves the content data properties of the stored Content instance.
 String getProperty(String name)
          Retrieves the value of a named content property.
 int getSize()
          Retrieves the size of the stored Content instance.
 int getVersion()
          Retrieves the version of the stored Content instance.
 boolean hasAttribute(String name)
          Indicates whether a specific named content attribute is present.
 boolean hasAttributes()
          Indicates whether named content attributes are present.
 boolean hasName()
          Indicates whether the stored Content instance has a name.
 boolean hasProperties()
          Indicates whether content data properties are present for the stored Content instance.
 boolean hasProperty(String name)
          Indicates whether a specific named content property is present.
 boolean isFragment()
          Retrieves wether the stored Content instance is a fragment or not.
 void setAttributes(Map<String,String> attributes)
          Sets the attributes map of the stored Content instance.
 void setCreated(Timestamp created)
          Sets the moment when the Content instance was stored.
 void setFragment(boolean fragment)
          Sets wether the stored Content instance is a fragment or not.
 void setMimeType(String mimeType)
          Sets the mime type of the stored Content instance.
 void setName(String name)
          Sets the name of the stored Content instance.
 void setPath(String path)
          Sets the path of the stored Content instance.
 void setProperties(Map<String,String> properties)
          Sets the content data properties of the stored Content instance.
 void setSize(int size)
          Sets the size of the stored Content instance.
 void setVersion(int version)
          Sets the version of the stored Content instance.
 
Methods inherited from class com.uwyn.rife.site.Validation
addConstrainedPropertyRules, addConstraint, addConstraint, addGroup, addRule, addValidationError, clone, constraintSet, countValidationErrors, focusGroup, generateConstrainedPropertyRules, getConstrainedBean, getConstrainedProperties, getConstrainedProperty, getErrorIndication, getGroup, getGroups, getLoadingErrors, getRules, getValidatedSubjects, getValidationErrors, hasPropertyConstraint, isSubjectValid, limitSubjectErrors, makeErrorValid, makeSubjectValid, provideValidatedBean, replaceValidationErrors, resetGroup, resetValidation, retrieveValidatedBean, unlimitSubjectErrors, validate, validate, validateGroup, validateGroup
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentInfo

public ContentInfo()
Instantiates a new ContentInfo instance.

Method Detail

activateValidation

public void activateValidation()
Description copied from class: Validation
This method is called at least once and maximum once when any method related to Validated rules, subjects and group or Constrained properties are used.

By overriding this method, you can thus isolate all the validation setup code code and don't enforce a performance penalty at each object construction when doing it in the default constructor.

Overrides:
activateValidation in class Validation

setPath

public void setPath(String path)
Sets the path of the stored Content instance.

The path has to be unique and will be used to retrieve this particular Content.

Parameters:
path - the absolute and unique path
Since:
1.0
See Also:
getPath()

getPath

public String getPath()
Retrieves the path of the stored Content instance.

Returns:
the Content's path
Since:
1.0
See Also:
setPath(String), getOptimalPath()

getOptimalPath

public String getOptimalPath()
Retrieves the path of the stored Content instance in the most optimal form for usage in the cmf.

Returns:
the Content's most optimal path
Since:
1.0
See Also:
getPath()

setVersion

public void setVersion(int version)
Sets the version of the stored Content instance.

Version numbers are unique and should be increased successively when the data on a certain Content is updated.

The path and the version together identify exactly one particular Content with one particular data.

Parameters:
version - the version as a unique integer
Since:
1.0
See Also:
getVersion()

getVersion

public int getVersion()
Retrieves the version of the stored Content instance.

Returns:
the Content's version
Since:
1.0
See Also:
setVersion(int)

setMimeType

public void setMimeType(String mimeType)
Sets the mime type of the stored Content instance.

Parameters:
mimeType - the String that identifies the mime type
Since:
1.0
See Also:
getMimeType()

getMimeType

public String getMimeType()
Retrieves the mime type of the stored Content instance.

Returns:
the Content's mime type textual identifier
Since:
1.0
See Also:
setMimeType(String)

setFragment

public void setFragment(boolean fragment)
Sets wether the stored Content instance is a fragment or not.

Parameters:
fragment - true if it's a fragment; or

false otherwise

Since:
1.0
See Also:
isFragment()

isFragment

public boolean isFragment()
Retrieves wether the stored Content instance is a fragment or not.

Returns:
true if it's a fragment; or

false otherwise

Since:
1.0
See Also:
setFragment(boolean)

setName

public void setName(String name)
Sets the name of the stored Content instance.

Parameters:
name - the name
Since:
1.0
See Also:
getName(), hasName()

getName

public String getName()
Retrieves the name of the stored Content instance.

Returns:
null if the stored Content instance has no name; or

the name of the content

Since:
1.0
See Also:
setName(String), hasName()

hasName

public boolean hasName()
Indicates whether the stored Content instance has a name.

Returns:
true if it has a name; or

false otherwise

Since:
1.0
See Also:
setName(String), getName()

setCreated

public void setCreated(Timestamp created)
Sets the moment when the Content instance was stored.

Parameters:
created - the moment of creation
Since:
1.0
See Also:
getCreated()

getCreated

public Timestamp getCreated()
Retrieves the moment when the Content instance was stored.

Returns:
the moment of creation
Since:
1.0
See Also:
setCreated(Timestamp)

setAttributes

public void setAttributes(Map<String,String> attributes)
Sets the attributes map of the stored Content instance.

Parameters:
attributes - the attributes map with String keys and value.
Since:
1.0
See Also:
getAttributes()

getAttributes

public Map<String,String> getAttributes()
Retrieves the attributes map of the stored Content instance.

Returns:
the attributes map
Since:
1.0
See Also:
setAttributes(Map)

hasAttributes

public boolean hasAttributes()
Indicates whether named content attributes are present.

Returns:
true if named content attributes are present; or

false otherwise

Since:
1.0
See Also:
setAttributes(Map), getAttributes()

hasAttribute

public boolean hasAttribute(String name)
Indicates whether a specific named content attribute is present.

Parameters:
name - the name of the attribute
Returns:
true if the name content attribute is present; or

false otherwise

Since:
1.0
See Also:
getAttribute(String)

getAttribute

public String getAttribute(String name)
Retrieves the value of a named content attribute.

Parameters:
name - the name of the attribute
Returns:
the value of the named content attribute; or

null if no such attribute could be found

Since:
1.0
See Also:
hasAttribute(String)

setSize

public void setSize(int size)
Sets the size of the stored Content instance.

Parameters:
size - the size of the cotent data
Since:
1.0
See Also:
getSize()

getSize

public int getSize()
Retrieves the size of the stored Content instance.

Returns:
the Content's size
Since:
1.0
See Also:
setSize(int), getFormattedSize()

getFormattedSize

public String getFormattedSize()
Retrieves the size of the stored Content instance as a formatted string.

Returns:
the Content's formatted size
Since:
1.0
See Also:
getSize()

setProperties

public void setProperties(Map<String,String> properties)
Sets the content data properties of the stored Content instance.

Parameters:
properties - the content data properties
Since:
1.0
See Also:
hasProperties(), getProperties()

hasProperties

public boolean hasProperties()
Indicates whether content data properties are present for the stored Content instance.

Returns:
true if properties are present; or

false otherwise

Since:
1.0
See Also:
setProperties(Map), getProperties()

hasProperty

public boolean hasProperty(String name)
Indicates whether a specific named content property is present.

Parameters:
name - the name of the property
Returns:
true if the name content property is present; or

false otherwise

Since:
1.0
See Also:
getProperty(String)

getProperty

public String getProperty(String name)
Retrieves the value of a named content property.

Parameters:
name - the name of the property
Returns:
the value of the named content property; or

null if no such property could be found

Since:
1.0
See Also:
hasProperty(String)

getProperties

public Map<String,String> getProperties()
Retrieves the content data properties of the stored Content instance.

Returns:
the content data properties; or

null if no content data properties are present

Since:
1.0
See Also:
setProperties(Map), hasProperties()


Copyright © 2001-2007 Uwyn sprl/bvba. All Rights Reserved.