KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ofbiz > widget > html > HtmlScreenRenderer


1 /*
2  * $Id: HtmlScreenRenderer.java 7050 2006-03-22 20:53:39Z jonesde $
3  *
4  * Copyright (c) 2004 The Open For Business Project - www.ofbiz.org
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a
7  * copy of this software and associated documentation files (the "Software"),
8  * to deal in the Software without restriction, including without limitation
9  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  * and/or sell copies of the Software, and to permit persons to whom the
11  * Software is furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included
14  * in all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
21  * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
22  * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23  */

24 package org.ofbiz.widget.html;
25
26 import java.io.ByteArrayInputStream JavaDoc;
27 import java.io.IOException JavaDoc;
28 import java.io.Writer JavaDoc;
29 import java.sql.Timestamp JavaDoc;
30 import java.util.Locale JavaDoc;
31 import java.util.Map JavaDoc;
32
33 import javax.servlet.ServletContext JavaDoc;
34 import javax.servlet.http.HttpServletRequest JavaDoc;
35 import javax.servlet.http.HttpServletResponse JavaDoc;
36 import javax.servlet.http.HttpSession JavaDoc;
37
38 import org.ofbiz.base.util.Debug;
39 import org.ofbiz.base.util.GeneralException;
40 import org.ofbiz.base.util.UtilDateTime;
41 import org.ofbiz.base.util.UtilFormatOut;
42 import org.ofbiz.base.util.UtilHttp;
43 import org.ofbiz.base.util.UtilMisc;
44 import org.ofbiz.base.util.UtilValidate;
45 import org.ofbiz.entity.GenericDelegator;
46 import org.ofbiz.entity.GenericEntityException;
47 import org.ofbiz.entity.GenericValue;
48 import org.ofbiz.webapp.control.RequestHandler;
49 import org.ofbiz.webapp.taglib.ContentUrlTag;
50 import org.ofbiz.webapp.view.ViewHandlerException;
51 import org.ofbiz.widget.WidgetContentWorker;
52 import org.ofbiz.widget.screen.ModelScreenWidget;
53 import org.ofbiz.widget.screen.ScreenStringRenderer;
54
55 /**
56  * Widget Library - HTML Form Renderer implementation
57  *
58  * @author <a HREF="mailto:jonesde@ofbiz.org">David E. Jones</a>
59  * @version $Rev: 7050 $
60  * @since 3.1
61  */

