public abstract class ItemWrapper extends Object implements ItemI
Modifier and Type | Class and Description |
---|---|
class |
ItemWrapper.FieldEmptyException |
Modifier and Type | Field and Description |
---|---|
boolean |
allowXMLDBAccess |
Constructor and Description |
---|
ItemWrapper() |
ItemWrapper(ItemI i) |
Modifier and Type | Method and Description |
---|---|
void |
activate(UserI user)
Activates this item and all of its children.
|
boolean |
canActivate(UserI user)
Whether or not this user can activate this Item.
|
boolean |
canCreate(UserI user) |
boolean |
canDelete(UserI user) |
boolean |
canEdit(UserI user)
Whether or not this user can edit this Item.
|
boolean |
canRead(UserI user)
Whether or not this user can read this Item.
|
void |
extend(boolean allowMultiples)
extends the item (loads any additional children).
|
Boolean |
getBooleanProperty(String sql_name)
Can take the sql name of a local field, or the XML dot syntax name for child fields.
|
boolean |
getBooleanProperty(String sql_name,
boolean defaultValue)
Can take the sql name of a local field, or the XML dot syntax name for child fields.
|
boolean |
getBooleanProperty(String name,
String default_value)
Can take the sql name of a local field, or the XML dot syntax name for child fields.
|
ItemCollection |
getChildItemCollection(String xmlPath)
Use the field's xmlPath name
|
ItemCollection |
getChildItemCollection(XFTFieldWrapper field)
Gets an ItemCollection of the XFTItems which are specified by the supplied field reference.
|
ArrayList |
getChildItems()
Gets all XFTItem child items.
|
ArrayList |
getChildItems(String xmlPath)
Use the field's xmlName,sq
|
ArrayList |
getChildItems(XFTFieldWrapper field)
Gets an ArrayList of the XFTItems which are specified by the supplied field reference.
|
ArrayList |
getChildItems(XFTFieldWrapper field,
boolean includeHistory) |
XFTItem |
getCurrentDBVersion()
Returns a new XFTItem which contains the current version of this item's data from the database.
|
XFTItem |
getCurrentDBVersion(boolean withChildren)
Returns a new XFTItem which contains the current version of this item's data from the database.
|
Date |
getDateProperty(String name) |
String |
getDBName() |
Double |
getDoubleProperty(String xmlPath) |
Float |
getFloatProperty(String xmlPath) |
Date |
getInsertDate() |
XdatUserI |
getInsertUser() |
Integer |
getIntegerProperty(String xmlPath) |
XFTItem |
getItem() |
String |
getLongCreateTime() |
XdatUserI |
getMetaCreatedBy() |
ItemI |
getParent()
returns parent Item (if there is one).
|
ArrayList |
getPossibleValues(String xmlPath)
Returns the possible value for this XML field (based on enumerations in the XML Schema).
|
Object |
getProperty(String sql_name)
Can take the sql name of a local field, or the XML dot syntax name for child fields.
|
Hashtable |
getProps()
returns Hashtable of this item's properties.
|
abstract String |
getSchemaElementName() |
String |
getStringProperty(String sql_name)
Can take the sql name of a local field, or the XML dot syntax name for child fields.
|
UserI |
getUser() |
String |
getXSIType()
Gets the data type name of this item.
|
boolean |
hasProperty(String id,
Object find) |
boolean |
isActive()
returns if this item is activated.
|
void |
lock(UserI user)
Lock this item and all of its children.
|
boolean |
needsActivation()
Whether or not this user needs Activation
|
String |
output() |
String |
output(String s) |
void |
postSave()
Override this method to customize logic performed after this item is saved.
|
void |
preSave()
Override this method to customize logic performed before this item is saved.
|
void |
quarantine(UserI user)
Quarantine this item and all of its children.
|
void |
readExternal(ObjectInput in) |
void |
save(UserI user,
boolean overrideSecurity,
boolean quarantine,
boolean overrideQuarantine,
boolean allowItemRemoval,
EventMetaI c) |
boolean |
save(UserI user,
boolean overrideSecurity,
boolean allowItemRemoval,
EventMetaI c)
Stores this item's data in the database.
|
void |
setItem(ItemI i) |
void |
setParent(ItemI item)
sets the parent item for this item.
|
void |
setProperty(String xmlPath,
Object value)
Can take the sql name of a local field, or the XML dot syntax name for child fields.
|
String |
toHTML()
Translates this item to an HTML representation.
|
Document |
toJoinedXML() |
ByteArrayOutputStream |
toXML_BOS(String location)
Save item data to DB.
|
Document |
toXML()
Translates this item to its XML representation using DOM.
|
void |
toXML(OutputStream out,
boolean allowDBAccess)
Translates this item to its XML representation.
|
void |
toXML(OutputStream out,
String schemaDir,
boolean allowDBAccess)
Translates this item to its XML representation.
|
void |
toXML(Writer out) |
void |
toXML(Writer out,
boolean allowDBAccess)
Translates this item to its XML representation.
|
void |
toXML(Writer out,
String schemaDir,
boolean allowDBAccess)
Translates this item to its XML representation.
|
ValidationResults |
validate()
Validates this item's content.
|
void |
writeExternal(ObjectOutput out) |
public ItemWrapper()
public ItemWrapper(ItemI i)
public Object getProperty(String sql_name) throws ElementNotFoundException, FieldNotFoundException
ItemI
getProperty
in interface ItemI
ElementNotFoundException
FieldNotFoundException
public Boolean getBooleanProperty(String sql_name) throws FieldNotFoundException
ItemI
getBooleanProperty
in interface ItemI
FieldNotFoundException
public boolean getBooleanProperty(String sql_name, boolean defaultValue) throws ElementNotFoundException, FieldNotFoundException
ItemI
getBooleanProperty
in interface ItemI
ElementNotFoundException
FieldNotFoundException
public boolean getBooleanProperty(String name, String default_value) throws XFTInitException, ElementNotFoundException, FieldNotFoundException
ItemI
getBooleanProperty
in interface ItemI
XFTInitException
ElementNotFoundException
FieldNotFoundException
public String getStringProperty(String sql_name) throws ElementNotFoundException, FieldNotFoundException
ItemI
getStringProperty
in interface ItemI
ElementNotFoundException
FieldNotFoundException
public ArrayList getChildItems(String xmlPath) throws XFTInitException, ElementNotFoundException, FieldNotFoundException
getChildItems
in interface ItemI
xmlPath
- The path of the field to retrieveXFTInitException
ElementNotFoundException
FieldNotFoundException
public ItemCollection getChildItemCollection(String xmlPath) throws XFTInitException, ElementNotFoundException, FieldNotFoundException, Exception
xmlPath
- XFTInitException
ElementNotFoundException
FieldNotFoundException
Exception
public ItemI getParent()
ItemI
public void setParent(ItemI item)
ItemI
public void setItem(ItemI i)
public void extend(boolean allowMultiples) throws XFTInitException, ElementNotFoundException, DBPoolException, SQLException, Exception
ItemI
extend
in interface ItemI
XFTInitException
ElementNotFoundException
DBPoolException
SQLException
Exception
public boolean isActive() throws MetaDataException
ItemI
isActive
in interface ItemI
MetaDataException
public void activate(UserI user) throws Exception
ItemI
public void quarantine(UserI user) throws Exception
ItemI
quarantine
in interface ItemI
Exception
public void lock(UserI user) throws Exception
ItemI
public boolean canActivate(UserI user) throws Exception
ItemI
canActivate
in interface ItemI
Exception
public boolean canEdit(UserI user) throws Exception
ItemI
public boolean canRead(UserI user) throws Exception
ItemI
public ItemCollection getChildItemCollection(XFTFieldWrapper field) throws XFTInitException, ElementNotFoundException, FieldNotFoundException
ItemI
getChildItemCollection
in interface ItemI
XFTInitException
ElementNotFoundException
FieldNotFoundException
public ArrayList getChildItems() throws XFTInitException, ElementNotFoundException, FieldNotFoundException
ItemI
getChildItems
in interface ItemI
XFTInitException
ElementNotFoundException
FieldNotFoundException
public ArrayList getChildItems(XFTFieldWrapper field) throws XFTInitException, ElementNotFoundException, FieldNotFoundException
ItemI
getChildItems
in interface ItemI
XFTInitException
ElementNotFoundException
FieldNotFoundException
public ArrayList getChildItems(XFTFieldWrapper field, boolean includeHistory) throws XFTInitException, ElementNotFoundException, FieldNotFoundException
getChildItems
in interface ItemI
XFTInitException
ElementNotFoundException
FieldNotFoundException
public XFTItem getCurrentDBVersion()
ItemI
getCurrentDBVersion
in interface ItemI
public XFTItem getCurrentDBVersion(boolean withChildren)
ItemI
getCurrentDBVersion
in interface ItemI
public boolean needsActivation() throws Exception
ItemI
needsActivation
in interface ItemI
Exception
public String getXSIType()
ItemI
getXSIType
in interface ItemI
public ArrayList getPossibleValues(String xmlPath) throws Exception
ItemI
getPossibleValues
in interface ItemI
Exception
public Hashtable getProps()
ItemI
public boolean save(UserI user, boolean overrideSecurity, boolean allowItemRemoval, EventMetaI c) throws Exception
ItemI
public void save(UserI user, boolean overrideSecurity, boolean quarantine, boolean overrideQuarantine, boolean allowItemRemoval, EventMetaI c) throws Exception
public void preSave() throws Exception
Exception
public void postSave() throws Exception
Exception
public void setProperty(String xmlPath, Object value) throws Exception
ItemI
setProperty
in interface ItemI
Exception
public String toHTML() throws Exception
ItemI
public ByteArrayOutputStream toXML_BOS(String location) throws Exception
ItemI
public Document toXML() throws Exception
ItemI
public void toXML(OutputStream out, String schemaDir, boolean allowDBAccess) throws IllegalArgumentException, SAXException
ItemI
toXML
in interface ItemI
IllegalArgumentException
SAXException
public void toXML(Writer out, String schemaDir, boolean allowDBAccess) throws IllegalArgumentException, SAXException
ItemI
toXML
in interface ItemI
IllegalArgumentException
SAXException
public void toXML(OutputStream out, boolean allowDBAccess) throws IllegalArgumentException, SAXException
ItemI
toXML
in interface ItemI
IllegalArgumentException
SAXException
public void toXML(Writer out, boolean allowDBAccess) throws IllegalArgumentException, SAXException
ItemI
toXML
in interface ItemI
IllegalArgumentException
SAXException
public ValidationResults validate() throws Exception
ItemI
public Integer getIntegerProperty(String xmlPath) throws FieldNotFoundException, ElementNotFoundException
xmlPath
- FieldNotFoundException
ElementNotFoundException
public Float getFloatProperty(String xmlPath) throws FieldNotFoundException, ElementNotFoundException
xmlPath
- FieldNotFoundException
ElementNotFoundException
public Double getDoubleProperty(String xmlPath) throws FieldNotFoundException, ElementNotFoundException
xmlPath
- FieldNotFoundException
ElementNotFoundException
public boolean hasProperty(String id, Object find) throws XFTInitException, ElementNotFoundException, FieldNotFoundException
hasProperty
in interface ItemI
XFTInitException
ElementNotFoundException
FieldNotFoundException
public Document toJoinedXML() throws Exception
toJoinedXML
in interface ItemI
Exception
public abstract String getSchemaElementName()
public String output()
public Date getDateProperty(String name) throws XFTInitException, ElementNotFoundException, FieldNotFoundException, ParseException
getDateProperty
in interface ItemI
XFTInitException
ElementNotFoundException
FieldNotFoundException
ParseException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public XdatUserI getInsertUser()
public Date getInsertDate()
public String getLongCreateTime()
public XdatUserI getMetaCreatedBy()
Copyright © 2015 Neuroinformatics Research Group. All rights reserved.