svn commit: r1369382 [16/19] - in /ofbiz/branches/20120329_portletWidget: ./ applications/accounting/script/org/ofbiz/accounting/payment/ applications/accounting/src/org/ofbiz/accounting/payment/ applications/accounting/webapp/accounting/WEB-INF/ appli...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1369382 [16/19] - in /ofbiz/branches/20120329_portletWidget: ./ applications/accounting/script/org/ofbiz/accounting/payment/ applications/accounting/src/org/ofbiz/accounting/payment/ applications/accounting/webapp/accounting/WEB-INF/ appli...

erwan
Modified: ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java?rev=1369382&r1=1369381&r2=1369382&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java (original)
+++ ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java Sat Aug  4 18:11:00 2012
@@ -47,7 +47,6 @@ import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.base.util.template.FreeMarkerWorker;
 import org.ofbiz.entity.Delegator;
 import org.ofbiz.entity.GenericValue;
-import org.ofbiz.service.DispatchContext;//#Eam# : portletWidget
 import org.ofbiz.service.LocalDispatcher;
 import org.ofbiz.webapp.control.RequestHandler;
 import org.ofbiz.webapp.taglib.ContentUrlTag;
@@ -55,7 +54,7 @@ import org.ofbiz.widget.ModelWidget;
 import org.ofbiz.widget.WidgetContentWorker;
 import org.ofbiz.widget.WidgetDataResourceWorker;
 import org.ofbiz.widget.WidgetWorker;
-//import org.ofbiz.widget.form.FormStringRenderer;  #Bam# PortletWidget : screenlet navigationForm
+import org.ofbiz.widget.form.FormStringRenderer;
 import org.ofbiz.widget.form.MacroFormRenderer;
 import org.ofbiz.widget.form.ModelForm;
 import org.ofbiz.widget.html.HtmlScreenRenderer.ScreenletMenuRenderer;
@@ -65,10 +64,6 @@ import org.xml.sax.SAXException;
 import freemarker.core.Environment;
 import freemarker.template.Template;
 import freemarker.template.TemplateException;
-//#Bam# portletWidget
-import java.util.List;
-import org.ofbiz.base.util.string.FlexibleStringExpander;
-//#Eam# portletWidget
 
 public class MacroScreenRenderer implements ScreenStringRenderer {
 
@@ -78,7 +73,7 @@ public class MacroScreenRenderer impleme
     private String rendererName;
     private int elementId = 999;
     protected boolean widgetCommentsEnabled = false;
-    //private static final String formrenderer = UtilProperties.getPropertyValue("widget", "screen.formrenderer"); #Bam# PortletWidget : screenlet navigationForm
+    private static final String formrenderer = UtilProperties.getPropertyValue("widget", "screen.formrenderer");
 
     public MacroScreenRenderer(String name, String macroLibraryPath) throws TemplateException, IOException {
         macroLibrary = FreeMarkerWorker.getTemplate(macroLibraryPath);
@@ -625,14 +620,9 @@ public class MacroScreenRenderer impleme
                 context.put("menuStringRenderer", renderer);
                 navMenu.renderWidgetString(sb, context, this);
                 context.put("menuStringRenderer", savedRenderer);
-            // #Bam# PortletWidget screenlet navigationForm
-            /*
             } else if (navForm != null) {
                 renderScreenletPaginateMenu(sb, context, navForm);
             }
-            */
-            }
-            // #Bam# PortletWidget screenlet navigationForm
             menuString = sb.toString();
         }
 
@@ -650,35 +640,11 @@ public class MacroScreenRenderer impleme
         parameters.put("showMore", showMore);
         parameters.put("collapsed", collapsed);
         parameters.put("javaScriptEnabled", javaScriptEnabled);
