~ubuntu-branches/ubuntu/vivid/herold/vivid

« back to all changes in this revision

Viewing changes to java/org/dbdoclet/trafo/html/docbook/editor/Editor.java

  • Committer: Package Import Robot
  • Author(s): Mathieu Malaterre
  • Date: 2012-11-29 13:00:52 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20121129130052-x60zqbks3mwb8nmx
Tags: 6.0.3-1
* New upstream. Closes: #692544
* option --logging-level was removed. Closes: #691170
* preserve lang attribute. Closes: #692543
* Fix herold help output. Closes: #692545
* pdftohtml support (detect-trapped-br=false to revert). Closes: #692741
* Fix invalid XML element. Closes: #693214
* Remove d/p/antencoding.patch, applied upstream
* man page is provided. Closes: #689309
* Fix herold.home location. Closes: #692547
* Support section element. Closes: #692756

Show diffs side-by-side

added added

removed removed

Lines of Context:
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;
40
41
 
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";
43
45
 
44
46
        private DocBookElement current;
45
47
        private DocBookElement parent;
65
67
                        dbk.setId(transformer.createUniqueId(htmlId));
66
68
                }
67
69
 
68
 
                StringBuilder buffer = new StringBuilder();
69
 
 
70
 
                String htmlClass = html.getCssClass();
71
 
 
72
 
                if (htmlClass != null) {
73
 
                        buffer.append(htmlClass);
74
 
                        buffer.append(",");
75
 
                }
76
 
 
77
 
                String htmlTitle = html.getTitle();
78
 
 
79
 
                if (htmlTitle != null) {
80
 
                        buffer.append(htmlTitle);
81
 
                        buffer.append(",");
82
 
                }
83
 
 
84
 
                String condition = buffer.toString();
85
 
 
86
 
                if (condition.trim().length() > 0) {
87
 
                        condition = StringServices.cutSuffix(condition, ",");
88
 
                        dbk.setCondition(condition);
89
 
                }
90
 
 
91
 
                String remap = String.format("%s:%d:%d", html.getTagName(),
92
 
                                html.getLine(), html.getColumn());
93
 
                dbk.setRemap(remap);
94
 
                dbk.setLine(html.getLine());
95
 
                dbk.setColumn(html.getColumn());
 
70
                Script script = getScript();
 
71
 
 
72
                if (script.isParameterOn(DbtConstants.SECTION_DOCBOOK,
 
73
                                DbtConstants.PARAM_DOCBOOK_CREATE_CONDITION_ATTRIBUTE, false)) {
 
74
 
 
75
                        StringBuilder buffer = new StringBuilder();
 
76
 
 
77
                        String htmlClass = html.getCssClass();
 
78
 
 
79
                        if (htmlClass != null) {
 
80
                                buffer.append(htmlClass);
 
81
                                buffer.append(",");
 
82
                        }
 
83
 
 
84
                        String htmlTitle = html.getTitle();
 
85
 
 
86
                        if (htmlTitle != null) {
 
87
                                buffer.append(htmlTitle);
 
88
                                buffer.append(",");
 
89
                        }
 
90
 
 
91
                        String condition = buffer.toString();
 
92
 
 
93
                        if (condition.trim().length() > 0) {
 
94
                                condition = StringServices.cutSuffix(condition, ",");
 
95
                                dbk.setCondition(condition);
 
96
                        }
 
97
                }
 
98
 
 
99
                if (script.isParameterOn(DbtConstants.SECTION_DOCBOOK,
 
100
                                DbtConstants.PARAM_DOCBOOK_CREATE_REMAP_ATTRIBUTE, false)) {
 
101
 
 
102
                        String remap = String.format("%s:%d:%d", html.getTagName(),
 
103
                                        html.getLine(), html.getColumn());
 
104
                        dbk.setRemap(remap);
 
105
                        dbk.setLine(html.getLine());
 
106
                        dbk.setColumn(html.getColumn());
 
107
                }
96
108
        }
97
109
 
98
110
        public EditorInstruction edit(EditorInstruction vo) throws EditorException {