21
21
import org.apache.commons.logging.Log;
22
22
import org.apache.commons.logging.LogFactory;
23
23
import org.dbdoclet.service.StringServices;
24
import org.dbdoclet.trafo.html.docbook.DbtConstants;
24
25
import org.dbdoclet.trafo.html.docbook.DocBookTransformer;
25
26
import org.dbdoclet.trafo.script.Script;
26
27
import org.dbdoclet.trafo.tag.docbook.AttributeAlign;
41
42
protected static final String FSEP = System.getProperty("file.separator");
42
43
protected static final Log logger = LogFactory.getLog(Editor.class);
44
protected static final String AUTOMATICALLY_INSERTED = "Automatically inserted";
44
46
private DocBookElement current;
45
47
private DocBookElement parent;
65
67
dbk.setId(transformer.createUniqueId(htmlId));
68
StringBuilder buffer = new StringBuilder();
70
String htmlClass = html.getCssClass();
72
if (htmlClass != null) {
73
buffer.append(htmlClass);
77
String htmlTitle = html.getTitle();
79
if (htmlTitle != null) {
80
buffer.append(htmlTitle);
84
String condition = buffer.toString();
86
if (condition.trim().length() > 0) {
87
condition = StringServices.cutSuffix(condition, ",");
88
dbk.setCondition(condition);
91
String remap = String.format("%s:%d:%d", html.getTagName(),
92
html.getLine(), html.getColumn());
94
dbk.setLine(html.getLine());
95
dbk.setColumn(html.getColumn());
70
Script script = getScript();
72
if (script.isParameterOn(DbtConstants.SECTION_DOCBOOK,
73
DbtConstants.PARAM_DOCBOOK_CREATE_CONDITION_ATTRIBUTE, false)) {
75
StringBuilder buffer = new StringBuilder();
77
String htmlClass = html.getCssClass();
79
if (htmlClass != null) {
80
buffer.append(htmlClass);
84
String htmlTitle = html.getTitle();
86
if (htmlTitle != null) {
87
buffer.append(htmlTitle);
91
String condition = buffer.toString();
93
if (condition.trim().length() > 0) {
94
condition = StringServices.cutSuffix(condition, ",");
95
dbk.setCondition(condition);
99
if (script.isParameterOn(DbtConstants.SECTION_DOCBOOK,
100
DbtConstants.PARAM_DOCBOOK_CREATE_REMAP_ATTRIBUTE, false)) {
102
String remap = String.format("%s:%d:%d", html.getTagName(),
103
html.getLine(), html.getColumn());
105
dbk.setLine(html.getLine());
106
dbk.setColumn(html.getColumn());
98
110
public EditorInstruction edit(EditorInstruction vo) throws EditorException {