|
Author: erwan
Date: Tue Jun 5 18:45:59 2012 New Revision: 1346521 URL: http://svn.apache.org/viewvc?rev=1346521&view=rev Log: Correcting some errors in portlet widget branch Modified: ofbiz/branches/20120329_portletWidget/applications/content/data/ExampleHelpData.xml ofbiz/branches/20120329_portletWidget/framework/common/data/CommonPortletData.xml ofbiz/branches/20120329_portletWidget/framework/images/webapp/images/portlet.js ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java ofbiz/branches/20120329_portletWidget/specialpurpose/example/data/ExamplePortletData.xml ofbiz/branches/20120329_portletWidget/specialpurpose/example/data/helpdata/HELP_portletattrs_FR.xml Modified: ofbiz/branches/20120329_portletWidget/applications/content/data/ExampleHelpData.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/content/data/ExampleHelpData.xml?rev=1346521&r1=1346520&r2=1346521&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/applications/content/data/ExampleHelpData.xml (original) +++ ofbiz/branches/20120329_portletWidget/applications/content/data/ExampleHelpData.xml Tue Jun 5 18:45:59 2012 @@ -84,8 +84,8 @@ objectInfo="framework/example/data/helpdata/HELP_EXAMPLE_pages.xml" dataTemplateTypeId="NONE" statusId="CTNT_IN_PROGRESS" dataResourceName="Use of Portal Page" mimeTypeId="text/xml" isPublic="Y" /> <Content contentId="EXAMPLE_pages" contentTypeId="DOCUMENT" contentName="Use of Portal Page" templateDataResourceId="HELP_TEMPL" dataResourceId="EXAMPLE_pages" statusId="CTNT_IN_PROGRESS" mimeTypeId="text/html"/> <DataResource dataResourceId="EXAMPLE_pages_FR" localeString="fr" dataResourceTypeId="OFBIZ_FILE" - objectInfo="framework/example/data/helpdata/HELP_EXAMPLE_pages_FR.xml" dataTemplateTypeId="NONE" statusId="CTNT_IN_PROGRESS" dataResourceName="Pages portails type" mimeTypeId="text/xml" isPublic="Y" /> - <Content contentId="EXAMPLE_pages_FR" contentTypeId="DOCUMENT" contentName="Pages portails type" templateDataResourceId="HELP_TEMPL" localeString="fr" dataResourceId="EXAMPLE_pages_FR" statusId="CTNT_IN_PROGRESS" mimeTypeId="text/html"/> + objectInfo="framework/example/data/helpdata/HELP_EXAMPLE_pages_FR.xml" dataTemplateTypeId="NONE" statusId="CTNT_IN_PROGRESS" dataResourceName="Utilisation des pages portail" mimeTypeId="text/xml" isPublic="Y" /> + <Content contentId="EXAMPLE_pages_FR" contentTypeId="DOCUMENT" contentName="Utilisation des pages portail" templateDataResourceId="HELP_TEMPL" localeString="fr" dataResourceId="EXAMPLE_pages_FR" statusId="CTNT_IN_PROGRESS" mimeTypeId="text/html"/> <ContentAssoc contentId="EXAMPLE_pages" contentIdTo="EXAMPLE_pages_FR" contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2006-01-12 01:01:01"/> <DataResource dataResourceId="EXAMPLE_portlets" localeString="en" dataResourceTypeId="OFBIZ_FILE" @@ -232,9 +232,9 @@ <ContentAssoc contentId="EXAMPLE_pages" contentIdTo="HELP_PPAGE_MGMT" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="000" mapKey="HELP_PPAGE_MGMT"/> <ContentAssoc contentId="EXAMPLE_devel" contentIdTo="EXAMPLE_portlets" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="002" mapKey="EXAMPLE_portlets"/> <ContentAssoc contentId="EXAMPLE_portlets" contentIdTo="HELP_portletcats" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="001" mapKey="HELP_portletcats"/> - <ContentAssoc contentId="EXAMPLE_portlets" contentIdTo="HELP_portletattrs" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="001" mapKey="HELP_portletattrs"/> - <ContentAssoc contentId="EXAMPLE_portlets" contentIdTo="HELP_iconsList" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="002" mapKey="HELP_iconsList"/> - <ContentAssoc contentId="EXAMPLE_portlets" contentIdTo="HELP_portlettypes" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="003" mapKey="HELP_portlettypes"/> + <ContentAssoc contentId="EXAMPLE_portlets" contentIdTo="HELP_portletattrs" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="002" mapKey="HELP_portletattrs"/> + <ContentAssoc contentId="EXAMPLE_portlets" contentIdTo="HELP_iconsList" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="003" mapKey="HELP_iconsList"/> + <ContentAssoc contentId="EXAMPLE_portlets" contentIdTo="HELP_portlettypes" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="004" mapKey="HELP_portlettypes"/> <ContentAssoc contentId="HELP_portlettypes" contentIdTo="HELP_Screenlet" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="001" mapKey="HELP_Screenlet"/> <ContentAssoc contentId="HELP_portlettypes" contentIdTo="HELP_ScreenletList" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="002" mapKey="HELP_ScreenletList"/> <ContentAssoc contentId="HELP_portlettypes" contentIdTo="HELP_Empty" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="003" mapKey="HELP_Empty"/> Modified: ofbiz/branches/20120329_portletWidget/framework/common/data/CommonPortletData.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/common/data/CommonPortletData.xml?rev=1346521&r1=1346520&r2=1346521&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/common/data/CommonPortletData.xml (original) +++ ofbiz/branches/20120329_portletWidget/framework/common/data/CommonPortletData.xml Tue Jun 5 18:45:59 2012 @@ -36,4 +36,7 @@ <PortletType portletTypeId="ScreenletList" screenName="ScreenletList" description="include a list type form (do not use screenName) and an editing area, depending of scriptName and menuName exist a screen with call (or not) scriptName in action and include a screenlet with include formName and include (or not) menuName" screenLocation="component://common/widget/PortletTypeScreens.xml"/> <PortletType portletTypeId="Empty" screenName="Empty" description="a empty screen, used to define a areaId" screenLocation="component://common/widget/PortletTypeScreens.xml"/> <!--#Eam# portletWidget --> + <!--#Bam# portletExample can be use for all portal page build like exampleMgmt--> + <PortalPortlet portalPortletId="CommonDetail" portletName="Common detail portlet place" description="Use this portlet to say where detail portlet call from a menu will be show" portletTypeId="Empty" component="common" subComponent="Common" securityServiceName="" securityMainAction="VIEW"/> + <!--#Eam# portletExample --> </entity-engine-xml> Modified: ofbiz/branches/20120329_portletWidget/framework/images/webapp/images/portlet.js URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/images/webapp/images/portlet.js?rev=1346521&r1=1346520&r2=1346521&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/images/webapp/images/portlet.js (original) +++ ofbiz/branches/20120329_portletWidget/framework/images/webapp/images/portlet.js Tue Jun 5 18:45:59 2012 @@ -194,199 +194,3 @@ var scripts = element.find("script"); } } } -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * 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 - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -function toggleParentScreenlet(id){ - var element = jQuery("#"+id); - element.parents("div.screenlet").filter(':first').children("div").filter(':first') - .children("ul").filter(':first').children("li.expanded").filter(':first').children('a') - .filter(':first').click(); -} - -/*Begin addon modification : event-messages*/ -/** Submit form, update multiple areas (HTML container elements). - * @param form The form element - * @param areaCsvString The area CSV string. The CSV string is a flat array in the - * form of: areaId, target, target parameters, boolean addParam [, areaId, target, target parameters...]. - * @param returnParamMap The parameters to return. It is a map in the form of: - * returnName1: parameterName1 , returnName2: parameterName2,... and will be added to the update area parameters with boolean addParam - */ - -function ajaxSubmitFormUpdateAreasWithReturn(form, areaCsvString, returnParamMap) { - submitFormDisableSubmits($(form)); - waitSpinnerShow(); - updateFunction = function(data) { - hideErrorContainer = function() { - jQuery('#content-messages').remove(); - } - if ((data._ERROR_MESSAGE_LIST_ != undefined || data._ERROR_MESSAGE_ != undefined) - && (data.responseMessage == undefined || data.responseMessage != "fail") ) { - showMessages('errorMessage',data._ERROR_MESSAGE_,data._ERROR_MESSAGE_LIST_); - waitSpinnerHide(); - }else { - //update areas - var areaArray = areaCsvString.split(","); - var numAreas = parseInt(areaArray.length / 4); - for (var i = 0; i < numAreas * 4; i = i + 4) { - //add return param to last update area request if necessary - var addParams = areaArray[i + 3]; - params = areaArray[i + 2]; - //alert('addParams='+addParams+' params='+params+' areaArray[i]='+areaArray[i]+' areaArray[i+1]='+areaArray[i+1]); - if (addParams && addParams != "false") { - for (var key in returnParamMap) { - if(data[returnParamMap[key]] != undefined){ - params = params + "&" + key + "=" + data[returnParamMap[key]]; - } - } - } - ajaxUpdateArea(areaArray[i], areaArray[i + 1], params); - } - // now show message if needed - if (data.responseMessage != undefined && data.responseMessage == "fail") { - showMessages('failMessage',data._ERROR_MESSAGE_,data._ERROR_MESSAGE_LIST_); - } - else if (data._EVENT_MESSAGE_LIST_ != undefined || data._EVENT_MESSAGE_ != undefined){ - showMessages('eventMessage',data._EVENT_MESSAGE_,data._EVENT_MESSAGE_LIST_); - } - else { - if(jQuery('#content-messages').text()) { - jQuery('#content-messages').remove(); - } - } - waitSpinnerHide(); - } - } - jQuery.ajax({ - type: "POST", - url: jQuery("#" + form).attr("action"), - data: jQuery("#" + form).serialize(), - success: function(data) { - updateFunction(data); - } - }); -} - -/** - * Add message div after content-main-section, and Print message to user with class=classMessage - * @param classMessage - * @param message - * @param messageList - * @return - */ -function showMessages(classMessage, message, messageList){ - if(!jQuery('#content-messages').text()) { - //add this div just after app-navigation - if(jQuery('#content-main-section')){ - jQuery('#content-main-section').before('<div id="content-messages" onclick="hideErrorContainer()"></div>'); - } - } - jQuery('#content-messages').removeClass(); - jQuery('#content-messages').addClass(classMessage); - if (message != undefined && messageList != undefined) { - jQuery('#content-messages' ).html(message + " " + messageList); - } else if (messageList != undefined) { - jQuery('#content-messages' ).html("" + messageList); - } else { - jQuery('#content-messages' ).html("" + message); - } - jQuery('#content-messages').fadeIn('fast'); -} - -function clickLink(linkDivId) { - var div = document.getElementById(linkDivId); - if(!div ) return; - var aNodeList = div.getElementsByTagName("A"); - link = aNodeList.item(0); - target =link.href; - if(target.match(new RegExp("javascript:.*"))){ - eval(target); - } else { - window.location.href = target; - } -} -function refrshPortlet(areaTargets, areaIds, areaParams, formName, areaForms, collapse, toggle, markSelected){ - waitSpinnerShow(); - var arealist = areaIds.split(";"); - var targetlist = areaTargets.split(";"); - var paramsList = areaParams.split(";"); - var formList = areaForms.split(";"); - var areasCsv = ""; - for( var index =0; index<arealist.length; index= index+1){ - areasCsv = areasCsv + arealist[index] + ","; - areasCsv = areasCsv + targetlist[index] + ","; - appendFormParams = formList[index]; - var targetParams = paramsList[index]; - if (targetParams== undefined) { - targetParams = ""; - } - if (appendFormParams) { - var forms = appendFormParams.split(",") - for (var i=0; i<forms.length; i++) { - var toSerializeName = forms[i]; - var formToSerialize =jQuery("#"+toSerializeName); - if(formToSerialize.length == 1) { - var formFields = formToSerialize.serialize().split("&"); - for (var j=0; j < formFields.length; j++) { - var formField = formFields[j].split("="); - var name = formField[0]; - if(formField.length > 1 &&(( targetParams.indexOf(name + "=") == -1) || - ( targetParams.indexOf(name + "=") > 0 && targetParams.indexOf("&" + name + "=") > 0))) - { - targetParams = targetParams + "&" + name + "=" + formField[1]; - } - } - } - } - //targetParams = targetParams + "&" +$("#"+appendFormParams).serialize(); - } - areasCsv = areasCsv + targetParams + ","; - } - areasCsv = areasCsv.substring(0,areasCsv.length-1) - ajaxUpdateAreas(areasCsv); - if ("true" == collapse) { - toggleParentScreenlet(toggle); - } - if ("true" == markSelected) { - markRowAsSelected(toggle); - } -} -function markRowAsSelected(id){ - var element = jQuery("#"+id); - // to ensure that all precedent selection are removed. - // a row is marked as selected by changing the css class of its tr. - // the tr is the first ancestor of the element defined by id. - var parentTR = element.parents("tr"); - element.parents("tbody").children("tr").removeClass("selected"); - parentTR.addClass('selected'); - -} -function evalScripts(element) { -var scripts = element.find("script"); - for (i=0; i < scripts.length; i++) { - // if src, eval it, otherwise eval the body - if (scripts[i].hasAttribute("src")) { - var src = scripts[i].getAttribute("src"); - var script = document.createElement('script'); - script.setAttribute("src", src); - document.getElementsByTagName('body')[0].appendChild(script); - } else { - eval(scripts[i].innerHTML); - } - } -} \ No newline at end of file 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=1346521&r1=1346520&r2=1346521&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 Tue Jun 5 18:45:59 2012 @@ -828,7 +828,7 @@ public class MacroScreenRenderer impleme } ajaxParams += extraParams; } - if(UtilValidate.isNotEmpty(parameters)){ + if(parameters!=null){ if(UtilValidate.isEmpty(ajaxParams)){ ajaxParams = ""; } Modified: ofbiz/branches/20120329_portletWidget/specialpurpose/example/data/ExamplePortletData.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/specialpurpose/example/data/ExamplePortletData.xml?rev=1346521&r1=1346520&r2=1346521&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/specialpurpose/example/data/ExamplePortletData.xml (original) +++ ofbiz/branches/20120329_portletWidget/specialpurpose/example/data/ExamplePortletData.xml Tue Jun 5 18:45:59 2012 @@ -32,12 +32,6 @@ under the License. screenName="ExamplePortlet3" screenLocation="component://example/widget/example/PortletScreens.xml" editFormName="ExamplePortlet3Edit" editFormLocation="component://example/widget/example/PortletEditForms.xml"/> - <PortalPortlet portalPortletId="IconsList" portletName="List all icons usable in portlet with iconsPurpose and IconsTooltips_" - description="List all icons usable in portlet with iconsPurpose and IconsTooltips_" - portletTypeId="Screenlet" component="example" subComponent="Example" webapp="example" - uiLabelLocation="component://example/widget/CommonScreens.xml"/> - <PortletPortletCategory portalPortletId="IconsList" portletCategoryId="EXAMPLE"/> - <PortletCategory portletCategoryId="EXAMPLE" description="Example Portlet(s)"/> <PortletPortletCategory portalPortletId="EXAMPLE_1" portletCategoryId="EXAMPLE"/> <PortletPortletCategory portalPortletId="EXAMPLE_2" portletCategoryId="EXAMPLE"/> @@ -137,7 +131,4 @@ under the License. <PortletPortletCategory portalPortletId="ListExampleFeature" portletCategoryId="EXAMPLE_PORTLET_TYPE"/> <!-- End Addon modification portletExample --> -<!--#Bam# portletExample can be use for all portal page build like exampleMgmt--> -<PortalPortlet portalPortletId="CommonDetail" portletName="Common detail portlet place" description="Use this portlet to say where detail portlet call from a menu will be show" portletTypeId="Empty" component="common" subComponent="Common" securityServiceName="" securityMainAction="VIEW"/> -<!--#Eam# portletExample --> </entity-engine-xml> Modified: ofbiz/branches/20120329_portletWidget/specialpurpose/example/data/helpdata/HELP_portletattrs_FR.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/specialpurpose/example/data/helpdata/HELP_portletattrs_FR.xml?rev=1346521&r1=1346520&r2=1346521&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/specialpurpose/example/data/helpdata/HELP_portletattrs_FR.xml (original) +++ ofbiz/branches/20120329_portletWidget/specialpurpose/example/data/helpdata/HELP_portletattrs_FR.xml Tue Jun 5 18:45:59 2012 @@ -17,23 +17,25 @@ License. version="5.0" xmlns:xl="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xsi:schemaLocation="http://docbook.org/ns/docbook" xmlns="http://docbook.org/ns/docbook"> - <title>Icons list available in OFBIz</title> + <title>Attributs d'une portlet</title> - <para> Icons are useful to make the user interface nicer. </para> - <para> To ensure consistency in the application, a logical name was given to each icon and it is advisable to use it. </para> - <para> To be able to change icon sets based on themes, it is advisable not access online the image file but to go through the appropriate properties files. </para> + <para>Les portlet utilisent des attributs pour permettre de rendre configurable cette portlet.</para> + <para>En effet, plus une porlet est configurable, plus il sera aisée de l'utiliser dans un autre contexte, sur une autre page.</para> <para>&nbsp;</para> <section> - <title>How to used icon in a link or show-portlet</title> - <para>Below is a "Details" icon usage example + <title>Gestion des attributs</title> + <para>Un exemple d'attributs standard fixé lors de la configuration : l'attribut "initiallyCollapsed" est un attribut générique utilisé par les types de portlets Screenlet et ScreenletList + pour déterminer si la screenlet sera initialement fermée ou ouverte. Ici, on configure sa valeur pour une page portail et une portlet données. <programlisting> - &lt;show-portlet portlet-id="ShowExample" image-location="${iconsPurpose.Details}" - image-title="${uiLabelMap.IconsTooltips_Details}"> + &lt;PortletAttribute portalPageId="ExampleNew" portalPortletId="FindExample2" attrName="initiallyCollapsed" attrValue="true" portletSeqId="00001"/> + </programlisting> + </para> + <para>Ensuite, on peut créer son propre attribut qui sera utilisé par le script (par exemple) pour rechercher une liste (par exemple une liste d'acteurs avec un rôle défini). + Ainsi, on pourra utiliser la portlet pour différentes valeurs de cet attributs (par exemple, une portlet acteur permet de filtrer sur des propects, des employés,...). + <programlisting> + &lt;PortletAttribute portalPageId="ExampleMgmt" portalPortletId="ListExample2" attrName="roleTypeId" attrValue="VENDOR" portletSeqId="00001"/> </programlisting> </para> - <para> In this page it is stated in the first column: the logical name of the icon (in the example above Details). </para> - <para> Second column is indicated, which will be displayed as an "image-title" So when the mouse is over the icon, or in some case what is good practice to use. </para> - <para> If you leave the mouse on the image of the icon you have the default "image-title". </para> </section> </section> \ No newline at end of file |
| Free forum by Nabble | Edit this page |
