Skip to Content

It took 3 months, but finally here is the last blog about the major features that were added to SAP NetWeaver Portal 2004, SP15. Today we look at the changes to the XML Content and Actions tool, which lets you automate the creation of portal content.

Instead of using the administration interfaces to create iViews, pages, worksets, roles and other portal objects, you can simply upload an XML file with all the information and — poof! — all you content is created. The tool is good if you are designing content on a test machine, and then you want to create the content on another machine.

Also, if you need to create a lot of objects that are similar — several roles with similar structure; you create the XML for one role, and simply duplicate it in the file and upload the file.

In addition, some companies design their content based on some back-end data, or use some tool (such as Excel) to define the content. From Excel, for example, you can then create a small conversion algorithm to export the Excel data to XML, and then upload the XML.

The tool is a lot like the PCD Inspector, in that it provides a type of backdoor for modifying PCD content. And like the PCD Inspector, you must be careful and check your XML, as you can create a lot of content — but also do a lot of other things, perhaps unintentionally, to harm the portal.

A Quick Review

Open the tool by going to System Administration –> Transport –> XML Content and Actions.

image

The import tool lets you upload a well-formed and valid XML file. After you export the file, the portal parses it and creates the portal objects and performs the actions defined in the XML. A report of the execution is displayed, showing what objects were created, what actions were performed, what sections did not parse correctly, and so forth.

image

How to Write XML to Create Content

The XML for the XML Content and Actions tool is, essentially, a collection of tags, possibly nested, and each tag defines an object to create, modify or delete. The type of object is specified by the handler name provided in the objectClass attribute. For example, to create an iView, you specify com.sapportals.portal.iview.

You can also add tags, that specify an action — such as deleting all objects from a folder, running another script, or assigning users to groups. These tags are not nested.

What’s New

The main addition in SP15 was the addition of an export tool, that lets you take existing content and create an XML file based on it. You can then take this XML file, modify as needed, and upload the file so that the content — or similar content — is created on the same portal, perhaps in a different area, or on another portal.

With the tool, you do not need to code XML by hand. You can design the skeleton of what you want and export it to XML. You can then modify the attributes, copy the elements to create additional objects, and so forth. In addition, a large group of handlers were added in SP13, with which you still may not be familiar.

The following objects can now be created:

  • Translation worklists
  • Related items (of iViews)
  • System aliases

The following actions can now be performed:

  • Run a script from within another script
  • Copy and mirror content
  • Assign users to groups and roles

Documentation

And, of course, we have a document that explains all the rules for building a valid XML file for the XML Content and Actions tool. It also lists all the objects you can create and all the actions that you can perform.

The documentation is located at How to Automate Content Creation via XML.

To report this post you need to login first.

11 Comments

You must be Logged on to comment or reply to a post.

  1. Thanh-Phong LAM
    Hi Daniel,
    your blog is very interesting 😉

    Is there a (official released SAP-) API to upload content programatically (by SOAP or something else)? I want to create a tool which creates the xml and does the import afterwards.

    Best regards
    Phong

    (0) 
    1. Daniel Wroblewski Post author
      Hi Phong,

      For the current version, there is no API.

      An API to run an XML script is being introduced in the next version; this will be available sometime next year.

      Daniel

      (0) 
      1. David Wiser
        Daniel,

        It’s been over a year since this post.  My server is currently running EP6 SP19, and I’m looking for a programmatic way to import XML Content and Actions.  Has this been included in any version yet?

        Thanks

        Dave

        (0) 
  2. Anonymous
    Hi Daniel,

    Is there a DTD to be able to create these XML files easily and accurately?

    Martin

    (0) 
  3. Kai Kraemer
    Hi Daniel,

    you wrote that it is possible now to assign users to groups. In the documentation I can only find how to assign users or groups to a role but not how to add a specific user to a group.

    Do you have an example for that?

    Thanks in advance
    Kai

    (0) 
    1. Daniel Wroblewski Post author
      Hi Kai,

      It could be that I was mistaken about this. It has been 2 years since I was in the portal group, so I am not on top of it.

      I also could not find the code for adding a user to a group. I have inquired if it is possible, and will write back if I find the answer.

      Daniel

      (0) 
    2. Daniel Wroblewski Post author
      Hi Kai,

      I checked and I was wrong (or miswrote the blog). What it should have said was “You can assign users/groups to roles”.

      Sorry for the error. I am told that there may be a way to import a script using the UME tools of the portal, but I am not familiar with this tool.

      Sorry for the error.

      Daniel

      (0) 

Leave a Reply