[xwiki-users] How to add a page with contents in xwiki through Rest api???
Hi All, I am very new to XWiki and also to rest api. I have gone through the link given by xwiki for rest api http://platform.xwiki.org/xwiki/bin/view/Features/XWikiRESTfulAPI. But i dont getting clear idea, how can i create a page under space with some contents.. and i am not getting any good samples for xwiki rest api. Normally through httpclient we can send the url with contents like eg :String url = "http://localhost:8080/jforum/jforum.page?"; + "module=adminCategories" + "&action=insertSave" + "&category_name=" + categoryName + "&moderate=0" + "&groups=1" + "&groups=2" + "&groups=3" + "&groups=4"; using POST method in httpclient and the data get stored in the respective place. Kindly anyone give me idea how rest will get differentiate in xwiki manner.. Can anyone give me a code snippet for this requirement so that i can improve my progress in my project.. Any help greatly appreciated. Thanks in advance. Regards, Nithya. -- View this message in context: http://n2.nabble.com/How-to-add-a-page-with-contents-in-xwiki-through-Rest-api-tp4520594p4520594.html Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
[xwiki-users] How to integrate xwiki as jsr-168 in jboss portal??
Hi All, Now i am working in xwiki to integrate xwiki application as portlet in jboss portal. I have placed the portlet.xml,portlet-instances.xml,xwiki-object.xml inside the xwiki war and deployed in jboss portal. It deployed and portlet also created. But inside the portlet its throwing the exception "Xwiki context initialization exception". The context not getting initialized.. How to fix this issue?? I am using xwiki 2.1.1 war and xar respectively. I didnt worked with exo portal yet. I am using jboss portal 2.6 which supports jsr-168. If anyone worked already and have a idea kindly guide. Thanks in advance. Thanks and Regards, Nithya -- View this message in context: http://n2.nabble.com/How-to-integrate-xwiki-as-jsr-168-in-jboss-portal-tp4570979p4570979.html Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
[xwiki-users] How to implement our own SSO in xwiki??
Hi All, I am struggling with the implementation of SSO in xwiki. I have few doubts to ask.. I am using my own SSO which use the OpenSSO and its OpenDS for authentication. My application, plugin to many application and the base is jboss portal. I have successfully implemented the jforum inside jboss portal and implemented my own custom SSO jforum, as the instructions given in jforum. But in xwiki i am not seeing any guide lines to implement my own SSO. Eventhough googling i didnt get the clear idea. I am using pure java and i cant go for keberos and OpenID concept. 1. Whether i can implement my own SSO in xwiki?? When i login in my application the same user should login in xwiki and the browser session n cookie should get maintain for the user session..Is it possible? 2. If so What all are the files i have touch? Where i have to make the changes for SSO? What is the name of the cookie which is used for sso in xiwiki now? 3. What all the changes for SSO? Thanks in advance. Regards, Nithya. -- View this message in context: http://n2.nabble.com/How-to-implement-our-own-SSO-in-xwiki-tp4627411p4627411.html Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
[xwiki-users] Login in xwiki through http client...
Hi All, I just want to know is it possible to login in xwiki application through httpclient. Now through xmlrpc and rest api we can. But for some purpose i need to login through httpclient. If possible, any one can tell the url along with the parameters needed to login. Thanks in advance. Regards, Nithya. -- View this message in context: http://n2.nabble.com/Login-in-xwiki-through-http-client-tp4654361p4654361.html Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] Login in xwiki through http client...
Hi All, Thanks for you valuable response. I am asking the httpclient for doing my own sso login. I am using JBoss portal which using OpenSSO -> OpenDS as a user datastore. The same user get store in both JForum application's seperate database and also in xwiki database. In JForum i followed this approach to do the single sign on. 1. Check for my LTPA token cookie. 2. If its there i will get the user details with username and password from OpenSSO and do the login in jforum through the http client to maintain the user in session. 3. Add a cookie for JForum application. (The user will be in session till the LTPA token get expire). But i am not getting clear idea about implementation of my own sso in xwiki. Any solution please suggest. Thanks, Nithya. -- View this message in context: http://n2.nabble.com/Login-in-xwiki-through-http-client-tp4654361p4655517.html Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
[xwiki-users] Creating user using XML RPC....
Hi All, Is there any sample available to create a user through XML RPC like the examples in the following link for creation of page, space etc.. http://platform.xwiki.org/xwiki/bin/view/Features/XMLRPCJavaExamples Please help me out if there any solution. Thanks, Nithya. -- View this message in context: http://n2.nabble.com/Creating-user-using-XML-RPC-tp4669004p4669004.html Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
[xwiki-users] How to add/ register a new user in xwiki through xmlrpc??
Hi All, I am struggling in the user creation part of xwiki through xml rpc. This is my code snippet to create a new user in xwiki.. String url = "http://sso.isupport.com/xwiki/xmlrpc/confluence";; String user = "Admin"; String pass = "admin"; Confluence confObj = new Confluence(url); confObj.login(user, pass); User userObj = new User(new HashMap()); userObj.setEmail("sh...@gmail.com"); userObj.setFullname("shimyThomas"); userObj.setName("shimy"); confObj.addUser(userObj, "csscorp"); while running this an application i am getting the following error.. in this specific line confObj.addUser(userObj, "csscorp"); org.codehaus.swizzle.confluence.ConfluenceException: No such handler: confluence1.addUser at org.codehaus.swizzle.confluence.Confluence.call(Confluence.java:808) at org.codehaus.swizzle.confluence.Confluence.call(Confluence.java:770) at org.codehaus.swizzle.confluence.Confluence.addUser(Confluence.java:435) at CreateUser.main(CreateUser.java:55) Can anyone suggest me how to create a user? Kindly tell me is there any bug in the code... Thanks, Nithya. -- View this message in context: http://n2.nabble.com/How-to-add-register-a-new-user-in-xwiki-through-xmlrpc-tp4694340p4694340.html Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] Creating user using XML RPC.... and also how to add the user in default group with the xwiki all group rights via xml rpc/programmatically??
Hi Dilip, Thanks for the valuable reply. I tried your example with this set of code and password also able to create for the user. But i didnt checked whether its plain text or hashed.. I used this snippet of code XWikiObject xobj = new XWikiObject(); xobj.setClassName("XWiki.XWikiUsers"); xobj.setPageId("XWiki.testuser"); xobj.setProperty("first_name", "Test"); xobj.setProperty("last_name", "User"); xobj.setProperty("password", "aa"); rpc.storeObject(xobj); If you check the xwiki-core..jar, you can find the class com.xpn.xwiki. XWiki and method getUserClass() which has properties which you are meaning here. I hope we can use all the properties depends on our need. Thanks, Nithya. And i logined as test user and its successfully working. -- View this message in context: http://n2.nabble.com/Creating-user-using-XML-RPC-tp4669004p4701447.html Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
[xwiki-users] Adding user to defaul group with appropriate rights through xml rpc.....
Hi All, I have created user through xml rpc. But the user dont have any rights and the user not added in the default group. how to add the user in XWiki All Group and give the rights through xml rpc?? Any idea.?? I surfed net and this nabble forum but i didnt get the solution. Thanks, Nithya. -- View this message in context: http://n2.nabble.com/Adding-user-to-defaul-group-with-appropriate-rights-through-xml-rpc-tp4701451p4701451.html Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] Adding user to defaul group with appropriate rights through xml rpc.....
Hi Marius, Thanks for the reply. This is my code snippet which i tried before posting this post. XWikiObject xobj = new XWikiObject(); xobj.setClassName("XWiki.XWikiAllGroups"); xobj.setProperty("member", "test1"); rpc.storeObject(xobj); But i am getting the error that xobj is null in rpc.storeObject(xobj).. Whether i have create some pages?? Here i want to add the user to xwikiallgroup.. Please guide me. Thanks, Nithya. -- View this message in context: http://n2.nabble.com/Adding-user-to-defaul-group-with-appropriate-rights-through-xml-rpc-tp4701451p4703643.html Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
[xwiki-users] How to create a skin/ theme in xwiki through xml rpc?
Hi All, I want to create a skin/ theme in xwiki. Or else is it possible to apply the existing skin of xwiki like nightfall, nature through program in xwiki? My requirement i have to create a theme and apply the theme to xwiki through some xml rpc? Is it possible? is there any code snippets? Kindly help me. Thanks, Nithya. -- View this message in context: http://n2.nabble.com/How-to-create-a-skin-theme-in-xwiki-through-xml-rpc-tp4717384p4717384.html Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] How to create a skin/ theme in xwiki through xml rpc?
Hi Florin, Thanks for your reply. I am using xwiki in my application. its one of the part in my application what i am developing. My application has its own theme and xwiki also. When i select and set my application theme, the same theme should get apply to the xwiki also. This is my requirement. I want to do all by programmatically.. Is it possible to elaborate the answer Any idea, kindly appreciated. Thanks, Nithya. -- View this message in context: http://n2.nabble.com/How-to-create-a-skin-theme-in-xwiki-through-xml-rpc-tp4717384p4779335.html Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] How to create a skin/ theme in xwiki programmatically?
How to create a skin/ theme in xwiki programmatically? in java in xwiki Any help !! thanks. nithya. -- View this message in context: http://n2.nabble.com/How-to-create-a-skin-theme-in-xwiki-through-xml-rpc-tp4717384p4785727.html Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
[xwiki-users] Creating skin/theme through httpclient...
Hi All, I am in the search and implementation of changing the xwiki theme programmatically. I made my xwiki theme Nighfall/Nature and trying to change my theme as default through program. Below i have given my code snippet. its running successfully and the parameters changing in xwiki as we mentioning here. But the color theme combo box is not changing and the theme not changing in the xwiki even after restarting the server. ** String loginUrl = "http://localhost:8090/xwiki/bin/Save/XWiki/XWikiPreferences";; HttpState initialState = new HttpState(); HttpClient client = new HttpClient(); client.getParams().setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY); client.setState(initialState); PostMethod method = new PostMethod(loginUrl); method.addParameter("XWiki.XWikiPreferences_0_title","Testing title"); method.addParameter("XWiki.XWikiPreferences_0_meta", "context.language"); method.addParameter("XWiki.XWikiPreferences_0_showLeftPanels", "1"); method.addParameter("XWiki.XWikiPreferences_0_leftPanels", "1"); method.addParameter("XWiki.XWikiPreferences_0_showRightPanels", "1"); method.addParameter("XWiki.XWikiPreferences_0_rightPanels", "Panels.QuickLinks,Panels.MyRecentModifications"); method.addParameter("XWiki.XWikiPreferences_0_webcopyright", "copyright"); method.addParameter("XWiki.XWikiPreferences_0_version", "openURL('http://enterprise.xwiki.org/xwiki/bin/view/Main/Documentation', '_blank'); return false < a href='http://www.xwiki.org/xwiki/bin/view/Main/Documentation'>Documentation '"); method.addParameter("XWiki.XWikiPreferences_0_skin", "XWiki.DefaultSkin"); //method.addParameter("XWiki.XWikiPreferences_0_colorTheme", ""); method.addParameter("XWiki.XWikiPreferences_0_colorTheme", "ColorThemes.Default color theme"); method.addParameter("XWiki.XWikiPreferences_0_stylesheet", "style.css"); method.addParameter("XWiki.XWikiPreferences_0_stylesheets", "style.css"); method.addParameter("xcontinue", "/xwiki/bin/admin/XWiki/XWikiPreferences?editor=globaladmin§ion=Presentation&space=XWiki"); method.addParameter("xredirect", "/xwiki/bin/admin/XWiki/XWikiPreferences?editor=globaladmin§ion=Presentation&space=XWiki"); method.addParameter("classname", "xwiki.xwikiPreferences"); method.addParameter("formactionsac", "Save"); int statusCode = client.executeMethod(method); ** Is there any solution. Kindly suggest is there any idea.. Thanks, Nithya. -- View this message in context: http://n2.nabble.com/Creating-skin-theme-through-httpclient-tp4813624p4813624.html Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
[xwiki-users] How to add cookie and header in xmlrpc in xwiki?
Hi All, I am facing issue in xmlrpc client while login the admin user. I want to add the user in the xwiki through xmlrpc. For that i have to login as admin and then i have to add the user which is given in the below link. I have used the login sample defined in the following link http://platform.xwiki.org/xwiki/bin/view/Features/XMLRPCJavaExamples I have my own sso implemented in xwiki. I need to add header and cookie in xmlrpc so that i can get those cookie in my own sso class and check for the authentication. It is possible to add the header and cookie in httpclient. But how to do the cookie based xmlrpc login in xwiki? is there any way to add the cookie and header in xmlrpc in xwiki? Kindly suggest any idea. Thanks, Nithya. -- View this message in context: http://n2.nabble.com/How-to-add-cookie-and-header-in-xmlrpc-in-xwiki-tp4932519p4932519.html Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
[xwiki-users] How to list the subspace under the space?
Hi All, Currently i am working in xwiki and facing some issues which i am not able to solve. I want to create a tree structure for the space and subspace and the pages inside it. Eg : I am creating Space Name : HelloMajor, Parent : nothing (by default it takes WebHome) Page Name : HelloMajorPage1 : Parent : HelloMajor Page Name : HelloMajorPage2 : Parent : HelloMajorPage1 If i use document tree its displaying like HelloMajor |___ HelloMajorPage1 |HelloMajorPage2 Another space creation : HelloMinor; Parent : HelloMajor.WebHome Page Name : HelloMinorPage Parent : HelloMinor Now i want to display the tree structure like this HelloMajor |___ HelloMajorPage1 ||HelloMajorPage2 |___HelloMinorPage |HelloMinorPage I want to display the subspace under the related space itself. I tried with child parent snippets but it didnt worked. As i explored i didnt get the solution to get the parent of the subspace. Normally in db its storing under XWD_Parent field in xwiki_doc table. I would like to give the subspace name as parameter so that i can get the parent name which i mean is "HelloMajor.WebHome". My requirement is to build a tree structure. I tried with space explorer,mk tree, document tree and spaceAllDocs. No one fitting my requirement. *Spacename * Subspacename * subspacepages * SpacePages In this manner i want to display. IS there any solution. Kindly help me. Thanks in advance. Regards, Nithya.Vembu. -- View this message in context: http://xwiki.475771.n2.nabble.com/How-to-list-the-subspace-under-the-space-tp5095367p5095367.html Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] How to list the subspace under the space? Little bit successful. Need more steps to go..
Hi Guillaume, Thanks for your valuable reply. I have somewhat achieved to get the subspaces and pages like a tree structure. This is the code snippet. I just changed the query in the child parent code snippet for my requirement. {{velocity}} #macro (createDocumentTree $document $depth $level) #if ($depth > 0) #set($translated = $document.getTranslatedDocument()) #set($name = $translated.getName()) #set($fullname = $translated.getFullName()) #set($prefixed = $translated.getPrefixedFullName()) #set($where = "where doc.parent = '$name' or doc.parent = '$fullname' or doc.parent = '$prefixed' order by doc.name") #if ($name == "WebHome") #set($space = $document.getSpace()) ## changes made here for our requirement #set($where1 = "where doc.parent = '$fullname' and doc.name='WebHome'") #end #foreach($name in $xwiki.searchDocuments($where)) #if ($xwiki.getDocument($name)) #set($document = $xwiki.getDocument($name)) #set($translated = $document.getTranslatedDocument()) #set($prefixed = $translated.getPrefixedFullName()) #set($title = $translated.getDisplayTitle()) #set($indent = "") #foreach($n in [1..$level]) #set($indent = "${indent}*") #end $indent [[$title>>$prefixed]] #set($depth = $depth - 1) #set($level = $level + 1) #createDocumentTree($document $depth $level) #set($depth = $depth + 1) #set($level = $level - 1) #end #end #end #end #createDocumentTree($doc 5 1) {{/velocity}} But here i am facing the problem. I am creating a space and putting this velocity code in that space and its displaying the whole tree structure related to it. But i want this code in panel and the tree structure should come for all spaces dynamically like Tree view Navigation. I put this code in panel but it displaying the tree related to panel. My requirement is to show all spaces and its related subspace, pages as tree in panel. How can i get spaces and also specify the proper document object? Is there any way to get successful in this. Kindly guide me. Thanks in Advance. Regards, Nithya. -- View this message in context: http://xwiki.475771.n2.nabble.com/How-to-list-the-subspace-under-the-space-tp5095367p5104916.html Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users