Updating wiki page programmatically
Posted by Nikhil R Bhise on 27.Jun.12 at 12:06 PM using a Web browser Category : Wikis Release: 2.5 Platform: Windows
Issue:>>LC is showing blank data even after database is showing the updated data when trying to updating the wiki page programatically>>
Explaination:
We are trying to update the wikipage programatically, updated comments are getting stored in the database but LC is unable to show anything(old or new) in view.
Code for this as below:
client.addCredentials("server:9444/", null, null, new UsernamePasswordCredentials("username", "password"));
response = client.get("server:9081/wikis/basic/api/wiki/WikiLabel/page/PageLabel/entry?acls=true&includeTags=true", options);
in = response.getInputStream();
Document document = (Document)abdera.getParser().parse(in);
Entry entry =(Entry) document.getRoot();
entry.addCategory("tag:ibm.com,2006:td/type", "page", "page");
String summary = entry.getSummary();
entry.setUpdated(new java.util.Date());
entry.setTitle("New Page");
entry.setContent("this is content...");
entry.setText("setting text...");
entry.addCategory("techwiki");
entry.setSummary("updating summary1");
entry.setPublished(new java.util.Date());
response = client.put("server:9081/wikis/basic/api/wiki/WikiLabel/page/PageLabel/entry?createVersion=true", entry, options);
*********************
Thanks in advance
Updating wiki page programmatically... (Nikhil R Bhise 27.Jun.12)
. . RE: Updating wiki page programmatic... (Luis Benitez 2.Jul.12)