Collaboration API Documentation

com.filenet.bso.api.collaboration.commands
Class DeleteCommand

java.lang.Object
  |
  +--com.filenet.bso.api.collaboration.commands.BaseCommand
        |
        +--com.filenet.bso.api.collaboration.commands.DeleteCommand
All Implemented Interfaces:
Command

public class DeleteCommand
extends BaseCommand

This command class deletes child objects in a teamspace, including all content and teamspace metadata except for the teamspace itself and the top-level containers of a teamspace.

The command must be supplied with two parameters, a teamspace object and a Map object. The Map object holds the data used to find and delete objects, a GUID, and an object type. The data is set into the map object using the GUID as the key and the Integer object type value as the value. If deleting content folders or documents, use the standard Content Engine data types, TYPE_FOLDER for folder and TYPE_VERSIONSERIES for documents. If deleting teamspace metadata, use the Collaboration object type for the object.

Caution: If a teamspace metadata object is deleted and the standard Content Engine object type was used instead of the actual Collaboration object type, the delete operation will not be performed by the responsible container or teamspace class. This could result in an invalid state in the teamspace.

A Map object may be returned from this command. If the return value is not null, exception(s) occurred. Each exception is stored in the return Map value, with the key representing the GUID of the object that could not be deleted, along with the exception message value.

Example:
    Teamspace ts = CollaborationFactory.getTeamspace(store, tsid, USERNAME, null);

    Command delete = CollaborationFactory.getCommand(Command.DELETE_COMMAND_KEY);

    Map map = new HashMap();

    map.put(deleteGUID, Integer.toString(deleteType));

    delete.setParameterData(DeleteCommand.TEAMSPACE_PARAMETER_KEY, ts);
    delete.setParameterData(DeleteCommand.DELETE_MAP_PARAMETER_KEY, map);

    Map exceptionMap = (Map) delete.execute();

    if(exceptionMap != null)
    {
        // exceptions thrown during command execution, some delete operations failed, others may have succeeded
    }
 


Field Summary
static java.lang.String DELETE_MAP_PARAMETER_KEY
          Key string used to store and retrieve parameter data in command object.
static java.lang.String TEAMSPACE_PARAMETER_KEY
          Key string used to store and retrieve parameter data in command object.
 
Fields inherited from interface com.filenet.bso.api.collaboration.Command
DELETE_COMMAND_KEY, POSTINGREPLY_COMMAND_KEY
 
Constructor Summary
DeleteCommand()
           
 
Method Summary
 java.lang.Object execute()
          Performs the operations specified by a command.
 
Methods inherited from class com.filenet.bso.api.collaboration.commands.BaseCommand
getCommandParameter, getCommandParameterIfAny, setParameterData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEAMSPACE_PARAMETER_KEY

public static final java.lang.String TEAMSPACE_PARAMETER_KEY
Key string used to store and retrieve parameter data in command object. This key used for teamspace object, value of "teamspace".

DELETE_MAP_PARAMETER_KEY

public static final java.lang.String DELETE_MAP_PARAMETER_KEY
Key string used to store and retrieve parameter data in command object. This key used for Map object holding GUID:TYPE info, value of "delete-map".
Constructor Detail

DeleteCommand

public DeleteCommand()
Method Detail

execute

public java.lang.Object execute()
                         throws java.lang.Exception
Performs the operations specified by a command.

Returns:
A Map object that holds GUID:ExceptionString pairs, null if no exceptions thrown.

Collaboration API Documentation

Copyright © 2002 - 2004 FileNet Corporation. All rights reserved.