|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.extensions.webscripts.ScriptBase org.springframework.extensions.webscripts.ScriptModelObject
public final class ScriptModelObject
Provides a write-able model object wrapper to the script engine. The properties of this object are writeable which means that the developer has the option to use either the properties array or explicit methods. The following commands are equivalent: myObject.properties.title = "abc"; myObject.properties["title"] = "abc"; myObject.setProperty("title", "abc"); Note: The index on the properties array is not supported. Thus, a command such as this: myObject.properties[0] = "abc"; will no-op and do nothing. The following is available for working with resources: var resources = myObject.resources;
Field Summary |
---|
Fields inherited from class org.springframework.extensions.webscripts.ScriptBase |
---|
context, properties |
Constructor Summary | |
---|---|
ScriptModelObject(RequestContext context,
ModelObject modelObject)
Instantiates a new script model object. |
Method Summary | |
---|---|
protected ScriptableMap |
buildProperties()
|
ScriptModelObject |
clone()
Creates a clone of this model object |
ScriptModelObject |
clone(String newObjectId)
Creates a clone of this model object The provided is to set as the new id of the object |
void |
delete()
Deletes the object |
boolean |
getBooleanProperty(String propertyName)
Gets the boolean property. |
String |
getDescription()
Gets the description. |
String |
getDescriptionId()
Gets the description id. |
String |
getId()
Gets the id. |
ModelObject |
getModelObject()
Returns the model object |
String |
getPersisterId()
Gets the persister id. |
String |
getProperty(String propertyName)
Gets the property. |
ScriptResources |
getResources()
|
String |
getStoragePath()
Gets the storage path. |
long |
getTimestamp()
Gets the timestamp. |
String |
getTitle()
Gets the title. |
String |
getTitleId()
Gets the title id. |
String |
getTypeId()
Gets the type id for the underlying model object |
void |
remove()
Removes the object |
void |
removeProperty(String propertyName)
Removes the property. |
void |
save()
Persist the object and all modified properties. |
void |
setDescription(Serializable value)
Sets the description. |
void |
setDescriptionId(Serializable value)
Sets the description id. |
void |
setId(String id)
Sets the id. |
void |
setProperty(String propertyName,
String propertyValue)
Sets the property. |
void |
setTitle(Serializable value)
Sets the title. |
void |
setTitleId(Serializable value)
Sets the title id. |
void |
touch()
Touches the object. |
String |
toXML()
To xml. |
Methods inherited from class org.springframework.extensions.webscripts.ScriptBase |
---|
getConfig, getModel, getObject, getProperties, getRequestContext, toString |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ScriptModelObject(RequestContext context, ModelObject modelObject)
context
- the request contextmodelObject
- the model objectMethod Detail |
---|
protected ScriptableMap buildProperties()
buildProperties
in class ScriptBase
public String getId()
public void setId(String id)
id
- the new idpublic String getTypeId()
public String getTitle()
public void setTitle(Serializable value)
value
- the new titlepublic String getTitleId()
public void setTitleId(Serializable value)
value
- the new title idpublic String getDescription()
public String getDescriptionId()
public void setDescriptionId(Serializable value)
value
- the new description idpublic void setDescription(Serializable value)
value
- the new descriptionpublic long getTimestamp()
public String getPersisterId()
public String getStoragePath()
public ScriptResources getResources()
public void save()
public void remove()
public void delete()
public String toXML()
public void touch()
public boolean getBooleanProperty(String propertyName)
propertyName
- the property name
public String getProperty(String propertyName)
propertyName
- the property name
public void setProperty(String propertyName, String propertyValue)
propertyName
- the property namepropertyValue
- the property valuepublic void removeProperty(String propertyName)
propertyName
- the property namepublic ModelObject getModelObject()
public ScriptModelObject clone()
clone
in class Object
public ScriptModelObject clone(String newObjectId)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |