add(parentPath, objects, options)
Use this method to add objects to the content store.
If you want to add a bibus » baseReport object to the content store, use report » add(parentPath, object, options), which sets the values for some properties to reflect the corresponding values in the report specification.
This method returns properties for each added object.
The bibus » uiClass » viewed property on new objects is set to false for security contexts other than the current security context.
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:
Signatures
- Java and Apache Axis
public com.cognos.developer.schemas.bibus._3.BaseClass[] add( com.cognos.developer.schemas.bibus._3.SearchPathSingleObject parentPath, com.cognos.developer.schemas.bibus._3.BaseClass[] objects, com.cognos.developer.schemas.bibus._3.AddOptions options)
- C# .NET
public baseClass[] add(searchPathSingleObject parentPath, baseClass[] objects, addOptions options)
- Example: Using the add(parentPath, objects, options) Method with the Content Manager Service in Java
The following Java code snippet demonstrates how to use the content » add(parentPath, 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.
AddOptions ao = new AddOptions(); ao.setUpdateAction(UpdateActionEnum.replace); return connection.getCMService().add( new SearchPathSingleObject(path), new BaseClass[] { bc }, ao)[0];
- Example: Using the add(parentPath, objects, options) Method with the Content Manager Service in C# .NET
The following C# code snippet demonstrates how to use the content » add(parentPath, 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.
bcNewPrinter = connection.CBICMS.add(printerParentPath, bcAddPrinter, add_options);
References
- Part of the following method sets:
- Implemented by the following services:
The services that implement the add method, along with the associated SOAP actions, are listed in the following table.
Table 1. Services implementing the add method. Service
SOAP Action
contentManagerService
http://www.ibm.com/xmlns/prod/cognos/contentManagerService/201404/
Input parameters
Use the following parameters when calling this method.
- parentPath
Specifies a search path that identifies a single object in the content store. This single object path identifies the parent location for the object or group of objects to add.
This parameter can be overridden on a per-object basis. This can be done by specifying the searchPath for the objects you are adding. If specifying the target location in this manner, you can set the value of this parameter to NULL.
For more information about specifying a search path, see Search path syntax.
This argument
is of type bibus » searchPathSingleObject
is encoded as type
tns:searchPathSingleObject
- objects
Specifies the objects to add to the content store.
If you do not specify a value for the bibus » baseClass » policies property for a new object, the policies for the object are acquired from the parent of the object.
When you create an object, you do not have to specify a name. If you do not specify a name, Content Manager generates a name using a string that represents the current date and time, in a format that is a subset of the ISO 8601 format. For more information, see the description of the bibus » baseClass » name property.
If you specify the bibus » baseClass » searchPath property for an object, it is treated as the search path for the container of the new object. This overrides the value specified in parentPath.
If you specify a value for a read-only property of a new object, such as the bibus » baseClass » version property, it is ignored.
By default, if the object being added contains a reference to a non-existent object, a fault is generated and the object is not added. For information about changing the default behavior, see the bibus » addOptions » ignoreInvalidObjectReference property.
This argument
- options
Specifies preferences for the resolution of conflicts and the encoding of data.
This argument
is of type bibus » addOptions
is encoded as type
tns:addOptions
Return values
This method returns the following values.
- result
Returns information about the objects that were added. The information that is returned is determined by the value of the bibus » addOptions » returnProperties property.
This result