Interface IBasicPolicy
- All Superinterfaces:
IBizPolicy
,IComponent
,IInitializable
,ISystemHandler
,IViewablePolicy
- All Known Subinterfaces:
IContainerPolicy
,IPortletPolicy
,ITaskBizPolicy
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
Modifier and TypeMethodDescriptionvoid
Adds a comment about the specified thing.addToTopics
(IContext context, IThingID thingID, IThingIDList topicIDList) Adds the specified thing as a reference to each of the specified list of containers.boolean
Can user perform a requested verb on the item.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
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
Permanently and immediately deletes the specified thing.getContent
(IContext context, IURI itemID, String mimeType) Get's the content of the specified thing.listContainers
(IContext context, IThingID itemId) Lists the containers that reference the specified thing.Lists the comments created about the specified thing.void
Moves the specified thing into the specified container.void
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
Sets the owner of the specified thing.void
Updates the specified properties of the specified thing.Methods inherited from interface com.webmethods.portal.system.IComponent
getComponentData, getComponentName, getComponentProvider, getURI, isInitialized, setComponentData, setComponentProvider
Methods inherited from interface com.webmethods.portal.system.init.IInitializable
init, shutdown
Methods inherited from interface com.webmethods.portal.bizPolicy.biz.view.IViewablePolicy
getIcon, getPagingCookie, getPagingCookie, pageBackward, pageForeward, setPagingCookie, view
-
Method Details
-
listContainers
Lists the containers that reference the specified thing.- Parameters:
context
- Command context (user state information).itemId
- Item for which to list.- Returns:
- List of
IView
s 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
Lists the comments created about the specified thing.- Parameters:
context
- Command context (user state information).itemId
- Item for which to list.- Returns:
- List of
IView
s 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
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
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:
-
addToTopics
List<IThingID> 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
IThingID
s 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
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
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<String, ? extends Object> properties) throws BizExceptionUpdates 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
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
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 usedelete(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
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
'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
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<String, Object> maps) throws BizExceptionCopies 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
Can user perform a requested verb on the item. Known verbs are: addChild, updateProperties, delete- Parameters:
context
- Command contextverb
- specified verb nameparam
- verb parameter- Returns:
- boolean
- Throws:
BizException
-