0 Replies Latest reply: Feb 14, 2013 9:12 AM by 984208 RSS

    SSXA ScriptableClientApplication not retrieving some informations

      I am trying to setup a small Java program using the Site Studio API (http://docs.oracle.com/cd/E17904_01/apirefs.1111/e17273/index.html?oracle/stellent/wcm/javaee/servlet/WCMServletApplication.html) in order to do batch treatments on my web sites. I successfully created a ScriptableClientApplication based on the wcm-config.xml file I use for my Java EE Project to maintain my website and I am able to browse through my site structure.

      Unfortunately, some features seem to be unavailable. Per example, the getRegionDefinition() method on a valid Placeholder object always returns null.

      I first thought that I needed to specify a valid username and password in order to obtain such information. I then added valid credentials to the "adminUser" and "adminPassword" attributes of the <contentServer /> tag in the wcm-config.xml file, but I still get the same result.

      Am i missing something to set all of this up?

      Here's a sample of the code I am using:
      ConfigurationFileLoader configFL = new ConfigurationFileLoader(new FileResource("wcm-config.xml"));
      ClientApplication app = new ScriptableClientApplication(configFL.getConfiguration());
      Project mySite = app.getServerContext().getProjectService().getProject("mySite");
      SectionNode rootSection = mySite.getStructure().getRootSection();
      log(rootSection.getUrlPath()); //Outputs the right path
      log(rootSection.getPrimaryLayout().getPlaceholder("main-placeholder").getDataFile()); //Outputs the right datafile dDocName
      log(rootSection.getPrimaryLayout().getPlaceholder("main-placeholder").getRegionDefinition()); //Outputs null