com.fatwire.agent
Interface IItem


public interface IItem

Represents an individual asset or folder in a repository.

This is actually a smallest individual part in a repository. For example, for filesystem an item could be either a directory or a file.

An item can have primary contents (retrieved via getInputStream() call) and metadata. Metadata consists of; 1. Dublin Core properties: name, title, createtion/modification dates, MIME type, author, keywords, summary, description 2. Binary data: frames, proxies, tokens 3. Custom properties

Custom properties conform a user-defined schema which consists of asset types with various fields - descriptors. Thus car.jpg and apple.png file system items can be of Image asset type with Width and Height descriptors.

Each item has a unique identifier inside a repository called item id. If an item is versioned than it has different version ids assigned, otherwise item id and version id are equal.

Items are organized in a tree-like hierarchy maintained by folders. Each item also has a name which is unique inside the folder where it resides. Each repository has a single top folder which is a root of the tree hierarchy.

See Also:
IRepository

Method Summary
 void addAssetTypeUID(java.lang.String uid)
          Adds asset type unique identifier to this item.
 java.util.List<java.lang.String> getAssetTypeUIDs()
          Retrieves the list of all asset types supported by this item.
 java.lang.String getAuthor()
          Gets the author of this item.
 java.util.Date getDateCreated()
          Gets the date when this item was created.
 java.util.Date getDateModified()
          Gets the date when this item was modified.
 java.lang.String getDescription()
          Gets item's description.
 java.lang.String getFilename()
          Retrieves file name associated with this item if any.
 java.io.InputStream getInputStream()
          Retrieves the input stream to the primary contents of this item.
 java.util.List<ItemFrame> getItemFrames()
          Gets the list of item frames.
 java.lang.String getItemID()
          Gets item identifier.
 ItemProxy getItemProxy(ProxyType type)
          Gets the requested item proxy.
 ItemTokens getItemTokens()
          Gets item tokens.
 java.lang.String getKeywords()
          Gets item's keywords.
 long getLength()
          Returns length in bytes of item's primary contents.
 java.lang.String getMajortype()
          Gets the major component of item's MIME type, e.g.
 java.lang.String getMinortype()
          Gets the minor component of item's MIME type, e.g.
 java.lang.String getName()
          Get item name.
 IItem getParent()
          Gets parent folder item.
 java.lang.String getParentID()
          Parent folder version identifier.
 java.util.List<IItem> getParents()
          Retrieves the list of parent folders starting from the root.
 Path getPath()
          Gets item path.
 Properties getProperties()
          Gets all properties of this item.
 java.lang.String getSummary()
          Gets item's summary.
 java.lang.String getTitle()
          Gets item's title.
 java.lang.String getVersionID()
          Gets item version identifier.
 java.lang.String getVersionNumber()
          Gets item version number.
 boolean isFolder()
          Returns 'true' if this item is a container (folder) or an asset.
 java.util.List<IItem> search(Query query)
          Performs a search within this item for the specified depth filtering by keywords, item types, and limiting the properties returned.
 void setAuthor(java.lang.String author)
          Sets the author of this item.
 void setDescription(java.lang.String description)
          Sets item's description.
 void setFilename(java.lang.String fileName)
          Sets file name associated with this item.
 void setItemFrames(java.util.List<ItemFrame> frames)
          Sets item frames.
 void setItemProxy(ItemProxy proxy, ProxyType type)
          Sets item proxy.
 void setItemTokens(ItemTokens tokens)
          Sets item tokens.
 void setKeywords(java.lang.String keywords)
          Sets item's keywords.
 void setSummary(java.lang.String summary)
          Sets item's summary.
 void setTitle(java.lang.String title)
          Sets item's title.
 

Method Detail

getItemID

java.lang.String getItemID()
Gets item identifier. It must be unique within a repository.

Returns:
item identifier.

getVersionID

java.lang.String getVersionID()
Gets item version identifier. It must be unique within a repository. If item is not versioned then version id must be equal to item id.

Returns:
item version identifier.

getVersionNumber

java.lang.String getVersionNumber()
Gets item version number. It must be unique within the same item (i.e. within all items with the same item id).

Returns:
item version number.

getParentID

java.lang.String getParentID()
Parent folder version identifier.

Returns:
parent folder version identifier

getName

java.lang.String getName()
Get item name. It is unique within the same folder.

Returns:
item name.

getPath

Path getPath()
Gets item path. It consists of names of all parent folders starting from the root.

Returns:
item path.

isFolder

boolean isFolder()
Returns 'true' if this item is a container (folder) or an asset.

