public class DocGenUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.util.Map<java.lang.String,java.lang.String> |
html2docbookConvert
this was trying to use regex only to convert html tags to docbook tags,
should probably switch to just using jsoup
|
Constructor and Description |
---|
DocGenUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
addDocbook(java.lang.String s)
tries to make s into a docbook paragraph if not already one
|
static java.lang.String |
addInvisibleSpace(java.lang.String s)
this is to help pdf transfrom be able to do wordwrap at non whitespace
chars, adds an invisible space to chars that should be able to break
probably should use some regex instead...
|
static java.lang.String |
addP(java.lang.String s)
tries to make s into a html paragraph if not already one
|
static DocumentElement |
ecoreTranslateView(ViewElement ve,
boolean forViewEditor) |
static java.util.List<java.lang.String> |
exportDiagram(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram d,
java.io.File directory,
boolean genNew)
Generates svg and png files of the diagram passed in, the diagram names
will be the diagram id in magicdraw
|
static java.lang.String |
fixString(java.lang.Object s)
given any object tries to return a string representation suitable for use
in docbook
|
static java.lang.String |
fixString(java.lang.Object s,
boolean convertHtml) |
static java.util.List<java.lang.String> |
getElementNames(java.util.Collection<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.NamedElement> elements)
return names of a collection of named elements
|
static java.lang.String |
getIndented(java.lang.String name,
int depth)
docbook ignores regular white space in table cells, this is to force
indentation in docbook, 1 indent is 4 spaces
|
static java.lang.Object |
getLiteralValue(java.lang.Object s,
boolean convertHtml) |
static java.lang.String |
html2docbook(java.lang.String html)
if string contains html, converts it to docbook
also does some special processing if there's informal table elements, removes width on tables so pdf transforms don't get cut off if width is set too big should use jsoup processing to replace the regex map above |
static java.lang.String |
htmlToXmlEntities(java.lang.String html)
Convert a String of HTML with named HTML entities to the
same String with entities converted to numbered XML entities
|
static java.lang.String |
slot2String(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Slot s)
gives sensible text representation for slot element
|
static java.lang.String |
slot2String(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Slot s,
boolean includeName) |
public static final java.util.Map<java.lang.String,java.lang.String> html2docbookConvert
public static java.lang.String getIndented(java.lang.String name, int depth)
name
- depth
- public static java.lang.String htmlToXmlEntities(java.lang.String html)
html
- public static java.lang.String fixString(java.lang.Object s)
s
- public static java.lang.String fixString(java.lang.Object s, boolean convertHtml)
public static java.lang.Object getLiteralValue(java.lang.Object s, boolean convertHtml)
public static java.lang.String slot2String(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Slot s)
s
- public static java.lang.String slot2String(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Slot s, boolean includeName)
public static java.lang.String addDocbook(java.lang.String s)
s
- public static java.lang.String addP(java.lang.String s)
s
- public static java.lang.String addInvisibleSpace(java.lang.String s)
s
- public static java.lang.String html2docbook(java.lang.String html)
html
- public static java.util.List<java.lang.String> exportDiagram(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram d, java.io.File directory, boolean genNew) throws java.io.IOException
diagram
- the magicdraw diagram elementoutputdir
- directory for docbook xml output (without trailing slash)outputfilename
- name of the docbook xml output name (without extension, this
will be used to generate a folder called outputfilename_files
inside outputdir where the diagrams will be stored)genNew
- true or false, if true, will always generate new image, if
not, will check whether image is already there before
generatingdebug
- java.io.IOException
public static java.util.List<java.lang.String> getElementNames(java.util.Collection<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.NamedElement> elements)
elements
- public static DocumentElement ecoreTranslateView(ViewElement ve, boolean forViewEditor)