Oxygen XML Editor 14.2 Author API

ro.sync.util.editorvars
Class EditorVariables

java.lang.Object
  extended by ro.sync.util.editorvars.EditorVariables

@API(type=NOT_EXTENDABLE,
     src=PRIVATE)
public final class EditorVariables
extends java.lang.Object

Holds constants representing all editor variables defined in Oxygen.


Nested Class Summary
static class EditorVariables.FrameworkRewritePolicy
          Used to determine how framework variables should be expanded/rewritten.
static interface EditorVariables.FunctionResolver
          Resolves a function
 
Field Summary
static java.lang.String ANCESTOR_FILE_TO_DIFF
          The ancestor file to diff.
static java.lang.String ARCHIVE_FILE_DIRECTORY
          The archive directory editor variable.
static java.lang.String ARCHIVE_FILE_DIRECTORY_URL
          The archive directory URL editor variable.
static java.lang.String ARCHIVE_NAME
          The archive name editor variable.
static java.lang.String ARCHIVE_NAME_WITH_EXTENSION
          The archive name with extension editor variable.
static java.lang.String ARCHIVE_PATH
          The archive path editor variable.
static java.lang.String ARCHIVE_PATH_URL
          The archive path URL editor variable.
static java.lang.String ASK_PARAM_VALUE_TEMPLATE
          Used to show the user the options he has to ask for a value.
static java.lang.String CT_CARET_EDITOR_VARIABLE
          The caret editor variable.
static java.lang.String CT_SELECTION_EDITOR_VARIABLE
          The caret editor variable.
static java.lang.String CURRENT_FILE
          The current file editor variable.
static java.lang.String CURRENT_FILE_DIRECTORY
          The current file directory editor variable.
static java.lang.String CURRENT_FILE_DIRECTORY_URL
          The current file directory url editor variable.
static java.lang.String CURRENT_FILE_URL
          The current file url editor variable.
static java.lang.String CURRENT_FILE_URL_OLD
          The current file url editor variable old version.
static java.lang.String CURRENT_FILENAME
          The current filename editor variable.
static java.lang.String CURRENT_FILENAME_WITH_EXTENSION
          The current filename extension editor variable.
static java.lang.String DATE_FUNCTION_SAMPLE
          Sample of date function specification
static java.lang.String DEBUGGER_XML_SOURCE
          The debugger XML input editor variable.
static java.lang.String DEBUGGER_XSL_SOURCE
          The debugger XSL input editor variable.
static java.lang.String DETECTED_SCHEMA
          The detected schema editor variable.
static java.lang.String DETECTED_SCHEMA_URL
          The detected schema URL editor variable.
static java.lang.String EDITOR_VARIABLES_PREFIX
          The editor variables prefix
static java.lang.String FIRST_FILE_TO_DIFF
          The first file to diff.
static java.lang.String FO_INPUT_FILE
          The FO input file editor variable.
static java.lang.String FOP_AH_TRANSFORMATION_METHOD
          The FOP Antenna House transformation method editor variable.
static java.lang.String FOP_TRANSFORMATION_METHOD
          The FOP transformation method editor variable.
static java.lang.String FRAMEWORK_DIRECTORY
          Represents the framework directory where the document type that contains this reference resides.
static java.lang.String FRAMEWORK_URL
          The framework directory URL editor variable.
static java.lang.String FRAMEWORKS_DIRECTORY
          The frameworks directory editor variable.
static java.lang.String FRAMEWORKS_DIRECTORY_URL
          The frameworks directory URL editor variable.
static java.lang.String FUNCTION_VARIABLE_SUFFIX
          Suffix for functions (env or system)
static java.lang.String ID
          The unique friendly ID generated by Oxygen.
static java.lang.String OUTPUT_FILE
          The output file editor variable.
static java.lang.String OUTPUT_FILE_URL
          The output file URL editor variable.
static java.lang.String OXYGEN_HOME_URL
          The Oxygen Home URL editor variable.
static java.lang.String OXYGEN_INSTALL_DIR
          The oxygen install dir editor variable.
static java.lang.String PATH_SEPARATOR
          Path separator editor variable.
static java.lang.String PROJECT_DIRECTORY
          The project directory editor variable.
