Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8802

Update KM XML Form

$
0
0

Hi, i need to update an xml form in km, i can read and modify it with the following code:

 

IWDClientUser wdClientUser = WDClientUser.getCurrentUser();

IUser sapUser = wdClientUser.getSAPUser();

com.sapportals.portal.security.usermanagement.IUser ep5User = WPUMFactory.getUserFactory().getEP5User(sapUser);

 

 

//          Getting the Resource.........

IResourceContext resourseContext = new ResourceContext(ep5User);

IResourceFactory resourseFactory = ResourceFactory.getInstance();

 

 

//          path to the KM Folder ("path")

RID pathRID = RID.getRID(path);

com.sapportals.wcm.repository.IResource resource = resourseFactory.getResource(pathRID, resourseContext);

 

DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();

docBuilderFactory.setNamespaceAware(true);

DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();

Document doc = docBuilder.parse(resource.getUnfilteredContent().getInputStream());

doc.getDocumentElement().normalize (); //You can access the DOM using this "doc" object reference. //Do further processing...

 

doc.getDocumentElement().getElementsByTagName("Answer").item(0).getChildNodes().item(0).setNodeValue("La mala vita!!!");

 

The question is how i can save the changes in the same resource.

 

Regards


Viewing all articles
Browse latest Browse all 8802

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>