Skip to Content
author's profile photo Former Member
Former Member

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?

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Apr 14, 2006 at 10:02 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 14, 2006 at 11:16 AM

    Thanks a lot for your answer, it was really helpful.

    But I forgot about another problem. During new xmlfile-creation I need to pass initial values for some fields. It's like edit mode but for new xmlfile. Is it possible?

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.