2 Replies Latest reply: Apr 11, 2014 11:00 AM by Satish_Bathala RSS

    How to manage page's group space with Webcenter Portal Spaces API?

    t.avezard

      Webcenter Portal Spaces 11.1.1.6 PS5

       

       

      Hi,

       

       

      My mission is to manage all the pages of a group space. One of this thing I would like to do is to hide a page.

      I tried the page service API, but without success.

       

      Here is what I did :

       

       

      public void hideGSPage(String guid, String pageName){

       

        if(guid!=null && pageName != null){

       

          PageService mPageService = PageServiceFactory.createInstance(new PageServiceConfig((MDSSession)ADFContext.getCurrent().getMDSSessionAsObject(), guid));

       

          if(mPageService != null){

       

            mPageService.setScope(guid);

       

            String initPath = "oracle/webcenter/page/scopedMD/";

       

            //ex path = oracle/webcenter/page/scopedMD/s40fb16ca_8550_489b_b405_70af0efd95c8/Page18.jspx

            String path = initPath + guid + "/" + pageName;

       

            PageDef pageDef = mPageService.getPage(path);

       

            if(pageDef != null){

       

          pageDef.setHidden(true);

       

          try{

       

            mPageService.updatePageDefAttributes(pageDef);

            mPageService.saveChanges();

            mPageService.invalidateScopeCache();

       

          } catch (ObjectChangedException e) {

       

            e.printStackTrace();

         

          } catch (InvalidNameException e) {

       

            e.printStackTrace();

       

          } catch (LockUnavailableException e) {

       

            e.printStackTrace();

       

          }

       

            }

       

          }

       

        }

       

      }

       

       

      Will I forget something?

      What have I done wrong?

      Does the page service API are always used to do that?

       

      Best regards,

       

      Thomas