static java.lang.String PROJECT_DIRECTORY_URL
          The project directory URL editor variable.
static java.lang.String PROJECT_NAME
          The project name editor variable The value is ${pn}.
static java.lang.String SECOND_FILE_TO_DIFF
          The second file to diff.
static java.lang.String SQL
          SQL Document editor variable The value is ${sql}.
static java.lang.String SQL_URL
          XSL Document URL editor variable The value is ${xslu}.
static java.lang.String TIMESTAMP
          The time stamp.
static java.lang.String TRANSFORMATION_SAVED_FILE
          The transformation saved file editor Variable.
static java.lang.String TRANSLATE_FUNCTION_VARIABLE_PREFIX
          Prefix for translate functions
static java.lang.String UNIQUE_CARET_MARKER_FOR_AUTHOR
          Unique marker used to position the caret
static java.lang.String UNIQUE_CARET_MARKER_PI_NAME_FOR_AUTHOR
          Unique marker used to position the caret
static java.lang.String USER_HOME_DIR
          The user home dir editor variable.
static java.lang.String USER_HOME_URL
          The user home URL editor variable.
static java.lang.String UUID
          The UUID.
static java.lang.String XML
          XML Document editor variable.
static java.lang.String XML_URL
          XML Document URL editor variable The value is ${xmlu}.
static java.lang.String XPROC
          XProc Document editor variable The value is ${xproc}.
static java.lang.String XPROC_URL
          XSL Document URL editor variable The value is ${xslu}.
static java.lang.String XQUERY
          XQuery Document editor variable The value is ${xquery}.
static java.lang.String XQUERY_URL
          XSL Document URL editor variable The value is ${xslu}.
static java.lang.String XSL
          XSL Document editor variable The value is ${xsl}.
static java.lang.String XSL_URL
          XSL Document URL editor variable The value is ${xslu}.
 
Constructor Summary
EditorVariables()
           
 
Method Summary
static boolean containsEditorVariable(java.lang.String expression)
          Checks if the given expression contains editor variables.
static java.lang.String expandEditorVariables(java.lang.String expr, java.lang.String currentEditedFileURL)
          Expand the editor variables in the output file name.
static java.lang.String expandFrameworksVariables(java.lang.String expr, EditorVariables.FrameworkRewritePolicy rewritePolicy, java.io.File frameworksDir, java.net.URL frameworksURL, java.io.File frameworkDir, java.net.URL frameworkURL)
          Expand FRAMEWORKS_DIRECTORY_URL, FRAMEWORKS_DIRECTORY, FRAMEWORK_DIRECTORY and FRAMEWORK_URL.
static java.lang.String expandFrameworksVariables(java.lang.String expr, java.lang.String frameworkStoreLocation, EditorVariables.FrameworkRewritePolicy rewritePolicy)
          Expand FRAMEWORKS_DIRECTORY_URL, FRAMEWORKS_DIRECTORY, FRAMEWORK_DIRECTORY and FRAMEWORK_URL.
static java.lang.String generateUniqueID()
           
static java.io.File getBaseUserFrameworksDir()
          Get the base frameworks directory from the user preferences directory like: Users\***\AppData\Roaming\com.oxygenxml\extensions\v14.0\frameworks Note: This is not the actual directory with frameworks but the directory which contains all frameworks directories.
static java.net.URL getCurrentArchiveURL(java.lang.String currentFileSystemID)
          Returns the URL of the current archive.
static java.net.URL getCurrentFrameworksURL()
          Get the current frameworks directory.
static java.net.URL getCurrentProjectURL(java.lang.String currentFileSystemID)
          Returns the URL of the current project.
static java.lang.String getDescription(java.lang.String editorVariable)
          Returns a description of the editor variable.
static java.io.File getFrameworksDir()
          Get the File representing the "frameworks" directory.
static java.net.URL getFrameworksUrl()
          Get the "frameworks" directory URL.
static java.lang.String getSystemPathSeparator()
           
static java.io.File[] getUserFrameworksDirs()
          Get the frameworks directories from the user preferences directory like: Users\***\AppData\Roaming\com.oxygenxml\extensions\v14.0\frameworks\{update_site}.