-       // #Bam# PortletWidget screenlet navigationForm
-        /*
         executeMacro(writer, "renderScreenletBegin", parameters);
-        */
-        String macroName = "renderScreenletBegin";
-        if (navForm != null) {
-            Map<String, Object> paramNav = preparePaginateData(context, navForm.getModelForm(context));
-            int listSize = (Integer) paramNav.get("listSize");
-            int viewSize = (Integer) paramNav.get("viewSize");
-            if (listSize > viewSize){
-                parameters.putAll(paramNav);
-                macroName = "renderScreenletBeginWithPaginate";
-            }
-        }
-        executeMacro(writer, macroName, parameters);
-        // #Bam# PortletWidget screenlet navigationForm
     }
 
     public void renderScreenletSubWidget(Appendable writer, Map<String, Object> context, ModelScreenWidget subWidget, ModelScreenWidget.Screenlet screenlet) throws GeneralException, IOException  {
         if (subWidget.equals(screenlet.getNavigationForm())) {
-           // #Bam# PortletWidget : screenlet navigationForm
-            Map<String, Object> globalCtx = UtilGenerics.checkMap(context.get("globalContext"));
-            globalCtx.put("NO_PAGINATOR", true);
-            MacroFormRenderer formRenderer = (MacroFormRenderer) context.get("formStringRenderer"); // in MacroScreenRenderer it should be a MacroForm
-            boolean previousRenderPagination = formRenderer.getRenderPagination();
-            formRenderer.setRenderPagination(false);
-            subWidget.renderWidgetString(writer, context, this);
-            formRenderer.setRenderPagination(previousRenderPagination);
-            /*
             HttpServletRequest request = (HttpServletRequest) context.get("request");
             HttpServletResponse response = (HttpServletResponse) context.get("response");
             if (request != null && response != null) {
@@ -696,8 +662,6 @@ public class MacroScreenRenderer impleme
                 subWidget.renderWidgetString(writer, context, this);
                 context.put("formStringRenderer", savedRenderer);
             }
-            */
-            // #Eam# PortletWidget : screenlet navigationForm
         } else {
             subWidget.renderWidgetString(writer, context, this);
         }
@@ -712,12 +676,6 @@ public class MacroScreenRenderer impleme
         ModelForm modelForm = form.getModelForm(context);
         modelForm.runFormActions(context);
         modelForm.preparePager(context);
-        //#Bam# portletWidget : screenlet navigationForm
-        context.put("forScreenlet", "Y");
-        MacroFormRenderer formStringRenderer = (MacroFormRenderer) context.get("formStringRenderer");
-        formStringRenderer.renderNextPrev(writer, context, modelForm);
-        //#Eam# portletWidget
-
         String targetService = modelForm.getPaginateTarget(context);
         if (targetService == null) {
             targetService = "${targetService}";
@@ -835,301 +793,6 @@ public class MacroScreenRenderer impleme
         executeMacro(writer, "renderScreenletPaginateMenu", parameters);
     }
 
-    //#Bam# portletWidget screenlet navigation Form
-    public Map<String, Object> preparePaginateData(Map<String, Object> context, ModelForm modelForm) {
-        boolean ajaxEnabled = false;
-        HttpServletRequest request = (HttpServletRequest) context.get("request");
-        HttpServletResponse response = (HttpServletResponse) context.get("response");
-        ServletContext ctx = (ServletContext) request.getAttribute("servletContext");
-        RequestHandler rh = (RequestHandler) ctx.getAttribute("_REQUEST_HANDLER_");
-        Map<String, Object> inputFields = UtilGenerics.checkMap(context.get("requestParameters"));
-        Map<String, Object> queryStringMap = UtilGenerics.toMap(context.get("queryStringMap"));
-        if (UtilValidate.isNotEmpty(queryStringMap)) {
-            inputFields.putAll(queryStringMap);
-        }
-        if (modelForm.getType().equals("multi")) {
-            inputFields = UtilHttp.removeMultiFormParameters(inputFields);
-        }
-        String queryString = UtilHttp.urlEncodeArgs(inputFields);
-        List<ModelForm.UpdateArea> updateAreas = modelForm.getOnPaginateUpdateAreas();
-        modelForm.runFormActions(context);
-        modelForm.preparePager(context);
-        String targetService = modelForm.getPaginateTarget(context);
-        if (UtilHttp.isJavaScriptEnabled(request)) {
-            if (UtilValidate.isNotEmpty(updateAreas)) {
-                ajaxEnabled = true;
-            }
-        }
-        if (targetService == null) {
-            targetService = "${targetService}";
-        }
-
-        // get the parameterized pagination index and size fields
-        int paginatorNumber = WidgetWorker.getPaginatorNumber(context);
-        String viewIndexParam = modelForm.getMultiPaginateIndexField(context);
-        String viewSizeParam = modelForm.getMultiPaginateSizeField(context);
-
-        int viewIndex = modelForm.getViewIndex(context);
-        int viewSize = modelForm.getViewSize(context);
-        int listSize = modelForm.getListSize(context);
-
-        int lowIndex = modelForm.getLowIndex(context);
-        int highIndex = modelForm.getHighIndex(context);
-        int actualPageSize = modelForm.getActualPageSize(context);
-
-        // needed for the "Page" and "rows" labels
-        Map<String, String> uiLabelMap = UtilGenerics.checkMap(context.get("uiLabelMap"));
-        String pageLabel = "";
-        String commonDisplaying = "";
-        if (uiLabelMap == null) {
-            Debug.logWarning("Could not find uiLabelMap in context", module);
-        } else {
-            pageLabel = uiLabelMap.get("CommonPage");
-            Map<String, Integer> messageMap = UtilMisc.toMap("lowCount", Integer.valueOf(lowIndex + 1), "highCount", Integer.valueOf(lowIndex + actualPageSize), "total", Integer.valueOf(listSize));
-            commonDisplaying = UtilProperties.getMessage("CommonUiLabels", "CommonDisplaying", messageMap, (Locale) context.get("locale"));
-        }
-
-        // for legacy support, the viewSizeParam is VIEW_SIZE and viewIndexParam is VIEW_INDEX when the fields are "viewSize" and "viewIndex"
-        if (viewIndexParam.equals("viewIndex" + "_" + paginatorNumber)) viewIndexParam = "VIEW_INDEX" + "_" + paginatorNumber;
-        if (viewSizeParam.equals("viewSize" + "_" + paginatorNumber)) viewSizeParam = "VIEW_SIZE" + "_" + paginatorNumber;
-
-
-        // strip legacy viewIndex/viewSize params from the query string
-        queryString = UtilHttp.stripViewParamsFromQueryString(queryString, "" + paginatorNumber);
-
-        // strip parameterized index/size params from the query string
-        HashSet<String> paramNames = new HashSet<String>();
-        paramNames.add(viewIndexParam);
-        paramNames.add(viewSizeParam);
-        queryString = UtilHttp.stripNamedParamsFromQueryString(queryString, paramNames);
-
-        String anchor = "";
-        String paginateAnchor = modelForm.getPaginateTargetAnchor();
-        if (UtilValidate.isNotEmpty(paginateAnchor)) anchor = "#" + paginateAnchor;
-
-        // Create separate url path String and request parameters String,
-        // add viewIndex/viewSize parameters to request parameter String
-        String urlPath = UtilHttp.removeQueryStringFromTarget(targetService);
-        String prepLinkText = UtilHttp.getQueryStringFromTarget(targetService);
-        String prepLinkSizeText;
-
-        if (UtilValidate.isNotEmpty(queryString)) {
-            queryString = UtilHttp.encodeAmpersands(queryString);
-        }
-        
-        if (prepLinkText == null) {
-            prepLinkText = "";
-        }
-        if (prepLinkText.indexOf("?") < 0) {
-            prepLinkText += "?";
-        } else if (!prepLinkText.endsWith("?")) {
-            prepLinkText += "&amp;";
-        }
-        if (!UtilValidate.isEmpty(queryString) && !queryString.equals("null")) {
-            prepLinkText += queryString + "&amp;";
-        }
-        prepLinkSizeText = prepLinkText + viewSizeParam + "='+this.value+'" + "&amp;" + viewIndexParam + "=0";
-        prepLinkText += viewSizeParam + "=" + viewSize + "&amp;" + viewIndexParam + "=";
-        if (ajaxEnabled) {
-            // Prepare params for prototype.js
-            prepLinkText = prepLinkText.replace("?", "");
-            prepLinkText = prepLinkText.replace("&amp;", "&");
-        }
-        String linkText;
-        String paginateStyle = modelForm.getPaginateStyle();
-        String paginateFirstStyle = modelForm.getPaginateFirstStyle();
-        String paginateFirstLabel = modelForm.getPaginateFirstLabel(context);
-        String firstUrl = "";
-        String ajaxFirstUrl = "";
-        String paginatePreviousStyle = modelForm.getPaginatePreviousStyle();
-        String paginatePreviousLabel = modelForm.getPaginatePreviousLabel(context);
-        String previousUrl = "";
-        String ajaxPreviousUrl = "";
-        String selectUrl = "";
-        String ajaxSelectUrl = "";
-        String paginateViewSizeLabel = modelForm.getPaginateViewSizeLabel(context);
-        String selectSizeUrl = "";
-        String ajaxSelectSizeUrl = "";
-        String paginateNextStyle = modelForm.getPaginateNextStyle();
-        String paginateNextLabel = modelForm.getPaginateNextLabel(context);
-        String nextUrl = "";
-        String ajaxNextUrl = "";
-        String paginateLastStyle = modelForm.getPaginateLastStyle();
-        String paginateLastLabel = modelForm.getPaginateLastLabel(context);
-        String lastUrl = "";
-        String ajaxLastUrl = "";
-
-        if (viewIndex > 0) {
-            if (ajaxEnabled) {
-                ajaxFirstUrl = createAjaxParamsFromUpdateAreas(rh, request, response, updateAreas, prepLinkText + 0 + anchor, context);
-            } else {
-                linkText = prepLinkText + 0 + anchor;
-                firstUrl = rh.makeLink(request, response, urlPath + linkText);
-            }
-        }
-        if (viewIndex > 0) {
-            if (ajaxEnabled) {
-                ajaxPreviousUrl = createAjaxParamsFromUpdateAreas(rh, request, response, updateAreas, prepLinkText + (viewIndex - 1) + anchor, context);
-            } else {
-                linkText = prepLinkText + (viewIndex - 1) + anchor;
-                previousUrl = rh.makeLink(request, response, urlPath + linkText);
-            }
-        }
-        // Page select dropdown
-        if (listSize > 0 && ajaxEnabled) {
-            if (ajaxEnabled) {
-                ajaxSelectUrl = createAjaxParamsFromUpdateAreas(rh, request, response, updateAreas, prepLinkText + "' + this.value + '", context);
-            } else {
-                linkText = prepLinkText;
-                if (linkText.startsWith("/")) {
-                    linkText = linkText.substring(1);
-                }
-                selectUrl = rh.makeLink(request, response, urlPath + linkText);
-            }
-        }
-
-        // Next button
-        if (highIndex < listSize) {
-            if (ajaxEnabled) {
-                ajaxNextUrl = createAjaxParamsFromUpdateAreas(rh, request, response, updateAreas, prepLinkText + (viewIndex + 1) + anchor, context);
-            } else {
-                linkText = prepLinkText + (viewIndex + 1) + anchor;
-                nextUrl = rh.makeLink(request, response, urlPath + linkText);
-            }
-        }
-
-        // Last button
-        if (highIndex < listSize) {
-            if (ajaxEnabled) {
-                ajaxLastUrl = createAjaxParamsFromUpdateAreas(rh, request, response, updateAreas, prepLinkText + (listSize / viewSize) + anchor, context);
-            } else {
-                linkText = prepLinkText + (listSize / viewSize) + anchor;
-                lastUrl = rh.makeLink(request, response, urlPath + linkText);
-            }
-        }
-
-        // Page size select dropdown
-        if (listSize > 0 && ajaxEnabled) {
-            if (ajaxEnabled) {
-                ajaxSelectSizeUrl = createAjaxParamsFromUpdateAreas(rh, request, response, updateAreas, prepLinkSizeText + anchor, context);
-            } else {
-                linkText = prepLinkSizeText;
-                if (linkText.startsWith("/")) {
-                    linkText = linkText.substring(1);
-                }
-                selectSizeUrl = rh.makeLink(request, response, urlPath + linkText);
-            }
-        }
-
-        Map<String, Object> navigationData = FastMap.newInstance();
-        navigationData.put("paginateStyle", paginateStyle);
-        navigationData.put("paginateFirstStyle", paginateFirstStyle);
-        navigationData.put("viewIndex", viewIndex);
-        navigationData.put("highIndex", highIndex);
-        navigationData.put("listSize", listSize);
-        navigationData.put("viewSize", viewSize);
-        navigationData.put("ajaxEnabled", ajaxEnabled);
-//        navigationData.put("javaScriptEnabled", Boolean.toString(ajaxEnabled));
-        navigationData.put("ajaxFirstUrl", ajaxFirstUrl);
-        navigationData.put("firstUrl", firstUrl);
-        navigationData.put("paginateFirstLabel", paginateFirstLabel);
-        navigationData.put("paginatePreviousStyle", paginatePreviousStyle);
-        navigationData.put("ajaxPreviousUrl", ajaxPreviousUrl);
-        navigationData.put("previousUrl", previousUrl);
-        navigationData.put("paginatePreviousLabel", paginatePreviousLabel);
-        navigationData.put("pageLabel", pageLabel);
-        navigationData.put("ajaxSelectUrl", ajaxSelectUrl);
-        navigationData.put("selectUrl", selectUrl);
-        navigationData.put("ajaxSelectSizeUrl", ajaxSelectSizeUrl);
-        navigationData.put("selectSizeUrl", selectSizeUrl);
-        navigationData.put("commonDisplaying", commonDisplaying);
-        navigationData.put("paginateNextStyle", paginateNextStyle);
-        navigationData.put("ajaxNextUrl", ajaxNextUrl);
-        navigationData.put("nextUrl", nextUrl);
-        navigationData.put("paginateNextLabel", paginateNextLabel);
-        navigationData.put("paginateLastStyle", paginateLastStyle);
-        navigationData.put("ajaxLastUrl", ajaxLastUrl);
-        navigationData.put("lastUrl", lastUrl);
-        navigationData.put("paginateLastLabel", paginateLastLabel);
-        navigationData.put("paginateViewSizeLabel", paginateViewSizeLabel);
-        return navigationData;
-
-    }
-    /** Create an ajaxXxxx JavaScript CSV string from a list of UpdateArea objects. See
-     * <code>selectall.js</code>.
-     * @param updateAreas
-     * @param extraParams Renderer-supplied additional target parameters
-     * @param context
-     * @return Parameter string or empty string if no UpdateArea objects were found
-     */
-    public String createAjaxParamsFromUpdateAreas(RequestHandler rh,HttpServletRequest request, HttpServletResponse response, List<ModelForm.UpdateArea> updateAreas, String extraParams, Map<String, ? extends Object> context) {
-        //FIXME copy from HtmlFormRenderer.java
-        if (updateAreas == null) {
-            return "";
-        }
-        String ajaxUrl = "";
-        boolean firstLoop = true;
-        for (ModelForm.UpdateArea updateArea : updateAreas) {
-            if (firstLoop) {
-                firstLoop = false;
-            } else {
-                ajaxUrl += ",";
-            }
-            Map<String, Object> ctx = UtilGenerics.checkMap(context);
-            Map<String, String> parameters = updateArea.getParameterMap(ctx);
-            String targetUrl = updateArea.getAreaTarget(context);
-            String ajaxParams = getAjaxParamsFromTarget(targetUrl);
-            if (UtilValidate.isNotEmpty(extraParams)) {
-                if (ajaxParams.length() > 0 && !extraParams.startsWith("&")) {
-                    ajaxParams += "&";
-                }
-                ajaxParams += extraParams;
-            }
-            if(parameters!=null){
-                if(UtilValidate.isEmpty(ajaxParams)){
-                    ajaxParams = "";
-                }
-                for (String key : parameters.keySet()) {
-                    if (ajaxParams.length() > 0 && ajaxParams.indexOf(key) < 0) {
-                        ajaxParams += "&";
-                    }
-                    if (ajaxParams.indexOf(key) < 0) {
-                        ajaxParams += key + "=" + parameters.get(key);
-                    }
-                }
-                StringBuilder params = new StringBuilder();
-                params.append(ajaxParams);
-                List<String> addingParams = UtilMisc.toList("portalPageId", "portalPortletId", "portletSeqId", "areaId", "idDescription");
-                for (String addingParam : addingParams) {
-                    if (UtilValidate.isNotEmpty(ajaxParams) && ajaxParams.contains(addingParam + "=")) {
-                        continue;
-                    }
-                    WidgetWorker.addToParamsIfInContext(params, ctx, addingParam, parameters);
-                }
-                ajaxParams = params.toString();
-            }
-            ajaxUrl += updateArea.getAreaId() + ",";
-            ajaxUrl += rh.makeLink(request, response, UtilHttp.removeQueryStringFromTarget(targetUrl));
-            ajaxUrl += "," + ajaxParams;
-        }
-        Locale locale = UtilMisc.ensureLocale(context.get("locale"));
-        return FlexibleStringExpander.expandString(ajaxUrl, context, locale);
-    }
-
-    /** Extracts parameters from a target URL string, prepares them for an Ajax
-     * JavaScript call. This method is currently set to return a parameter string
-     * suitable for the Prototype.js library.
-     * @param target Target URL string
-     * @return Parameter string
-     */
-    public static String getAjaxParamsFromTarget(String target) {
-        String targetParams = UtilHttp.getQueryStringFromTarget(target);
-        targetParams = targetParams.replace("?", "");
-        targetParams = targetParams.replace("&amp;", "&");
-        return targetParams;
-     }
-    //#Eam# portletWidget
-
     public void renderPortalPageBegin(Appendable writer, Map<String, Object> context, ModelScreenWidget.PortalPage portalPage) throws GeneralException, IOException {
         String portalPageId = portalPage.getActualPortalPageId();
         String originalPortalPageId = portalPage.getOriginalPortalPageId();
@@ -1227,10 +890,6 @@ public class MacroScreenRenderer impleme
         sr.append(colWidthLabel);
         sr.append("\" setColumnSizeHint=\"");
         sr.append(setColumnSizeHint);
-        //#Bam# portletWidget add new field in PortalPageColumn to be able to have multiple line in a portalPage. Each line has multiple column
-        sr.append("\" newLine=\"");
-        sr.append(portalPageColumn.getString("newLine"));
-        //#Eam# portletWidget add new field in PortalPageColumn to be able to have multiple line in a portalPage. Each line has multiple column
         sr.append("\" />");
         executeMacro(writer, sr.toString());
     }  
@@ -1245,18 +904,8 @@ public class MacroScreenRenderer impleme
         String portalPageId = portalPage.getActualPortalPageId();
         String originalPortalPageId = portalPage.getOriginalPortalPageId();
         String portalPortletId = portalPortlet.getString("portalPortletId");
-       //#Bam# portletWidget
-        /*
         String portletSeqId = portalPortlet.getString("portletSeqId");
         String columnSeqId = portalPortlet.getString("columnSeqId");
-        */
-        String portletSeqId = null;
-        String columnSeqId = null;
-        if (! portalPortlet.getEntityName().equals("PortalPortlet")){
-            portletSeqId = portalPortlet.getString("portletSeqId");
-            columnSeqId = portalPortlet.getString("columnSeqId");
-        }
-        //#Eam# portletWidget
         String confMode = portalPage.getConfMode(context);
         String editFormName = portalPortlet.getString("editFormName");
         String editFormLocation = portalPortlet.getString("editFormLocation");
@@ -1277,7 +926,6 @@ public class MacroScreenRenderer impleme
             delPortletHint = uiLabelMap.get("CommonDeleteThisPortlet");
             editAttributeHint = uiLabelMap.get("CommonEditPortletAttributes");
         }
