net.windward.tags
Class ImportTag
net.windward.tags.BaseTag
|
+--net.windward.tags.ImportTag
- public class ImportTag
- extends BaseTag
Import an external file. This tag represents a <wr:import ...> in the template. The full usage is
<wr:import url="./name"/> or <wr:import value="./name"/>. This will read the value from the
node and will assume that the read in value is a filename (url=) or this will use the value as the filename (value=).
It will then read in that file. It uses the file extension to determine what type of file it is - unless overridden
with the type attribute. Acceptable file extensions are:
- .txt - ASCII text file.
- .pdf - Acrobat PDF file - can only be used if the report is PDF (otherwise ignored).
- .rtf - RTF file. This will include styles, fonts, colors, etc. who's index is not in the base template. But for
document header table entries which have the same index, the values in the base template will be used.
- .xml - WordML file. This will include styles, fonts, colors, etc. who's index is not in the base template. But for
document header table entries which have the same index, the values in the base template will be used.
- .bmp, .dib - BMP bitmap file.
- .gif - GIF bitmap file.
- .jpg, .jpeg - JPEG bitmap file.
- .png - PNG bitmap file.
- .pnm - PNM bitmap file.
- .raw - RAW bitmap file.
- .tif, .tiff - TIFF bitmap file.
- .wbmp - WBMP bitmap file.
The full list of attributes are:
- select - required (or value) - the node that will be read for the filename.
- value - required (or select) - the text that will be used as the filename.
- type - optional - The file type (ignore the file's extension). Allowed values are: BMP, GIF, JPG, PDF, PNG, PNM, RAW,
TIFF, TXT, RTF, WBMP, and XML.
- display - optional - can be the text notEmpty, notNull, always, or a string that is evaluated to be true or false.
If displayed is false, then if the out tag is the only item in a paragraph, the paragraph will be deleted.
- notEmpty - only displayed if the select is a string.
- notNull - displayed if the select exists, even if null or 0 length string value.
- always - displayed even if the select returns nothing.
- true/false(evaluate) - displayed if the value evaluates to true. If it evaluates to false it is not displayed
even if there is a non-null value for the select.
- source - optional - The url will ordinarily be read in the order; 1) Thread.currentThread().getContextClassLoader(),
2) ProcessReport.class.getClassLoader(), 3) ClassLoader.getSystemResource(propFile), 4) as a file, and 5) as a URL.
This can be forced with this setting. Allowed values are:
- THREAD
- APP-CLASS
- SYSTEM-CLASS
- FILE
- URL
- wrap - optional - This is only for the case where type='BITMAP' and sets how the image is placed with respect
to the text next to it. Allowed values are:
- BEHIND - places the image under the text. The text continues over the image.
- FRONT - places the image over the text. The text continues under the image.
- INLINE - places the bitmap after preceeding text and following text follows the image. This is the default.
- SQUARE - similiar to INLINE except text continues to break on both sides of the image while INLINE will
always move the next line of text below the image.
- default - optional - Will use this url if the url= node is non-existent or empty.
- inline - optional - For rtf and xml only, if inline='true' then all leading and trailing paragraph markers in
the imported file will be stripped.
It is an error to enter <wr:import url="./name"< ... >/wr:import>
This tag follows the jstl example of c:import.
- Version:
- 2.0 November 1, 2003
| Fields inherited from class net.windward.tags.BaseTag |
CHART, COLUMN, DISPLAY_ALWAYS, DISPLAY_NOT_EMPTY, DISPLAY_NOT_NULL, ELSE, END_FOREACH, END_IF, END_LINK, END_MATRIX, ESCAPE, FOREACH, FUNCTION, HTML, IF, IMPORT, LINK, MATRIX, OUT, PROP_COMMENT, PROP_DATASOURCE, PROP_DEFAULT, PROP_DISPLAY, PROP_ENABLED, PROP_INPUT, PROP_PATTERN, PROP_TITLE, PROP_TYPE, PROP_VAR, PROP_WRAP, QUERY, ROW, SET, TAG_DISPLAY_DEFAULT, TAG_DISPLAY_SELECT, TAG_DISPLAY_TAG, TYPE_BITMAP, TYPE_BOTH, TYPE_CURRENCY, TYPE_DATE, TYPE_NUMBER, TYPE_PERCENT, TYPE_TIME, WRAP_BEHIND, WRAP_FRONT, WRAP_INLINE, WRAP_SQUARE |
|
Constructor Summary |
ImportTag(java.util.Map map,
boolean selfContained,
boolean ignoreErrors)
Create an import element using the passed in map values. |
|
Method Summary |
net.windward.document.Element |
dup(boolean sameRefId)
Makes a duplicate of this object. |
int |
getXmlType()
Returns which type of xml element this is. |
java.lang.String |
toDisplay(int type)
How this node is displayed on the page when in a field. |
java.lang.String |
toString()
Returns this object as a string in the format "var:...". |
java.lang.String |
toText()
Converts this node back in to it's string representation in the document |
| Methods inherited from class net.windward.tags.BaseTag |
containsAttribute, factory, factory, getAttribute, getAttributes, getBean, getDatasource, getIntAttribute, getLevel, getMode, getNode, getType, setLevel, setNode, toTagText |
MODE_SELECT
public static final int MODE_SELECT
MODE_VALUE
public static final int MODE_VALUE
PROP_SOURCE
public static final java.lang.String PROP_SOURCE
PROP_INLINE
public static final java.lang.String PROP_INLINE
SOURCE_THREAD
public static final java.lang.String SOURCE_THREAD
SOURCE_APP_CLASS
public static final java.lang.String SOURCE_APP_CLASS
SOURCE_SYSTEM_CLASS
public static final java.lang.String SOURCE_SYSTEM_CLASS
SOURCE_FILE
public static final java.lang.String SOURCE_FILE
SOURCE_URL
public static final java.lang.String SOURCE_URL
ImportTag
public ImportTag(java.util.Map map,
boolean selfContained,
boolean ignoreErrors)
throws TagException
- Create an import element using the passed in map values.
- Parameters:
map - Must have a url entry.selfContained - Must be true.ignoreErrors - - Throws:
TagException - thrown if illegal parameters passed in.
toText
public java.lang.String toText()
throws TagException
- Converts this node back in to it's string representation in the document
- Overrides:
toText in class BaseTag
- Returns:
- <wr:import ...> type string.
toDisplay
public java.lang.String toDisplay(int type)
- How this node is displayed on the page when in a field.
- Overrides:
toDisplay in class BaseTag
- Parameters:
type - One of the DISPLAY_* constants- Returns:
- title, end of select, or <cmd> type string.
dup
public net.windward.document.Element dup(boolean sameRefId)
- Makes a duplicate of this object. A deep clone is done so the new object shares nothing
with the original object.
- Parameters:
sameRefId - - Returns:
- The new duplicate of this object
getXmlType
public int getXmlType()
- Returns which type of xml element this is.
- Overrides:
getXmlType in class BaseTag
- Returns:
- IMPORT
toString
public java.lang.String toString()
- Returns this object as a string in the format "var:...".
- Returns:
- A String listing this element.
Copyright © 2002 - 2008 Windward Reports - All Rights Reserved. java reporting software