static java.lang.String makeFileRelative2Framework(java.lang.String path, java.lang.String frameworkFilePath)
          Make a file or directory relative to the $framework or $frameworks directory.
static java.lang.String makeFileRelative2Frameworks(java.lang.String fileOrDir)
          Make a file or directory relative to the "frameworks" directory.
static java.lang.String makeURLRelative2Framework(java.lang.String url, java.lang.String frameworkFileURL)
          Make an URL relative to $framework or that if not possible, to $frameworks (also if possible).
static java.lang.String makeURLRelative2Frameworks(java.lang.String url)
          Make an URL relative to the "frameworks" directory.
static java.lang.String replaceFunctions(java.lang.String expr, java.lang.String functionVariablePrefix, java.lang.String functionVariableSuffix, EditorVariables.FunctionResolver keyToValueMap)
          Replace all functions with the value taken from the map corresponding to the key
static void setArchiveExtensionsRecognizer(ro.sync.util.ArchiveExtensionsRecognizer archiveExtensionsRecognizer)
          Set an archive extensions recognizer
static void setArchiveURLProvider(ro.sync.util.ArchiveURLProvider archiveURLProvider)
          Set the archive URL provider.
static void setFrameworksDirForTest(java.io.File fDir)
          Set a frameworks dir so it will not be computed from the home url.
static void setFrameworksURLForTest(java.net.URL fURL)
          Set a frameworks url so it will not be computed from the home url.
static void setProjectURLProvider(ro.sync.util.ProjectURLProvider projectURLProvider)
          Set the project URL provider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EDITOR_VARIABLES_PREFIX

public static final java.lang.String EDITOR_VARIABLES_PREFIX
The editor variables prefix

See Also:
Constant Field Values

CURRENT_FILE_DIRECTORY_URL

public static final java.lang.String CURRENT_FILE_DIRECTORY_URL
The current file directory url editor variable. The value is ${cfdu}.

See Also:
Constant Field Values

CURRENT_FILE_DIRECTORY

public static final java.lang.String CURRENT_FILE_DIRECTORY
The current file directory editor variable. The value is ${cfd}.

See Also:
Constant Field Values

CURRENT_FILE_URL

public static final java.lang.String CURRENT_FILE_URL
The current file url editor variable. The value is ${currentFileURL}.

See Also:
Constant Field Values

CURRENT_FILE_URL_OLD

public static final java.lang.String CURRENT_FILE_URL_OLD
The current file url editor variable old version. The value is ${cfu}.

See Also:
Constant Field Values

CURRENT_FILE

public static final java.lang.String CURRENT_FILE
The current file editor variable. The value is ${cf}.

See Also:
Constant Field Values

CURRENT_FILENAME

public static final java.lang.String CURRENT_FILENAME
The current filename editor variable. The value is ${cfn}.

See Also:
Constant Field Values

CURRENT_FILENAME_WITH_EXTENSION

public static final java.lang.String CURRENT_FILENAME_WITH_EXTENSION
The current filename extension editor variable. The value is ${cfne}.

See Also:
Constant Field Values

PROJECT_DIRECTORY_URL

public static final java.lang.String PROJECT_DIRECTORY_URL
The project directory URL editor variable. The value is ${pdu}.

See Also:
Constant Field Values

PROJECT_DIRECTORY

public static final java.lang.String PROJECT_DIRECTORY
The project directory editor variable. The value is ${pd}.

See Also:
Constant Field Values

PROJECT_NAME

public static final java.lang.String PROJECT_NAME
The project name editor variable The value is ${pn}.

See Also:
Constant Field Values

ARCHIVE_NAME

public static final java.lang.String ARCHIVE_NAME
The archive name editor variable.

See Also:
Constant Field Values

ARCHIVE_NAME_WITH_EXTENSION

public static final java.lang.String ARCHIVE_NAME_WITH_EXTENSION
The archive name with extension editor variable.

See Also:
Constant Field Values

ARCHIVE_PATH

public static final java.lang.String ARCHIVE_PATH
The archive path editor variable.

See Also:
Constant Field Values

ARCHIVE_PATH_URL

public static final java.lang.String ARCHIVE_PATH_URL
The archive path URL editor variable.

See Also:
Constant Field Values

