|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mycore.datamodel.metadata.MCRObjectService
public class MCRObjectService
This class implements all methode for handling one document service data. The service data are to use to handel the database with batch jobs automatical changes. The service class holds two types of data, dates and flags. The flags are text strings and are optional.
The dates are represent by a date and a type. Two types are in service data at every time and can't remove:
| Constructor Summary | |
|---|---|
MCRObjectService()
This is the constructor of the MCRObjectService class. |
|
| Method Summary | |
|---|---|
void |
addFlag(String value)
This method add a flag to the flag list. |
void |
addFlag(String type,
String value)
This method adds a flag to the flag list. |
void |
addRule(String permission,
Element condition)
This method add a rule to the rules list. |
Element |
createXML()
This method create a XML stream for all structure data. |
Date |
getDate(String type)
This method get a date for a given type. |
int |
getDateSize()
This method return the size of the date list. |
String |
getFlag(int index)
This method get a single flag from the flag list as a string. |
int |
getFlagIndex(String value)
This method returns the index for the given flag value. |
String |
getFlags()
This method get all flags from the flag list as a string. |
ArrayList<String> |
getFlags(String type)
This method returns all flag values of the specified type. |
protected ArrayList<MCRMetaLangText> |
getFlagsAsMCRMetaLangText(String type)
This method returns all flag values of the specified type. |
int |
getFlagSize()
This method return the size of the flag list. |
String |
getFlagType(int index)
This method gets a single flag type from the flag list as a string. |
MCRMetaAccessRule |
getRule(int index)
This method get a single rule from the rules list as a JDOM Element. |
int |
getRuleIndex(String permission)
This method return the index of a permission in the rules list. |
String |
getRulePermission(int index)
This method get a single permission name of rule from the rules list as a string. |
int |
getRulesSize()
This method return the size of the rules list. |
boolean |
isFlagSet(String value)
This method return a boolean value if the given flag is set or not. |
boolean |
isFlagTypeSet(String type)
Proves if the type is set in the flag list. |
boolean |
isValid()
This method check the validation of the content of this class. |
void |
removeFlag(int index)
This method remove a flag from the flag list. |
void |
removeFlags(String type)
This method removes all flags of the specified type from the flag list. |
void |
removeRule(int index)
This method remove a rule from the rules list. |
void |
replaceFlag(int index,
String value)
This method set a flag in the flag list. |
void |
replaceFlagType(int index,
String value)
This method sets the type value of a flag at the specified index. |
void |
setDate(String type)
This method set a date element in the dates list to a actual date value. |
void |
setDate(String type,
Date date)
This method set a date element in the dates list to a given date value. |
void |
setFromDOM(Element service_element)
This method read the XML input stream part from a DOM part for the structure data of the document. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MCRObjectService()
| Method Detail |
|---|
public final void setFromDOM(Element service_element)
service_element - a list of relevant DOM elements for the metadatapublic final int getDateSize()
public final Date getDate(String type)
type - the type of the date
public final void setDate(String type)
type - the type of the date
public final void setDate(String type,
Date date)
type - the type of the datedate - set time to this Calendarpublic final void addFlag(String value)
value - -
the new flag as string
public final void addFlag(String type,
String value)
type - a type as stringvalue - the new flag value as stringpublic final String getFlags()
protected final ArrayList<MCRMetaLangText> getFlagsAsMCRMetaLangText(String type)
type - a type as string.
public final ArrayList<String> getFlags(String type)
type - a type as string.
public final int getFlagSize()
public final String getFlag(int index)
throws IndexOutOfBoundsException
IndexOutOfBoundsException - throw this exception, if the index is false
public final String getFlagType(int index)
throws IndexOutOfBoundsException
IndexOutOfBoundsException - throw this exception, if the index is falsepublic final boolean isFlagSet(String value)
value - a searched flag
public final boolean isFlagTypeSet(String type)
type - a type as string
public final void removeFlag(int index)
throws IndexOutOfBoundsException
index - a index in the list
IndexOutOfBoundsException - throw this exception, if the index is falsepublic final void removeFlags(String type)
type - a type as string
public final void replaceFlag(int index,
String value)
throws IndexOutOfBoundsException
index - a index in the listvalue - the value of a flag as string
IndexOutOfBoundsException - throw this exception, if the index is false
public final void replaceFlagType(int index,
String value)
throws IndexOutOfBoundsException
index - a index in the listvalue - the value of a flag as string
IndexOutOfBoundsException - throw this exception, if the index is false
public final void addRule(String permission,
Element condition)
permission - -
the new permission as stringcondition - -
the new rule as JDOM tree Elementpublic final int getRulesSize()
public final int getRuleIndex(String permission)
public final MCRMetaAccessRule getRule(int index)
throws IndexOutOfBoundsException
IndexOutOfBoundsException - throw this exception, if the index is false
public final String getRulePermission(int index)
throws IndexOutOfBoundsException
IndexOutOfBoundsException - throw this exception, if the index is false
public final void removeRule(int index)
throws IndexOutOfBoundsException
index - a index in the list
IndexOutOfBoundsException - throw this exception, if the index is false
public final Element createXML()
throws MCRException
MCRException - if the content of this class is not validpublic final boolean isValid()
public final int getFlagIndex(String value)
value - the value of a flag as string
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||