HI Team, Please help as I am not able to create xwiki through WikiManagerPluginApi and still getting " You don't have create wiki rights"
Not sure how to set admin user in context. Thanks karamjit. On Sun, Jul 31, 2011 at 8:57 PM, Karamjit Singh <[email protected]>wrote: > Hi Eduard, > > I am already setting user in context usign below code - > ctx.setUser("XWiki.Admin"); > > Please correct if any issue in this code. > > Thanks > Karamjit. > > > On Sun, Jul 31, 2011 at 8:48 PM, Eduard Moraru <[email protected]>wrote: > >> Hi Karamjit, >> >> WikiManager plugin requires admin rights for handling subwikis. >> >> See http://jira.xwiki.org/jira/browse/XEM-113 for details and a >> workaround. >> >> Thanks, >> Eduard >> >> On Jul 31, 2011 5:08 PM, "Karamjit Singh" <[email protected]> wrote: >> > >> > Yes. I have installed it already. I am getting bellow error message >> > " you donot have create wiki rights" >> > >> > Looks like a permission issue. Any idea how to set user in wikicontext? >> > On Jul 31, 2011 7:23 PM, "Eduard Moraru" <[email protected]> wrote: >> > > Hi Karamjit, >> > > >> > > On Sun, Jul 31, 2011 at 2:13 PM, Karamjit Singh < >> [email protected] >> > >wrote: >> > > >> > >> Hi Team, >> > >> >> > >> I am not able to create virtual xwiki through the >> XwikiManagerPluginAPI. >> > I >> > >> have developed just sample restful web service. Below is the code >> which >> I >> > >> am >> > >> using to create virtual xwiki :- >> > >> >> > >> @Component("org.sisgma.xwiki.rest.HelloWorldResource") >> > >> @Path("/hello/") >> > >> public class HelloWorldResource extends XWikiResource { >> > >> public HelloWorldResource(){ >> > >> } >> > >> @GET >> > >> public String get(@DefaultValue("world") String myresourcename) >> throws >> > >> XWikiException, QueryException { >> > >> XWikiContext ctx = Utils.getXWikiContext(componentManager); >> > >> try { >> > >> WikiManagerPluginApi aoi = >> > >> >> > >> >> > >> >> (WikiManagerPluginApi)ctx.getWiki().getPluginApi(WikiManagerPlugin.PLUGIN_NAME, >> > >> ctx); >> > >> ctx.setDoc(new XWikiDocument(new DocumentReference("jaspreet", >> "space", >> > >> "page"))); >> > >> System.out.println("_____________********* deleting xwiki"); >> > >> aoi.deleteWiki("neenu", true); >> > >> aoi.deleteWiki("neenu1", true); >> > >> aoi.deleteWiki("karam", true); >> > >> System.out.println("_____________********* deleted xwikies"); >> > >> System.out.println("_____________********* Creating new xwiki"); >> > >> aoi.createNewWiki("jaspreet", "templatexe", >> > null,aoi.createWikiDocument(), >> > >> true); >> > >> >> > > >> > > Did you install the default template "templatexe"? >> > > >> > > >> > >> } catch (XWikiException e) { >> > >> e.printStackTrace(); >> > >> } >> > >> System.out.println("_____________********* " +ctx); >> > >> System.out.println("_____________"+ctx); >> > >> return "Hello " + myresourcename; >> > >> } >> > >> } >> > >> >> > >> Above code is not working. Virtual xwiki is not being created using >> the >> > >> API. >> > >> >> > > >> > > You should share the stack trace of the exception that is thrown. >> > > >> > > Thanks, >> > > Eduard >> > > >> > > >> > >> It is very urgent. Please help. >> > >> >> > >> Thanks >> > >> Karamjit. >> > >> _______________________________________________ >> > >> devs mailing list >> > >> [email protected] >> > >> http://lists.xwiki.org/mailman/listinfo/devs >> > >> >> > > _______________________________________________ >> > > devs mailing list >> > > [email protected] >> > > http://lists.xwiki.org/mailman/listinfo/devs >> > _______________________________________________ >> > devs mailing list >> > [email protected] >> > http://lists.xwiki.org/mailman/listinfo/devs >> _______________________________________________ >> devs mailing list >> [email protected] >> http://lists.xwiki.org/mailman/listinfo/devs >> > > _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs

