It could be "Save" which should be "save"
There is also

    method.addParameter("classname", "xwiki.xwikiPreferences");

which should be

    method.addParameter("classname", "XWiki.XWikiPreferences");



In any case, you should look at the REST api which is more suited for doing that.

Ludovic

Le 28/03/10 18:18, Nithya Vembu a écrit :
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&section=Presentation&space=XWiki");
         method.addParameter("xredirect",
"/xwiki/bin/admin/XWiki/XWikiPreferences?editor=globaladmin&section=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.



--
Ludovic Dubost
Blog: http://blog.ludovic.org/
XWiki: http://www.xwiki.com
Skype: ldubost GTalk: ldubost
_______________________________________________
users mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to