delete(objects, options)
Use this method to delete objects from the content store.
This method returns the number of objects deleted from the content store. An error is not returned if no objects are selected.
When you delete a shortcut, the object it references is not deleted.
If optimistic concurrency control is used, the bibus » baseClass » version property is compared to the version of the affected objects in the content store. For more information, see Concurrency Control.
Use of this method requires:
write permission for the object and its parent object
traverse permission for all ancestors of the object
traverse permission for the object if the object has child objects and the bibus » deleteOptions » recursive property is
true
If the bibus » deleteOptions » force property is true
and the user has setPolicy
permission for the object, write and traverse permissions are not required for the object.
Signatures
- Java and Apache Axis
public int delete( com.cognos.developer.schemas.bibus._3.BaseClass[] objects, com.cognos.developer.schemas.bibus._3.DeleteOptions options )
- C# .NET
public int delete(baseClass[] objects, deleteOptions options)
- Example: Using the delete(objects, options) Method with the Content Manager Service in Java
The following Java code snippet demonstrates how to use the content » delete(objects, options) method with the Content Manager service.
To see this code in context, view the Java sample HandlersCS/CSHandlers.java. For more information about the samples, see Code samples and language-specific coding practices.
DeleteOptions del = new DeleteOptions(); del.setForce(true); int i = connection.getCMService().delete(new BaseClass[] { bc }, del);
- Example: Using the delete(objects, options) Method with the Content Manager Service in C# .NET
The following C# code snippet demonstrates how to use the content » delete(objects, options) method with the Content Manager service.
To see this code in context, view the C# sample PrintReport/PrintReport.cs. For more information about the samples, see Code samples and language-specific coding practices.
int result = connection.CBICMS.delete(bcaDeletePrinter, delete_options); if (0 >= result) { returnMessage = "Error occured while deleting the printer."; return false; }
References
- Part of the following method sets:
- Implemented by the following services:
The services that implement the delete method, along with the associated SOAP actions, are listed in the following table.
Table 1. Services implementing the delete method. Service
SOAP Action
contentManagerService
http://www.ibm.com/xmlns/prod/cognos/contentManagerService/201404/
Input parameters
Use the following parameters when calling this method.
- objects
Specifies the objects to be deleted from the content store.
The bibus » baseClass » searchPath property of each object is used to select the object.
By default, deleting an object that is referenced by another object clears the reference. For information about changing the default behavior, see the bibus » deleteOptions » faultIfObjectReferenced property.
This argument
- options
Specifies the options for the content » delete(objects, options) method.
This argument
is of type bibus » deleteOptions
is encoded as type
tns:deleteOptions
Return values
This method returns the following values.
- result
Returns the number of objects deleted from the content store.
This result
is of type
int
is encoded as type
xs:int