com.webmethods.portal.bizPolicy.biz.meta
Interface IBasicPolicy

All Superinterfaces:
IViewablePolicy
All Known Subinterfaces:
IContainerPolicy

public interface IBasicPolicy
extends IViewablePolicy

Policy used to manipulate (create, move, delete, etc.) basic metadata service things.

Policy commands are always invoked with a IContext object. The IContext object contains information about the user on whose behalf the command is invoked, as well as access, event, and workflow states. These states, which can be toggled on and off, are known as traits, and are encapsulated by the ITraits object. By default, all policy commands will check access, fire events, and initiate workflow as appropriate for the command.


Method Summary
 void addNote(IContext context, IThingID itemId, String note)
          Adds a comment about the specified thing.
 List addToTopics(IContext context, IThingID thingID, IThingIDList topicIDList)
          Adds the specified thing as a reference to each of the specified list of containers.
 boolean canUser(IContext context, IURI itemID, String verb, Object param)
          Can user perform a requested verb on the item.
 IThingID cloneRemote(IContext context, IURI destContainerUri, IURI srcItemUri, Map maps)
          Copies the specified item from a remote metadata datasource into the specified container of a local metadata datasource.
 void copyToClipboard(IContext context, IURI resourceURI, IURI containerURI, boolean isReference)
          'Copies' the specified item from the specified container into the specified context's clipboard.
 void cutToClipboard(IContext context, IURI resourceURI, IURI containerURI, boolean isReference)
          'Cuts' the specified item from the specified container into the specified context's clipboard.
 void delete(IContext context, IURI uri)
          Archives the specified thing, and schedules it for deletion.
 void deleteReference(IContext context, IURI containerID, IURI uri)
          Removes the specified reference from the specified container.
 void destroy(IContext context, IURI uri)
          Permanently and immediately deletes the specified thing.
 IContentStore getContent(IContext context, IURI itemID, String mimeType)
          Get's the content of the specified thing.
 IListView listContainers(IContext context, IThingID itemId)
          Lists the containers that reference the specified thing.
 IListView listNotes(IContext context, IThingID itemId)
          Lists the comments created about the specified thing.
 void moveThing(IContext context, IThingID thingID, IThingID parentID)
          Moves the specified thing into the specified container.
 void moveThing(IContext context, IThingID thingID, IThingID parentID, String newName)
          Moves the specified thing into the specified container.
 void pasteFromClipboard(IContext context, IURI resourceURI)
          'Pastes' the specified item from the specified context's clipboard into the specified container.
 void removeNote(IContext context, IThingID itemId, int noteID)
          Removes the specified comment about the specified thing.
 void setOwner(IContext context, IThingID thingID, IThingID ownerID)
          Sets the owner of the specified thing.
 void updateProperties(IContext context, IURI uri, Map properties)
          Updates the specified properties of the specified thing.
 
Methods inherited from interface com.webmethods.portal.bizPolicy.biz.view.IViewablePolicy
getIcon, getPagingCookie, getPagingCookie, pageBackward, pageForeward, setPagingCookie, view
 

Method Detail

listContainers

IListView listContainers(IContext context,
                         IThingID itemId)
                         throws BizException
Lists the containers that reference the specified thing.

Parameters:
context - Command context (user state information).
itemId - Item for which to list.
Returns:
List of IViews representing metadata topics or folders which contain references to the specified thing.
Throws:
BizException - if command fails because access was denied or a datasource error occured.

listNotes

IListView listNotes(IContext context,
                    IThingID itemId)
                    throws BizException
Lists the comments created about the specified thing.

Parameters:
context - Command context (user state information).
itemId - Item for which to list.
Returns:
List of IViews representing comments which have been created about the specified thing.
Throws:
BizException - if command fails because access was denied or a datasource error occured.

addNote

void addNote(IContext context,
             IThingID itemId,
             String note)
             throws BizException
Adds a comment about the specified thing.

Parameters:
context - Command context (user state information).
itemId - Item for which to add.
note - Comment text.
Throws:
BizException - if command fails because access was denied or a datasource error occured.

removeNote

void removeNote(IContext context,
                IThingID itemId,
                int noteID)
                throws BizException
Removes the specified comment about the specified thing.

Parameters:
context - Command context (user state information).
itemId - Item for which to remove.
noteID - Id of note to remove.
Throws:
BizException - if command fails because access was denied or a datasource error occured.
See Also:
INote#getNoteID

addToTopics

List addToTopics(IContext context,
                 IThingID thingID,
                 IThingIDList topicIDList)
                 throws BizException
Adds the specified thing as a reference to each of the specified list of containers.

Parameters:
context - Command context (user state information).
thingID - Item to reference.
topicIDList - Containers to which to add the reference.
Returns:
List of IThingIDs identifing the containers to which the reference was actually added.
Throws:
BizException - if command fails because access was denied or a datasource error occured.

moveThing

void moveThing(IContext context,
               IThingID thingID,
               IThingID parentID)
               throws BizException
Moves the specified thing into the specified container.

