Hello,
I had activated the statistics in xwiki.cfg :
xwiki.stats=1
xwiki.stats.default=1
But in the Stats space, no statistics are registered.
In the config file, we can read : "storage can be enabled/disabled by wiki
using the XWikiPreference property "statistics". What does it mean ? I don't
have any "statistics" attribute in the XWikiPreferences object.
XWiki initially installed in 1.9.2 and upgraded to 2.0.2.
Thank you for your help.
Maxime
Finally, I have a working version of the code to access the Xwiki RESTful
API.
It worked smooth on a Tomcat 6.0.14 + JDK 1.5 machine. But had to make
certain changes to the bootstrap files for JDK 1.6 as I mentioned in the
previous post. I have used the Apache HTTP HTTPClient 3.1 jar files here but
soon will upgrade that to Apache HTTPClient 4.0. The only change in the code
from the one posted at
http://platform.xwiki.org/xwiki/bin/view/Features/XWikiRESTfulAPI are the
lines Unmarshaller un = context.createUnmarshaller(); and the line Page page
= (Page) ((JAXBElement)
un.unmarshal(getMethod.getResponseBodyAsStream())).getValue();
The default object that getMethod returns turned out to be a JAXBElement
rather than a Page object. Hence, had to do some class casting.
A big thanks to Fabio Mancinelli & Sergiu Dumitriu for helping me out on
this one.
Just one more request though. Do we cast the
getMethod.getResponseBodyAsStream() to Tags class (if we want to retrieve a
list of pages based on their tags) or the SearchResults class (if we want to
retrieve pages returned through a page search). Even though, I cast the
getMethod.getResponseBodyAsStream to the tags class, my compiler still
throws an error for class cast exception : org.xwiki.Pages. Could someone
please post a snippet to access pages with specific tags or any other
complex querying using classes in the org.xwiki classes. Any help on this
would be greatly appreciated friends.
/*
JDK: 1.5
Tomcat: 6.0.14 (Xwiki server)
Libraries: Apache HTTPClient 3.1, JAXB 2.1, Apache Commons Logging 1.1.1 &
Apache Commons Codec 1.4
Class File Dependencies: org.xwiki package of class files generated from the
XSD file at
http://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-rest/src/main/r
esources/xwiki.rest.model.xsd with the help of the XJC compiler available in
the JAXB 2.1 distribution
*/
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.List;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.methods.GetMethod;
import org.xwiki.Page;
public class Main {
public static void main(String[] args) throws JAXBException,
HttpException, IOException {
HttpClient httpClient = new HttpClient();
JAXBContext context = JAXBContext.newInstance("org.xwiki");
Unmarshaller un = context.createUnmarshaller();
GetMethod getMethod = new
GetMethod("http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/We
bHome");
getMethod.addRequestHeader("Accept", "application/xml");
httpClient.executeMethod(getMethod);
Page page = (Page) ((JAXBElement)
un.unmarshal(getMethod.getResponseBodyAsStream())).getValue();
System.out.println(page.getCreator());
System.out.println(page.getCreated());
System.out.println(page.getFullName());
System.out.println(page.getXwikiAbsoluteUrl());
}
}
Hello,
I'm a very keen and happy user of xwiki. We use it for our corporate
intranet and our users love it! I generally move directly between major
versions as soon as convenient. The factor that has the most bearing on
when we upgrade is the ease with which we can move between new versions.
I remember seeing an items relating to simpler installation. I'd like to
ask when that is scheduled to be worked on, and perhaps share some of my
experiences in upgrading and some suggestions.
I'd like to give you an idea of what has to be done to move between
versions. It's a bit long, so bear with me, but here it is:
* Download the latest xwiki xar to your local machine
* Download the latest xwiki war to the machine which will run xwiki.
* Backup the entire xwiki installation directory (the one that contains
the directories database, jetty, lucene etc), and move the old directory
aside (rename to xwiki.old)
* //We do this to easily be able to get the jetty, hsql, etc dirs back
in place//: Restore the backed up xwiki directory, thus putting the
xwiki dir back in place
* Delete the directory xwiki/webapps/xwiki
* In xwiki/webapps, create an xwiki directory
* Unzip the xwiki war in the xwiki/webapps/xwiki directory
* //Getting our corp logo back//: Copy
xwiki.old/webapps/xwiki/skins/toucan/mywiki.jpg to
xwiki/webapps/xwiki/skins/toucan/mywiki.jpg
* //Next few steps: need to merge old config with new config//: Do a
diff between xwiki.old/webapps/xwiki/WEB-INF/xwiki.cfg and
xwiki/webapps/xwiki/WEB-INF/xwiki.cfg. Update
xwiki/webapps/xwiki/WEB-INF/xwiki.cfg as needed.
* Do a diff between xwiki.old/webapps/xwiki/WEB-INF/xwiki.properties and
xwiki/webapps/xwiki/WEB-INF/xwiki.properties. Update
xwiki/webapps/xwiki/WEB-INF/xwiki.properties as needed.
* Do a diff between xwiki.old/webapps/xwiki/WEB-INF/hibernate.cfg.xml
and xwiki/webapps/xwiki/WEB-INF/hibernate.cfg.xml. Update
xwiki/webapps/xwiki/WEB-INF/hibernate.cfg.xml as needed.
* //This is the part we fear the most, for we might accidentally delete
some configuration that we need and we would need to start the whole
process again//: Start XWiki and import the default wiki xar. Be careful
of what you import - read the instructions at
http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Installation#HUpgrading…
.
** The normally excluded pages from import are:
*** XWiki.XWikiPreferences
*** XWiki.XWikiGroups
*** XWiki.XWikiAdminGroup
*** XWiki.WebPreferences
*** XWiki.WebHome
*** XWiki.XWikiUsers
*** XWiki.XWikiAllGroup
*** XWiki.DefaultSkin
*** Main.WebHome
*** Panels.QuickLinks
*** Panels.Search
* //We customise the PDF cover//: The PDF covers files has been manually
modified. Do a diff between
xwiki.old/webapps/xwiki/templates/pdfcover.vm and
xwiki/webapps/xwiki/templates/pdfcover.vm. Merge the differences.
* //We customise the PDF footer//: The PDF footers file has been
modified by hand. Do a diff between
xwiki.old/webapps/xwiki/templates/pdffooter.vm and
xwiki/webapps/xwiki/templates/pdffooter.vm. Merge the differences.
* //We do this to be able to specify the PDF template to use in "Export
as PDF"//: The Menuitems have to be edited by hand, so that PDFs are
exported using the correct stylesheet. Do a diff between
xwiki.old/webapps/xwiki/templates/menuview.vm and
xwiki/webapps/xwiki/templates/menuview.vm. Merge the differences (there
should only be one line).As you can see, there are quite a few steps,
and it normally takes 1/2hr - 1hr to complete. Note that we will move to
MySQL eventually, but the performance of HSQL is OK ATM.
This may not be the most optimal upgrade path, so if there are any clear
improvements you can see, please let me know.
The part that needs to be improved upon the most, in my opinion, is the
"import default XAR" step because it is easy to overwrite an important
page. I would like to put in a big vote for separating information that
can be modified by the user from information that xwiki needs to be able
to operate, that comes with default xwiki. Perhaps making certain pages
"system" pages so that it is clear that if a page is modified it may
interrupt the operation of the wiki, and may be difficult to upgrade.
The next most important thing to be improved is the storage of
configuration that now sits in xwiki.cfg and xwiki.properties. This is
difficult to migrate between versions. If this was automatically
migrated between versions like the pages are, this would be much easier
to manage. At our office we have a large system written in Java and we
solved a similar problem using the Java Preferences API.
Being able to fully customise the PDF layout (not just the stylesheet)
inside xwiki, and also specify a default PDF style sheet to use during
export would be #3 on my list.
I'm interested in hearing some thoughts.
Regards,
Nigel
Hi,
I'd like to use the Grid/LiveTable components to list data and create links to edit pages for that data. I would also like to add restrictions so that only users who created that data can edit it.
>From my understanding it is not possible to restrict edits for individual xwiki class objects to only users who created that object (along with an administrator user) as edit permissions can only be set at the page level and not at the individual object level.
The solution I was thinking about was to create a new page for each record then restrict edit permissions at the page level.
This would however require me to aggregate all of the xwiki class objects on a single page so that they could be used with the grid/LiveTable component. I can't however see a way of doing this. Is this possible or is there a better way of doing this?
Thanks in advance,
Radek
Hi,
I am currently trying to set up XWiki Enterprise 1.6.1 to use JBossCache in
REPL_ASYNC mode, but I am current experiencing a few issues.
I discovered that the directory structure WEB-INF/cache/jbosscache is not
correct, so I renamed the folder jbosscache to jboss. The default.xml file
had an incorrect tag EvictionConfig instead of the correct
EvictionPolicyConfig.
After fixing the 2 minor issues (tested in LOCAL mode) mentioned above,
nothing can be stored in the cache due to serializable issue, the stack
traces:
With UseLazyDeserialization = true
2009-07-13 12:30:05,080 ERROR [STDERR] org.jboss.cache.CacheException:
java.io.NotSerializableException: Marshalled values can only wrap Objects
that are serializable! Instance of class com.xpn.xwiki.doc.XWikiD
ocument won't Serialize.
2009-07-13 12:30:05,081 ERROR [STDERR] at
org.jboss.cache.interceptors.InterceptorChain.invoke(InterceptorChain.java:227)
2009-07-13 12:30:05,081 ERROR [STDERR] at
org.jboss.cache.invocation.CacheInvocationDelegate.put(CacheInvocationDelegate.java:480)
2009-07-13 12:30:05,081 ERROR [STDERR] at
org.xwiki.cache.jbosscache.internal.JBossCacheCache.set(JBossCacheCache.java:146)
2009-07-13 12:30:05,081 ERROR [STDERR] at
com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:143)
2009-07-13 12:30:05,081 ERROR [STDERR] at
com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:128)
2009-07-13 12:30:05,081 ERROR [STDERR] at
com.xpn.xwiki.XWiki.saveDocument(XWiki.java:1271)
2009-07-13 12:30:05,081 ERROR [STDERR] at
com.xpn.xwiki.XWiki.saveDocument(XWiki.java:1233)
2009-07-13 12:30:05,081 ERROR [STDERR] at
com.xpn.xwiki.XWiki.saveDocument(XWiki.java:1228)
2009-07-13 12:30:05,081 ERROR [STDERR] at
com.xpn.xwiki.plugin.calendar.CalendarPlugin.getCalendarEventClass(CalendarPlugin.java:84)
2009-07-13 12:30:05,081 ERROR [STDERR] at
com.xpn.xwiki.plugin.calendar.CalendarPlugin.init(CalendarPlugin.java:335)
2009-07-13 12:30:05,081 ERROR [STDERR] at
com.xpn.xwiki.plugin.XWikiPluginManager.initPlugin(XWikiPluginManager.java:155)
2009-07-13 12:30:05,081 ERROR [STDERR] at
com.xpn.xwiki.plugin.XWikiPluginManager.addPlugin(XWikiPluginManager.java:92)
2009-07-13 12:30:05,081 ERROR [STDERR] at
com.xpn.xwiki.plugin.XWikiPluginManager.addPlugins(XWikiPluginManager.java:120)
2009-07-13 12:30:05,081 ERROR [STDERR] at
com.xpn.xwiki.XWiki.preparePlugins(XWiki.java:1008)
2009-07-13 12:30:05,081 ERROR [STDERR] at
com.xpn.xwiki.XWiki.initXWiki(XWiki.java:727)
2009-07-13 12:30:05,081 ERROR [STDERR] at
com.xpn.xwiki.XWiki.<init>(XWiki.java:655)
2009-07-13 12:30:05,081 ERROR [STDERR] at
com.xpn.xwiki.XWiki.getMainXWiki(XWiki.java:315)
2009-07-13 12:30:05,081 ERROR [STDERR] at
com.xpn.xwiki.XWiki.getXWiki(XWiki.java:386)
2009-07-13 12:30:05,081 ERROR [STDERR] at
com.xpn.xwiki.xmlrpc.XWikiReflectiveXmlRpcHandler.execute(XWikiReflectiveXmlRpcHandler.java:85)
2009-07-13 12:30:05,081 ERROR [STDERR] at
org.apache.xmlrpc.server.XmlRpcServerWorker.execute(XmlRpcServerWorker.java:43)
2009-07-13 12:30:05,081 ERROR [STDERR] at
org.apache.xmlrpc.server.XmlRpcServer.execute(XmlRpcServer.java:83)
2009-07-13 12:30:05,081 ERROR [STDERR] at
org.apache.xmlrpc.server.XmlRpcStreamServer.execute(XmlRpcStreamServer.java:182)
2009-07-13 12:30:05,081 ERROR [STDERR] at
org.apache.xmlrpc.webserver.XmlRpcServletServer.execute(XmlRpcServletServer.java:103)
2009-07-13 12:30:05,081 ERROR [STDERR] at
org.apache.xmlrpc.webserver.XmlRpcServlet.doPost(XmlRpcServlet.java:120)
2009-07-13 12:30:05,081 ERROR [STDERR] at
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
..............
And with UseLazyDeserialization = false
2009-07-13 12:38:57,160 ERROR [STDERR] org.jboss.cache.CacheException:
Unable to invoke method public void org.jboss.cache.RPCManagerImpl.start()
on object instance org.jboss.cache.RPCManagerImpl@1938222
2009-07-13 12:38:57,161 ERROR [STDERR] at
org.jboss.cache.util.reflect.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:127)
2009-07-13 12:38:57,161 ERROR [STDERR] at
org.jboss.cache.factories.ComponentRegistry$PrioritizedMethod.invoke(ComponentRegistry.java:932)
2009-07-13 12:38:57,161 ERROR [STDERR] at
org.jboss.cache.factories.ComponentRegistry.internalStart(ComponentRegistry.java:718)
2009-07-13 12:38:57,161 ERROR [STDERR] at
org.jboss.cache.factories.ComponentRegistry.start(ComponentRegistry.java:582)
2009-07-13 12:38:57,161 ERROR [STDERR] at
org.jboss.cache.invocation.CacheInvocationDelegate.start(CacheInvocationDelegate.java:279)
2009-07-13 12:38:57,161 ERROR [STDERR] at
org.jboss.cache.DefaultCacheFactory.createCache(DefaultCacheFactory.java:95)
2009-07-13 12:38:57,161 ERROR [STDERR] at
org.jboss.cache.DefaultCacheFactory.createCache(DefaultCacheFactory.java:79)
2009-07-13 12:38:57,161 ERROR [STDERR] at
org.xwiki.cache.jbosscache.internal.JBossCacheCache.initialize(JBossCacheCache.java:101)
2009-07-13 12:38:57,161 ERROR [STDERR] at
org.xwiki.cache.jbosscache.internal.JBossCacheCacheFactory.newCache(JBossCacheCacheFactory.java:78)
2009-07-13 12:38:57,161 ERROR [STDERR] at
com.xpn.xwiki.store.XWikiCacheStore.initCache(XWikiCacheStore.java:99)
2009-07-13 12:38:57,161 ERROR [STDERR] at
com.xpn.xwiki.store.XWikiCacheStore.initCache(XWikiCacheStore.java:84)
2009-07-13 12:38:57,161 ERROR [STDERR] at
com.xpn.xwiki.store.XWikiCacheStore.<init>(XWikiCacheStore.java:64)
2009-07-13 12:38:57,161 ERROR [STDERR] at
com.xpn.xwiki.XWiki.initXWiki(XWiki.java:679)
2009-07-13 12:38:57,161 ERROR [STDERR] at
com.xpn.xwiki.XWiki.<init>(XWiki.java:655)
2009-07-13 12:38:57,161 ERROR [STDERR] at
com.xpn.xwiki.XWiki.getMainXWiki(XWiki.java:315)
2009-07-13 12:38:57,161 ERROR [STDERR] at
com.xpn.xwiki.XWiki.getXWiki(XWiki.java:386)
2009-07-13 12:38:57,161 ERROR [STDERR] at
com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:135)
2009-07-13 12:38:57,161 ERROR [STDERR] at
com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:115)
2009-07-13 12:38:57,161 ERROR [STDERR] at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
2009-07-13 12:38:57,161 ERROR [STDERR] at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
2009-07-13 12:38:57,161 ERROR [STDERR] at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
2009-07-13 12:38:57,161 ERROR [STDERR] at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
2009-07-13 12:38:57,162 ERROR [STDERR] at
javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
2009-07-13 12:38:57,162 ERROR [STDERR] at
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
2009-07-13 12:38:57,162 ERROR [STDERR] at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
2009-07-13 12:38:57,162 ERROR [STDERR] at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
2009-07-13 12:38:57,162 ERROR [STDERR] at
com.xpn.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:94)
2009-07-13 12:38:57,162 ERROR [STDERR] at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
2009-07-13 12:38:57,162 ERROR [STDERR] at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
Has anyone ever managed to get XWiki running with a replicated cache (JBoss
or OSCache) ????
Any help is greatly appreciated.
Cheers,
Andy
Hello XWiki users,
I have worked a lot with XWiki Skins on the top of XWiki Enterprise
instances and I wanted to share my experience with you all. This is why
I created a new XWiki Skins tutorial that you can find it here:
http://dev.xwiki.org/xwiki/bin/view/Drafts/XWikiNewSkin . It would be
great if you could give me your feedback about this tutorial.
Enjoy customizing your XWiki Enterprise instances!
Raluca Stavro.
Hi Sergiu,
Thanks for taking the time out to look into the issue.
I reinstalled the XWiki instance & now have a clean XWiki instance. I
checked the xwiki/WEB-INF/lib folder and I see that the JAXB library shipped
with XWiki is JAXB2.1 (jaxb-api-2.1, jaxb-fluent-api-2.1.8,
jaxb-impl-2.1.10,jaxb-xjc-2.1.8,jaxrpc-api-1.1 & activation-1.1).
Tried accessing the URL
http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/WebHome
directly from the browser.
Following is the java.lang.Linkage error that I get:
java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap
classloader, but this RI (from
jar:file:/C:/Tomcat6.0/webapps/xwiki/WEB-INF/lib/jaxb-impl-2.1.10.jar!/com/s
un/xml/bind/v2/model/impl/ModelBuilder.class) needs 2.1 API. Use the
endorsed directory mechanism to place jaxb-api.jar in the bootstrap
classloader. (See http://java.sun.com/j2se/1.5.0/docs/guide/standards/)
com.sun.xml.bind.v2.model.impl.ModelBuilder.<clinit>(ModelBuilder.java:173)
com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.j
ava:431)
com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:288)
com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBCon
textImpl.java:1111)
com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:154)
com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:121)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
javax.xml.bind.ContextFinder.newInstance(Unknown Source)
javax.xml.bind.ContextFinder.find(Unknown Source)
javax.xml.bind.JAXBContext.newInstance(Unknown Source)
javax.xml.bind.JAXBContext.newInstance(Unknown Source)
org.restlet.ext.jaxrs.internal.provider.AbstractJaxbProvider.getJaxbContext(
AbstractJaxbProvider.java:63)
org.restlet.ext.jaxrs.internal.provider.AbstractJaxbProvider.marshal(Abstrac
tJaxbProvider.java:84)
org.restlet.ext.jaxrs.internal.provider.JaxbProvider.writeTo(JaxbProvider.ja
va:106)
org.restlet.ext.jaxrs.internal.wrappers.provider.SingletonProvider.writeTo(S
ingletonProvider.java:335)
org.restlet.ext.jaxrs.internal.util.JaxRsOutputRepresentation.write(JaxRsOut
putRepresentation.java:105)
com.noelios.restlet.http.HttpServerCall.writeResponseBody(HttpServerCall.jav
a:492)
com.noelios.restlet.http.HttpServerCall.sendResponse(HttpServerCall.java:428
)
com.noelios.restlet.ext.servlet.ServletCall.sendResponse(ServletCall.java:40
7)
com.noelios.restlet.http.HttpServerConverter.commit(HttpServerConverter.java
:391)
com.noelios.restlet.http.HttpServerHelper.handle(HttpServerHelper.java:148)
com.noelios.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:881
)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:117)
com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:68)
com.xpn.xwiki.web.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFi
lter.java:295)
com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFi
lter.java:112)
Hello folks,
The REST example at
http://platform.xwiki.org/xwiki/bin/view/Features/XWikiRESTfulAPI seems to
be working fine to quite some extent.
I retrieved the xwiki.org Main.WebHome page in the XML format. However, the
same code returns empty result if I look for the Main.WebHome on
localhost:8080/xwiki.
Is there something that I need to enable on my localhost XWiki instance. I
see that xwiki.org has been upgraded to version 2.0.2 which is the same
version on my machine.
I am using tomcat 6.0.18 with MySql 5.
Also, the URL
http://www.xwiki.org/xwiki/rest/wikis/xwiki/spaces/Main/pages/WebHome
returns a well formed XML document.
However, the URL
http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/WebHome
returns an error : XML Parsing Error: no element foundLocation:
http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/WebHome Line
Number 1, Column 1: in Mozilla FF
& the error : XML document must have a top level element. Error processing
resource 'http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/... in IE8
I am retrieving XML info through the following code:
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBContext.*;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import org.apache.commons.httpclient.*;
import org.apache.commons.httpclient.methods.GetMethod;
import java.io.IOException;
import java.io.InputStream;
public class Main{
public static void main(String[] args) throws JAXBException, IOException {
HttpClient httpClient = new HttpClient();
JAXBContext context = JAXBContext.newInstance("org.xwiki");
Unmarshaller un = context.createUnmarshaller();
GetMethod getMethod = new
GetMethod("http://xwiki.org/xwiki/rest/wikis/xwiki/spaces/Main/pages/WebHome
");
getMethod.addRequestHeader("Accept", "application/xml");
httpClient.executeMethod(getMethod);
InputStream is = getMethod.getResponseBodyAsStream();
System.out.println(getMethod.getResponseBodyAsString());
//Page page = (Page) un.unmarshal(getMethod.getResponseBodyAsStream());
}
}
Any help would be greatly appreciated. Thank you.
Regards,
Dilipkumar Jadhav