This discussion is archived
1 Reply Latest reply: Mar 28, 2012 9:23 AM by pbell RSS

Beehive BDK create wiki page

916520 Newbie
Currently Being Moderated
Gurus,

Im using the Beehive BDK in java, generated off https://stbeehive.oracle.com/ws/wsdl using ant and WSIMPORT.

I can get lots of the code to work, but when I create the wiki page, I get nothing no content etc.

The basic code is below. The page is created with the name etc as I expect. Just no content.

Ideas? Thoughts? Examples are greatly appreciated!

Note that in an earlier example the IdentifiableSimpleContentUpdater class was used vs the SimpleContentUpdater. However the example called setContentStream(byte[])). Unfortuantely this method doesn't exist when I generate the java interfaces from the WSDL. On SimpleContentUpdater there is a similar method setContentBytes(byte[]) but it doesn't seem to work.



          TeamWorkspace teamWS = getWorkspace(workspaceName);
          
          if (teamWS == null ) {
               throw new BHException("createOID cannot create OIG, workspace '"+workspaceName+"' does not exist");
          }
          
          
          /**
          * Create a wiki page using the default wiki page folder
          * specified by the parent id
          */
     WikiPageCreator wikiPageCreator = new WikiPageCreator();
wikiPageCreator.setParent(teamWS.getDefaultWikiFolder().getCollabId());

/**
* Ignore attempts by two users to create the same page
* In theory its a new page so it should never happen
*/
     wikiPageCreator.setIgnorePendingConflicts(true);
     wikiPageCreator.setName(oigName);
     
     /**
     * Wiki page updater specifies information about the wiki page itself
     * Meta-data basically, note that the name is set in the creator
     *
     */
     WikiPageUpdater wikiPageUpdater = new WikiPageUpdater();
     wikiPageCreator.setUpdater(wikiPageUpdater);
     
     wikiPageUpdater.setDescription("OIG Template");
     wikiPageUpdater.setIncrementViewCount(true); // increment view count when someone looks
     
     /*Identifiable */ SimpleContentUpdater updater = new /*Identifiable*/ SimpleContentUpdater();
     wikiPageUpdater.setUpdatedBody(updater);
     //updater.
     
     
     IdentifiableSimpleContentUpdater updater2 = new IdentifiableSimpleContentUpdater();
     
     String content = new String();
     content ="this is some content";
     try {
               updater.setContentBytes (content.getBytes("UTF-8"));
          } catch (UnsupportedEncodingException e) {
                              e.printStackTrace();
          }
     
     getWikiService().createWikiPage(wikiPageCreator, null,getProjection("BASIC"));
  • 1. Re: Beehive BDK create wiki page
    pbell Pro
    Currently Being Moderated
    The reason the wiki page is empty is you have only done the second part of the process - you have to upload your content first and then associate the content with the wiki page - it is a 2 step process. - unfortunately it looks like the upload functionality was not put in the service so you will have to use REST which does have the necessary pieces.

    Phil

    Edited by: pbell on Mar 28, 2012 9:22 AM

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points