addFolderEntry

Adds an entry to a folder. (V1—V1.0.3)

Syntax

public long addFolderEntry( long folderId, String definitionId, String inputDataAsXML, String attachedFileName | null );

Description

The addFolderEntry operation adds an entry to a folder.

Parameters and Return Value

folderId

The binder identifier of the folder that is to contain the new entry.

definitionId

The 32-character, hexadecimal identifier that maps to the type of entry to be created (for example, some default entry types are topic, file, blog, wiki, and calendar).

The easiest way to work with definition identifiers for entries is to specify null for this value. When you specify null, Teaming automatically applies the definition identifier for the default entry type of the folder in which you are creating a new entry. For example, by default, you want to create an entry in a blog folder. If you pass null as the definition identifier, Teaming automatically applies the definition identifier for a blog entry.

As another option, you can use the getDefinitionConfigAsXML operation to get information about all definitions. Then, you can parse the XML string for the definition identifier of the type of entry you want.

inputDataAsXML

A string of XML containing the values needed to create an entry of your desired type.

Use the Teaming UI to create a complete entry of the type you want this Web services operation to create, note the entry identifier, and then use the getFolderEntryAsXML operation to return XML for the entry. Then, use the returned XML as a template for this parameter.

attachedFileName

The name of the file you wish to attach to the new entry. This is an optional parameter. The file must be located in the directory in which the client code executes.

return_value

The entry identifier for the newly created entry.

Examples

call.setOperationName(new QName(“addFolderEntry”)); Object result = call.invoke(new Object[] {new Long(21), new String(“402883b90cc53079010cc539bf260002“), s, filename}, filename);

This code creates a new entry in the folder whose binder identifier is 21; the specified entry-definition identifier maps to a discussion topic. The variable s contains XML elements needed by Teaming to create the entry. The new entry includes the attached file whose filename is specified by the value of the filename variable.

call.setOperationName(new QName(“addFolderEntry”)); Object result = call.invoke(new Object[] {new Long(21), new String(“402883b90cc53079010cc539bf260002“), s, null});

This code produces the same effect as the last example, except that it does not attach a file.

See Also