ARCHIVE_FILE_DIRECTORY

public static final java.lang.String ARCHIVE_FILE_DIRECTORY
The archive directory editor variable.

See Also:
Constant Field Values

ARCHIVE_FILE_DIRECTORY_URL

public static final java.lang.String ARCHIVE_FILE_DIRECTORY_URL
The archive directory URL editor variable.

See Also:
Constant Field Values

FRAMEWORKS_DIRECTORY_URL

public static final java.lang.String FRAMEWORKS_DIRECTORY_URL
The frameworks directory URL editor variable. The value is ${frameworks}.

See Also:
Constant Field Values

USER_HOME_URL

public static final java.lang.String USER_HOME_URL
The user home URL editor variable. The value is ${home}.

See Also:
Constant Field Values

FRAMEWORKS_DIRECTORY

public static final java.lang.String FRAMEWORKS_DIRECTORY
The frameworks directory editor variable. The value is ${frameworksDir}.

See Also:
Constant Field Values

FRAMEWORK_DIRECTORY

public static final java.lang.String FRAMEWORK_DIRECTORY
Represents the framework directory where the document type that contains this reference resides. The value is ${frameworkDir}.

See Also:
Constant Field Values

FRAMEWORK_URL

public static final java.lang.String FRAMEWORK_URL
The framework directory URL editor variable. The value is ${framework}.

See Also:
Constant Field Values

USER_HOME_DIR

public static final java.lang.String USER_HOME_DIR
The user home dir editor variable. The value is ${homeDir}.

See Also:
Constant Field Values

OXYGEN_INSTALL_DIR

public static final java.lang.String OXYGEN_INSTALL_DIR
The oxygen install dir editor variable. The value is ${oxygenInstallDir}.

See Also:
Constant Field Values

DETECTED_SCHEMA

public static final java.lang.String DETECTED_SCHEMA
The detected schema editor variable. The value is ${ds}.

See Also:
Constant Field Values

DETECTED_SCHEMA_URL

public static final java.lang.String DETECTED_SCHEMA_URL
The detected schema URL editor variable. The value is ${dsu}.

See Also:
Constant Field Values

TRANSFORMATION_SAVED_FILE

public static final java.lang.String TRANSFORMATION_SAVED_FILE
The transformation saved file editor Variable. The value is ${tsf}.

See Also:
Constant Field Values

DEBUGGER_XML_SOURCE

public static final java.lang.String DEBUGGER_XML_SOURCE
The debugger XML input editor variable. The value is ${dbgXML}.

See Also:
Constant Field Values

DEBUGGER_XSL_SOURCE

public static final java.lang.String DEBUGGER_XSL_SOURCE
The debugger XSL input editor variable. The value is ${dbgXSL}.

See Also:
Constant Field Values

FOP_TRANSFORMATION_METHOD

public static final java.lang.String FOP_TRANSFORMATION_METHOD
The FOP transformation method editor variable. The value is ${method}.

See Also:
Constant Field Values

FOP_AH_TRANSFORMATION_METHOD

public static final java.lang.String FOP_AH_TRANSFORMATION_METHOD
The FOP Antenna House transformation method editor variable. The value is ${ah_method}.

See Also:
Constant Field Values

FO_INPUT_FILE

public static final java.lang.String FO_INPUT_FILE
The FO input file editor variable. The value is ${fo}.

See Also:
Constant Field Values

OUTPUT_FILE

public static final java.lang.String OUTPUT_FILE
The output file editor variable. The value is ${out}.

See Also:
Constant Field Values

OUTPUT_FILE_URL

public static final java.lang.String OUTPUT_FILE_URL
The output file URL editor variable. The value is ${outu}.

See Also:
Constant Field Values

OXYGEN_HOME_URL

public static final java.lang.String OXYGEN_HOME_URL
The Oxygen Home URL editor variable. The value is ${oxygenHome}.

See Also:
Constant Field Values

XML

public static final java.lang.String XML
XML Document editor variable. The value is ${xml}.

See Also:
Constant Field Values

XSL

public static final java.lang.String XSL
XSL Document editor variable The value is ${xsl}.

See Also:
Constant Field Values

SQL

