Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

XML Form builder

Hello everybody!

There is an XML form (created in XML Forms Builder). I need to create/edit xml files using this form, in the same way as I can do it in the Portal.

I have some code, which should solve my problem, but it isn't work:

IURLGeneratorService generatorService = (IURLGeneratorService) ResourceFactory.getInstance().
    getServiceFactory().getService("URLGeneratorService");

IUriReference reference = generatorService.getRelativeUri(PathKey.XML_FORMS_EDIT_PAGE);

UriQuery query = new UriQuery();
query.add("XMLFormID", "btexx_quicknotes");

reference = reference.setQuery(query.toExternalForm());
response.write("<a href="" + reference.toExternalForm() + "" >link</a><br>n");

It opens my XML form, but after clicking “save” button it rises exception:

Cannot read item b0c02216-adad-2810-3180-f457b90bace4.xml
com.sapportals.wcm.repository.InvalidUriException: Invalid RID: b0c02216-adad-2810-3180-f457b90bace4.xml
	at com.sapportals.wcm.repository.ResourceException.fillInStackTrace(ResourceException.java:399)
…

I suppose that there are some other necessary parameters for XML editor, but I don’t know where I can get it.

Does anyone know how to solve my problem?

Former Member
replied

Hi Egor,

it's really easy to get an idea about what's needed - just check the URL called from the Folder -> New -> Forms -> [Form] command:

To create (that seems what you are trying here):

http://[server]/irj/servlet/prt/portal/prtroot/com.sap.km.cm.xmlformedit?XMLFormID=[form_name]&post/path=[path of the folder where the doc will be created]&createmode=true

- so you missed the post/path parameter.

To edit:

http://[server]/irj/servlet/prt/portal/prtroot/com.sap.km.cm.xmlformedit?XMLFormID=&show/test=[path of the xml to be edited]

Hope it helps

Detlev

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question