1
14
15 package com.liferay.portal.upgrade.v4_3_0.util;
16
17 import com.liferay.portal.kernel.upgrade.util.BaseUpgradeColumnImpl;
18 import com.liferay.portal.kernel.upgrade.util.UpgradeColumn;
19 import com.liferay.portal.kernel.util.StringUtil;
20
21
27 public class JournalTemplateXSLUpgradeColumnImpl extends BaseUpgradeColumnImpl {
28
29 public JournalTemplateXSLUpgradeColumnImpl(UpgradeColumn templateIdColumn) {
30 super("xsl");
31
32 _templateIdColumn = templateIdColumn;
33 }
34
35 public Object getNewValue(Object oldValue) throws Exception {
36 String xsl = (String)oldValue;
37
38 return formatXSL(xsl);
39 }
40
41 protected String formatXSL(String xsl) throws Exception {
42
46
47 String templateId = (String)_templateIdColumn.getOldValue();
48
49 if (templateId.equals("BASIC-BANNER")) {
50
51
53 xsl = StringUtil.replace(
54 xsl,
55 "background-repeat: no-repeat; width: 520; height: 175;",
56 "background-repeat: no-repeat; width: 520px; height: 175px;");
57 }
58
59 return xsl;
60 }
61
62 private UpgradeColumn _templateIdColumn;
63
64 }