Taking closer look at xmlaccess request

Top element of xmlaccess script file is always <request>. The request element has type attribute that determines what type of request is it. Type attribute supports three values


  • export: when you set type equal to export that means you want to export full or part of the portal configuration. The child elements of request element would be used to indicate what all elements you wan to export. This request will not change any configuration on the portal where it is executed.

  • update: when you set type equal to update that means you want to update the configuration of the portal where your executing this request. Child elements of request element indicate the exact update that you want to make

  • export-orphaned-data:An export-orphaned-data request exports the complete portal configuration into XML, including orphaned data. It results in a response file. This type of request is used exclusively for removing orphaned data using SLCCheckerTool




//Export Request - Sample for exporting full portal configuration
<?xml version="1.0" encoding="UTF-8"?>
<request
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="PortalConfig_1.4.xsd"
type="export"
export-users="false">
<portal action="export"/>
</request>

//Export orphaned data request- Sample for exporting full portal including the orphaned data
<request
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="PortalConfig_1.4.xsd"
type="export-orphaned-data"
export-users="false">
<portal action="export"/>
</request>

//Import request - Sample for creating URL mapping
<request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="PortalConfig_1.4.xsd"
type="update"
create-oids="true">
<portal action="locate">
<content-node action="locate" uniquename="ibm.portal.SamplePage" objectid="SamplePage"/>
<url-mapping-context action="update" label="samples">
<additional-label>examples</additional-label>
<portal-url resourceref="SamplePage" locale="en"/>
</url-mapping-context>
</portal>
</request>


The <request> top element can have either portal or status as child element or in somecases both of them

  1. portal: This is the main element in the request. It represents the portal

  2. status: When xmlaccess generates response it will add status element as child of request element to indicate what status of the request.



This is sample result.xml file with status equal to ok that means the request was executed successfully.

<request build="wp6101_115_01" type="update" version="6.1.0.1" xsi:noNamespaceSchemaLocation="PortalConfig_6.1.0.xsd">
<status element="all" result="ok"/>
</request>

No comments: