public class CometPrintTools extends Object
| Modifier and Type | Field and Description |
|---|---|
static char |
COMET_EMPTY_STRING_MARGKER_CHARACTER |
static String |
COMET_EMPTY_STRING_MARGKER_TAG |
static String |
INDESIGN_NORMAL_PARAGRAPH_STYLE_TAG |
| Constructor and Description |
|---|
CometPrintTools() |
| Modifier and Type | Method and Description |
|---|---|
static String |
createW2CrossreferenceSource(Item sourceItem,
Item targetItem,
SessionContext ctx)
Creates a Werk II crossreference source tag / <w2: ...> tag for the given source and target item
|
static String |
createW2CrossreferenceSource(Item source,
String itemLink,
SessionContext ctx)
Converts an itemlink to a Werk II crossreference source tag / <w2: ...> tag
|
static String |
createW2CrossreferenceSource(String sourceItemPK,
String itemLink)
Converts an itemlink to a Werk II crossreference source tag / <w2: ...> tag
|
static String |
createW2CrossreferenceSourceForPKs(String sourceItemPK,
String targetItemPK,
SessionContext ctx,
String linkId,
String replacementType)
Creates a Werk II crossreference source tag / <w2: ...> tag for the given source and target item
|
static String |
createW2CrossreferenceTarget(Item targetItem,
String displayName,
SessionContext ctx)
Creates a Werk II crossreference target tag / <w2cross: ...> tag for the given target item
|
static String |
createW2CrossreferenceTarget(String itemLink,
String displayName,
SessionContext ctx)
Converts an itemlink to a Werk II crossreference target tag / <w2cross: ...> tag
|
static Node |
getChildNodeByName(Node node,
String childNodeName)
Returns the first found child node with the specified (local)name
|
static String |
getCompletePath(SessionContext ctx,
String pathTemplate)
Tries to resolve the variables in a given path template and returns the resulting path.
A path template e.g. |
static String |
getCompletePath(String pathTemplate)
Tries to resolve the variables in a given path template and returns the resulting path.
A path template e.g. |
static List<? extends PrintPublication> |
getPublications() |
static String |
normalizePath(String path) |
static Map<String,CometCondition> |
parseConditions(Map<String,CometCondition> map,
CometCondition[] conditions)
Parses the given conditions
|
static Map<String,String> |
parseParameters(String parameters)
Parses the parameters specified in the given String
|
static double |
pixToPt(double dim)
Converts dimensions specified in pixel to pt (point).
|
static double |
pixToPt(double dim,
JaloTranslatorConfiguration translatorConfig)
Converts dimensions specified in pixel to pt (point).
|
static String |
prepareLineBreaksForInDesign(String text)
Converts the different Windows, Linux or MacOS style line breaks to InDesign specific entities
This prevents problems with Windows-style linebreaks that lead to "double linebreaks" in InDesign |
static String |
removeHTMLFormattings(String text)
Removes all HTML tags from the given string.
Converts all kinds of line breaks to '\n'. |
static String |
removeInDesignFormattings(String text)
Removes any TaggedText tags from the given text.
Converts all kinds of line breaks to '\n'. |
static String |
removeQuotes(String quotedString)
Removes surrounding quote characters (' and ")
(ATTENTION: Works only if a string has the same signs at the beginning and at the end.) |
static void |
writeTagWithValue(XMLOutputter xmlOut,
String tag,
Double value)
Writes the tag with the given Double value.
|
static void |
writeTagWithValue(XMLOutputter xmlOut,
String tag,
Integer value)
Writes the tag with the given Integer value.
|
static void |
writeTagWithValue(XMLOutputter xmlOut,
String tag,
String value)
Writes the tag with the given text value.
|
public static final String COMET_EMPTY_STRING_MARGKER_TAG
public static final char COMET_EMPTY_STRING_MARGKER_CHARACTER
public static final String INDESIGN_NORMAL_PARAGRAPH_STYLE_TAG
public static Map<String,CometCondition> parseConditions(Map<String,CometCondition> map, CometCondition[] conditions) throws InvalidParameterException
map - The map where to store the conditions inconditions - The array that contains Comet conditionsInvalidParameterException - If the conditions are unspecifiedpublic static Map<String,String> parseParameters(String parameters) throws InvalidParameterException
parameters - The String that contains Comet action parametersInvalidParameterException - If the parameters are unspecifiedpublic static String removeQuotes(String quotedString)
quotedString - The String that is surrounded by quote characterspublic static String removeInDesignFormattings(String text)
text - The String that contains formatting tagspublic static String removeHTMLFormattings(String text)
text - The String that contains formatting tagspublic static String prepareLineBreaksForInDesign(String text)
Windows = CR+LF 0D+0A \r\n Unix = LF 0A \n Mac = CR 0D \r
text - The text wherein to convert the line breaks symbolspublic static Node getChildNodeByName(Node node, String childNodeName)
node - The node in which's child nodes to find a node with the given (local)namechildNodeName - The (local, unqualified) name of the child nodepublic static double pixToPt(double dim)
dim - dimension specified in pixelpublic static double pixToPt(double dim,
JaloTranslatorConfiguration translatorConfig)
dim - dimension specified in pixeltranslatorConfig - The JaloTranslatorConfiguration from where to get the configured multiplierpublic static void writeTagWithValue(XMLOutputter xmlOut,
String tag,
String value)
throws IOException
xmlOut - tag - value - IOExceptionpublic static void writeTagWithValue(XMLOutputter xmlOut,
String tag,
Integer value)
throws IOException
xmlOut - tag - value - IOExceptionpublic static void writeTagWithValue(XMLOutputter xmlOut,
String tag,
Double value)
throws IOException
xmlOut - tag - value - IOExceptionpublic static String createW2CrossreferenceTarget(String itemLink, String displayName, SessionContext ctx) throws JaloBusinessException, JaloInvalidParameterException, JaloItemNotFoundException
itemLink - The textual item linkdisplayName - The name that is used in InDesign to display the crossreference (may be null)ctx - The SessionContextJaloBusinessException - If an error occured while resolving the item linkJaloInvalidParameterException - If there is no or more then one item foundJaloItemNotFoundException - If the referenced item could not be foundpublic static String createW2CrossreferenceTarget(Item targetItem, String displayName, SessionContext ctx)
targetItem - The target itemdisplayName - The name that is used in InDesign to display the crossreference (may be null)ctx - The SessionContextpublic static String createW2CrossreferenceSource(Item source, String itemLink, SessionContext ctx) throws JaloBusinessException, JaloInvalidParameterException, JaloItemNotFoundException
source - The source item that references to another item with the given textual item linkitemLink - The textual item linkctx - The SessionContextJaloBusinessException - If an error occured while resolving the item linkJaloInvalidParameterException - If there is no or more then one item foundJaloItemNotFoundException - If the referenced item could not be foundpublic static String createW2CrossreferenceSource(String sourceItemPK, String itemLink) throws JaloBusinessException, JaloInvalidParameterException, JaloItemNotFoundException
sourceItemPK - The PK of the source item that references to another item with the given textual item linkitemLink - The textual item linkJaloBusinessException - If an error occured while resolving the item linkJaloInvalidParameterException - If there is no or more then one item foundJaloItemNotFoundException - If the referenced item could not be foundpublic static String createW2CrossreferenceSource(Item sourceItem, Item targetItem, SessionContext ctx)
sourceItem - The source item that references to the target itemtargetItem - The target item where the crossreference links toctx - The SessionContextpublic static String createW2CrossreferenceSourceForPKs(String sourceItemPK, String targetItemPK, SessionContext ctx, String linkId, String replacementType)
sourceItemPK - The PK of the source item that references to the target itemtargetItemPK - The PK of the target item where the crossreference links toctx - The SessionContextpublic static List<? extends PrintPublication> getPublications()
public static String getCompletePath(String pathTemplate)
pathTemplate - A path template that might contain several variablespublic static String getCompletePath(SessionContext ctx, String pathTemplate)
ctx - The SessionContextpathTemplate - A path template that might contain several variablesCopyright © 2017 SAP SE. All Rights Reserved.