Examples of DojoLibrary


Examples of com.ibm.sbt.jslibrary.servlet.DojoLibrary

    ClassLoader loader = current.getContextClassLoader();
      try {
        current.setContextClassLoader(getClass().getClassLoader());
        context = createContext();
       
        DojoLibrary library = new DojoLibrary();
       
          // load initialization parameters
        LibraryRequestParams params = new LibraryRequestParams();
        params.initDefaults();
        if (params.getEnvironment() == null) {
          params.setEnvironment(createDefaultEnvironment(renderContext));
        }
       
        LibraryRequest request = new LibraryRequest(renderContext.request, null);
        request.init(params);
        request.setRegPath(false);
        request.setInitJs(true);
        request.setDebug(renderContext.mode == Mode.DEBUG);
       
        output = library.generateJavaScript(request);
      } catch (LibraryException e) {
        e.printStackTrace();
        throw new IOException("Error writing library init", e);
      } finally {
        destroyContext(context);
View Full Code Here

Examples of com.ibm.sbt.jslibrary.servlet.DojoLibrary

  @Test
    public void testDojoLibrary() throws Exception {
      try {
        createContext();
       
        DojoLibrary library = new DojoLibrary();
       
          // load initialization parameters
        LibraryRequestParams params = new LibraryRequestParams();
        params.initDefaults();
        params.setParameter("debug", "true");
        params.setParameter("_js", "false");
          params.setRequestUrl("https://localhost:8443/sbt.sample.web/library?lib=dojo&ver=1.4.3&debug=true");
          params.setServerUrl("https://localhost:8443");
          params.setContextUrl("https://localhost:8443/sbt.sample.web");
          params.setServiceUrl("%context_path%/service");
          params.setContextPath("/sbt.sample.web");
          params.setPathInfo("/init.js");
       
        LibraryRequest request = new LibraryRequest();
        request.init(params);
       
        String javascript = library.generateJavaScript(request);
        System.out.println(javascript);
        Assert.assertNotNull(javascript);
      } catch (Exception e) {
        e.printStackTrace(System.err);
        Assert.fail("Error generating javascript caused by:"+e.getMessage());
View Full Code Here

Examples of com.ibm.xsp.context.DojoLibrary

        pw.println("        ]");
      }
     
      protected void aggregatorAddLibraryModules(DojoDependencyList dojoResources) throws IOException {
            ResourceFactory factory = dojoResources.getFactory();
            DojoLibrary dojoLibrary = dojoResources.getDojoLibrary();
   
    //        if(includeSDKModules) {
          // The resources bellow are generally needed
          // They should not be included if the SDK layer is already loaded
            dojoResources.addResource(factory.getDojoResource("sbt.config",dojoLibrary));
View Full Code Here

Examples of com.ibm.xsp.context.DojoLibrary

  //
  // Helpers
  //
  public static class BaseRenderer {
    protected static String getDefautLibraryPath(String serverUrl) {
      DojoLibrary lib = DojoLibraryFactory.getDefaultLibrary();
          String s = '-'+lib.getVersionTag();
      return serverUrl+"/xsp/.ibmxspres/dojoroot"+s+"/";
    }
View Full Code Here

Examples of com.ibm.xsp.context.DojoLibrary

    }
   
    protected String aggregatorAddModules(String serverUrl, String js, boolean includeLibraryModules) throws IOException {
      // XPages aggregator
          ResourceFactory factory = ResourceFactory.get();
          DojoLibrary dojoLibrary = DojoLibraryFactory.getDefaultLibrary(false);
          String dojoLocale = "en-us";
          DojoDependencyList dojoResources = new DojoDependencyList(factory,dojoLibrary,dojoLocale);
         
          aggregatorAddDojoModules(dojoResources);
          if(includeLibraryModules) {
            aggregatorAddLibraryModules(dojoResources);
          }
          aggregatorAddJSDependencyModules(dojoResources, js);
 
          StringBuilder b = new StringBuilder();
          b.append(MinifierResourceProvider.URL_DOJO);
          if(dojoLibrary.isUncompressed() || dojoLibrary!=DojoLibraryFactory.getDefaultLibrary(false)) {
              b.append('-');
              b.append(dojoLibrary.getVersionTag());
          }
          b.append('/');
          b.append(dojoResources.getUrlParameter());
          b.append(".js"); // $NON-NLS-1$
          String fullUrl = b.toString();
View Full Code Here

Examples of com.ibm.xsp.context.DojoLibrary

          return dojoAgg;
    }
     
    protected void aggregatorAddDojoModules(DojoDependencyList dojoResources) throws IOException {
          ResourceFactory factory = dojoResources.getFactory();
          DojoLibrary dojoLibrary = dojoResources.getDojoLibrary();
         
        // Common dojo resources
          dojoResources.addResource(factory.getDojoResource("dojo.parser",dojoLibrary));
          dojoResources.addResource(factory.getDojoResource("dojo.date",dojoLibrary));
          dojoResources.addResource(factory.getDojoResource("dojo.date.locale",dojoLibrary));
View Full Code Here

Examples of com.ibm.xsp.context.DojoLibrary

    protected void aggregatorAddLibraryModules(DojoDependencyList dojoResources) throws IOException {
    }
   
    protected void aggregatorAddJSDependencyModules(DojoDependencyList dojoResources, String js) throws IOException {
          ResourceFactory factory = dojoResources.getFactory();
          DojoLibrary dojoLibrary = dojoResources.getDojoLibrary();
 
          //if(includeSDKModules) {
          // Extract the entries from the JS file
          // This might be in the SDK layer already, so we don't load them if not fully using the XPages agg but the SDK one
          if(StringUtil.isNotEmpty(js)) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.