com.tle.common.scripting.types
Interface ItemScriptType
Declaration: public interface ItemScriptType extends java.io.Serializable
All Superinterfaces: java.io.Serializable

 

Available as 'currentItem' in scripts, but also available from results of calls to methods on 'items' and within search results return by 'utils.search(...)'.

 

 

Fields Summary
static java.lang.String CURRENT_ITEM
    
The variable name of the item being edited (if any)

 

 

Methods Summary
abstract void addSharedOwner(java.lang.String userUniqueId)
    
Can only be used on the current item, and depending on the script context it may still not be saved.
abstract CollectionScriptType getCollection()
    
abstract java.lang.String getDescription()
    
abstract java.lang.String getItemStatus()
    
Get the status of the item.
abstract java.lang.String getName()
    
abstract java.lang.String getOwner()
    
abstract java.lang.String getThumbnail()
    
abstract java.lang.String getUuid()
    
abstract int getVersion()
    
abstract XmlScriptType getXml()
    
There is generally an 'xml' object available for the current item's xml, but you can use this for getting xml from OTHER items.
abstract java.util.List<java.lang.String> listSharedOwners()
    
abstract boolean removeSharedOwner(java.lang.String userUniqueId)
    
Can only be used on the current item, and depending on the script context it may still not be saved.
abstract void setOwner(java.lang.String userUniqueId)
    
Can only be used on the currentItem, and depending on the script context it may still not be saved.
abstract void setThumbnail(java.lang.String thumbnail)
    
Sets the thumbnail to show in gallery view and search results.

 

 

 

 

CURRENT_ITEM

 

public static final java.lang.String CURRENT_ITEM

 

The variable name of the item being edited (if any)

 

See also: Constants

 

 

 

 

getUuid

 

public abstract java.lang.String getUuid( )

 

Returns:
The system generated UUID of the item

 

 

 

getVersion

 

public abstract int getVersion( )

 

Returns:
The version number of the item

 

 

 

getName

 

public abstract java.lang.String getName( )

 

Returns:
The name of the item in the current user's language (if language pack available).

 

 

 

getDescription

 

public abstract java.lang.String getDescription( )

 

Returns:
The description of the item in the current user's language (if language pack available).

 

 

 

getXml

 

public abstract XmlScriptType getXml( )

 

There is generally an 'xml' object available for the current item's xml, but you can use this for getting xml from OTHER items. Note that this is READ-ONLY, any changes you make will not be persisted.

 

Returns:
The XML of the item as a PropBagScriptType object

 

 

 

getItemStatus

 

public abstract java.lang.String getItemStatus( )

 

Get the status of the item. One of: DRAFT, LIVE, REJECTED, MODERATING, ARCHIVED, SUSPENDED, DELETED, REVIEW, PERSONAL

 

Returns:
The status of the item.

 

 

 

getOwner

 

public abstract java.lang.String getOwner( )

 

Returns:
The unique ID of the owner. This may not be initialised in a wizard context as the item does not yet have an owner.

 

 

 

setOwner

 

public abstract void setOwner( java.lang.String userUniqueId)

 

Can only be used on the currentItem, and depending on the script context it may still not be saved.

 

Parameters:
userUniqueId-
The unique ID of the new owner.

 

 

 

addSharedOwner

 

public abstract void addSharedOwner( java.lang.String userUniqueId)

 

Can only be used on the current item, and depending on the script context it may still not be saved.

 

Parameters:
userUniqueId-
The unique ID of the shared owner to add.

 

 

 

removeSharedOwner

 

public abstract boolean removeSharedOwner( java.lang.String userUniqueId)

 

Can only be used on the current item, and depending on the script context it may still not be saved.

 

Parameters:
userUniqueId-
The unique ID of the shared owner to remove.

 

 

 

listSharedOwners

 

public abstract java.util.List<java.lang.String> listSharedOwners( )

 

Returns:
A list of the unique IDs of the current shared owners.

 

 

 

getCollection

 

public abstract CollectionScriptType getCollection( )

 

Returns:
The collection that this item belongs to

 

 

 

setThumbnail

 

public abstract void setThumbnail( java.lang.String thumbnail)

 

Sets the thumbnail to show in gallery view and search results.

 

Parameters:
thumbnail-
Either "default", "none" or "custom:[uuid]" where [uuid] is the UUID of an attachment.

 

 

 

getThumbnail

 

public abstract java.lang.String getThumbnail( )

 

Returns:
The thumbnail to show in gallery view and search results.