-        String includedInPage = (String) context.get("includedInPage");//#Eam# : portletWidget
 
         StringWriter sr = new StringWriter();
         sr.append("<@renderPortalPagePortletBegin ");
@@ -1309,10 +957,6 @@ public class MacroScreenRenderer impleme
         sr.append(editAttributeHint);
         sr.append("\" confMode=\"");
         sr.append(confMode);
-        //#Bam# : portletWidget
-        sr.append("\" includedInPage=\"");
-        sr.append(includedInPage);
-        //#Eam# : portletWidget
         sr.append("\"");
         if (UtilValidate.isNotEmpty(editFormName) && UtilValidate.isNotEmpty(editFormLocation)) {
             sr.append(" editAttribute=\"true\"");
@@ -1328,11 +972,6 @@ public class MacroScreenRenderer impleme
         sr.append("<@renderPortalPagePortletEnd ");
         sr.append(" confMode=\"");
         sr.append(confMode);
-        //#Bam# : portletWidget
-        String includedInPage = (String) context.get("includedInPage");
-        sr.append("\" includedInPage=\"");
-        sr.append(includedInPage);
-        //#Eam# : portletWidget
         sr.append("\" />");
         executeMacro(writer, sr.toString());
     }
@@ -1341,49 +980,11 @@ public class MacroScreenRenderer impleme
         String portalPortletId = portalPortlet.getString("portalPortletId");
         String screenName = portalPortlet.getString("screenName");
         String screenLocation = portalPortlet.getString("screenLocation");
