Creating an XML file
Occasionally, you need to create a Content Manager OnDemand XML file, and this section discusses the overall syntax and layout of the XML file. The XML syntax discussed in this section helps you understand XML to be able to construct the XML objects which are used by Content Manager OnDemand. For more detailed information on XML and specific XML syntax information, reference XML documentation.
Overall file structure
A Content Manager OnDemand XML file is a basic text file that can be created by the user.
- An XML identifier tag
- An OnDemand identifier tag
- One or more Content Manager OnDemand objects
- An OnDemand ending tag
- XML identifier tag
- The XML identifier tag specifies the version of XML that is used and the
encoding that is used. The standard XML identifier is:
<?xml version="1.0" encoding="UTF-8"?>
- OnDemand identifier tag
- The OnDemand identifier tag specifies the purpose for which the XML file is used. The
standard OnDemand identifier is:
<onDemand xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
Previous versions of Content Manager OnDemand included an
xsi:noNamespaceSchemaLocation
attribute on the OnDemand identifier tag to indicate the location of the Content Manager OnDemand schema file. The schema file is now located in the Content Manager OnDemand installation directory. Content Manager OnDemand no longer looks for the schema file location based on thexsi:noNamespaceSchemaLocation
attribute in the input XML file. If thexsi:noNamespaceSchemaLocation
attribute is present in the XML file, it is ignored. - Content Manager OnDemand objects
- See Objects and data model used in the Content Manager OnDemand XML file for the objects and data model used in the XML file.
- OnDemand ending tag
- The OnDemand ending tag indicates the end of the Content Manager OnDemand
XML file. The ending tag is:
</onDemand>
<?xml version="1.0" encoding="UTF-8"?>
<onDemand xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
... Content Manager OnDemand Objects ...
</onDemand>
Content Manager OnDemand objects
The basic building blocks for the XML file are referred to as objects.
- systemParameters
- user
- group
- printer
- storageSet
- applicationGroup
- application
- folder
- cabinet
- hold
- odfRecipient
- odfRecipientList
- odfReportId
- odfDistribution with odfReportBundles
- systemParameters
- user
- group
- printer
- storageSet
- applicationGroup
- application
- folder
- cabinet
- hold
- odfRecipient
- odfRecipientList
- odfReportId
- odfDistribution with odfReportBundles
Each object which is to be put into the XML file contains the following information:
- A
Start of Object
tag. - A list of object attributes.
- An optional list of child objects.
- An
End of Object
tag.
Start of Object
<
symbol. For example,
<user
starts a user object.Object attributes
<user name="SAMPLEUSER" phone="(212) 555-1212" timeOut="4" >
Indicates
a user with a name of SAMPLEUSER
, a phone number of (212)
555-1212
, and a timeout value of 4 minutes
. All of the
attributes that can be specified for each object as well as the possible values and
default values are shown in the XML data tables.- The capitalization of the object names is important and should be used exactly as shown in the data tables in Objects and data model used in the Content Manager OnDemand XML file.
- Unless you set Case Sensitivity as one of the system parameters, when you
add a user, Content Manager OnDemand converts lowercase
letters in the user ID to uppercase. You can type the user ID in uppercase,
lowercase, or mixed case letters. In the above example, whether you enter
the user ID as
SAMPLEUSER
,sampleuser
, orSampleUser
, Content Manager OnDemand automatically converts it toSAMPLEUSER
.
Child objects
SampleUser
user. <user name="SampleUser" phone="(212) 555-1212" timeOut="4" >
<permission user="APP1" adminAuthority="Yes" />
<permission user="APP2" adminAuthority="Yes" />
/
and the >
symbol.See XML objects in the Content Manager OnDemand XML file for detailed information about the types of child objects that each object can have and, in some cases, the maximum number of child objects that can be created.
Some of the child objects themselves can have children. These are defined in the same way as above. See the second example in the Examples section below.
End of object
end of object
tag. This is indicated by placing the name of the
object between </
and >
. For example,
</user>
indicates the end of the user object./>
at the end of the object definition. So the
following,
<group name="Sample" gid="1084000">
</group>
is
equivalent to: <group name="Sample" gid="1084000"/>
Examples
<?xml version="1.0" encoding="UTF-8"?>
<onDemand xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<user
name="SampleUser1" email="Sample@us.ibm.com" printer="Sample"
userType="User Admin"
createFoldersAuth="Yes">
<permission user="SampleUser2" adminAuthority="Yes" />
<permission user="SampleUser3" adminAuthority="No" />
<permission group="SampleGroup1"/>
</user>
<user
name="SampleUser2" password="xxxxxxx" timeOut="No Limit"
description="This is a description of Sample User Two">
</user>
<group
name="SampleGroup1"
description="A Sample Group Number One"
ownerUser="Admin">
<user name="SampleUser2"/>
<user name="SampleUser3"/>
</group>
</onDemand>
fieldInfo
child.
<?xml version="1.0" encoding="UTF-8"?>
<onDemand xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<folder name="FolderOne" searchType="Hit List">
<field name="cost" fieldType="Decimal" >
<fieldInfo user="SampleUser" sortOrder="2" greaterThan="Default" lessThan="Yes"/>
</field>
</folder>
</onDemand>
Creating Content Manager OnDemand XML files for update
- Only the fields which are intended to be updated need to be specified.
- Child objects might contain an additional attribute,
task
. Thetask
attribute indicates the task that is performed by the child object.
SampleUser
to timeout after 10
minutes, you
need to put the following XML code into an XML file.
<user name="SampleUser" timeOut="10"/>
XML code | Character |
---|---|
& | & |
' | ' |
" | “ |
< | < |
> | > |
...
<user
name="DBRYANTDEU"
acctInfo="Engraving & Printing"
newName
attribute. For
example, to change the name of a printer from Boston to New York, use the following
XML code during an update:
<printer name="Boston" newName="NewYork"/>
- add
- Indicates that the child object should be added to the parent object.
The default value for the task attribute is
add
. However, some child objects do not contain a task attribute. For those objects without a task attribute, the action taken for the object is the same action as the parent object. - update
- This indicates that the child object already exists and should be updated with the attributes provided.
- delete
- This indicates that the child object already exists and should be removed from the parent object.
The default value for the task attribute is "add". However, some child objects do not contain a task attribute. For those objects without a task attribute, the action taken for the object will be the same action as the parent object.
If an object that is updated requires a change to another object, that object must be included in the XML file before the object that references it.
Additional examples
SampleUser
to
the folder FolderOne
, the following code could be
used during an update: <folder name="FolderOne">
<permission user="SampleUser" adminAuthority="Yes" maxHits="No Limit" />
</folder>
To remove the admin authority permission from SampleUser
on
the folder FolderOne
, you need to update the permission
child. The following code is an example: <folder name="FolderOne">
<permission task="update" user="SampleUser" adminAuthority="No" />
</folder>
To remove the SampleUser
permission
from the folder, you need to delete the permission child. <folder name="FolderOne">
<permission task="delete" user="SampleUser"/>
</folder>
Creating Content Manager OnDemand XML files for delete and export
- The only attribute field which is examined is the name field.
- All child objects are ignored.
When you export or delete objects, the only information that is required is the name of the object(s). Other attributes might be present in the XML file, but they are ignored. Child objects cannot be deleted through the delete process, they can be deleted only during an update process by using the attribute task="delete".
When you specify an application for delete or export, you must also specify the name of the application group in which the application is contained.
<?xml version="1.0" encoding="UTF-8"?>
<onDemand xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<user name="SampleOne"/>
<user name="SampleTwo"/>
<user name="SampleThree"/>
</onDemand>
To
delete the printer, OldPrinter, and the folder, MyFolder, use the following XML
code:
<printer name="OldPrinter"/>
<folder name="MyFolder"/>
<printer name="_ALL"/>
arsxml export -h <host> -u <uid> -p <password> -i input.xml -o
allprinters.xml
Then
use the output from this command to feed the delete
command:arsxml delete -h <host> -u <uid> -p <password> -i allprinters.xml
When you specify an application for delete or export, the name of the application group in which it is contained must also be specified.
Application Index Parameter Object
The indexParm
child
object of the application object has a slightly different syntax than
all other objects. Due to the nature of the data associated with
the Index Parameters it is not appropriate to use an object attribute
to specify this information. Therefore, for this object (and only
this object), the data associated with the object is simply the character
data which appears between the <indexParm>
and
the </indexParm>
flags.
<application name="SampleApp" .... >
<indexParm>
*dummy index parameters
parm1=value;
parm2=value;
parm3=value;
</indexParm>
</application>