|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.wcm.sandbox.script.Asset
public class Asset
WCM Asset in a sandbox exposed over Java Script API.
Constructor Summary | |
---|---|
Asset(Sandbox sandbox,
AssetInfo asset)
|
Method Summary | |
---|---|
void |
createFile(java.lang.String name,
java.lang.String stringContent)
create a new file with the specified properties and content. |
void |
createFolder(java.lang.String name)
create a new folder |
void |
deleteAsset()
Delete this asset, after it has been deleted do not use this asset. |
Asset[] |
getChildren()
Get children of this asset, returns an empty array if there are no children. |
java.lang.String |
getContent()
Returns textual representation of the Asset content |
java.util.Date |
getCreatedDate()
|
java.lang.String |
getCreatedDateAsISO8601()
|
java.lang.String |
getCreator()
The creator of this asset |
long |
getFileSize()
|
java.util.Date |
getModifiedDate()
|
java.lang.String |
getModifiedDateAsISO8601()
|
java.lang.String |
getModifier()
|
java.lang.String |
getName()
|
java.lang.String |
getPath()
Get the full path of this asset eg. |
java.util.Map |
getProperties()
Get the properties as a key value pair. |
Sandbox |
getSandbox()
Get the parent sandbox which contains this asset |
int |
getVersion()
|
boolean |
isDeleted()
|
boolean |
isFile()
|
boolean |
isFolder()
|
boolean |
isLocked()
|
java.lang.String |
lockOwner()
|
Asset |
move(java.lang.String newPath)
move this asset |
Asset |
rename(java.lang.String newName)
rename this asset |
void |
revert()
revert this asset |
void |
save()
Save the properties please note some system properties are protected and cannot be updated. |
void |
setProperties(java.lang.Object nativeProperties)
|
void |
submit(java.lang.String submitLabel,
java.lang.String submitComment)
Submit this asset to staging |
boolean |
writeContent(org.springframework.extensions.surf.util.Content content)
Updates a content of the current Asset |
boolean |
writeContent(java.lang.String content)
Updates a content of a current Asset |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Asset(Sandbox sandbox, AssetInfo asset)
Method Detail |
---|
public java.lang.String getCreator()
public java.util.Date getCreatedDate()
public long getFileSize()
public java.lang.String getCreatedDateAsISO8601()
public java.lang.String getModifier()
public java.util.Date getModifiedDate()
public java.lang.String getModifiedDateAsISO8601()
public Asset rename(java.lang.String newName)
newName
- public Asset move(java.lang.String newPath)
newPath
- public java.lang.String getName()
public java.lang.String getPath()
public boolean isFile()
public boolean isFolder()
public boolean isDeleted()
public boolean isLocked()
public java.lang.String lockOwner()
public int getVersion()
public java.util.Map getProperties()
public void save()
properties
- public void setProperties(java.lang.Object nativeProperties) throws org.json.JSONException
properties
-
org.json.JSONException
public boolean writeContent(java.lang.String content)
content
- String
value which represents new textual content
true
if a content has been set without errorspublic boolean writeContent(org.springframework.extensions.surf.util.Content content)
content
- a Content
value which represents new content
true
if a content has been set without errorspublic java.lang.String getContent() throws org.alfresco.service.cmr.repository.ContentIOException, java.io.IOException
org.alfresco.service.cmr.repository.ContentIOException
java.io.IOException
public void submit(java.lang.String submitLabel, java.lang.String submitComment)
submitLabel
- submitComment
- public void deleteAsset()
public void revert()
public Asset[] getChildren()
public void createFile(java.lang.String name, java.lang.String stringContent)
name
- the name of the filestringContent
- the content of the file. Can be null.public void createFolder(java.lang.String name)
name
- the name of the new folderpublic Sandbox getSandbox()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |