You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by do...@apache.org on 2009/03/22 00:43:52 UTC
svn commit: r757086 [4/4] - in /ofbiz/trunk/applications/content/src: ./
org/ofbiz/content/ org/ofbiz/content/blog/ org/ofbiz/content/cms/
org/ofbiz/content/compdoc/ org/ofbiz/content/content/
org/ofbiz/content/data/ org/ofbiz/content/layout/ org/ofbiz...
Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/EditRenderSubContentTransform.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/EditRenderSubContentTransform.java?rev=757086&r1=757085&r2=757086&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/EditRenderSubContentTransform.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/EditRenderSubContentTransform.java Sat Mar 21 23:43:51 2009
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -42,13 +42,13 @@
/**
* EditRenderSubContentTransform - Freemarker Transform for URLs (links)
- *
+ *
* This is an interactive FreeMarker tranform that allows the user to modify the contents that are placed within it.
*/
public class EditRenderSubContentTransform implements TemplateTransformModel {
public static final String module = EditRenderSubContentTransform.class.getName();
-
+
/**
* A wrapper for the FreeMarkerWorker version.
*/
@@ -76,7 +76,7 @@
String subDataResourceTypeIdTemp = getArg(args, "subDataResourceTypeId", ctx);
final String contentId = getArg(args, "contentId", ctx);
-
+
final Locale locale = (Locale) FreeMarkerWorker.getWrappedObject("locale", env);
String mimeTypeIdTemp = getArg(args, "mimeTypeId", ctx);
final String rootDir = getArg(args, "rootDir", ctx);
@@ -179,9 +179,9 @@
templateContext.put("webSiteId", webSiteId);
templateContext.put("https", https);
templateContext.put("rootDir", rootDir);
-
+
Map templateRoot = FreeMarkerWorker.createEnvironmentMap(env);
-
+
templateRoot.put("wrapDataResourceId", dataResourceId);
templateRoot.put("wrapDataResourceTypeId", subDataResourceTypeId);
templateRoot.put("wrapContentIdTo", contentId);
@@ -189,7 +189,7 @@
templateRoot.put("wrapMimeTypeId", mimeTypeId);
templateRoot.put("wrapMapKey", mapKey);
templateRoot.put("context", templateContext);
-
+
try {
ContentWorker.renderContentAsText(dispatcher, delegator, wrapTemplateId, out, templateRoot, locale, mimeTypeId, false);
} catch (IOException e) {
@@ -199,7 +199,7 @@
Debug.logError(e2, "Error rendering content" + e2.getMessage(), module);
throw new IOException("Error rendering content" + e2.toString());
}
-
+
Map ctx = (Map) FreeMarkerWorker.getWrappedObject("context", env);
templateContext.put("contentId", contentId);
templateContext.put("locale", locale);
Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/InjectNodeTrailCsvTransform.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/InjectNodeTrailCsvTransform.java?rev=757086&r1=757085&r2=757086&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/InjectNodeTrailCsvTransform.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/InjectNodeTrailCsvTransform.java Sat Mar 21 23:43:51 2009
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -109,12 +109,12 @@
if (Debug.infoOn()) Debug.logInfo("in InjectNodeTrailCsv(0), contentAssocTypeId:"+contentAssocTypeId,module);
try {
if (UtilValidate.isNotEmpty(subContentId)) {
- csvTrail = ContentWorker.getContentAncestryNodeTrailCsv(delegator, subContentId, contentAssocTypeId, "to");
+ csvTrail = ContentWorker.getContentAncestryNodeTrailCsv(delegator, subContentId, contentAssocTypeId, "to");
if (UtilValidate.isNotEmpty(csvTrail))
csvTrail += ",";
csvTrail += subContentId;
} else if (UtilValidate.isNotEmpty(contentId)) {
- csvTrail = ContentWorker.getContentAncestryNodeTrailCsv(delegator, contentId, contentAssocTypeId, "to");
+ csvTrail = ContentWorker.getContentAncestryNodeTrailCsv(delegator, contentId, contentAssocTypeId, "to");
if (UtilValidate.isNotEmpty(csvTrail))
csvTrail += ",";
csvTrail += contentId;
@@ -131,12 +131,12 @@
csvTrail = passedCsv;
int lastComma = passedCsv.lastIndexOf(",");
String lastPassedContentId = null;
- if (lastComma >= 0) {
+ if (lastComma >= 0) {
lastPassedContentId = passedCsv.substring(lastComma + 1);
} else {
lastPassedContentId = passedCsv;
}
-
+
if (UtilValidate.isNotEmpty(lastPassedContentId)) {
if (UtilValidate.isNotEmpty(trail)) {
Map nd = (Map)trail.get(0);
Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/LimitedSubContentCacheTransform.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/LimitedSubContentCacheTransform.java?rev=757086&r1=757085&r2=757086&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/LimitedSubContentCacheTransform.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/LimitedSubContentCacheTransform.java Sat Mar 21 23:43:51 2009
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -94,7 +94,7 @@
contentAssocTypeId = "SUB_CONTENT";
templateRoot.put("contentAssocTypeId ", contentAssocTypeId);
}
-
+
final Map pickedEntityIds = FastMap.newInstance();
List assocTypes = StringUtil.split(contentAssocTypeId, "|");
@@ -123,7 +123,7 @@
fromDate = UtilDateTime.nowTimestamp();
String limitSize = (String) templateRoot.get("limitSize");
- final int returnLimit = Integer.parseInt(limitSize);
+ final int returnLimit = Integer.parseInt(limitSize);
// limitMode will be "random" to begin with
String limitMode = (String) templateRoot.get("limitMode");
final GenericValue userLogin = (GenericValue) FreeMarkerWorker.getWrappedObject("userLogin", env);
@@ -131,7 +131,7 @@
String strNullThruDatesOnly = (String) templateRoot.get("nullThruDatesOnly");
String orderBy = (String) templateRoot.get("orderBy");
Boolean nullThruDatesOnly = (strNullThruDatesOnly != null && strNullThruDatesOnly.equalsIgnoreCase("true")) ? Boolean.TRUE : Boolean.FALSE;
-
+
// NOTE this was looking for subContentId, but that doesn't make ANY sense, so changed to contentId
String contentId = (String) templateRoot.get("contentId");
@@ -190,7 +190,7 @@
List subList = list.subList(0, list.size() - 1);
templateRoot.put("globalNodeTrail", subList);
env.setVariable("globalNodeTrail", FreeMarkerWorker.autoWrap(subList, env));
-
+
//if (Debug.infoOn()) Debug.logInfo("highIndex(2):" + highIndexInteger , "");
//if (Debug.infoOn()) Debug.logInfo("in limited, returnLimit(2):" + returnLimit , "");
//if (Debug.verboseOn()) Debug.logVerbose("in limited, pickedEntityIds(2):" + pickedEntityIds , "");
Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/LoopSubContentTransform.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/LoopSubContentTransform.java?rev=757086&r1=757085&r2=757086&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/LoopSubContentTransform.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/LoopSubContentTransform.java Sat Mar 21 23:43:51 2009
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -143,13 +143,13 @@
final GenericDelegator delegator = (GenericDelegator) FreeMarkerWorker.getWrappedObject("delegator", env);
final Map savedValues = FreeMarkerWorker.saveValues(templateCtx, saveKeyNames);
FreeMarkerWorker.overrideWithArgs(templateCtx, args);
-
+
String contentAssocTypeId = (String) templateCtx.get("contentAssocTypeId");
if (UtilValidate.isEmpty(contentAssocTypeId)) {
contentAssocTypeId = "SUB_CONTENT";
templateCtx.put("contentAssocTypeId ", contentAssocTypeId);
}
-
+
List assocTypes = UtilMisc.toList(contentAssocTypeId);
templateCtx.put("assocTypes", assocTypes);
Locale locale = (Locale) templateCtx.get("locale");
@@ -164,12 +164,12 @@
fromDate = UtilDateTime.toTimestamp(fromDateStr);
}
if (fromDate == null) fromDate = UtilDateTime.nowTimestamp();
-
+
String thisContentId = (String) templateCtx.get("contentId");
-
+
//DEJ20080730 Should always use contentId, not subContentId since we're searching for that and it is confusing
//if (UtilValidate.isEmpty(thisContentId)) thisContentId = (String)templateCtx.get("subContentId");
-
+
String thisMapKey = (String)templateCtx.get("mapKey");
//GenericValue subContentDataResourceView = null;
Map results = ContentServicesComplex.getAssocAndContentAndDataResourceMethod(delegator, thisContentId, thisMapKey, null, fromDate, null, null, null, assocTypes, null);
@@ -216,14 +216,14 @@
String wrapTemplateId = (String)templateCtx.get("wrapTemplateId");
if (UtilValidate.isNotEmpty(wrapTemplateId)) {
templateCtx.put("wrappedFTL", wrappedFTL);
-
+
Map templateRoot = FreeMarkerWorker.createEnvironmentMap(env);
-
+
templateRoot.put("wrapDataResourceTypeId", templateCtx.get("subDataResourceTypeId"));
templateRoot.put("wrapContentIdTo", templateCtx.get("contentId"));
templateRoot.put("wrapMimeTypeId", templateCtx.get("mimeTypeId"));
templateRoot.put("context", templateCtx);
-
+
Locale locale = (Locale) templateCtx.get("locale");
if (locale == null) locale = Locale.getDefault();
String mimeTypeId = (String) templateCtx.get("mimeTypeId");
Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentAndSubContent.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentAndSubContent.java?rev=757086&r1=757085&r2=757086&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentAndSubContent.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentAndSubContent.java Sat Mar 21 23:43:51 2009
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -51,7 +51,7 @@
* RenderContentAndSubContent - Freemarker Transform for Content rendering
* This transform cannot be called recursively (at this time).
*/
-public class RenderContentAndSubContent implements TemplateTransformModel {
+public class RenderContentAndSubContent implements TemplateTransformModel {
public static final String module = RenderContentAndSubContent.class.getName();
// public static final String [] upSaveKeyNames = {"globalNodeTrail"};
@@ -73,7 +73,7 @@
FreeMarkerWorker.overrideWithArgs(templateRoot, args);
final Map savedValues = FastMap.newInstance();
-
+
return new Writer(out) {
public void write(char cbuf[], int off, int len) {
@@ -106,12 +106,12 @@
String mapKey = (String)templateRoot.get("mapKey");
String contentAssocTypeId = (String)templateRoot.get("contentAssocTypeId");
if (UtilValidate.isNotEmpty(mapKey) || UtilValidate.isNotEmpty(contentAssocTypeId)) {
- String txt = ContentWorker.renderSubContentAsText(dispatcher, delegator, contentId, mapKey, templateRoot, locale, mimeTypeId, true);
+ String txt = ContentWorker.renderSubContentAsText(dispatcher, delegator, contentId, mapKey, templateRoot, locale, mimeTypeId, true);
//String txt = ContentWorker.renderSubContentAsTextCache(delegator, thisContentId, thisMapKey, null, templateRoot, locale, mimeTypeId, null, fromDate);
// if ("true".equals(xmlEscape)) {
// txt = UtilFormatOut.encodeXmlValue(txt);
// }
-
+
out.write(txt);
// if (Debug.infoOn()) Debug.logInfo("in RenderSubContent, after renderContentAsTextCache:", module);
@@ -120,18 +120,18 @@
// assocList = UtilMisc.toList(contentAssocTypeId);
// }
// GenericValue content = ContentWorker.getSubContent(delegator, contentId, mapKey, null, null, assocList, null);
-// if (content != null) {
+// if (content != null) {
// contentId = content.getString("contentId");
// } else {
// contentId = null;
// }
- } else if (contentId != null) {
+ } else if (contentId != null) {
ContentWorker.renderContentAsText(dispatcher, delegator, contentId, out, templateRoot, locale, mimeTypeId, true);
// ((MapStack)templateRoot).pop();
}
//FreeMarkerWorker.reloadValues(templateRoot, savedValues, env);
//FreeMarkerWorker.reloadValues(templateRoot, savedValuesUp, env);
-
+
} catch (GeneralException e) {
String errMsg = "Error rendering thisContentId:" + (String)templateRoot.get("contentId") + " msg:" + e.toString();
Debug.logError(e, errMsg, module);
Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentAsText.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentAsText.java?rev=757086&r1=757085&r2=757086&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentAsText.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentAsText.java Sat Mar 21 23:43:51 2009
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -184,9 +184,9 @@
if ("true".equals(xmlEscape)) {
txt = UtilFormatOut.encodeXmlValue(txt);
}
-
+
out.write(txt);
-
+
// if (Debug.infoOn()) Debug.logInfo("in RenderSubContent, after renderContentAsTextCache:", module);
} catch (GeneralException e) {
String errMsg = "Error rendering thisContentId:" + thisContentId + " msg:" + e.toString();
@@ -219,7 +219,7 @@
fullRequest += delim + "contentId=" + contentId;
delim = "&";
}
-
+
out.write("<a href=\"");
ServletContext servletContext = (ServletContext) request.getSession().getServletContext();
RequestHandler rh = (RequestHandler) servletContext.getAttribute("_REQUEST_HANDLER_");
@@ -236,7 +236,7 @@
if (UtilValidate.isEmpty(editStyle)) {
editStyle = "buttontext";
}
- return editStyle;
+ return editStyle;
}
};
}
Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentTransform.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentTransform.java?rev=757086&r1=757085&r2=757086&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentTransform.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentTransform.java Sat Mar 21 23:43:51 2009
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -58,7 +58,7 @@
final LocalDispatcher dispatcher = (LocalDispatcher) FreeMarkerWorker.getWrappedObject("dispatcher", env);
final HttpServletRequest request = (HttpServletRequest) FreeMarkerWorker.getWrappedObject("request", env);
final HttpServletResponse response = (HttpServletResponse) FreeMarkerWorker.getWrappedObject("response", env);
-
+
final Map templateRoot = MapStack.create(FreeMarkerWorker.createEnvironmentMap(env));
((MapStack)templateRoot).push(args);
final String xmlEscape = (String)templateRoot.get("xmlEscape");
@@ -96,7 +96,7 @@
try {
String txt = null;
-
+
String mapKey = (String)templateRoot.get("mapKey");
if ( UtilValidate.isEmpty(mapKey)) {
txt = ContentWorker.renderContentAsText(dispatcher, delegator, thisContentId, templateRoot, locale, mimeTypeId, true);
@@ -106,9 +106,9 @@
if ("true".equals(xmlEscape)) {
txt = UtilFormatOut.encodeXmlValue(txt);
}
-
+
out.write(txt);
-
+
} catch (GeneralException e) {
String errMsg = "Error rendering thisContentId:" + thisContentId + " msg:" + e.toString();
Debug.logError(e, errMsg, module);
@@ -133,7 +133,7 @@
fullRequest += delim + "contentId=" + thisContentId;
delim = "&";
}
-
+
out.write("<a href=\"");
ServletContext servletContext = (ServletContext) request.getSession().getServletContext();
RequestHandler rh = (RequestHandler) servletContext.getAttribute("_REQUEST_HANDLER_");
@@ -150,7 +150,7 @@
if (UtilValidate.isEmpty(editStyle)) {
editStyle = "buttontext";
}
- return editStyle;
+ return editStyle;
}
};
}
Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderSubContentAsText.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderSubContentAsText.java?rev=757086&r1=757085&r2=757086&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderSubContentAsText.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderSubContentAsText.java Sat Mar 21 23:43:51 2009
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -163,12 +163,12 @@
FreeMarkerWorker.saveContextValues(templateRoot, saveKeyNames, savedValues);
try {
- String txt = ContentWorker.renderSubContentAsText(dispatcher, delegator, thisContentId, thisMapKey, templateRoot, locale, mimeTypeId, true);
+ String txt = ContentWorker.renderSubContentAsText(dispatcher, delegator, thisContentId, thisMapKey, templateRoot, locale, mimeTypeId, true);
//String txt = ContentWorker.renderSubContentAsTextCache(delegator, thisContentId, thisMapKey, null, templateRoot, locale, mimeTypeId, null, fromDate);
if ("true".equals(xmlEscape)) {
txt = UtilFormatOut.encodeXmlValue(txt);
}
-
+
out.write(txt);
if (Debug.infoOn()) Debug.logInfo("in RenderSubContent, after renderContentAsTextCache:", module);
@@ -187,13 +187,13 @@
}
public void openEditWrap(Writer out, String editStyle) throws IOException {
-
+
String divStr = "<div class=\"" + editStyle + "\">";
out.write(divStr);
}
public void closeEditWrap(Writer out, String editRequestName) throws IOException {
- /*
+ /*
if (Debug.infoOn()) Debug.logInfo("in RenderSubContent, contentId(5):" + templateRoot.get("contentId"), module);
if (Debug.infoOn()) Debug.logInfo("in RenderSubContent, subContentId(5):" + templateRoot.get("subContentId"), module);
StringBuilder sb = new StringBuilder();
@@ -203,7 +203,7 @@
String contentAssocTypeId = null;
String mapKey = null;
String fromDate = null;
-
+
contentIdTo = (String)templateRoot.get("contentId");
contentAssocTypeId = (String)templateRoot.get("contentAssocTypeId");
mapKey = (String)templateRoot.get("mapKey");
@@ -254,7 +254,7 @@
fullRequest += delim + "fromDate=" + fromDate;
delim = "&";
}
-
+
if (Debug.infoOn()) Debug.logInfo("in Render(2), contentIdTo ." + contentIdTo , module);
WidgetWorker.appendOfbizUrl(sb, fullRequest, request, response);
String url = sb.toString();
@@ -273,7 +273,7 @@
if (UtilValidate.isEmpty(editStyle)) {
editStyle = "buttontext";
}
- return editStyle;
+ return editStyle;
}
};
}
Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderSubContentCacheTransform.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderSubContentCacheTransform.java?rev=757086&r1=757085&r2=757086&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderSubContentCacheTransform.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderSubContentCacheTransform.java Sat Mar 21 23:43:51 2009
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -208,7 +208,7 @@
String contentAssocTypeId = null;
String mapKey = null;
String fromDate = null;
-
+
if (!directAssocMode) {
contentIdTo = (String)templateRoot.get("contentId");
contentAssocTypeId = (String)templateRoot.get("contentAssocTypeId");
@@ -263,7 +263,7 @@
fullRequest += delim + "fromDate=" + fromDate;
delim = "&";
}
-
+
if (Debug.infoOn()) Debug.logInfo("in Render(2), contentIdTo ." + contentIdTo , module);
out.write("<a href=\"");
ServletContext servletContext = (ServletContext) request.getSession().getServletContext();
@@ -281,10 +281,10 @@
if (UtilValidate.isEmpty(editStyle)) {
editStyle = "buttontext";
}
- return editStyle;
+ return editStyle;
}
};
-
+
}
}
Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderSubContentTransform.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderSubContentTransform.java?rev=757086&r1=757085&r2=757086&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderSubContentTransform.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderSubContentTransform.java Sat Mar 21 23:43:51 2009
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/TraverseSubContentCacheTransform.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/TraverseSubContentCacheTransform.java?rev=757086&r1=757085&r2=757086&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/TraverseSubContentCacheTransform.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/TraverseSubContentCacheTransform.java Sat Mar 21 23:43:51 2009
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -94,7 +94,7 @@
Boolean nullThruDatesOnly = (strNullThruDatesOnly != null && strNullThruDatesOnly.equalsIgnoreCase("true")) ? Boolean.TRUE :Boolean.FALSE;
GenericValue val = null;
try {
- // getCurrentContent puts the "current" node on the end of globalNodeTrail.
+ // getCurrentContent puts the "current" node on the end of globalNodeTrail.
// It may have already been there, but getCurrentContent will compare its contentId
// to values in templateRoot.
val = ContentWorker.getCurrentContent(delegator, globalNodeTrail, userLogin, templateRoot, nullThruDatesOnly, contentAssocPredicateId);
Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/TraverseSubContentTransform.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/TraverseSubContentTransform.java?rev=757086&r1=757085&r2=757086&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/TraverseSubContentTransform.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/TraverseSubContentTransform.java Sat Mar 21 23:43:51 2009
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -102,16 +102,16 @@
//final GenericValue userLogin = (GenericValue) FreeMarkerWorker.getWrappedObject("userLogin", env);
GenericValue view = (GenericValue) FreeMarkerWorker.getWrappedObject("subContentDataResourceView", env);
final Integer indent = (templateCtx.get("indent") == null) ? Integer.valueOf(0) : (Integer)templateCtx.get("indent");
-
+
String contentId = (String)templateCtx.get("contentId");
String subContentId = (String)templateCtx.get("subContentId");
if (view == null) {
String thisContentId = subContentId;
- if (UtilValidate.isEmpty(thisContentId))
+ if (UtilValidate.isEmpty(thisContentId))
thisContentId = contentId;
if (UtilValidate.isNotEmpty(thisContentId)) {
-
+
try {
view = delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", thisContentId));
} catch (GenericEntityException e) {
@@ -148,7 +148,7 @@
startContentAssocTypeId = "SUB_CONTENT";
traverseContext.put("contentAssocTypeId", startContentAssocTypeId);
String direction = (String)templateCtx.get( "direction");
- if (UtilValidate.isEmpty(direction))
+ if (UtilValidate.isEmpty(direction))
direction = "From";
traverseContext.put("direction", direction);
@@ -229,9 +229,9 @@
String wrapTemplateId = (String)templateCtx.get("wrapTemplateId");
if (UtilValidate.isNotEmpty(wrapTemplateId)) {
templateCtx.put("wrappedFTL", wrappedFTL);
-
+
Map templateRoot = FreeMarkerWorker.createEnvironmentMap(env);
-
+
/*
templateRoot.put("viewSize", viewSize);
templateRoot.put("viewIndex", viewIndex);
@@ -243,7 +243,7 @@
templateRoot.put("wrapContentIdTo", contentId);
templateRoot.put("wrapMimeTypeId", mimeTypeId);
//templateRoot.put("wrapMapKey", mapKey);
-
+
*/
templateRoot.put("context", templateCtx);
String mimeTypeId = (String) templateCtx.get("mimeTypeId");
@@ -277,7 +277,7 @@
}
private boolean checkWhen (GenericValue thisContent, String contentAssocTypeId) {
-
+
boolean isPick = false;
Map assocContext = FastMap.newInstance();
if (UtilValidate.isEmpty(contentAssocTypeId))
Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/WrapSubContentCacheTransform.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/WrapSubContentCacheTransform.java?rev=757086&r1=757085&r2=757086&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/WrapSubContentCacheTransform.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/WrapSubContentCacheTransform.java Sat Mar 21 23:43:51 2009
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -44,7 +44,7 @@
//import com.clarkware.profiler.Profiler;
/**
* WrapSubContentCacheTransform - Freemarker Transform for URLs (links)
- *
+ *
* This is an interactive FreeMarker tranform that allows the user to modify the contents that are placed within it.
*/
public class WrapSubContentCacheTransform implements TemplateTransformModel {
@@ -52,7 +52,7 @@
public static final String module = WrapSubContentCacheTransform.class.getName();
public static final String [] upSaveKeyNames = {"globalNodeTrail"};
public static final String [] saveKeyNames = {"contentId", "subContentId", "subDataResourceTypeId", "mimeTypeId", "whenMap", "locale", "wrapTemplateId", "encloseWrapText", "nullThruDatesOnly"};
-
+
/**
* A wrapper for the FreeMarkerWorker version.
*/
@@ -149,13 +149,13 @@
FreeMarkerWorker.reloadValues(templateCtx, savedValues, env);
//if (Debug.infoOn()) Debug.logInfo("in Wrap(2), savedValues ." + savedValues , module);
String wrappedContent = buf.toString();
-
+
//if (view != null && Debug.infoOn()) Debug.logInfo("in WrapSubContent, view(2):" + view.get("contentId"), module);
//if (Debug.infoOn()) Debug.logInfo("in WrapSubContent, wrappedContent:" + wrappedContent, module);
//if (Debug.infoOn()) Debug.logInfo("in WrapSubContent, wrapTemplateId(2):" + wrapTemplateId, module);
if (UtilValidate.isNotEmpty(wrapTemplateId)) {
templateCtx.put("wrappedContent", wrappedContent);
-
+
//Map templateRoot = FreeMarkerWorker.createEnvironmentMap(env);
Map templateRoot = null;
Map templateRootTemplate = (Map)templateCtx.get("templateRootTemplate");
@@ -166,9 +166,9 @@
} else {
templateRoot = UtilMisc.makeMapWritable(templateRootTemplate);
}
-
+
templateRoot.put("context", templateCtx);
-
+
String mimeTypeId = (String)templateCtx.get("mimeTypeId");
Locale locale = null;
try {
@@ -182,7 +182,7 @@
Debug.logError(e2, "Error rendering content" + e2.getMessage(), module);
throw new IOException("Error rendering content" + e2.toString());
}
-
+
FreeMarkerWorker.reloadValues(templateCtx, savedValuesUp, env);
//if (Debug.infoOn()) Debug.logInfo("in Wrap(2), savedValuesUp ." + savedValuesUp , module);
}