-        //#Bam# : portletWidget
-        if (UtilValidate.isEmpty(screenName) || UtilValidate.isEmpty(screenLocation)){
-            Debug.logError("Impossible to show portalPortletId="+portalPortletId+" screenName="+screenName+" screenLocation="+screenLocation, module);
-            return;
-        }
-
-        LocalDispatcher dispatcher = (LocalDispatcher) context.get("dispatcher");
-        DispatchContext dctx = dispatcher.getDispatchContext();
-        Boolean hasPermission = true;
-        if (UtilValidate.isNotEmpty(portalPortlet.get("securityServiceName")) && UtilValidate.isNotEmpty(portalPortlet.get("securityMainAction"))) {
-            String serviceName = portalPortlet.getString("securityServiceName");
-                Map<String, Object> inMap = UtilMisc.toMap("mainAction", portalPortlet.get("securityMainAction"),
-                                                           "resourceDescription", portalPortletId,
-                                                           "userLogin",context.get("userLogin"));
-                //Add request parameters to service context
-                Map<String, Object> inputFields = UtilGenerics.checkMap(context.get("requestParameters"));
-                for (String name: inputFields.keySet()) {
-                    inMap.put(name, inputFields.get(name));
-                }
-                inMap = dctx.makeValidContext(serviceName, "IN", inMap);
-                Map<String, Object> result = dispatcher.runSync(serviceName, inMap);
-                if (UtilValidate.isNotEmpty(result)) {
-                    hasPermission = (Boolean) result.get("hasPermission");
-
-                    //Add service result parameters to context
-                    for (String name: result.keySet()) {
-                        context.put(name, result.get(name));
-                    }
-                }
-        }
-        //#Eam# : portletWidget
 
         ModelScreen modelScreen = null;
         if (UtilValidate.isNotEmpty(screenName) && UtilValidate.isNotEmpty(screenLocation)) {
             try {
-            if (hasPermission) {//#Eam# : portletWidget
                 modelScreen = ScreenFactory.getScreenFromLocation(screenLocation, screenName);
-            //#Bam# : portletWidget
-            } else {
-                //Display permission error screen
-                modelScreen = ScreenFactory.getScreenFromLocation("component://common/widget/PortalPageScreens.xml","PermissionErrorScreen");
-            }
-            //#Eam# : portletWidget
             } catch (IOException e) {
                 String errMsg = "Error rendering portlet ID [" + portalPortletId + "]: " + e.toString();
                 Debug.logError(e, errMsg, module);

Modified: ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/screen/ModelScreen.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/screen/ModelScreen.java?rev=1369382&r1=1369381&r2=1369382&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/screen/ModelScreen.java (original)
+++ ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/screen/ModelScreen.java Sat Aug  4 18:11:00 2012
@@ -339,7 +339,7 @@ public class ModelScreen extends ModelWi
      *    - autoUserLogin (if a user is automatically logged in, ie no password has been entered)
      *    - formStringRenderer
      *    - request, response, session, application (special case, only in HTML contexts, etc)
-     *    - delegator, dispatcher, authz, security
+     *    - delegator, dispatcher, security
      *    - null (represents a null field value for entity operations)
      *    - sections (used for decorators to reference the sections to be decorated and render them)
      * @param screenStringRenderer An implementation of the ScreenStringRenderer

Modified: ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/screen/ModelScreenAction.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/screen/ModelScreenAction.java?rev=1369382&r1=1369381&r2=1369382&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/screen/ModelScreenAction.java (original)
+++ ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/screen/ModelScreenAction.java Sat Aug  4 18:11:00 2012
@@ -401,37 +401,31 @@ public abstract class ModelScreenAction
 
     @Deprecated
     public static class Script extends ModelScreenAction {
-        protected FlexibleStringExpander scriptLocationExdr;
+        protected String location;
+        protected String method;
 
         public Script(ModelScreen modelScreen, Element scriptElement) {
             super (modelScreen, scriptElement);
-            this.scriptLocationExdr = FlexibleStringExpander.getInstance(scriptElement.getAttribute("location"));
+            String scriptLocation = scriptElement.getAttribute("location");
+            this.location = WidgetWorker.getScriptLocation(scriptLocation);
+            this.method = WidgetWorker.getScriptMethodName(scriptLocation);
         }
 
         @Override
         public void runAction(Map<String, Object> context) throws GeneralException {
-            Locale locale = (Locale) context.get("locale");
-            String scriptLocation = this.scriptLocationExdr.expandString(context, locale);
-            String location = WidgetWorker.getScriptLocation(scriptLocation);
-            String method = WidgetWorker.getScriptMethodName(scriptLocation);
             if (location.endsWith(".xml")) {
+                Map<String, Object> localContext = FastMap.newInstance();
+                localContext.putAll(context);
                 DispatchContext ctx = this.modelScreen.getDispatcher(context).getDispatchContext();
-                MethodContext methodContext = new MethodContext(ctx, context);
+                MethodContext methodContext = new MethodContext(ctx, localContext, null);
                 try {
                     SimpleMethod.runSimpleMethod(location, method, methodContext);
-                    Map<String, Object> resultContext = methodContext.getEnv("widget");
-                    if (UtilValidate.isNotEmpty(resultContext)){
-                        context.putAll(resultContext);
-                    }
-                    Map<String, Object> parametersUp = methodContext.getParameters();
-                    if (UtilValidate.isNotEmpty(parametersUp)){
-                        context.put("parameters",parametersUp);
-                    }
+                    context.putAll(methodContext.getResults());
                 } catch (MiniLangException e) {
                     throw new GeneralException("Error running simple method at location [" + location + "]", e);
                 }
             } else {
-                ScriptUtil.executeScript(location, method, context);
+                ScriptUtil.executeScript(this.location, this.method, context);
             }
         }
     }

Modified: ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/screen/ModelScreenCondition.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/screen/ModelScreenCondition.java?rev=1369382&r1=1369381&r2=1369382&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/screen/ModelScreenCondition.java (original)
+++ ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/screen/ModelScreenCondition.java Sat Aug  4 18:11:00 2012
@@ -41,7 +41,6 @@ import org.ofbiz.entity.GenericValue;
 import org.ofbiz.entityext.permission.EntityPermissionChecker;
 import org.ofbiz.minilang.operation.BaseCompare;
 import org.ofbiz.security.Security;
-import org.ofbiz.security.authz.Authorization;
 import org.ofbiz.service.DispatchContext;
 import org.ofbiz.service.GenericServiceException;
 import org.ofbiz.service.LocalDispatcher;
@@ -308,18 +307,15 @@ public class ModelScreenCondition implem
             if (userLogin != null) {
                 String permission = permissionExdr.expandString(context);
                 String action = actionExdr.expandString(context);
-
-                Authorization authz = (Authorization) context.get("authz");
                 Security security = (Security) context.get("security");
                 if (UtilValidate.isNotEmpty(action)) {
-                    //Debug.logWarning("Deprecated method hasEntityPermission() was called; the action field should no longer be used", module);
                     // run hasEntityPermission
                     if (security.hasEntityPermission(permission, action, userLogin)) {
                         return true;
                     }
                 } else {
                     // run hasPermission
-                    if (authz.hasPermission(userLogin.getString("userLoginId"), permission, context)) {
+                    if (security.hasPermission(permission, userLogin)) {
                         return true;
                     }
                 }

Modified: ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java?rev=1369382&r1=1369381&r2=1369382&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java (original)
+++ ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java Sat Aug  4 18:11:00 2012
@@ -45,7 +45,6 @@ import org.ofbiz.base.util.string.Flexib
 import org.ofbiz.entity.Delegator;
 import org.ofbiz.entity.GenericEntityException;
 import org.ofbiz.entity.GenericValue;
-import org.ofbiz.entity.util.EntityUtil; //#Eam# portletWidget
 import org.ofbiz.widget.ModelWidget;
 import org.ofbiz.widget.ModelWidgetAction;
 import org.ofbiz.widget.WidgetFactory;
@@ -346,6 +345,9 @@ public abstract class ModelScreenWidget
                 for (ModelWidget subWidget : this.subWidgets) {
                     if (formName.equals(subWidget.getName()) && subWidget instanceof Form) {
                         this.navigationForm = (Form) subWidget;
+                        // Let's give this a try, it can be removed later if it
+                        // proves to cause problems
+                        this.padded = false;
                         break;
                     }
                 }
@@ -1600,44 +1602,12 @@ public abstract class ModelScreenWidget
         protected String originalPortalPageId;
         protected String actualPortalPageId;
         protected Boolean usePrivate;
-        //#Bam# portletWidget
-        protected FlexibleStringExpander portalPortletId;
-        protected FlexibleStringExpander portletSeqId;
-        private static final List<String> portletFieldNames = initPortletFieldNames();
-
-        static private List<String> initPortletFieldNames(){
-            List<String> _portletFieldNames = FastList.newInstance();
-            _portletFieldNames.add("screenName");
-            _portletFieldNames.add("screenLocation");
-            _portletFieldNames.add("useScreen");
-            _portletFieldNames.add("useScript");
-            _portletFieldNames.add("scriptName");
-            _portletFieldNames.add("uiLabelLocation");
-            _portletFieldNames.add("formName");
-            _portletFieldNames.add("formLocation");
-            _portletFieldNames.add("pkIdName");
-            _portletFieldNames.add("editAreaDivId");
-            _portletFieldNames.add("subAreaDivId");
-            _portletFieldNames.add("titleLabel");
-            _portletFieldNames.add("useMenu");
-            _portletFieldNames.add("menuName");
-            _portletFieldNames.add("menuLocation");
-            _portletFieldNames.add("helpName");
-            _portletFieldNames.add("editFormName");
-            _portletFieldNames.add("editFormLocation");
-            return _portletFieldNames;
-        }
-        //#Eam# portletWidget
 
         public PortalPage(ModelScreen modelScreen, Element portalPageElement) {
             super(modelScreen, portalPageElement);
             this.idExdr = FlexibleStringExpander.getInstance(portalPageElement.getAttribute("id"));
             this.confModeExdr = FlexibleStringExpander.getInstance(portalPageElement.getAttribute("conf-mode"));
             this.usePrivate = !("false".equals(portalPageElement.getAttribute("use-private")));
-            //#Bam# portletWidget
-            this.portalPortletId = FlexibleStringExpander.getInstance(portalPageElement.getAttribute("portalPortletId"));
-            this.portletSeqId = FlexibleStringExpander.getInstance(portalPageElement.getAttribute("portletSeqId"));
-            //#Eam# portletWidget
         }
 
         @Override
@@ -1647,10 +1617,9 @@ public abstract class ModelScreenWidget
                 GenericValue portalPage = null;
                 List<GenericValue> portalPageColumns = null;
                 List<GenericValue> portalPagePortlets = null;
+                List<GenericValue> portletAttributes = null;
 
                 String expandedPortalPageId = getId(context);
-                String portalPortletId = this.portalPortletId.expandString(context);//#Eam# portletWidget
-                String portletSeqId = this.portletSeqId.expandString(context);//#Eam# portletWidget
 
                 if (UtilValidate.isNotEmpty(expandedPortalPageId)) {
                     if (usePrivate) {
@@ -1674,45 +1643,6 @@ public abstract class ModelScreenWidget
                     return;
                 }
 
-                //#Bam# portletWidget
-                if (UtilValidate.isNotEmpty(portalPortletId)) {
-                    GenericValue portletValue = null;
-                    if ( UtilValidate.isNotEmpty(portletSeqId)) {
-                        portletValue = delegator.findOne("PortalPagePortletView", UtilMisc.toMap("portalPageId", actualPortalPageId, "portalPortletId", portalPortletId, "portletSeqId", portletSeqId), false);
-                    } else {
-                        List<GenericValue> portletValues = delegator.findByAnd("PortalPagePortletView", UtilMisc.toMap("portalPageId", actualPortalPageId, "portalPortletId", portalPortletId), null, false);
-                        if (UtilValidate.isNotEmpty(portletValues)) {
-                            portletValue = EntityUtil.getFirst(portletValues);
-                            portletSeqId = portletValue.getString("portletSeqId");
-                        }
-                    }
-                    if ( UtilValidate.isEmpty(portletValue)) {
-                        portletValue = delegator.findOne("PortalPortlet", UtilMisc.toMap("portalPortletId", portalPortletId), false);
-                    }
-
-                    if (UtilValidate.isNotEmpty(portletValue)) {
-                        //remove from context value which will be initialized by this portlet
-                        for (String portletField : portletFieldNames) {
-                            if (context.containsKey(portletField)) context.put(portletField, null); //remove not works, suppose it's a because it's a stack
-                        }
-                        context.put("portletValue",portletValue);
-                        context.put("portalPageId", actualPortalPageId);
-                        context.put("portletSeqId", portletSeqId);
-                        context.put("portalPortletId", portalPortletId);
-
-                        retrievePortletAttributes(context);
-                        putScreenNameLocationValue(delegator, context, portletValue);
-
-                        // Renders the portalPagePortlet
-                        context.put("includedInPage", "N"); // portletWidget modification
-                        screenStringRenderer.renderPortalPagePortletBegin(writer, context, this, portletValue);
-                        screenStringRenderer.renderPortalPagePortletBody(writer, context, this, portletValue);
-                        screenStringRenderer.renderPortalPagePortletEnd(writer, context, this, portletValue);
-                    }
-                } else {
-                    context.put("includedInPage", "Y"); // portletWidget modification
-                //#Eam# portletWidget
-
                 // Renders the portalPage header
                 screenStringRenderer.renderPortalPageBegin(writer, context, this);
                 
@@ -1763,8 +1693,6 @@ public abstract class ModelScreenWidget
                         context.put("nextColumnSeqId", nextColumnSeqId);
                       
                         // Get portlet's attributes
-                        //#Bam# portletWidget
-                        /*
                         portletAttributes = delegator.findList("PortletAttribute",
                             EntityCondition.makeCondition(UtilMisc.toMap("portalPageId", portletValue.get("portalPageId"), "portalPortletId", portletValue.get("portalPortletId"), "portletSeqId", portletValue.get("portletSeqId"))),
                             null, null, null, false);
@@ -1773,30 +1701,7 @@ public abstract class ModelScreenWidget
                             GenericValue attribute = attributesIterator.next();
                             context.put(attribute.getString("attrName"), attribute.getString("attrValue"));
                         }
-                        */
-                        for (String portletField : portletFieldNames) {
-                            if (context.containsKey(portletField))     context.remove(portletField);
-                        }
-                        //if (context.containsKey("areaDivId"))        context.remove("areaDivId"); with id build with portalPageId portalPortletId portletSeqId, it seem, it's no more necessary because always unique
-                        if (context.containsKey("component"))        context.remove("component");
-                        if (context.containsKey("portletLongId"))    context.remove("portletLongId");
-                        if (context.containsKey("portletTypeId"))    context.remove("portletTypeId");
-                        if (context.containsKey("subComponent"))     context.remove("subComponent");
-                        if (context.containsKey("webapp"))           context.remove("webapp");
-                        if (context.containsKey("areaId"))           context.remove("areaId");
-
-                        context.put("portletValue",portletValue);
-                        context.put("portalPageId", portletValue.get("portalPageId"));
-                        context.put("portalPortletId", portletValue.get("portalPortletId"));
-                        context.put("portletSeqId", portletValue.get("portletSeqId"));
-
-                        retrievePortletAttributes(context);
-
-                        ListIterator<GenericValue> attributesIterator = (ListIterator<GenericValue>) context.remove("portletAttributesIterator");
                         
-                        putScreenNameLocationValue(delegator, context, portletValue);
-                        //#Eam# portletWidget
-
                         // Renders the portalPagePortlet
                         screenStringRenderer.renderPortalPagePortletBegin(writer, context, this, portletValue);
                         screenStringRenderer.renderPortalPagePortletBody(writer, context, this, portletValue);
@@ -1820,7 +1725,6 @@ public abstract class ModelScreenWidget
                 }
                 // Renders the portalPage footer
                 screenStringRenderer.renderPortalPageEnd(writer, context, this);
-              } //#Eam# portletWidget
             } catch (IOException e) {
                 String errMsg = "Error rendering PortalPage with portalPageId [" + getId(context) + "]: " + e.toString();
                 Debug.logError(e, errMsg, module);
@@ -1832,214 +1736,6 @@ public abstract class ModelScreenWidget
             }
         }
 
-        /**
-         *  update screenName and screenLocation in portletValue with correct value if it's with a portletType or if it's a default value
-         * @param delegator
-         * @param context
-         * @param portletValue
-         * @throws GenericEntityException
-         */
-        private static void putScreenNameLocationValue(Delegator delegator, Map<String,Object> context, GenericValue portletValue) throws GenericEntityException{
-            if (UtilValidate.isNotEmpty(portletValue.get("portletTypeId"))) {
-                //update screen values
-                GenericValue portletType = delegator.findOne("PortletType", true, "portletTypeId", portletValue.get("portletTypeId"));
-                if (UtilValidate.isEmpty(portletType)){
-                    Debug.logError("PortletId = " + portletValue.get("portalPortletId") + " with a not existing portletType, portletTypeId = " + portletValue.get("portletTypeId"), module);
-                } else {
-                    portletValue.put("screenName", portletType.get("screenName"));
-                    portletValue.put("screenLocation", portletType.get("screenLocation"));
-                }
-            } else {
-                if (UtilValidate.isEmpty(portletValue.get("screenName"))){
-                    portletValue.put("screenName", context.get("screenName"));
-                }
-                if (UtilValidate.isEmpty(portletValue.get("screenLocation"))){
-                    portletValue.put("screenLocation", context.get("screenLocation"));
-                }
-            }
-        }
-
-        protected static Map<String,Object> retrievePortletAttributes (Map<String,Object> context) throws GenericEntityException {
-            Delegator delegator = (Delegator) context.get("delegator");
-            String portalPageId = (String) context.get("portalPageId");
-            String portalPortletId = (String) context.get("portalPortletId");
-            GenericValue portletValue = (GenericValue) context.remove("portletValue");
-            if (UtilValidate.isEmpty(portletValue)) {
-                portletValue = delegator.findOne("PortalPortlet", UtilMisc.toMap("portalPortletId", portalPortletId), false);
-            }
-            String portletSeqId= (String) context.get("portletSeqId");
-
-            List<GenericValue> portletAttributes = delegator.findList("PortletAttribute",
-                    EntityCondition.makeCondition(UtilMisc.toMap("portalPageId", "_NA_", "portalPortletId", portalPortletId, "portletSeqId", "00000")),
-                    null, null, null, false);
-            //Begin addon modification : portletWidget
-
-            //Retrieve attributes from portletValue
-            // portalPortlet field overwrite PortletAttribute coming from portalPageId _NA_
-            if (UtilValidate.isNotEmpty(portletValue)) {
-                for (String portletField : portletFieldNames) {
-                    if (UtilValidate.isNotEmpty(portletValue.get(portletField)))     portletAttributes.add(delegator.makeValidValue("PortletAttribute", UtilMisc.toMap("attrName",portletField,"attrValue", portletValue.get(portletField))));
-                }
-                if (UtilValidate.isNotEmpty(portletValue.get("helpName"))) {
-                    String helpName = (String) portletValue.get("helpName");
-                    if (helpName.startsWith("DETAIL_") && helpName.length()>7) {
-                        helpName = (String) context.get(helpName.substring(7, helpName.length()));
-                    }
-                    portletAttributes.add(delegator.makeValidValue("PortletAttribute", UtilMisc.toMap("attrName","helpName","attrValue", helpName)));
-                }
-            }
-            //End addon modification : portletWidget
-
-            if (UtilValidate.isNotEmpty(portletSeqId)) {
-                List<GenericValue> portalPortletAttributes = delegator.findList("PortletAttribute",
-                        EntityCondition.makeCondition(UtilMisc.toMap("portalPageId", portalPageId, "portalPortletId", portalPortletId, "portletSeqId",portletSeqId)),
-                        null, null, null, false);
-                if (UtilValidate.isNotEmpty(portalPortletAttributes)) {
-                    portletAttributes.addAll(portalPortletAttributes);
-                }
-            }
-            ListIterator<GenericValue> portletAttributesIterator = portletAttributes.listIterator();
-            while (portletAttributesIterator.hasNext()) {
-                GenericValue attribute = portletAttributesIterator.next();
-                context.put(attribute.getString("attrName"), attribute.getString("attrValue"));
-            }
-            if (UtilValidate.isNotEmpty(portletValue.get("portletLongId"))) context.put("portletLongId", portletValue.get("portletLongId"));
-            if (UtilValidate.isNotEmpty(portletValue.get("portletTypeId"))) context.put("portletTypeId", portletValue.get("portletTypeId"));
-            if (UtilValidate.isNotEmpty(portletValue.get("component")))     context.put("component", portletValue.get("component"));
-            if (UtilValidate.isNotEmpty(portletValue.get("subComponent")))  context.put("subComponent", portletValue.get("subComponent"));
-            if (UtilValidate.isNotEmpty(portletValue.get("webapp")))        context.put("webapp", portletValue.get("webapp"));
-
-            // put default value in areaId, use value in attribute (so in context) or in parameters or PP_${portalPageId}${portalPortletId}${portletSeqId}
-            String areaId = (String) context.get("areaId");
-            if (UtilValidate.isEmpty(areaId)) {
-                Map<String, Object> contextParameters = UtilGenerics.checkMap( context.get("parameters"));
-                areaId = (String) contextParameters.get("areaId");
-            }
-            if (UtilValidate.isEmpty(areaId)) {
-                areaId = "PP_"+portalPageId+portalPortletId+portletSeqId;
-            }
-            context.put("currentAreaId", "PP_"+portalPageId+portalPortletId+portletSeqId);
-            context.put("areaId", areaId);
-
-            //Begin addon modification : portletWidget
-            String portletLongId = (String) context.get("portletLongId");
-            if (UtilValidate.isEmpty(portletLongId)) {
-                portletLongId = portalPortletId;
-            }
-            if (UtilValidate.isNotEmpty(portletValue.get("component"))) {
-                if (UtilValidate.isNotEmpty(portletValue) && UtilValidate.isNotEmpty(portletValue.get("screenName"))) {
-                    context.put("screenName", portletValue.get("screenName"));
-                } else {
-                    context.put("screenName", portletLongId);
-                }
-            }
-
-            // prepare location for screen form menu
-            StringBuffer location = new StringBuffer();
-            StringBuffer uiLabelLocation = new StringBuffer();
-            if (UtilValidate.isNotEmpty(portletValue.get("component"))){
-                location.append("component://").append(portletValue.get("component")).append("/widget/");
-                if (UtilValidate.isNotEmpty(context.get("webapp"))) {
-                    location.append(context.get("webapp")).append("/");
-                }
-                uiLabelLocation.append(location);
-                location.append(context.get("subComponent"));
-            }
-            //End addon modification : portletWidget
-            if (UtilValidate.isNotEmpty(portletValue.get("component"))) {
-                if (UtilValidate.isNotEmpty(portletValue) && UtilValidate.isNotEmpty(portletValue.get("screenLocation"))
-                        && "Y".equals(portletValue.get("useScreen"))) {
-                    context.put("screenLocation",portletValue.get("screenLocation"));
-                } else if ("Y".equals(portletValue.get("useScreen")) ) {
-                    context.put("screenLocation", location +"Screens.xml");
-                }
-            }
-            else if (UtilValidate.isNotEmpty(portletValue)) {
-                context.put("screenLocation", portletValue.get("screenLocation"));
-            }
-
-            //if (UtilValidate.isEmpty(context.get("areaDivId")))     context.put("areaDivId", "PP_" + portalPageId + portalPortletId + portletSeqId); with id build with portalPageId portalPortletId portletSeqId, it seem, it's no more necessary because always unique
-            if (UtilValidate.isEmpty(context.get("editAreaDivId"))) context.put("editAreaDivId", portletLongId + "_EditArea");
-            if (UtilValidate.isEmpty(context.get("entity")))        context.put("entity", portletLongId);
-            if (UtilValidate.isEmpty(context.get("helpName")))      context.put("helpName", "HELP_" + portalPortletId);
-            if (UtilValidate.isEmpty(context.get("subAreaDivId")))  context.put("subAreaDivId", portletLongId + "_SubArea");
-            if (UtilValidate.isEmpty(context.get("titleLabel")))    context.put("titleLabel", "PageTitle"+portletLongId);
-
-                if (UtilValidate.isNotEmpty(portletValue) && UtilValidate.isNotEmpty(portletValue.get("menuName")) ){
-                    context.put("menuName", portletValue.get("menuName"));
-                } else {
-                    context.put("menuName", portletLongId);
-                }
-
-                if (UtilValidate.isNotEmpty(portletValue.get("portletTypeId"))){
-                    if (UtilValidate.isNotEmpty(portletValue) && UtilValidate.isNotEmpty(portletValue.get("menuLocation"))
-                            && "Y".equals(portletValue.get("useMenu")) ){
-                        context.put("menuLocation", portletValue.get("menuLocation"));
-                    } else if ("Y".equals(portletValue.get("useMenu")) ) {
-                        context.put("menuLocation", location.toString() + "Menus.xml");
-                    }
-                }
-
-            if (UtilValidate.isNotEmpty(portletValue.get("portletTypeId"))){
-                if (UtilValidate.isNotEmpty(portletValue)
-                        && UtilValidate.isNotEmpty(portletValue.get("scriptName"))
-                        && "Y".equals(portletValue.get("useScript"))  ){
-                    context.put("scriptName", portletValue.get("scriptName"));
-                } else {
-                    StringBuffer scriptName = new StringBuffer();
-                    scriptName.append("component://").append(context.get("component"))
-                                                     .append("/script/org/ofbiz/")
-                                                     .append(context.get("component"))
-                                                     .append("/");
-                    if (UtilValidate.isNotEmpty(context.get("webapp"))) {
-                        scriptName.append(context.get("webapp")).append("/");
-                    }
-                    // test if we should use script, if yes add scriptName in context
-                    if (UtilValidate.isNotEmpty(portletValue) && "Y".equals(portletValue.get("useScript"))) {
-                        context.put("scriptName", scriptName.append(context.get("subComponent")).append("Wactions.xml").append("#").append(portletLongId) );
-                    }
-                }
-                if (UtilValidate.isNotEmpty(portletValue) && UtilValidate.isNotEmpty(portletValue.get("uiLabelLocation")) ){
-                    context.put("uiLabelLocation", portletValue.get("uiLabelLocation"));
-                } else {
-                    uiLabelLocation.append("CommonScreens.xml");
-                    context.put("uiLabelLocation", uiLabelLocation );
-                }
-            }
-            if (UtilValidate.isEmpty(context.get("formName"))) {
-                if (UtilValidate.isNotEmpty(portletValue) && UtilValidate.isNotEmpty(portletValue.get("formName")) ){
-                    context.put("formName", portletValue.get("formName"));
-                } else {
-                    context.put("formName", portletLongId);
-                }
-            }
-            if (UtilValidate.isEmpty(context.get("formLocation"))) {
-                if (UtilValidate.isNotEmpty(portletValue) && UtilValidate.isNotEmpty(portletValue.get("formLocation")) ){
-                    context.put("formLocation", portletValue.get("formLocation"));
-                } else {
-                    context.put("formLocation", location.toString() + "Forms.xml");
-                }
-            }
-
-            if (UtilValidate.isEmpty(context.get("editFormName"))){
-                if (UtilValidate.isNotEmpty(portletValue) && UtilValidate.isNotEmpty(portletValue.get("editFormName")) ){
-                    context.put("editFormName", portletValue.get("editFormName"));
-                } else {
-                    context.put("editFormName", "EditParam_"+portletLongId);
-                }
-            }
-            if (UtilValidate.isEmpty(context.get("editFormLocation"))) {
-                if (UtilValidate.isNotEmpty(portletValue) && UtilValidate.isNotEmpty(portletValue.get("editFormLocation")) ){
-                    context.put("editFormLocation", portletValue.get("editFormLocation"));
-                } else {
-                    context.put("editFormLocation", location.toString() + "Forms.xml");
-                }
-            }
-            //End addon modification : portletWidget
-            context.put("portletAttributesIterator", portletAttributesIterator);
-            return context;
-        }
-
         public String getId(Map<String, Object> context) {
             return this.idExdr.expandString(context);
         }

Modified: ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/screen/ScreenRenderer.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/screen/ScreenRenderer.java?rev=1369382&r1=1369381&r2=1369382&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/screen/ScreenRenderer.java (original)
+++ ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/screen/ScreenRenderer.java Sat Aug  4 18:11:00 2012
@@ -49,7 +49,6 @@ import org.ofbiz.entity.Delegator;
 import org.ofbiz.entity.GenericEntity;
 import org.ofbiz.entity.GenericValue;
 import org.ofbiz.security.Security;
-import org.ofbiz.security.authz.Authorization;
 import org.ofbiz.service.DispatchContext;
 import org.ofbiz.service.GenericServiceException;
 import org.ofbiz.service.LocalDispatcher;
@@ -145,11 +144,11 @@ public class ScreenRenderer {
         return this.screenStringRenderer;
     }
 
-    public void populateBasicContext(Map<String, Object> parameters, Delegator delegator, LocalDispatcher dispatcher, Authorization authz, Security security, Locale locale, GenericValue userLogin) {
-        populateBasicContext(context, this, parameters, delegator, dispatcher, authz, security, locale, userLogin);
+    public void populateBasicContext(Map<String, Object> parameters, Delegator delegator, LocalDispatcher dispatcher, Security security, Locale locale, GenericValue userLogin) {
+        populateBasicContext(context, this, parameters, delegator, dispatcher, security, locale, userLogin);
     }
 
-    public static void populateBasicContext(MapStack<String> context, ScreenRenderer screens, Map<String, Object> parameters, Delegator delegator, LocalDispatcher dispatcher, Authorization authz, Security security, Locale locale, GenericValue userLogin) {
+    public static void populateBasicContext(MapStack<String> context, ScreenRenderer screens, Map<String, Object> parameters, Delegator delegator, LocalDispatcher dispatcher, Security security, Locale locale, GenericValue userLogin) {
         // ========== setup values that should always be in a screen context
         // include an object to more easily render screens
         context.put("screens", screens);
@@ -163,7 +162,6 @@ public class ScreenRenderer {
         context.put("parameters", parameters);
         context.put("delegator", delegator);
         context.put("dispatcher", dispatcher);
-        context.put("authz", authz);
         context.put("security", security);
         context.put("locale", locale);
         context.put("userLogin", userLogin);
@@ -192,14 +190,14 @@ public class ScreenRenderer {
         HttpSession session = request.getSession();
 
         // attribute names to skip for session and application attributes; these are all handled as special cases, duplicating results and causing undesired messages
-        Set<String> attrNamesToSkip = UtilMisc.toSet("delegator", "dispatcher", "authz", "security", "webSiteId",
+        Set<String> attrNamesToSkip = UtilMisc.toSet("delegator", "dispatcher", "security", "webSiteId",
                 "org.apache.catalina.jsp_classpath");
         Map<String, Object> parameterMap = UtilHttp.getCombinedMap(request, attrNamesToSkip);
 
         GenericValue userLogin = (GenericValue) session.getAttribute("userLogin");
 
         populateBasicContext(context, screens, parameterMap, (Delegator) request.getAttribute("delegator"),
-                (LocalDispatcher) request.getAttribute("dispatcher"), (Authorization) request.getAttribute("authz"),
+                (LocalDispatcher) request.getAttribute("dispatcher"),
                 (Security) request.getAttribute("security"), UtilHttp.getLocale(request), userLogin);
 
         context.put("autoUserLogin", session.getAttribute("autoUserLogin"));
@@ -313,7 +311,7 @@ public class ScreenRenderer {
     }
 
     public void populateContextForService(DispatchContext dctx, Map<String, Object> serviceContext) {
-        this.populateBasicContext(serviceContext, dctx.getDelegator(), dctx.getDispatcher(), dctx.getAuthorization(),
+        this.populateBasicContext(serviceContext, dctx.getDelegator(), dctx.getDispatcher(),
                 dctx.getSecurity(), (Locale) serviceContext.get("locale"), (GenericValue) serviceContext.get("userLogin"));
     }
 }

Modified: ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/text/TextFormRenderer.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/text/TextFormRenderer.java?rev=1369382&r1=1369381&r2=1369382&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/text/TextFormRenderer.java (original)
+++ ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/text/TextFormRenderer.java Sat Aug  4 18:11:00 2012
@@ -46,7 +46,6 @@ import org.ofbiz.widget.form.ModelFormFi
 import org.ofbiz.widget.form.ModelFormField.RadioField;
 import org.ofbiz.widget.form.ModelFormField.RangeFindField;
 import org.ofbiz.widget.form.ModelFormField.ResetField;
-import org.ofbiz.widget.form.ModelFormField.ShowPortletLink;
 import org.ofbiz.widget.form.ModelFormField.SubmitField;
 import org.ofbiz.widget.form.ModelFormField.TextField;
 import org.ofbiz.widget.form.ModelFormField.TextFindField;
@@ -299,9 +298,4 @@ public class TextFormRenderer implements
 
     public void renderContainerFindField(Appendable writer, Map<String, Object> context, ContainerField containerField) throws IOException {
     }
-
-    @Override
-    public void renderShowPortletLink(Appendable writer, Map<String, Object> context, ShowPortletLink showPortletLink) {
-        // TODO Auto-generated method stub
-    }
 }

Modified: ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/tree/ModelTreeCondition.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/tree/ModelTreeCondition.java?rev=1369382&r1=1369381&r2=1369382&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/tree/ModelTreeCondition.java (original)
+++ ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/tree/ModelTreeCondition.java Sat Aug  4 18:11:00 2012
@@ -39,7 +39,6 @@ import org.ofbiz.entity.GenericValue;
 import org.ofbiz.entityext.permission.EntityPermissionChecker;
 import org.ofbiz.minilang.operation.BaseCompare;
 import org.ofbiz.security.Security;
-import org.ofbiz.security.authz.Authorization;
 import org.w3c.dom.Element;
 
 /**
@@ -211,18 +210,15 @@ public class ModelTreeCondition {
             if (userLogin != null) {
                 String permission = permissionExdr.expandString(context);
                 String action = actionExdr.expandString(context);
-
-                Authorization authz = (Authorization) context.get("authz");
                 Security security = (Security) context.get("security");
                 if (UtilValidate.isNotEmpty(action)) {
-                    //Debug.logWarning("Deprecated method hasEntityPermission() was called; the action field should no longer be used", module);
                     // run hasEntityPermission
                     if (security.hasEntityPermission(permission, action, userLogin)) {
                         return true;
                     }
                 } else {
                     // run hasPermission
-                    if (authz.hasPermission(userLogin.getString("userLoginId"), permission, context)) {
+                    if (security.hasPermission(permission, userLogin)) {
                         return true;
                     }
                 }

Modified: ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/xml/XmlFormRenderer.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/xml/XmlFormRenderer.java?rev=1369382&r1=1369381&r2=1369382&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/xml/XmlFormRenderer.java (original)
+++ ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/xml/XmlFormRenderer.java Sat Aug  4 18:11:00 2012
@@ -46,7 +46,6 @@ import org.ofbiz.widget.form.ModelFormFi
 import org.ofbiz.widget.form.ModelFormField.RadioField;
 import org.ofbiz.widget.form.ModelFormField.RangeFindField;
 import org.ofbiz.widget.form.ModelFormField.ResetField;
-import org.ofbiz.widget.form.ModelFormField.ShowPortletLink;
 import org.ofbiz.widget.form.ModelFormField.SubmitField;
 import org.ofbiz.widget.form.ModelFormField.TextField;
 import org.ofbiz.widget.form.ModelFormField.TextFindField;
@@ -340,9 +339,4 @@ public class XmlFormRenderer implements
 
     public void renderContainerFindField(Appendable writer, Map<String, Object> context, ContainerField containerField) throws IOException {
     }
-
-    @Override
-    public void renderShowPortletLink(Appendable writer, Map<String, Object> context, ShowPortletLink showPortletLink) {
-        // TODO Auto-generated method stub
-    }
 }

Modified: ofbiz/branches/20120329_portletWidget/framework/widget/templates/htmlFormMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/widget/templates/htmlFormMacroLibrary.ftl?rev=1369382&r1=1369381&r2=1369382&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/widget/templates/htmlFormMacroLibrary.ftl (original)
+++ ofbiz/branches/20120329_portletWidget/framework/widget/templates/htmlFormMacroLibrary.ftl Sat Aug  4 18:11:00 2012
@@ -47,19 +47,8 @@ under the License.
     </#if>
 </#macro>
 <#macro renderHyperlinkField></#macro>
-<#macro makeShowPortletString linkStyle id event action target targetArea targetPortletId description parameterForm parameterList collapse>
-<div <#if id?has_content>id="${id}_div"</#if>><a href="javascript:ajaxUpdateArea('${targetArea}','${target}',<#if parameterForm?has_content> jQuery('#${parameterForm}').serialize()<#elseif parameterList?has_content>${parameterList}<#else>'portalPortletId=${targetPortletId}'</#if>); <#if collapse?has_content>toggleParentScreenlet('${collapse}');</#if>">${description}</a></div>
-</#macro>
-<#macro rerenderRefreshPortlet linkStyle event action areaId id formName imgSrc title alternate target appendFormParams description params collapse markSelected>
-<#if id?has_content><div id="${id}_div"></#if>
-<a <#if linkStyle?has_content>class="${linkStyle}"</#if> href='javascript:refrshPortlet("${target}", "${areaId}", "${params}", "${formName}", "${appendFormParams}", "${collapse}", <#if (collapse== "true"  || markSelected=="true" ) && id?has_content>"${id}_div"<#else>""</#if>,"${markSelected}" )' <#if action?has_content && event?has_content> ${event}="${action}"</#if><#if imgSrc?length == 0 && title?has_content> title="${title}"</#if>><#if imgSrc?has_content><img src="${imgSrc}" alt="${alternate}" title="${title}"/></#if>${description}</a><#if id?has_content></div></#if>
-</#macro>
 
-<#--#Bam# validate-form
 <#macro renderTextField name className alert value textSize maxlength id event action disabled clientAutocomplete ajaxUrl ajaxEnabled mask>
--->
-<#macro renderTextField name className alert value textSize maxlength id event action disabled clientAutocomplete validateLinkOnEnter validateLinkId ajaxUrl ajaxEnabled mask>
-<#--#Eam# validate-form -->
     <#if mask?has_content>
       <script type="text/javascript">
         jQuery(function($){jQuery("#${id}").mask("${mask}");});
@@ -72,7 +61,6 @@ under the License.
     <#if maxlength?has_content> maxlength="${maxlength}"</#if><#rt/>
     <#if disabled?has_content && disabled> disabled="disabled"</#if><#rt/>
     <#if id?has_content> id="${id}"</#if><#rt/>
-    <#if validateLinkOnEnter?has_content && validateLinkOnEnter && validateLinkId?has_content>onkeydown="if ((window.event && window.event.keyCode == 13) || (event && event.keyCode == 13)) clickLink('${validateLinkId}_div')"</#if> <#--#Eam# validate-form -->
     <#if event?has_content && action?has_content> ${event}="${action}"</#if><#rt/>
     <#if clientAutocomplete?has_content && clientAutocomplete=="false"> autocomplete="off"</#if><#rt/>
     /><#t/>
@@ -289,15 +277,13 @@ ${item.description}</span>
 </#list>
 </#macro>
 
-<#-- <#macro renderSubmitField buttonType className alert formName title name event action imgSrc confirmation containerId ajaxUrl> -->
-<#macro renderSubmitField buttonType className alert formName title name event action imgSrc confirmation containerId ajaxUrl returnParams>
+<#macro renderSubmitField buttonType className alert formName title name event action imgSrc confirmation containerId ajaxUrl>
 <#if buttonType=="text-link">
  <a <@renderClass className alert /> href="javascript:document.${formName}.submit()" <#if confirmation?has_content>onclick="return confirm('${confirmation?js_string}');"</#if>><#if title?has_content>${title}</#if> </a>
 <#elseif buttonType=="image">
  <input type="image" src="${imgSrc}" <@renderClass className alert /><#if name?has_content> name="${name}"</#if><#if title?has_content> alt="${title}"</#if><#if event?has_content> ${event}="${action}"</#if> <#if confirmation?has_content>onclick="return confirm('${confirmation?js_string}');"</#if>/>
 <#else>
-<#--<input type="<#if containerId?has_content>button<#else>submit</#if>" <@renderClass className alert /><#if name?exists> name="${name}"</#if><#if title?has_content> value="${title}"</#if><#if event?has_content> ${event}="${action}"</#if><#if containerId?has_content> onclick="<#if confirmation?has_content>if (confirm('${confirmation?js_string}')) </#if>ajaxSubmitFormUpdateAreas('${containerId}', '${ajaxUrl}')"<#else><#if confirmation?has_content> onclick="return confirm('${confirmation?js_string}');"</#if></#if>/></#if>-->
-<input type="<#if containerId?has_content>button<#else>submit</#if>" <@renderClass className alert /><#if name?exists> name="${name}"</#if><#if title?has_content> value="${title}"</#if><#if event?has_content> ${event}="${action}"</#if><#if containerId?has_content> onclick="<#if confirmation?has_content>if (confirm('${confirmation?js_string}')) </#if><#if returnParams?has_content>ajaxSubmitFormUpdateAreasWithReturn('${containerId}', '${ajaxUrl}', ${returnParams})"<#else>ajaxSubmitFormUpdateAreas('${containerId}', '${ajaxUrl}')"</#if><#else><#if confirmation?has_content> onclick="return confirm('${confirmation?js_string}');"</#if></#if>/></#if>
+<input type="<#if containerId?has_content>button<#else>submit</#if>" <@renderClass className alert /><#if name?exists> name="${name}"</#if><#if title?has_content> value="${title}"</#if><#if event?has_content> ${event}="${action}"</#if><#if containerId?has_content> onclick="<#if confirmation?has_content>if (confirm('${confirmation?js_string}')) </#if>ajaxSubmitFormUpdateAreas('${containerId}', '${ajaxUrl}')"<#else><#if confirmation?has_content> onclick="return confirm('${confirmation?js_string}');"</#if></#if>/></#if>
 </#macro>
 
 <#macro renderResetField className alert name title>
@@ -391,7 +377,7 @@ ${item.description}</span>
 </#macro>
 
 <#macro renderFormatItemRowOpen formName itemIndex altRowStyles evenRowStyle oddRowStyle>
-    <tr <#if itemIndex?has_content>id="${formName}_row_${itemIndex}" </#if><#if itemIndex?has_content><#if itemIndex%2==0><#if evenRowStyle?has_content>class="${evenRowStyle}<#if altRowStyles?has_content> ${altRowStyles}</#if>"<#elseif altRowStyles?has_content>class="${altRowStyles}"</#if><#else><#if oddRowStyle?has_content>class="${oddRowStyle}<#if altRowStyles?has_content> ${altRowStyles}</#if>"<#elseif altRowStyles?has_content>class="${altRowStyles}"</#if></#if></#if> >
+    <tr <#if itemIndex?has_content><#if itemIndex%2==0><#if evenRowStyle?has_content>class="${evenRowStyle}<#if altRowStyles?has_content> ${altRowStyles}</#if>"<#elseif altRowStyles?has_content>class="${altRowStyles}"</#if><#else><#if oddRowStyle?has_content>class="${oddRowStyle}<#if altRowStyles?has_content> ${altRowStyles}</#if>"<#elseif altRowStyles?has_content>class="${altRowStyles}"</#if></#if></#if> >
 </#macro>
 <#macro renderFormatItemRowClose formName>
     </tr>
@@ -454,11 +440,7 @@ ${item.description}</span>
 
 <#macro renderFormatEmptySpace>&nbsp;</#macro>
 
-<#--#Bam# validate-form
 <#macro renderTextFindField name value defaultOption opEquals opBeginsWith opContains opIsEmpty opNotEqual className alert size maxlength autocomplete titleStyle hideIgnoreCase ignCase ignoreCase>
--->
-<#macro renderTextFindField name value defaultOption opEquals opBeginsWith opContains opIsEmpty opNotEqual className alert size maxlength autocomplete validateLinkOnEnter validateLinkId titleStyle hideIgnoreCase ignCase ignoreCase>
-<#--#Eam# validate-form -->
 <#if opEquals?has_content>
 <select <#if name?has_content>name="${name}_op"</#if>    class="selectBox"><#rt/>
 <option value="equals"<#if defaultOption=="equals"> selected="selected"</#if>>${opEquals}</option><#rt/>
@@ -470,11 +452,7 @@ ${item.description}</span>
 <#else>
 <input type="hidden" name=<#if name?has_content> "${name}_op"</#if>    value="${defaultOption}"/><#rt/>
 </#if>
-<#--#Bam# validate-form
  <input type="text" <@renderClass className alert /> name="${name}"<#if value?has_content> value="${value}"</#if><#if size?has_content> size="${size}"</#if><#if maxlength?has_content> maxlength="${maxlength}"</#if><#if autocomplete?has_content> autocomplete="off"</#if>/><#rt/>
--->
- <input type="text" <@renderClass className alert /> <#if validateLinkOnEnter?has_content && validateLinkOnEnter && validateLinkId?has_content>onkeydown="if ((window.event && window.event.keyCode == 13) || (event && event.keyCode == 13)) clickLink('${validateLinkId}_div')"</#if> name="${name}"<#if value?has_content> value="${value}"</#if><#if size?has_content> size="${size}"</#if><#if maxlength?has_content> maxlength="${maxlength}"</#if><#if autocomplete?has_content> autocomplete="off"</#if>/><#rt/>
-<#--#Eam# validate-form -->
 <#if titleStyle?has_content><span class="${titleStyle}" ><#rt/></#if>
 <#if hideIgnoreCase>
  <input type="hidden" name="${name}_ic" value=<#if ignCase>"Y"<#else> ""</#if>/><#rt/>
@@ -695,7 +673,7 @@ Parameter: lastViewName, String, optiona
  args : <#rt/>
     <#if targetParameterIter?has_content>
     <#assign isFirst = true>
-    <#lt/>, [<#rt/>
+    <#lt/>[<#rt/>
     <#list targetParameterIter as item>
       <#if isFirst>
           <#lt/>document.${formName}.${item}<#rt/>
@@ -792,8 +770,4 @@ Parameter: lastViewName, String, optiona
 
 <#macro makeHiddenFormLinkForm actionUrl name parameters targetWindow><form method="post" action="${actionUrl}" <#if targetWindow?has_content>target="${targetWindow}"</#if> onsubmit="javascript:submitFormDisableSubmits(this)" name="${name}"><#list parameters as parameter><input name="${parameter.name}" value="${parameter.value}" type="hidden"/></#list></form></#macro>
 <#macro makeHiddenFormLinkAnchor linkStyle hiddenFormName event action imgSrc description confirmation><a <#if linkStyle?has_content>class="${linkStyle}"</#if> href="javascript:document.${hiddenFormName}.submit()"<#if action?has_content && event?has_content> ${event}="${action}"</#if><#if confirmation?has_content> onclick="return confirm('${confirmation?js_string}')"</#if>><#if imgSrc?has_content><img src="${imgSrc}" alt=""/></#if>${description}</a></#macro>
-<#--#Bam# validate-form
 <#macro makeHyperlinkString linkStyle hiddenFormName event action imgSrc title alternate linkUrl targetWindow description confirmation><a <#if linkStyle?has_content>class="${linkStyle}"</#if> href="${linkUrl}"<#if targetWindow?has_content> target="${targetWindow}"</#if><#if action?has_content && event?has_content> ${event}="${action}"</#if><#if confirmation?has_content> onclick="return confirm('${confirmation?js_string}')"</#if><#if imgSrc?length == 0 && title?has_content> title="${title}"</#if>><#if imgSrc?has_content><img src="${imgSrc}" alt="${alternate}" title="${title}"/></#if>${description}</a></#macro>
--->
-<#macro makeHyperlinkString linkStyle hiddenFormName event action id imgSrc title alternate linkUrl targetWindow description confirmation><#if id?has_content><div id="${id}_div"></#if><a <#if linkStyle?has_content>class="${linkStyle}"</#if> href="${linkUrl}"<#if targetWindow?has_content> target="${targetWindow}"</#if><#if action?has_content && event?has_content> ${event}="${action}"</#if><#if confirmation?has_content> onclick="return confirm('${confirmation?js_string}')"</#if><#if imgSrc?length == 0 && title?has_content> title="${title}"</#if>><#if imgSrc?has_content><img src="${imgSrc}" alt="${alternate}" title="${title}"/></#if>${description}</a><#if id?has_content></div></#if></#macro>
-<#--#Eam# validate-form -->

Modified: ofbiz/branches/20120329_portletWidget/framework/widget/templates/htmlScreenMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/widget/templates/htmlScreenMacroLibrary.ftl?rev=1369382&r1=1369381&r2=1369382&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/widget/templates/htmlScreenMacroLibrary.ftl (original)
+++ ofbiz/branches/20120329_portletWidget/framework/widget/templates/htmlScreenMacroLibrary.ftl Sat Aug  4 18:11:00 2012
@@ -193,11 +193,7 @@ ${menuString}
   </table>
 </#macro>
 
-<#--#Bam# portletWidget  add new field in PortalPageColumn to be able to have multiple line in a portalPage. Each line has multiple column
 <#macro renderPortalPageColumnBegin originalPortalPageId portalPageId columnSeqId confMode="false" width="auto" delColumnLabel="Delete column" delColumnHint="Delete this column" addPortletLabel="Add portlet" addPortletHint="Add a new portlet to this column" colWidthLabel="Col. width:" setColumnSizeHint="Set column size">
--->
-<#macro renderPortalPageColumnBegin originalPortalPageId portalPageId columnSeqId confMode="false" width="auto" delColumnLabel="Delete column" delColumnHint="Delete this column" addPortletLabel="Add portlet" addPortletHint="Add a new portlet to this column" colWidthLabel="Col. width:" setColumnSizeHint="Set column size" newLine="N">
-<#--#Eam# portletWidget -->
   <#assign columnKey = portalPageId+columnSeqId>
   <#assign columnKeyFields = '<input name="portalPageId" value="' + portalPageId + '" type="hidden"/><input name="columnSeqId" value="' + columnSeqId + '" type="hidden"/>'>
   <script type="text/javascript">
@@ -209,11 +205,6 @@ ${menuString}
       }
     }
   </script>
-  <#--#Bam# portletWidget  add new field in PortalPageColumn to be able to have multiple line in a portalPage. Each line has multiple column -->
-  <#if newLine == "Y">
-    </tr></table><table width="100%"><tr>
-  </#if>
-  <#--#Eam# portletWidget -->
   <td class="portal-column<#if confMode == "true">-config</#if> connectedSortable" style="vertical-align: top; <#if width?has_content> width:${width};</#if>" id="portalColumn_${columnSeqId}">
     <#if confMode == "true">
       <div class="portal-column-config-title-bar">
@@ -246,17 +237,10 @@ ${menuString}
   </td>
 </#macro>
 
-<#--#Bam# portletWidget -->
-<#--
 <#macro renderPortalPagePortletBegin originalPortalPageId portalPageId portalPortletId portletSeqId prevPortletId="" prevPortletSeqId="" nextPortletId="" nextPortletSeqId="" columnSeqId="" prevColumnSeqId="" nextColumnSeqId="" confMode="false" delPortletHint="Remove this portlet" editAttribute="false" editAttributeHint="Edit portlet parameters">
--->
-<#macro renderPortalPagePortletBegin originalPortalPageId portalPageId portalPortletId portletSeqId includedInPage prevPortletId="" prevPortletSeqId="" nextPortletId="" nextPortletSeqId="" columnSeqId="" prevColumnSeqId="" nextColumnSeqId="" confMode="false" delPortletHint="Remove this portlet" editAttribute="false" editAttributeHint="Edit portlet parameters">
-<#--#Eam# portletWidget  -->
   <#assign portletKey = portalPageId+portalPortletId+portletSeqId>
   <#assign portletKeyFields = '<input name="portalPageId" value="' + portalPageId + '" type="hidden"/><input name="portalPortletId" value="' + portalPortletId + '" type="hidden"/><input name="portletSeqId" value="' + portletSeqId  + '" type="hidden"/>'>
-  <#if includedInPage=="Y"><#--#Bam# portletWidget -->
   <div id="PP_${portletKey}" name="portalPortlet" class="noClass" portalPageId="${portalPageId}" portalPortletId="${portalPortletId}" columnSeqId="${columnSeqId}" portletSeqId="${portletSeqId}">
-  </#if><#--#Bam# portletWidget -->
     <#if confMode == "true">
       <div class="portlet-config" id="PPCFG_${portletKey}">
         <div class="portlet-config-title-bar">
@@ -330,73 +314,8 @@ ${menuString}
       </#if>
 </#macro>
 
-<#--#Bam# portletWidget screenlet navigation form (ajax) -->
-<#macro renderScreenletBeginWithPaginate id title collapsible saveCollapsed collapsibleAreaId expandToolTip collapseToolTip fullUrlString padded menuString showMore collapsed javaScriptEnabled paginateStyle paginateFirstStyle viewIndex highIndex listSize viewSize ajaxEnabled javaScriptEnabled ajaxFirstUrl firstUrl paginateFirstLabel paginatePreviousStyle ajaxPreviousUrl previousUrl paginatePreviousLabel pageLabel ajaxSelectUrl selectUrl ajaxSelectSizeUrl selectSizeUrl commonDisplaying paginateNextStyle ajaxNextUrl nextUrl paginateNextLabel paginateLastStyle ajaxLastUrl lastUrl paginateLastLabel paginateViewSizeLabel>
-<div class="screenlet"<#if id?has_content> id="${id}"</#if>><#rt/>
-<#if showMore>
-<div class="screenlet-title-bar-pager">
-        <ul>
-<#if title?has_content>
-            <li class="h3">${title}</li>
-</#if>
-            <li>&nbsp;</li>
-<#if listSize gt viewSize>
-            <li class="${paginateFirstStyle}<#if viewIndex gt 0>"><a href="<#if ajaxEnabled>javascript:ajaxUpdateAreas('${ajaxFirstUrl}')<#else>${firstUrl}</#if>">${paginateFirstLabel}</a><#else>-disabled"><span>${paginateFirstLabel}</span></#if></li>
-            <li class="${paginatePreviousStyle}<#if viewIndex gt 0>"><a href="<#if ajaxEnabled>javascript:ajaxUpdateAreas('${ajaxPreviousUrl}')<#else>${previousUrl}</#if>">${paginatePreviousLabel}</a><#else>-disabled"><span>${paginatePreviousLabel}</span></#if></li>
-     <#if listSize gt 0 && javaScriptEnabled>
-            <li class="nav-page-select">${pageLabel}
-                <select name="page" size="1" onchange="<#if ajaxEnabled>javascript:ajaxUpdateAreas('${ajaxSelectUrl}')<#else>location.href='${selectUrl}'+this.value;</#if>"><#rt/>
-        <#assign x=Static["java.lang.Math"].floor(listSize/viewSize)>
-        <#if listSize gt (viewIndex*viewSize)><#assign x=x+1></#if>
-        <#list 1..x as i>
-            <#if i == (viewIndex+1)><option selected="selected" value="<#else><option value="</#if>${i-1}">${i}</option>
-        </#list>
-                </select>
-            </li>
-    </#if>
-            <li class="${paginateNextStyle}<#if highIndex lt listSize>"><a href="<#if ajaxEnabled>javascript:ajaxUpdateAreas('${ajaxNextUrl}')<#else>${nextUrl}</#if>">${paginateNextLabel}</a><#else>-disabled"><span>${paginateNextLabel}</span></#if></li>
-            <li class="${paginateLastStyle}<#if highIndex lt listSize>"><a href="<#if ajaxEnabled>javascript:ajaxUpdateAreas('${ajaxLastUrl}')<#else>${lastUrl}</#if>">${paginateLastLabel}</a><#else>-disabled"><span>${paginateLastLabel}</span></#if></li>
-    <#if javaScriptEnabled>
-            <li class="nav-pagesize">
-                <select name="pageSize" size="1" onchange="<#if ajaxEnabled>javascript:ajaxUpdateAreas('${ajaxSelectSizeUrl}')<#else>location.href='${selectSizeUrl}';</#if>"><#rt/>
-        <#assign availPageSizes = [20, 30, 50, 100, 200]>
-        <#list availPageSizes as ps>
-                    <option <#if viewSize == ps>selected="selected" </#if> value="${ps}">${ps}</option>
-        </#list>
-                </select> ${paginateViewSizeLabel}
-            </li>
-            <li>&nbsp;</li>
-    </#if>
-</#if>
-
-<#if collapsible>
-            <li class="<#rt/>
-    <#if collapsed>
-collapsed"><a <#if javaScriptEnabled>onclick="javascript:toggleScreenlet(this, '${collapsibleAreaId}', '${saveCollapsed?string}', '${expandToolTip}', '${collapseToolTip}');"<#else>href="${fullUrlString}"</#if><#if expandToolTip?has_content> title="${expandToolTip}"</#if>
-    <#else>
-expanded nav-displaying"><a <#if javaScriptEnabled>onclick="javascript:toggleScreenlet(this, '${collapsibleAreaId}', '${saveCollapsed?string}', '${expandToolTip}', '${collapseToolTip}');"<#else>href="${fullUrlString}"</#if><#if collapseToolTip?has_content> title="${collapseToolTip}"</#if>
-    </#if>>&nbsp;</a>
-            </li>
-            <#if listSize gt viewSize>
-            <li class="nav-displaying">${commonDisplaying}</li>
-            </#if>
-</#if>
-        </ul>
-
-</div>
-<#if menuString?has_content><div class="screenlet-title-bar"><ul>${menuString}</ul></div></#if><#--#Eam# portletWidget -->
-</#if>
-<div <#if collapsibleAreaId?has_content> id="${collapsibleAreaId}" <#if collapsed> style="display: none;"</#if></#if><#if padded> class="screenlet-body"<#else> class="screenlet-body no-padding"</#if>>
-</#macro>
-<#--#Eam# portletWidget navigation form (ajax)-->
-<#--#Bam# portletWidget
 <#macro renderPortalPagePortletEnd confMode="false">
--->
-<#macro renderPortalPagePortletEnd includedInPage confMode="false">
-<#--#Bam# portletWidget -->
-  <#if includedInPage=="Y"> <#--#Eam# portletWidget -->
   </div>
-  </#if> <#--#Eam# portletWidget -->
   <#if confMode == "true">
     </div>
   </#if>