|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.birt.report.model.api.util.ElementExportUtil
public class ElementExportUtil
Represents the utility class to help export element and structure to library file. The element or structure to export must comply with the following rule:
IllegalArgumentException
.
Constructor Summary | |
---|---|
ElementExportUtil()
|
Method Summary | |
---|---|
static boolean |
canExport(DesignElementHandle elementToExport)
Checks whether the given element can be exported into one library. |
static boolean |
canExport(DesignElementHandle elementToExport,
boolean ignoreName)
Checks whether the given element can be exported into one library. |
static boolean |
canExport(DesignElementHandle elementToExport,
LibraryHandle targetLibraryHandle,
boolean canOverride)
Checks whether the given element can be exported into one library. |
static boolean |
canExport(StructureHandle structToExport)
Checks whether the given structure can be exported into one library. |
static boolean |
canExport(StructureHandle structToExport,
boolean ignoreName)
Checks whether the given structure can be exported into one library. |
static boolean |
canExport(StructureHandle structToExport,
LibraryHandle targetLibraryHandle,
boolean canOverride)
Checks whether the given structure can be exported into one library. |
static void |
exportDesign(ReportDesignHandle designToExport,
LibraryHandle targetLibraryHandle,
boolean canOverride,
boolean genDefaultName)
Exports one design to library. |
static void |
exportDesign(ReportDesignHandle designToExport,
java.lang.String libraryFileName,
boolean canOverride,
boolean genDefaultName)
Export the report design to a library file specified by the file name. |
static void |
exportElement(DesignElementHandle elementToExport,
LibraryHandle targetLibraryHandle,
boolean canOverride)
Exports the given element into one library. |
static void |
exportElement(DesignElementHandle elementToExport,
java.lang.String libraryFileName,
boolean canOverride)
Exports the given element into one library file. |
static void |
exportElements(java.util.List elementsToExport,
java.lang.String libraryFileName,
boolean canOverride)
Exports the given element list into one library file. |
static void |
exportStructure(StructureHandle structToExport,
LibraryHandle targetLibraryHandle,
boolean canOverride)
Exports the given structure into one library. |
static void |
exportStructure(StructureHandle structToExport,
java.lang.String libraryFileName,
boolean canOverride)
Exports the given structure into one library. |
static void |
exportStructures(java.util.List structsToExport,
java.lang.String libraryFileName,
boolean canOverride)
Exports the given structure into one library. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ElementExportUtil()
Method Detail |
---|
public static void exportElement(DesignElementHandle elementToExport, java.lang.String libraryFileName, boolean canOverride) throws DesignFileException, SemanticException, java.io.IOException
elementToExport
- handle of the element to export.libraryFileName
- file name of the target librarycanOverride
- indicates whether the element with the same name in target
library will be overriden.
DesignFileException
- if error encountered when open library file with the given
file name.
SemanticException
- if error encountered when element name is duplicate in the
target library.
java.io.IOException
- if error encountered when writing file.
java.lang.IllegalArgumentException
- if the element to export is not in design file, or the
element doesn't has name.public static void exportElements(java.util.List elementsToExport, java.lang.String libraryFileName, boolean canOverride) throws DesignFileException, SemanticException, java.io.IOException
elementsToExport
- list of the element to export, each of which is the instance
of DesignElementHandle
.libraryFileName
- file name of the target librarycanOverride
- indicates whether the element with the same name in target
library will be overridden.
DesignFileException
- if error encountered when open library file with the given
file name.
SemanticException
- if error encountered when element name is duplicate in the
target library.
java.io.IOException
- if error encountered when writing file.
java.lang.IllegalArgumentException
- if the element to export is not in design file.public static void exportElement(DesignElementHandle elementToExport, LibraryHandle targetLibraryHandle, boolean canOverride) throws SemanticException
elementToExport
- handle of the element to export.targetLibraryHandle
- handle of target librarycanOverride
- indicates whether the element with the same name in target
library will be overriden.
SemanticException
- if error encountered when element name is duplicate in the
target library.
java.lang.IllegalArgumentException
- if the element to export is not in design file.public static void exportStructure(StructureHandle structToExport, java.lang.String libraryFileName, boolean canOverride) throws DesignFileException, SemanticException, java.io.IOException
EmbeddedImage
,CustomColor
and
ConfigVariable
. If the library file is not found, new
library file will be created and saved as the given file name.
structToExport
- handle of the structure to export.libraryFileName
- file name of the target librarycanOverride
- indicates whether the structure with the same name in target
library will be overriden.
DesignFileException
- if error encountered when open library file with the given
file name.
SemanticException
- if error encountered when adding new structure to library or
value setting.
java.io.IOException
- if error encountered when writing file.
java.lang.IllegalArgumentException
- if the element to export is not in design file.public static void exportStructures(java.util.List structsToExport, java.lang.String libraryFileName, boolean canOverride) throws DesignFileException, SemanticException, java.io.IOException
EmbeddedImage
,CustomColor
and
ConfigVariable
. If the library file is not found, new
library file will be created and saved as the given file name.
structsToExport
- list of the structure to export, each of which is the instance
of StructureHandle
.libraryFileName
- file name of the target librarycanOverride
- indicates whether the structure with the same name in target
library will be overridden.
DesignFileException
- if error encountered when open library file with the given
file name.
SemanticException
- if error encountered when adding new structure to library or
value setting.
java.io.IOException
- if error encountered when writing file.
java.lang.IllegalArgumentException
- if the element to export is not in design file.public static void exportStructure(StructureHandle structToExport, LibraryHandle targetLibraryHandle, boolean canOverride) throws SemanticException
EmbeddedImage
,CustomColor
and
ConfigVariable
.
structToExport
- handle of the structure to export.targetLibraryHandle
- handle of target librarycanOverride
- indicates whether the structure with the same name in target
library will be overriden.
SemanticException
- if error encountered when adding new structure to library or
value setting.public static void exportDesign(ReportDesignHandle designToExport, java.lang.String libraryFileName, boolean canOverride, boolean genDefaultName) throws DesignFileException, SemanticException, java.io.IOException
designToExport
- the design which need to be exportedlibraryFileName
- target library file namecanOverride
- indicates whether the element with the same name in target
library will be overriden.genDefaultName
- if true, a default name will be generated if an element
doesn't has a name. if false, an exception will be throwed
indicate that the element to export must has a name
DesignFileException
- if the library file has fatal errors which can not be opened.
SemanticException
- if error encountered when element name is duplicated in the
target library.
java.io.IOException
- if error encountered when writing file.public static void exportDesign(ReportDesignHandle designToExport, LibraryHandle targetLibraryHandle, boolean canOverride, boolean genDefaultName) throws SemanticException
designToExport
- handle of the report design to exporttargetLibraryHandle
- handle of target librarycanOverride
- indicates whether the element with the same name in target
library will be overridden.genDefaultName
- if true, a default name will be generated if an element
doesn't has a name. if false, an exception will be thrown
indicate that the element to export must has a name
SemanticException
- if error encountered when element name is duplicate in the
target library.public static boolean canExport(DesignElementHandle elementToExport, LibraryHandle targetLibraryHandle, boolean canOverride)
elementToExport
- handle of the element to export.targetLibraryHandle
- handle of target librarycanOverride
- indicates whether the element with the same name in target
library will be overridden.
true
if the element can be exported successfully.
Otherwise false
.public static boolean canExport(StructureHandle structToExport, LibraryHandle targetLibraryHandle, boolean canOverride)
EmbeddedImage
,
CustomColor
and ConfigVariable
.
structToExport
- the handle of the structure to export.targetLibraryHandle
- the handle of target librarycanOverride
- indicates whether the element with the same name in target
library will be overridden.
true
if the element can be exported successfully.
Otherwise false
.public static boolean canExport(DesignElementHandle elementToExport)
canExport
, this method only concerns
meta-data level. That is, based on element definition and regardless of
the design context.
elementToExport
- handle of the element to export.
true
if the element can be exported successfully.
Otherwise false
.public static boolean canExport(StructureHandle structToExport)
EmbeddedImage
,
CustomColor
and ConfigVariable
.
Different from another canExport
, this method only concerns
meta-data level. That is, based on structure definition and regardless of
the design context.
structToExport
- the handle of the structure to export.
true
if the structure can be exported successfully.
Otherwise false
.public static boolean canExport(DesignElementHandle elementToExport, boolean ignoreName)
canExport
, this method only concerns
meta-data level. That is, based on element definition and regardless of
the design context.
elementToExport
- handle of the element to exportignoreName
- true if not consider the name of the element when determines
whether the element can be export or not, false if must
consider the element name to determine
true
if the element can be exported successfully.
Otherwise false
.public static boolean canExport(StructureHandle structToExport, boolean ignoreName)
EmbeddedImage
,
CustomColor
and ConfigVariable
.
Different from another canExport
, this method only concerns
meta-data level. That is, based on structure definition and regardless of
the design context.
structToExport
- the handle of the structure to exportignoreName
- true if not consider the key name of the structure when
determines whether the structure can be export or not, false
if must consider the name to determine
true
if the structure can be exported successfully.
Otherwise false
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |