Skip to Content
0
May 27, 2015 at 09:19 AM

Create Wiki Space in Portal Component with IWikiSpaceManager

20 Views

Hi,

we try to create Wiki Spaces and Pages out of a Portal Component.(Release/Patch: SAP NetWeaver 7.4 SP09)

Coding in function "CreateWiki":

WikiContext context = new WikiContext(request.getUser());

WikiFactory wiki = WikiFactory.getInstance(context);

IWikiSpaceManager wikiSpaceManager = wiki.getSpaceManager();

IWikiSpace neu = wikiSpaceManager.createSpace("Generated Wiki", "Generated Wiki");

Imports:

import com.sap.netweaver.coll.wiki.WikiContext;

import com.sap.netweaver.coll.wiki.WikiFactory;

import com.sap.netweaver.coll.wiki.api.IWikiSpace;

import com.sap.netweaver.coll.wiki.api.IWikiSpaceManager;

Dependencies:

com.sap.netweaver.coll.wiki.api

Exceptions:

We get an exception when "wikiSpaceManager.createSpace" is called:

12:26:56:502 at XXXXXXXXXXXXXXXX.KmItem.CreateWiki(KmItem.java:106) System.err

12:26:56:502 at com.sap.netweaver.coll.wiki.WikiFactory.getSpaceManager(WikiFactory.java:88) System.err

12:26:56:502 at com.sap.netweaver.coll.wiki.WikiSpaceManager.<init>(WikiSpaceManager.java:31) System.err

12:26:56:502 at com.sap.netweaver.coll.wiki.WikiContext.getWikiService(WikiContext.java:210) System.err

12:26:56:502 at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:135) System.err

12:26:56:501 at com.sap.engine.system.PortableRemoteObjectProxy.narrow(PortableRemoteObjectProxy.java:24) System.err

12:26:56:501 at com.sap.engine.services.cross.PortableRemoteObjectContainer.narrow(PortableRemoteObjectContainer.java:238) System.err

12:26:56:500 java.lang.ClassCastException: com.sap.netweaver.coll.wiki.ejb.api.IWikiSpaceService

Any suggestions?

Regards,

Golo