Parameters:
context - Command context (user state information).
thingID - Item to move.
parentID - Container into which to move.
Throws:
BizException - if command fails because access was denied or a datasource error occured.

moveThing

void moveThing(IContext context,
               IThingID thingID,
               IThingID parentID,
               String newName)
               throws BizException
Moves the specified thing into the specified container.

Parameters:
context - Command context (user state information).
thingID - Item to move.
parentID - Container into which to move.
newName - new name for the moved thing
Throws:
BizException - if command fails because access was denied or a datasource error occured.

setOwner

void setOwner(IContext context,
              IThingID thingID,
              IThingID ownerID)
              throws BizException
Sets the owner of the specified thing.

Parameters:
context - Command context (user state information).
thingID - Item the owner of which to set.
ownerID - New owner.
Throws:
BizException - if command fails because access was denied or a datasource error occured.

updateProperties

void updateProperties(IContext context,
                      IURI uri,
                      Map properties)
                      throws BizException
Updates the specified properties of the specified thing.

Parameters:
context - Command context (user state information).
uri - Item to update.
properties - Properties to update.
Throws:
BizException - if command fails because access was denied or a datasource error occured.

delete

void delete(IContext context,
            IURI uri)
            throws BizException
Archives the specified thing, and schedules it for deletion. If the thing is a container, all its children will be deleted when the thing is deleted.

Parameters:
context - Command context (user state information).
uri - Item to delete.
Throws:
BizException - if command fails because access was denied or a datasource error occured.

destroy

void destroy(IContext context,
             IURI uri)
             throws BizException
Permanently and immediately deletes the specified thing. If the thing is a container, all its children will also be deleted. This method might not clean up all resources associated with the deleted things properly; in most cases one should use IBasicPolicy.delete(com.webmethods.portal.bizPolicy.IContext, com.webmethods.portal.system.IURI) instead.

Parameters:
context - Command context (user state information).
uri - Item to delete.
Throws:
BizException - if command fails because access was denied or a datasource error occured.

deleteReference

void deleteReference(IContext context,
                     IURI containerID,
                     IURI uri)
                     throws BizException
Removes the specified reference from the specified container.

Parameters:
context - Command context (user state information).
containerID - Container from which to remove the reference.
uri - Item the reference to which to remove.
Throws:
BizException - if command fails because access was denied or a datasource error occured.

cutToClipboard

void cutToClipboard(IContext context,
                    IURI resourceURI,
                    IURI containerURI,
                    boolean isReference)
                    throws BizException
'Cuts' the specified item from the specified container into the specified context's clipboard. The item will not be removed from the current container until it has been pasted into a new container.

Parameters:
context - Command context (user state information).
resourceURI - Item to cut.
containerURI - Container from which to cut. If null, the item's primary container is used.
isReference - False if the container is the item's primary container.
Throws:
BizException - if command fails because access was denied or a datasource error occured.

copyToClipboard

void copyToClipboard(IContext context,
                     IURI resourceURI,
                     IURI containerURI,
                     boolean isReference)
                     throws BizException
'Copies' the specified item from the specified container into the specified context's clipboard.

Parameters:
context - Command context (user state information).
resourceURI - Item to copy.
containerURI - Container from which to copy. If null, the item's primary container is used.
isReference - False if the container is the item's primary container.
Throws:
BizException - if command fails because access was denied or a datasource error occured.

pasteFromClipboard

void pasteFromClipboard(IContext context,
                        IURI resourceURI)
                        throws BizException
'Pastes' the specified item from the specified context's clipboard into the specified container. If the item on the clipboard has been cut, the item is moved into the specified container. If the item on the clipboard has been copied, or has been pasted at least once, the item is copied into the specified container.

Parameters:
context - Command context (user state information).
resourceURI - Container into which to paste.
Throws:
BizException - if command fails because access was denied or a datasource error occured.

getContent

IContentStore getContent(IContext context,
                         IURI itemID,
                         String mimeType)
                         throws BizException
Get's the content of the specified thing.

Parameters:
context - Command context (user state information).
itemID - Item whose content to get.
mimeType - Preferred content type to get. Pass null for the default type.
Returns:
Content of the specified thing, or null if the thing has no content or no content of the specified type.
Throws:
BizException - if command fails because access was denied or a datasource error occured.

cloneRemote

IThingID cloneRemote(IContext context,
                     IURI destContainerUri,
                     IURI srcItemUri,
                     Map maps)
                     throws BizException
Copies the specified item from a remote metadata datasource into the specified container of a local metadata datasource.

Parameters:
context - Command context (user state information).
destContainerUri - Local container into which to copy the remote item.
srcItemUri - Remote item to copy.
maps - Custom properties for the newly copied item. May be null.
Returns:
Id of the newly created item.
Throws:
BizException - if command fails because access was denied or a datasource error occured.

canUser

boolean canUser(IContext context,
                IURI itemID,
                String verb,
                Object param)
                throws BizException
Can user perform a requested verb on the item. Known verbs are: addChild, updateProperties, delete

Parameters:
context - Command context
verb - specified verb name
param - verb parameter
Returns:
boolean
Throws:
BizException