public static final java.lang.String SQL
SQL Document editor variable The value is ${sql}.

See Also:
Constant Field Values

XQUERY

public static final java.lang.String XQUERY
XQuery Document editor variable The value is ${xquery}.

See Also:
Constant Field Values

XPROC

public static final java.lang.String XPROC
XProc Document editor variable The value is ${xproc}.

See Also:
Constant Field Values

XML_URL

public static final java.lang.String XML_URL
XML Document URL editor variable The value is ${xmlu}.

See Also:
Constant Field Values

XSL_URL

public static final java.lang.String XSL_URL
XSL Document URL editor variable The value is ${xslu}.

See Also:
Constant Field Values

SQL_URL

public static final java.lang.String SQL_URL
XSL Document URL editor variable The value is ${xslu}.

See Also:
Constant Field Values

XQUERY_URL

public static final java.lang.String XQUERY_URL
XSL Document URL editor variable The value is ${xslu}.

See Also:
Constant Field Values

XPROC_URL

public static final java.lang.String XPROC_URL
XSL Document URL editor variable The value is ${xslu}.

See Also:
Constant Field Values

PATH_SEPARATOR

public static final java.lang.String PATH_SEPARATOR
Path separator editor variable. Expands to ":" on Linux and Mac, ";" on Windows The value is ${ps}.

See Also:
Constant Field Values

FIRST_FILE_TO_DIFF

public static final java.lang.String FIRST_FILE_TO_DIFF
The first file to diff. The value is ${firstFile}.

See Also:
Constant Field Values

SECOND_FILE_TO_DIFF

public static final java.lang.String SECOND_FILE_TO_DIFF
The second file to diff. The value is ${secondFile}.

See Also:
Constant Field Values

ANCESTOR_FILE_TO_DIFF

public static final java.lang.String ANCESTOR_FILE_TO_DIFF
The ancestor file to diff. The value is ${ancestorFile}.

See Also:
Constant Field Values

TIMESTAMP

public static final java.lang.String TIMESTAMP
The time stamp. The value is ${timeStamp}.

See Also:
Constant Field Values

UUID

public static final java.lang.String UUID
The UUID. The value is ${uuid}.

See Also:
Constant Field Values

ID

public static final java.lang.String ID
The unique friendly ID generated by Oxygen. The value is ${id}.

See Also:
Constant Field Values

ASK_PARAM_VALUE_TEMPLATE

public static final java.lang.String ASK_PARAM_VALUE_TEMPLATE
Used to show the user the options he has to ask for a value.

See Also:
Constant Field Values

TRANSLATE_FUNCTION_VARIABLE_PREFIX

public static final java.lang.String TRANSLATE_FUNCTION_VARIABLE_PREFIX
Prefix for translate functions

See Also:
Constant Field Values

FUNCTION_VARIABLE_SUFFIX

public static final java.lang.String FUNCTION_VARIABLE_SUFFIX
Suffix for functions (env or system)

See Also:
Constant Field Values

DATE_FUNCTION_SAMPLE

public static final java.lang.String DATE_FUNCTION_SAMPLE
Sample of date function specification

See Also:
Constant Field Values

CT_CARET_EDITOR_VARIABLE

public static final java.lang.String CT_CARET_EDITOR_VARIABLE
The caret editor variable.

See Also:
Constant Field Values

CT_SELECTION_EDITOR_VARIABLE

public static final java.lang.String CT_SELECTION_EDITOR_VARIABLE
The caret editor variable.

See Also:
Constant Field Values

UNIQUE_CARET_MARKER_PI_NAME_FOR_AUTHOR

public static final java.lang.String UNIQUE_CARET_MARKER_PI_NAME_FOR_AUTHOR
Unique marker used to position the caret

See Also:
Constant Field Values

UNIQUE_CARET_MARKER_FOR_AUTHOR

public static final java.lang.String UNIQUE_CARET_MARKER_FOR_AUTHOR
Unique marker used to position the caret

See Also:
Constant Field Values
Constructor Detail

EditorVariables

public EditorVariables()
Method Detail

getDescription

public static java.lang.String getDescription(java.lang.String editorVariable)
Returns a description of the editor variable.

Parameters:
editorVariable - The editor variable to get description for.
Returns:
The description for the editor variable.

