Class PageDefinitions

java.lang.Object
org.zkoss.zk.ui.metainfo.PageDefinitions

public class PageDefinitions extends Object
Utilities to retrieve page definitions.
Author:
tomyeh
  • Constructor Details

    • PageDefinitions

      public PageDefinitions()
  • Method Details

    • getPageDefinitionDirectly

      public static final PageDefinition getPageDefinitionDirectly(WebApp wapp, org.zkoss.util.resource.Locator locator, String content, String extension)
      Returns the page definition of the specified raw content; never null.

      This is the lowest method that other getPageDefinitionDirectly depends.

      Dependency: Execution.createComponentsDirectly -& Execution.getPageDefinitionDirectly -& UiFactory.getPageDefiitionDirectly -& PageDefintions.getPageDefinitionDirectly

      Parameters:
      locator - the locator used to locate taglib and other resources. If null, wapp is assumed (WebApp is also assumed).
      extension - the default extension if the content doesn't specify an language. In other words, if the content doesn't specify an language, LanguageDefinition.getByExtension(java.lang.String) is called. If extension is null and the content doesn't specify a language, the language called "xul/html" is assumed.
      Throws:
      UiException - if failed to parse
    • getPageDefinitionDirectly

      public static final PageDefinition getPageDefinitionDirectly(WebApp wapp, org.zkoss.util.resource.Locator locator, Reader reader, String extension) throws IOException
      Returns the page definition of the raw content from the specified reader; never null.
      Parameters:
      locator - the locator used to locate taglib and other resources. If null, wapp is assumed (WebApp is also assumed).
      extension - the default extension if the content doesn't specify an language. In other words, if the content doesn't specify an language, LanguageDefinition.getByExtension(java.lang.String) is called. If extension is null and the content doesn't specify a language, the language called "xul/html" is assumed.
      Throws:
      UiException - if failed to parse
      IOException
    • getPageDefinitionDirectly

      public static final PageDefinition getPageDefinitionDirectly(WebApp wapp, org.zkoss.util.resource.Locator locator, org.zkoss.idom.Document doc, String extension)
      Returns the page definition of the specified raw content in DOM; never null.
      Parameters:
      locator - the locator used to locate taglib and other resources. If null, wapp is assumed (WebApp is also assumed).
      extension - the default extension if the content doesn't specify an language. In other words, if the content doesn't specify an language, LanguageDefinition.getByExtension(java.lang.String) is called. If extension is null and the content doesn't specify a language, the language called "xul/html" is assumed.
      Throws:
      UiException - if failed to parse
    • getPageDefinition

      public static final PageDefinition getPageDefinition(WebApp wapp, org.zkoss.util.resource.Locator locator, String path)
      Returns the page definition of the specified path, or null if not found or failed to parse.

      This is the lowest method that other getPageDefinition depends.

      Dependency: Execution.createComponents -& Execution.getPageDefinition -& UiFactory.getPageDefiition -& PageDefintions.getPageDefinition

      Parameters:
      locator - the locator used to locate taglib and other resources. If null, wapp is assumed (WebApp is also assumed).
    • getLocator

      public static final org.zkoss.util.resource.Locator getLocator(WebApp wapp, String path)
      Returns the locator for the specified context.
      Parameters:
      path - the original path, or null if not available. The original path is used to resolve a relative path. If not specified, Desktop.getCurrentDirectory() is used.