Package org.cruxframework.crux.core.rebind.module

Examples of org.cruxframework.crux.core.rebind.module.Module


  public Document getRootView(String relativeScreenId, String moduleId, String device) throws CruxGeneratorException
    {
    try
        {
          Set<String> screenIDs = ScreenResourceResolverInitializer.getScreenResourceResolver().getAllScreenIDs(moduleId);
          Module module = Modules.getInstance().getModule(moduleId);
         
          if (screenIDs == null || module == null)
          {
            throw new ScreenConfigException("Can not find pages for module ["+moduleId+"]");
          }
View Full Code Here


     
      extractFolderViews(result, url, handler);
     
      if (moduleId != null)
      {
        Module module = Modules.getInstance().getModule(moduleId);
        URL moduleLocation = module.getLocation();
        URLResourceHandler resourceHandler = URLResourceHandlersRegistry.getURLResourceHandler(moduleLocation.getProtocol());
        for(String publicPath: module.getPublicPaths())
        {
          extractFolderViews(result, resourceHandler.getChildResource(moduleLocation, publicPath), handler);
        }
      }
    }
View Full Code Here

  private static void extractModuleViews(String viewsLocator, List<String> result)
    {
      viewsLocator = viewsLocator.substring(1);
      int index = viewsLocator.indexOf("/");
      String moduleId = viewsLocator.substring(0, index);
      Module module = Modules.getInstance().getModule(moduleId);
      if (module == null)
      {
        throw new ViewException("Invalid module ["+moduleId+"] referenced by the view locator expression ["+viewsLocator+"]");
      }
      if (viewsLocator.length() > index +1)
      {
        viewsLocator = viewsLocator.substring(index+1);
        if (isViewName(viewsLocator))
        {
          List<URL> urls = views.get(viewsLocator);
          if (urls != null)
          {
            for(URL url: urls)
            {
              if (Modules.getInstance().isResourceOnModulePath(url, moduleId))
              {
                result.add(viewsLocator);
              }
            }
          }
        }
        else
        {
          URL rootURL = Modules.getInstance().getModuleRootURL(moduleId);
          URLResourceHandler urlResourceHandler = URLResourceHandlersRegistry.getURLResourceHandler(rootURL.getProtocol());
          FilePatternHandler handler = new FilePatternHandler(viewsLocator, null);
          for (String path : module.getPublicPaths())
              {
            URL modulePublicPath = urlResourceHandler.getChildResource(rootURL, path);
            extractFolderViews(result, modulePublicPath, handler);
              }
        }
View Full Code Here

   * @return
   * @throws ScreenConfigException
   */
  public String getRelativeScreenId(String id, String module) throws ScreenConfigException
  {
    Module mod = Modules.getInstance().getModule(module);
    if (mod == null)
    {
      throw new ScreenConfigException("No module declared on screen ["+id+"].");
    }
    return Modules.getInstance().getRelativeScreenId(mod, id);
View Full Code Here

  {
    Element screenElement = screen.getDocumentElement();
    String moduleName = screenElement.getAttribute("moduleName");
    String screenId = screenElement.getAttribute("screenId");

    Module mod = Modules.getInstance().getModule(moduleName);
    if (mod == null)
    {
      throw new ScreenConfigException("No module declared on screen ["+id+"].");
    }
    String relativeScreenId = Modules.getInstance().getRelativeScreenId(mod, id).replace(".offline.xml", ".html");
View Full Code Here

      return args.toArray(new String[args.size()]);
    }

  private String findUserAgentInModules(String currentModuleName)
  {
    Module module = Modules.getInstance().getModule(currentModuleName);
   
    if(module == null)
    {
      return null;
    }
   
    if(module.getUserAgent() != null)
    {
      return module.getUserAgent();
    }
   
    for(String inherits : module.getInherits())
    {
      String foundUserAgent = findUserAgentInModules(inherits);
      if(StringUtils.isEmpty(foundUserAgent))
      {
        return foundUserAgent;
View Full Code Here

  public static void main(String[] args) throws MalformedURLException
  {
    CruxRegisterUtil.registerFilesCruxBridge(args);
   
    String initialModule = CruxRegisterUtil.getModule(args);
    Module module = Modules.getInstance().getModule(initialModule);
    if (module != null)
    {
      initialModule = module.getFullName();
    }
   
    String[] newArgs = new String[args.length+1];
    System.arraycopy(args, 0, newArgs, 0, args.length);
    newArgs[args.length] = initialModule;
View Full Code Here

   * @throws IOException
   * @throws InterfaceConfigException
   */
  public static String findModuleNameFromHostedPage(URL pageFile) throws IOException, InterfaceConfigException
  {
    Module module = findModuleFromPageUrl(pageFile);
    if (module != null)
    {
      return module.getFullName();
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of org.cruxframework.crux.core.rebind.module.Module

Copyright © 2018 www.massapicom. 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.