containsEditorVariable

public static boolean containsEditorVariable(java.lang.String expression)
Checks if the given expression contains editor variables.

Parameters:
expression - The expression to check.
Returns:
true if the expression contains one of the available editor variables.

expandEditorVariables

public static java.lang.String expandEditorVariables(java.lang.String expr,
                                                     java.lang.String currentEditedFileURL)
Expand the editor variables in the output file name. The currently known editor variables are declared in this class.

Parameters:
expr - The expresion containing editor variables.
currentEditedFileURL - The full path of the current edited file, as an URI.
Returns:
The expresion with the editor variables expanded, possibly an URI.

replaceFunctions

public static java.lang.String replaceFunctions(java.lang.String expr,
                                                java.lang.String functionVariablePrefix,
                                                java.lang.String functionVariableSuffix,
                                                EditorVariables.FunctionResolver keyToValueMap)
Replace all functions with the value taken from the map corresponding to the key

Parameters:
expr - The expression to modify.
functionVariablePrefix - Prefix of function signature.
functionVariableSuffix - Suffix of function signature.
keyToValueMap - Map between keys and values.
Returns:
The processed expression.

makeURLRelative2Frameworks

public static java.lang.String makeURLRelative2Frameworks(java.lang.String url)
Make an URL relative to the "frameworks" directory.

Parameters:
url - The original URL.
Returns:
The relative URL to the "frameworks" if possible, otherwise the original URL.

makeFileRelative2Frameworks

public static java.lang.String makeFileRelative2Frameworks(java.lang.String fileOrDir)
Make a file or directory relative to the "frameworks" directory.

Parameters:
fileOrDir - The original file or directory.
Returns:
The relative path to the "frameworks" if possible, otherwise the original file or directory path.

setFrameworksURLForTest

public static void setFrameworksURLForTest(java.net.URL fURL)
Set a frameworks url so it will not be computed from the home url.

Parameters:
fURL - The url.

getFrameworksUrl

public static java.net.URL getFrameworksUrl()
                                     throws java.net.MalformedURLException
Get the "frameworks" directory URL.

Returns:
The "frameworks" directory URL.
Throws:
java.net.MalformedURLException - If the oxygen home URL is not set.

getCurrentFrameworksURL

public static java.net.URL getCurrentFrameworksURL()
                                            throws java.net.MalformedURLException
Get the current frameworks directory.

Returns:
The current frameworks URL. Can be a custom one if it was set in options, or the default one.
Throws:
java.net.MalformedURLException - If the oxygen home URL is not set.

setFrameworksDirForTest

public static void setFrameworksDirForTest(java.io.File fDir)
Set a frameworks dir so it will not be computed from the home url.

Parameters:
fDir -

getFrameworksDir

public static java.io.File getFrameworksDir()
                                     throws java.net.MalformedURLException
Get the File representing the "frameworks" directory.

Returns:
The "frameworks" directory File.
Throws:
java.net.MalformedURLException - If the oxygen home URL is not set.

getBaseUserFrameworksDir

public static java.io.File getBaseUserFrameworksDir()
Get the base frameworks directory from the user preferences directory like: Users\***\AppData\Roaming\com.oxygenxml\extensions\v14.0\frameworks Note: This is not the actual directory with frameworks but the directory which contains all frameworks directories. A directory for each update site: - extensions\v14.0\frameworks\{update_site_1} - extensions\v14.0\frameworks\{update_site_2}

Returns:
The user frameworks directory.

getUserFrameworksDirs

public static java.io.File[] getUserFrameworksDirs()
Get the frameworks directories from the user preferences directory like: Users\***\AppData\Roaming\com.oxygenxml\extensions\v14.0\frameworks\{update_site}. A new level is inserted ({update_site}) to protect against add-ons conflicts (sort of like a namespace).

Returns:
The user frameworks directories or null if it doesn't exists.

getCurrentProjectURL

public static java.net.URL getCurrentProjectURL(java.lang.String currentFileSystemID)
Returns the URL of the current project.

Parameters:
currentFileSystemID - The current file system ID.
Returns:
The current project URL or null if it cannot be determined.

getCurrentArchiveURL