Returns:
'true' if is folder or 'false' otherwise.

getLength

long getLength()
Returns length in bytes of item's primary contents. It should return 0 for folders and items without contents.

Returns:
item contents length in bytes.

getParent

IItem getParent()
                throws AgentException
Gets parent folder item.

Returns:
parent item.
Throws:
AgentException - if an error happens during the parent item fetching process.

getParents

java.util.List<IItem> getParents()
                                 throws AgentException
Retrieves the list of parent folders starting from the root.

Returns:
the list of parent folders.
Throws:
AgentException - if an error happens during the parent items fetching process.

search

java.util.List<IItem> search(Query query)
                             throws AgentException
Performs a search within this item for the specified depth filtering by keywords, item types, and limiting the properties returned. Called by the replication facility.

Parameters:
query - query to run.
Returns:
vector of matched items. If no items matched the vector is empty.
Throws:
AgentException - if an error occurs which prevents items to be retrieved

getInputStream

java.io.InputStream getInputStream()
                                   throws NotFoundException,
                                          FeatureNotSupportedException,
                                          AgentException
Retrieves the input stream to the primary contents of this item.

Returns:
item contents input stream.
Throws:
NotFoundException - if this item doesn't exist any more.
FeatureNotSupportedException - if this item doesn't have contents.
AgentException - if an error occurs.

getDateCreated

java.util.Date getDateCreated()
Gets the date when this item was created.

Returns:
creation date.

getDateModified

java.util.Date getDateModified()
Gets the date when this item was modified.

Returns:
modification date.

getMajortype

java.lang.String getMajortype()
Gets the major component of item's MIME type, e.g. for 'image/jpeg' it returns 'image'.

Returns:
major type.

getMinortype

java.lang.String getMinortype()
Gets the minor component of item's MIME type, e.g. for 'image/jpeg' it returns 'jpeg'.

Returns:
minor type.

getTitle

java.lang.String getTitle()
Gets item's title.

Returns:
item's title.

setTitle

void setTitle(java.lang.String title)
Sets item's title.

Parameters:
title - title to set.

getAuthor

java.lang.String getAuthor()
Gets the author of this item.

Returns:
item's author.

setAuthor

void setAuthor(java.lang.String author)
Sets the author of this item.

Parameters:
author - author to set.

getKeywords

java.lang.String getKeywords()
Gets item's keywords.

Returns:
item's keywords.

setKeywords

void setKeywords(java.lang.String keywords)
Sets item's keywords.

Parameters:
keywords - keywords to set.

getSummary

java.lang.String getSummary()
Gets item's summary.

Returns:
item's summary.

setSummary

void setSummary(java.lang.String summary)
Sets item's summary.

Parameters:
summary - summary to set.

getDescription

java.lang.String getDescription()
Gets item's description.

Returns:
item's description.

setDescription

void setDescription(java.lang.String description)
Sets item's description.

Parameters:
description - description to set.

getAssetTypeUIDs

java.util.List<java.lang.String> getAssetTypeUIDs()
Retrieves the list of all asset types supported by this item. See description of AddAssetTypeUID() method for more details.

Returns:
the list of asset types.

addAssetTypeUID

void addAssetTypeUID(java.lang.String uid)
Adds asset type unique identifier to this item.

Parameters:
uid - asset type to add.

getProperties

Properties getProperties()
Gets all properties of this item.

Returns:
all item properties.

getItemTokens

ItemTokens getItemTokens()
Gets item tokens.

Returns:
item tokens if available of null if not.

setItemTokens

void setItemTokens(ItemTokens tokens)
Sets item tokens.

Parameters:
tokens - tokens to set.

getItemFrames

java.util.List<ItemFrame> getItemFrames()
Gets the list of item frames.

Returns:
item frames if available of an empty list if not.

setItemFrames

void setItemFrames(java.util.List<ItemFrame> frames)
Sets item frames.

Parameters:
frames - frames to set.

getItemProxy

ItemProxy getItemProxy(ProxyType type)
Gets the requested item proxy.

Parameters:
type - type of the proxy to retrieve.
Returns:
item proxy if available or null if not.

setItemProxy

void setItemProxy(ItemProxy proxy,
                  ProxyType type)
Sets item proxy.

Parameters:
proxy - proxy to set.
type - proxy type.

getFilename

java.lang.String getFilename()
Retrieves file name associated with this item if any.

Returns:
file name or null.

setFilename

void setFilename(java.lang.String fileName)
Sets file name associated with this item.

Parameters:
fileName - file name.