com.ibm.xsp.context
Class DojoLibrary

java.lang.Object
  extended by com.ibm.xsp.context.DojoLibrary
Direct Known Subclasses:
BundleDojoLibrary

public abstract class DojoLibrary
extends java.lang.Object

Dojo Library. Encapsulate the content of a Dojo library.


Field Summary
static java.lang.String BUILD_REPORT
           
static int SYNTAX_LEGACY
           
static int SYNTAX_REQUIRE
           
static java.lang.String UNCOMPRESS_SUFFIX
           
 
Constructor Summary
protected DojoLibrary()
           
 
Method Summary
abstract  boolean exists(java.lang.String path)
          Check if a resource exists in the library.
protected  java.lang.String getBuildReport()
           
 java.util.Map getCSSResources()
          Get access to the Dojo CSS map.
 java.lang.String getDebugFileName(java.lang.String path)
          Get the file name being used, for debugging purposes.
 java.util.Set<java.lang.String> getDojoJsModules()
          Get the list of the dojo modules already loaded by dojo.js
 java.util.Map getDojoResources()
          Get access to the Dojo JS modules map.
 int getDojoSyntax()
          Check the dojo syntax to be used
abstract  java.io.InputStream getFileInputStream(java.lang.String path)
          Read a resource from the library.
abstract  java.lang.String getResourceUrl(java.lang.String url, boolean optimize)
          Encode the resource as a URL.
abstract  com.ibm.xsp.core.Version getVersion()
          Return the actual version of the library.
 int getVersionNumber()
          Shortcut: get the Version number from the version object.
abstract  java.lang.String getVersionTag()
          Return the version of this library.
abstract  boolean hasIbmModules()
          Check if the dojo library also contain the IBM modules.
protected  void initDojoJsDepends()
           
abstract  boolean isDefaultIbmLibrary()
          Check if the library is the default one for IBM classes.
abstract  boolean isDefaultLibrary()
          Check if the library is the default one.
 boolean isSyntaxLegacy()
           
 boolean isSyntaxRequire()
           
 boolean isUncompressed()
          Check if the library uses uncompressed files.
protected  java.util.Set<java.lang.String> loadLayer(java.lang.String layer)
           
abstract  boolean useIbmLayers()
          Check if the layers can be used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUILD_REPORT

public static final java.lang.String BUILD_REPORT
See Also:
Constant Field Values

UNCOMPRESS_SUFFIX

public static final java.lang.String UNCOMPRESS_SUFFIX
See Also:
Constant Field Values

SYNTAX_LEGACY

public static final int SYNTAX_LEGACY
See Also:
Constant Field Values

SYNTAX_REQUIRE

public static final int SYNTAX_REQUIRE
See Also:
Constant Field Values
Constructor Detail

DojoLibrary

protected DojoLibrary()
Method Detail

initDojoJsDepends

protected void initDojoJsDepends()

isUncompressed

public boolean isUncompressed()
Check if the library uses uncompressed files. This should be overridden in subclasses, but a default implementation (false) is provided for backward compatibility reasons.


isDefaultLibrary

public abstract boolean isDefaultLibrary()
Check if the library is the default one.


isDefaultIbmLibrary

public abstract boolean isDefaultIbmLibrary()
Check if the library is the default one for IBM classes.


getVersion

public abstract com.ibm.xsp.core.Version getVersion()
Return the actual version of the library.

Returns:

getVersionNumber

public final int getVersionNumber()
Shortcut: get the Version number from the version object.

Returns:

getVersionTag

public abstract java.lang.String getVersionTag()
Return the version of this library. The form of the version should be x.y.z, like 1.4.3 or 1.5.0

Returns:

getResourceUrl

public abstract java.lang.String getResourceUrl(java.lang.String url,
                                                boolean optimize)
Encode the resource as a URL. This method does all the necessary transformation for a URL. For example, it replaces an access to the servlet by a physical access to the Domino server. Or simply an access to a dojo resource that is not in the default library with a url that inludes the library version (e.g /dojoroot/ into /dojolib/x.y.z/)

Parameters:
url -
Returns:

exists

public abstract boolean exists(java.lang.String path)
Check if a resource exists in the library. The path should be a path to the file, like /dijit/TextBox.js


getFileInputStream

public abstract java.io.InputStream getFileInputStream(java.lang.String path)
                                                throws java.io.IOException
Read a resource from the library. The path should be a path to the file, like /dijit/TextBox.js

Throws:
java.io.IOException

getDebugFileName

public java.lang.String getDebugFileName(java.lang.String path)
                                  throws java.io.IOException
Get the file name being used, for debugging purposes. The name is written to the logger traceDebug methods. This method should be overridden in subclasses, but a (mostly useless) implementation is provided for backward compatibility reasons. Note, this isn't asking for the uncompressed name specifically, just a developer-understandable name for the file that would be loaded by the getFileInputStream(String) method, (the actual file may be compressed or uncompressed).

Throws:
java.io.IOException

hasIbmModules

public abstract boolean hasIbmModules()
Check if the dojo library also contain the IBM modules. The IbmModules (ibm.) are installed with the domino servers libraries but might not be installed by other contributed libraries. In that case, the runtime should read them from the default library.


useIbmLayers

public abstract boolean useIbmLayers()
Check if the layers can be used. The built layers can be used only if the IBM modules are contributed as part of the library. Practically, this means that the library is delivered as part of Notes/Domino, and not contributed apart from it.


getDojoSyntax

public int getDojoSyntax()
Check the dojo syntax to be used


isSyntaxRequire

public boolean isSyntaxRequire()

isSyntaxLegacy

public boolean isSyntaxLegacy()

getDojoJsModules

public java.util.Set<java.lang.String> getDojoJsModules()
Get the list of the dojo modules already loaded by dojo.js


getDojoResources

public java.util.Map getDojoResources()
Get access to the Dojo JS modules map.


getCSSResources

public java.util.Map getCSSResources()
Get access to the Dojo CSS map.


loadLayer

protected java.util.Set<java.lang.String> loadLayer(java.lang.String layer)

getBuildReport

protected java.lang.String getBuildReport()