public static java.net.URL getCurrentArchiveURL(java.lang.String currentFileSystemID)
Returns the URL of the current archive.

Parameters:
currentFileSystemID - The current file system ID.
Returns:
The current archive URL or null if it cannot be determined.

setProjectURLProvider

public static void setProjectURLProvider(ro.sync.util.ProjectURLProvider projectURLProvider)
Set the project URL provider.

Parameters:
projectURLProvider - The new project URL provider.

setArchiveURLProvider

public static void setArchiveURLProvider(ro.sync.util.ArchiveURLProvider archiveURLProvider)
Set the archive URL provider.

Parameters:
archiveURLProvider - The new archive URL provider.

setArchiveExtensionsRecognizer

public static void setArchiveExtensionsRecognizer(ro.sync.util.ArchiveExtensionsRecognizer archiveExtensionsRecognizer)
Set an archive extensions recognizer

Parameters:
archiveExtensionsRecognizer - The archiveExtensionsRecognizer.

getSystemPathSeparator

public static java.lang.String getSystemPathSeparator()
Returns:
The system path separator. It is dependent on the platform.

generateUniqueID

public static java.lang.String generateUniqueID()
Returns:
The generated Unique ID

expandFrameworksVariables

public static java.lang.String expandFrameworksVariables(java.lang.String expr,
                                                         java.lang.String frameworkStoreLocation,
                                                         EditorVariables.FrameworkRewritePolicy rewritePolicy)
Expand FRAMEWORKS_DIRECTORY_URL, FRAMEWORKS_DIRECTORY, FRAMEWORK_DIRECTORY and FRAMEWORK_URL. All these variables are resolved relative to framework store location.

Parameters:
expr - Editor variables expression.
frameworkStoreLocation - The framework store location as an file path.
rewritePolicy - Rewrite FRAMEWORK_DIRECTORY and FRAMEWORK_URL using FRAMEWORKS_DIRECTORY_URL and FRAMEWORKS_DIRECTORY variables.
Returns:
The given expression with the framework variables expanded.

expandFrameworksVariables

public static java.lang.String expandFrameworksVariables(java.lang.String expr,
                                                         EditorVariables.FrameworkRewritePolicy rewritePolicy,
                                                         java.io.File frameworksDir,
                                                         java.net.URL frameworksURL,
                                                         java.io.File frameworkDir,
                                                         java.net.URL frameworkURL)
Expand FRAMEWORKS_DIRECTORY_URL, FRAMEWORKS_DIRECTORY, FRAMEWORK_DIRECTORY and FRAMEWORK_URL.

Parameters:
expr - Editor variables expression.
rewritePolicy - Rewrite FRAMEWORK_DIRECTORY and FRAMEWORK_URL using FRAMEWORKS_DIRECTORY_URL and FRAMEWORKS_DIRECTORY variables.
frameworksDir - The directory where all frameworks reside.
frameworksURL - The URL of the directory where all frameworks reside.
frameworkDir - The directory where the specific framework reside.
frameworkURL - The URL of the directory where the specific framework reside.
Returns:
The given expression with the framework variables expanded.

makeURLRelative2Framework

public static java.lang.String makeURLRelative2Framework(java.lang.String url,
                                                         java.lang.String frameworkFileURL)
Make an URL relative to $framework or that if not possible, to $frameworks (also if possible). OBS: $frameworks is the frameworks directory of the given framework frameworkFileURL.

Parameters:
url - The URL.
frameworkFileURL - The URL of the ".framework" file.
Returns:
The relative URL to the $framework or $frameworks if possible, otherwise the original URL.

makeFileRelative2Framework

public static java.lang.String makeFileRelative2Framework(java.lang.String path,
                                                          java.lang.String frameworkFilePath)
Make a file or directory relative to the $framework or $frameworks directory. The $frameworks directory is the frameworks directory of the given framework file, so it might differ from the default Oxygen frameworks directory.

Parameters:
path - The original file or directory.
frameworkFilePath - The URL of the ".framework" file.
Returns:
The relative path to the $framework or $frameworks if possible, otherwise the original file or directory path.

Oxygen XML Editor 14.2 Author API

© Copyright SyncRO Soft SRL 2002 - 2013. All rights reserved.