62 public class HtmlScreenRenderer implements ScreenStringRenderer {
63
64     public static final String JavaDoc module = HtmlScreenRenderer.class.getName();
65
66     public HtmlScreenRenderer() {}
67
68     public void renderSectionBegin(Writer JavaDoc writer, Map JavaDoc context, ModelScreenWidget.Section section) throws IOException JavaDoc {
69         // do nothing, this is just a place holder container for HTML
70
}
71     public void renderSectionEnd(Writer JavaDoc writer, Map JavaDoc context, ModelScreenWidget.Section section) throws IOException JavaDoc {
72         // do nothing, this is just a place holder container for HTML
73
}
74
75     public void renderContainerBegin(Writer JavaDoc writer, Map JavaDoc context, ModelScreenWidget.Container container) throws IOException JavaDoc {
76         writer.write("<div");
77
78         String JavaDoc id = container.getId(context);
79         if (UtilValidate.isNotEmpty(id)) {
80             writer.write(" id=\"");
81             writer.write(id);
82             writer.write("\"");
83         }
84         
85         String JavaDoc style = container.getStyle(context);
86         if (UtilValidate.isNotEmpty(style)) {
87             writer.write(" class=\"");
88             writer.write(style);
89             writer.write("\"");
90         }
91         
92         writer.write(">");
93         appendWhitespace(writer);
94     }
95     public void renderContainerEnd(Writer JavaDoc writer, Map JavaDoc context, ModelScreenWidget.Container container) throws IOException JavaDoc {
96         writer.write("</div>");
97         appendWhitespace(writer);
98     }
99
100     public void renderLabel(Writer JavaDoc writer, Map JavaDoc context, ModelScreenWidget.Label label) throws IOException JavaDoc {
101         // open tag
102
String JavaDoc style = label.getStyle(context);
103         String JavaDoc id = label.getId(context);
104         if (UtilValidate.isNotEmpty(style) || UtilValidate.isNotEmpty(id) ) {
105             writer.write("<span");
106             
107             if (UtilValidate.isNotEmpty(id)) {
108                 writer.write(" id=\"");
109                 writer.write(id);
110                 writer.write("\"");
111             }
112             if (UtilValidate.isNotEmpty(style)) {
113                 writer.write(" class=\"");
114                 writer.write(style);
115                 writer.write("\"");
116             }
117             writer.write(">");
118             
119             // the text
120
writer.write(label.getText(context));
121             
122             // close tag
123
writer.write("</span>");
124             
125         } else {
126             writer.write(label.getText(context));
127         }
128         
129         appendWhitespace(writer);
130     }
131
132     public void renderLink(Writer JavaDoc writer, Map JavaDoc context, ModelScreenWidget.Link link) throws IOException JavaDoc {
133         // open tag
134
writer.write("<a");
135         String JavaDoc id = link.getId(context);
136         if (UtilValidate.isNotEmpty(id)) {
137             writer.write(" id=\"");
138             writer.write(id);
139             writer.write("\"");
140         }
141         String JavaDoc style = link.getStyle(context);
142         if (UtilValidate.isNotEmpty(style)) {
143             writer.write(" class=\"");
144             writer.write(style);
145             writer.write("\"");
146         }
147         String JavaDoc name = link.getName(context);
148         if (UtilValidate.isNotEmpty(name)) {
149             writer.write(" name=\"");
150             writer.write(name);
151             writer.write("\"");
152         }
153         String JavaDoc targetWindow = link.getTargetWindow(context);
154         if (UtilValidate.isNotEmpty(targetWindow)) {
155             writer.write(" target=\"");
156             writer.write(targetWindow);
157             writer.write("\"");
158         }
159         String JavaDoc target = link.getTarget(context);
160         if (UtilValidate.isNotEmpty(target)) {
161             writer.write(" HREF=\"");
162             String JavaDoc urlMode = link.getUrlMode();
163             String JavaDoc prefix = link.getPrefix(context);
164             boolean fullPath = link.getFullPath();
165             boolean secure = link.getSecure();
166             boolean encode = link.getEncode();
167             HttpServletResponse JavaDoc response = (HttpServletResponse JavaDoc) context.get("response");
168             HttpServletRequest JavaDoc request = (HttpServletRequest JavaDoc) context.get("request");
169             if (urlMode != null && urlMode.equalsIgnoreCase("intra-app")) {
170                 if (request != null && response != null) {
171                     ServletContext JavaDoc ctx = (ServletContext JavaDoc) request.getAttribute("servletContext");
172                     RequestHandler rh = (RequestHandler) ctx.getAttribute("_REQUEST_HANDLER_");
173                     String JavaDoc urlString = rh.makeLink(request, response, target, fullPath, secure, encode);
174                     writer.write(urlString);
175                 } else if (prefix != null) {
176                     writer.write(prefix + target);
177                 } else {
178                     writer.write(target);
179                 }
180             } else if (urlMode != null && urlMode.equalsIgnoreCase("content")) {
181                 if (request != null && response != null) {
182                     StringBuffer JavaDoc newURL = new StringBuffer JavaDoc();
183                     ContentUrlTag.appendContentPrefix(request, newURL);
184                     newURL.append(target);
185                     writer.write(newURL.toString());
186                 }
187             } else {
188                 writer.write(target);
189             }
190
191             writer.write("\"");
192         }
193         writer.write(">");
194         
195         // the text
196
ModelScreenWidget.Image img = link.getImage();
197         if (img == null)
198             writer.write(link.getText(context));
199         else
200             renderImage(writer, context, img);
201         
202         // close tag
203
writer.write("</a>");
204         
205         appendWhitespace(writer);
206     }
207
208     public void renderImage(Writer JavaDoc writer, Map JavaDoc context, ModelScreenWidget.Image image) throws IOException JavaDoc {
209         // open tag
210
writer.write("<img ");
211         String JavaDoc id = image.getId(context);
212         if (UtilValidate.isNotEmpty(id)) {
213             writer.write(" id=\"");
214             writer.write(id);
215             writer.write("\"");
216         }
217         String JavaDoc style = image.getStyle(context);
218         if (UtilValidate.isNotEmpty(style)) {
219             writer.write(" class=\"");
220             writer.write(style);
221             writer.write("\"");
222         }
223         String JavaDoc wid = image.getWidth(context);
224         if (UtilValidate.isNotEmpty(wid)) {
225             writer.write(" width=\"");
226             writer.write(wid);
227             writer.write("\"");
228         }
229         String JavaDoc hgt = image.getHeight(context);
230         if (UtilValidate.isNotEmpty(hgt)) {
231             writer.write(" height=\"");
232             writer.write(hgt);
233             writer.write("\"");
234         }
235         String JavaDoc border = image.getBorder(context);
236         if (UtilValidate.isNotEmpty(border)) {
237             writer.write(" border=\"");
238             writer.write(border);
239             writer.write("\"");
240         }
241         String JavaDoc src = image.getSrc(context);
242         if (UtilValidate.isNotEmpty(src)) {
243             writer.write(" SRC=\"");
244             String JavaDoc urlMode = image.getUrlMode();
245             boolean fullPath = false;
246             boolean secure = false;
247             boolean encode = false;
248             HttpServletResponse JavaDoc response = (HttpServletResponse JavaDoc) context.get("response");
249             HttpServletRequest JavaDoc request = (HttpServletRequest JavaDoc) context.get("request");
250             if (urlMode != null && urlMode.equalsIgnoreCase("intra-app")) {
251                 if (request != null && response != null) {
252                     ServletContext JavaDoc ctx = (ServletContext JavaDoc) request.getAttribute("servletContext");
253                     RequestHandler rh = (RequestHandler) ctx.getAttribute("_REQUEST_HANDLER_");
254                     String JavaDoc urlString = rh.makeLink(request, response, src, fullPath, secure, encode);
255                     writer.write(urlString);
256                 } else {
257                     writer.write(src);
258                 }
259             } else if (urlMode != null && urlMode.equalsIgnoreCase("content")) {
260                 if (request != null && response != null) {
261                     StringBuffer JavaDoc newURL = new StringBuffer JavaDoc();
262                     ContentUrlTag.appendContentPrefix(request, newURL);
263                     newURL.append(src);
264                     writer.write(newURL.toString());
265                 }
266             } else {
267                 writer.write(src);
268             }
269
270             writer.write("\"");
271         }
272         writer.write("/>");
273         
274         
275         appendWhitespace(writer);
276     }
277
278     public void renderContentBegin(Writer JavaDoc writer, Map JavaDoc context, ModelScreenWidget.Content content) throws IOException JavaDoc {
279         String JavaDoc editRequest = content.getEditRequest(context);
280         String JavaDoc editContainerStyle = content.getEditContainerStyle(context);
281         String JavaDoc enableEditName = content.getEnableEditName(context);
282         String JavaDoc enableEditValue = (String JavaDoc)context.get(enableEditName);
283         
284         if (Debug.verboseOn()) Debug.logVerbose("directEditRequest:" + editRequest, module);
285         
286         if (UtilValidate.isNotEmpty(editRequest) && "true".equals(enableEditValue)) {
287             writer.write("<div");
288             writer.write(" class=\"" + editContainerStyle + "\"> ");
289             appendWhitespace(writer);
290         }
291     }
292
293     public void renderContentBody(Writer JavaDoc writer, Map JavaDoc context, ModelScreenWidget.Content content) throws IOException JavaDoc {
294             Locale JavaDoc locale = Locale.getDefault();
295             Boolean JavaDoc nullThruDatesOnly = new Boolean JavaDoc(false);
296             String JavaDoc mimeTypeId = "text/html";
297             String JavaDoc expandedContentId = content.getContentId(context);
298             String JavaDoc renderedContent = null;
299             GenericDelegator delegator = (GenericDelegator) context.get("delegator");
300
301             if (Debug.verboseOn()) Debug.logVerbose("expandedContentId:" + expandedContentId, module);
302             
303             try {
304                 if (UtilValidate.isNotEmpty(expandedContentId)) {
305                     if (WidgetContentWorker.contentWorker != null) {
306                         renderedContent = WidgetContentWorker.contentWorker.renderContentAsTextCacheExt(delegator, expandedContentId, context, null, locale, mimeTypeId);
307                     } else {
308                         Debug.logError("Not rendering content, not ContentWorker found.", module);
309                     }
310                 }
311                 if (UtilValidate.isEmpty(renderedContent)) {
312                     String JavaDoc editRequest = content.getEditRequest(context);
313                     if (UtilValidate.isNotEmpty(editRequest)) {
314                         if (WidgetContentWorker.contentWorker != null) {
315                             WidgetContentWorker.contentWorker.renderContentAsTextCacheExt(delegator, "NOCONTENTFOUND", writer, context, null, locale, mimeTypeId);
316                         } else {
317                             Debug.logError("Not rendering content, not ContentWorker found.", module);
318                         }
319                     }
320                 } else {
321                     if (content.xmlEscape()) {
322                         renderedContent = UtilFormatOut.encodeXmlValue(renderedContent);
323                     }
324                     
325                     writer.write(renderedContent);
326                 }
327
328             } catch(GeneralException e) {
329                 String JavaDoc errMsg = "Error rendering included content with id [" + expandedContentId + "] : " + e.toString();
330                 Debug.logError(e, errMsg, module);
331                 //throw new RuntimeException(errMsg);
332
} catch(IOException JavaDoc e2) {
333                 String JavaDoc errMsg = "Error rendering included content with id [" + expandedContentId + "] : " + e2.toString();
334                 Debug.logError(e2, errMsg, module);
335                 //throw new RuntimeException(errMsg);
336
}
337     }
338
339     public void renderContentEnd(Writer JavaDoc writer, Map JavaDoc context, ModelScreenWidget.Content content) throws IOException JavaDoc {
340
341                 //Debug.logInfo("renderContentEnd, context:" + context, module);
342
String JavaDoc expandedContentId = content.getContentId(context);
343         String JavaDoc editMode = "Edit";
344         String JavaDoc editRequest = content.getEditRequest(context);
345         String JavaDoc editContainerStyle = content.getEditContainerStyle(context);
346         String JavaDoc enableEditName = content.getEnableEditName(context);
347         String JavaDoc enableEditValue = (String JavaDoc)context.get(enableEditName);
348         if (editRequest != null && editRequest.toUpperCase().indexOf("IMAGE") > 0) {
349             editMode += " Image";
350         }
351         Map JavaDoc params = (Map JavaDoc)context.get("parameters");
352         //String editRequestWithParams = editRequest + "?contentId=${currentValue.contentId}&drDataResourceId=${currentValue.drDataResourceId}&directEditRequest=${directEditRequest}&indirectEditRequest=${indirectEditRequest}&caContentIdTo=${currentValue.caContentIdTo}&caFromDate=${currentValue.caFromDate}&caContentAssocTypeId=${currentValue.caContentAssocTypeId}";
353

354         if (UtilValidate.isNotEmpty(editRequest) && "true".equals(enableEditValue)) {
355             String JavaDoc contentId = content.getContentId(context);
356             HttpServletResponse JavaDoc response = (HttpServletResponse JavaDoc) context.get("response");
357             HttpServletRequest JavaDoc request = (HttpServletRequest JavaDoc) context.get("request");
358             if (request != null && response != null) {
359                 if (editRequest.indexOf("?") < 0) editRequest += "?";
360                 else editRequest += "&amp;";
361                 editRequest += "contentId=" + expandedContentId;
362                 ServletContext JavaDoc ctx = (ServletContext JavaDoc) request.getAttribute("servletContext");
363                 RequestHandler rh = (RequestHandler) ctx.getAttribute("_REQUEST_HANDLER_");
364                 String JavaDoc urlString = rh.makeLink(request, response, editRequest, false, false, false);
365                 String JavaDoc linkString = "<a HREF=\"" + urlString + "\">" + editMode + "</a>";
366                 writer.write(linkString);
367             }
368             if (UtilValidate.isNotEmpty(editContainerStyle)) {
369                 writer.write("</div>");
370             }
371             appendWhitespace(writer);
372         }
373     }
374
375     public void renderContentFrame(Writer JavaDoc writer, Map JavaDoc context, ModelScreenWidget.Content content) throws IOException JavaDoc {
376         
377         String JavaDoc dataResourceId = content.getDataResourceId(context);
378         String JavaDoc urlString = "ViewSimpleContent?dataResourceId=" + dataResourceId;
379         
380         String JavaDoc width = content.getWidth();
381         String JavaDoc widthString=" width=\"" + width + "\"";
382         String JavaDoc height = content.getHeight();
383         String JavaDoc heightString=" height=\"" + height + "\"";
384         String JavaDoc border = content.getBorder();
385         String JavaDoc borderString = (UtilValidate.isNotEmpty(border)) ? " border=\"" + border + "\"" : "";
386         
387         HttpServletRequest JavaDoc request = (HttpServletRequest JavaDoc) context.get("request");
388         HttpServletResponse JavaDoc response = (HttpServletResponse JavaDoc) context.get("response");
389         if (request != null && response != null) {
390             ServletContext JavaDoc ctx = (ServletContext JavaDoc) request.getAttribute("servletContext");
391             RequestHandler rh = (RequestHandler) ctx.getAttribute("_REQUEST_HANDLER_");
392             String JavaDoc fullUrlString = rh.makeLink(request, response, urlString, true, false, false);
393             String JavaDoc linkString = "<iframe SRC=\"" + fullUrlString + "\" " + widthString + heightString + borderString + " />";
394             writer.write(linkString);
395         }
396         
397     }
398
399
400     public void renderSubContentBegin(Writer JavaDoc writer, Map JavaDoc context, ModelScreenWidget.SubContent content) throws IOException JavaDoc {
401
402         String JavaDoc editRequest = content.getEditRequest(context);
403         String JavaDoc editContainerStyle = content.getEditContainerStyle(context);
404         String JavaDoc enableEditName = content.getEnableEditName(context);
405         String JavaDoc enableEditValue = (String JavaDoc)context.get(enableEditName);
406         if (UtilValidate.isNotEmpty(editRequest) && "true".equals(enableEditValue)) {
407             writer.write("<div");
408             writer.write(" class=\"" + editContainerStyle + "\"> ");
409     
410             appendWhitespace(writer);
411         }
412     }
413
414     public void renderSubContentBody(Writer JavaDoc writer, Map JavaDoc context, ModelScreenWidget.SubContent content) throws IOException JavaDoc {
415             Locale JavaDoc locale = Locale.getDefault();
416             Boolean JavaDoc nullThruDatesOnly = new Boolean JavaDoc(false);
417             String JavaDoc mimeTypeId = "text/html";
418             String JavaDoc expandedContentId = content.getContentId(context);
419             String JavaDoc expandedAssocName = content.getAssocName(context);
420             String JavaDoc renderedContent = null;
421             GenericDelegator delegator = (GenericDelegator) context.get("delegator");
422             Timestamp JavaDoc fromDate = UtilDateTime.nowTimestamp();
423             HttpServletRequest JavaDoc request = (HttpServletRequest JavaDoc) context.get("request");
424             GenericValue userLogin = null;
425             if (request != null) {
426                 HttpSession JavaDoc session = request.getSession();
427                 userLogin = (GenericValue)session.getAttribute("userLogin");
428             }
429                 Debug.logInfo("expandedContentId:" + expandedContentId, module);
430             try {
431                 if (WidgetContentWorker.contentWorker != null) {
432                     renderedContent = WidgetContentWorker.contentWorker.renderSubContentAsTextCacheExt(delegator, expandedContentId, expandedAssocName, null, context, locale, mimeTypeId, userLogin, fromDate);
433                 } else {
434                     Debug.logError("Not rendering content, not ContentWorker found.", module);
435                 }
436                 if (UtilValidate.isEmpty(renderedContent)) {
437                     String JavaDoc editRequest = content.getEditRequest(context);
438                     if (UtilValidate.isNotEmpty(editRequest)) {
439                         if (WidgetContentWorker.contentWorker != null) {
440                             WidgetContentWorker.contentWorker.renderContentAsTextCacheExt(delegator, "NOCONTENTFOUND", writer, context, null, locale, mimeTypeId);
441                         } else {
442                             Debug.logError("Not rendering content, not ContentWorker found.", module);
443                         }
444                     }
445                 } else {
446                     if (content.xmlEscape()) {
447                         renderedContent = UtilFormatOut.encodeXmlValue(renderedContent);
448                     }
449                         
450                     writer.write(renderedContent);
451                 }
452
453             } catch(GeneralException e) {
454                 String JavaDoc errMsg = "Error rendering included content with id [" + expandedContentId + "] : " + e.toString();
455                 Debug.logError(e, errMsg, module);
456                 //throw new RuntimeException(errMsg);
457
} catch(IOException JavaDoc e2) {
458                 String JavaDoc errMsg = "Error rendering included content with id [" + expandedContentId + "] : " + e2.toString();
459                 Debug.logError(e2, errMsg, module);
460                 //throw new RuntimeException(errMsg);
461
}
462     }
463
464     public void renderSubContentEnd(Writer JavaDoc writer, Map JavaDoc context, ModelScreenWidget.SubContent content) throws IOException JavaDoc {
465
466         String JavaDoc editMode = "Edit";
467         String JavaDoc editRequest = content.getEditRequest(context);
468         String JavaDoc editContainerStyle = content.getEditContainerStyle(context);
469         String JavaDoc enableEditName = content.getEnableEditName(context);
470         String JavaDoc enableEditValue = (String JavaDoc)context.get(enableEditName);
471         String JavaDoc expandedContentId = content.getContentId(context);
472         String JavaDoc expandedAssocName = content.getAssocName(context);
473         Map JavaDoc params = (Map JavaDoc)context.get("parameters");
474         if (editRequest != null && editRequest.toUpperCase().indexOf("IMAGE") > 0) {
475             editMode += " Image";
476         }
477         if (UtilValidate.isNotEmpty(editRequest) && "true".equals(enableEditValue)) {
478             HttpServletResponse JavaDoc response = (HttpServletResponse JavaDoc) context.get("response");
479             HttpServletRequest JavaDoc request = (HttpServletRequest JavaDoc) context.get("request");
480             if (request != null && response != null) {
481                 if (editRequest.indexOf("?") < 0) editRequest += "?";
482                 else editRequest += "&amp;";
483                 editRequest += "contentId=" + expandedContentId;
484                 if (UtilValidate.isNotEmpty(expandedAssocName)) {
485                     editRequest += "&amp;assocName=" + expandedAssocName;
486                 }
487                 HttpSession JavaDoc session = request.getSession();
488                 GenericValue userLogin = (GenericValue)session.getAttribute("userLogin");
489                 /* don't know why this is here. might come to me later. -amb
490                 GenericDelegator delegator = (GenericDelegator)request.getAttribute("delegator");
491                 String contentIdTo = content.getContentId(context);
492                 String mapKey = content.getAssocName(context);
493                 GenericValue view = null;
494                 try {
495                     view = ContentWorker.getSubContentCache(delegator, contentIdTo, mapKey, userLogin, null, UtilDateTime.nowTimestamp(), new Boolean(false), null);
496                 } catch(GenericEntityException e) {
497                     throw new IOException("Originally a GenericEntityException. " + e.getMessage());
498                 }
499                 */

500                 ServletContext JavaDoc ctx = (ServletContext JavaDoc) request.getAttribute("servletContext");
501                 RequestHandler rh = (RequestHandler) ctx.getAttribute("_REQUEST_HANDLER_");
502                 String JavaDoc urlString = rh.makeLink(request, response, editRequest, false, false, false);
503                 String JavaDoc linkString = "<a HREF=\"" + urlString + "\">" + editMode + "</a>";
504                 writer.write(linkString);
505             }
506             if (UtilValidate.isNotEmpty(editContainerStyle)) {
507                 writer.write("</div>");
508             }
509             appendWhitespace(writer);
510         }
511     }
512
513
514     public void appendWhitespace(Writer JavaDoc writer) throws IOException JavaDoc {
515         // appending line ends for now, but this could be replaced with a simple space or something
516
writer.write("\r\n");
517         //writer.write(' ');
518
}
519 }
520
Popular Tags