|
Modified: ofbiz/branches/20111205EmailHandling/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Days.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Days.groovy?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Days.groovy (original) +++ ofbiz/branches/20111205EmailHandling/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Days.groovy Mon Mar 26 20:56:02 2012 @@ -18,22 +18,10 @@ */ import java.util.*; -import java.text.*; -import org.ofbiz.entity.*; -import org.ofbiz.base.util.*; -import org.ofbiz.webapp.pseudotag.*; -import org.ofbiz.workeffort.workeffort.*; import java.sql.Timestamp; +import org.ofbiz.base.util.*; -String currentDay = parameters.get("currentDay"); String startParam = parameters.get("start"); -facilityId = parameters.facilityId; -fixedAssetId = parameters.fixedAssetId; -partyId = parameters.partyId; -workEffortTypeId = parameters.workEffortTypeId; -calendarType = parameters.calendarType; -entityExprList = context.entityExprList; - Timestamp start = null; if (UtilValidate.isNotEmpty(startParam)) { start = new Timestamp(Long.parseLong(startParam)); @@ -43,21 +31,18 @@ if (start == null) { } else { start = UtilDateTime.getDayStart(start, timeZone, locale); } - Timestamp prev = UtilDateTime.getDayStart(start, -1, timeZone, locale); context.prevMillis = new Long(prev.getTime()).toString(); Timestamp next = UtilDateTime.getDayStart(start, 1, timeZone, locale); context.nextMillis = new Long(next.getTime()).toString(); - -Map serviceCtx = UtilMisc.toMap("userLogin", userLogin,"start",start,"numPeriods", 24,"periodType", Calendar.HOUR); -serviceCtx.putAll(UtilMisc.toMap("partyId", partyId, "facilityId", facilityId, "fixedAssetId", fixedAssetId, "workEffortTypeId", workEffortTypeId, "calendarType", calendarType, "locale", locale, "timeZone", timeZone)); -if (entityExprList) { - serviceCtx.putAll(["entityExprList" : entityExprList]); +Map serviceCtx = dispatcher.getDispatchContext().makeValidContext("getWorkEffortEventsByPeriod", "IN", parameters); +serviceCtx.putAll(UtilMisc.toMap("userLogin", userLogin, "start", start, "numPeriods", 24, "periodType", Calendar.HOUR, "locale", locale, "timeZone", timeZone)); +if (context.entityExprList) { + serviceCtx.entityExprList = entityExprList; } - -Map result = dispatcher.runSync("getWorkEffortEventsByPeriod",serviceCtx); -context.put("periods",result.get("periods")); -context.put("maxConcurrentEntries",result.get("maxConcurrentEntries")); -context.put("start",start); -context.put("prev",prev); -context.put("next",next); +Map result = dispatcher.runSync("getWorkEffortEventsByPeriod", serviceCtx); +context.put("periods", result.get("periods")); +context.put("maxConcurrentEntries", result.get("maxConcurrentEntries")); +context.put("start", start); +context.put("prev", prev); +context.put("next", next); Modified: ofbiz/branches/20111205EmailHandling/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Month.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Month.groovy?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Month.groovy (original) +++ ofbiz/branches/20111205EmailHandling/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Month.groovy Mon Mar 26 20:56:02 2012 @@ -18,24 +18,11 @@ */ import java.sql.*; -import java.text.*; import java.util.*; -import org.ofbiz.security.*; -import org.ofbiz.entity.*; import org.ofbiz.base.util.*; -import org.ofbiz.webapp.pseudotag.*; -import org.ofbiz.workeffort.workeffort.*; startParam = parameters.start; - -facilityId = parameters.facilityId; -fixedAssetId = parameters.fixedAssetId; -partyId = parameters.partyId; -workEffortTypeId = parameters.workEffortTypeId; -calendarType = parameters.calendarType; -entityExprList = context.entityExprList; - -start = null; +Timestamp start = null; if (UtilValidate.isNotEmpty(startParam)) { start = new Timestamp(Long.parseLong(startParam)); } @@ -44,16 +31,13 @@ if (start == null) { } else { start = UtilDateTime.getMonthStart(start, timeZone, locale); } - tempCal = UtilDateTime.toCalendar(start, timeZone, locale); numDays = tempCal.getActualMaximum(Calendar.DAY_OF_MONTH); - prev = UtilDateTime.getMonthStart(start, -1, timeZone, locale); context.prevMillis = new Long(prev.getTime()).toString(); next = UtilDateTime.getDayStart(start, numDays+1, timeZone, locale); context.nextMillis = new Long(next.getTime()).toString(); end = UtilDateTime.getMonthEnd(start, timeZone, locale); - //Find out what date to get from getFrom = null; prevMonthDays = tempCal.get(Calendar.DAY_OF_WEEK) - tempCal.getFirstDayOfWeek(); @@ -63,7 +47,6 @@ numDays += prevMonthDays; getFrom = new Timestamp(tempCal.getTimeInMillis()); firstWeekNum = tempCal.get(Calendar.WEEK_OF_YEAR); context.put("firstWeekNum", firstWeekNum); - // also get days until the end of the week at the end of the month lastWeekCal = UtilDateTime.toCalendar(end, timeZone, locale); monthEndDay = lastWeekCal.get(Calendar.DAY_OF_WEEK); @@ -74,15 +57,12 @@ if (followingMonthDays < 0) { followingMonthDays += 7; } numDays += followingMonthDays; - -serviceCtx = UtilMisc.toMap("userLogin", userLogin, "start", getFrom, "numPeriods", numDays, "periodType", Calendar.DATE); -serviceCtx.putAll(UtilMisc.toMap("partyId", partyId, "facilityId", facilityId, "fixedAssetId", fixedAssetId, "workEffortTypeId", workEffortTypeId, "calendarType", calendarType, "locale", locale, "timeZone", timeZone)); -if (entityExprList) { - serviceCtx.putAll(["entityExprList" : entityExprList]); +Map serviceCtx = dispatcher.getDispatchContext().makeValidContext("getWorkEffortEventsByPeriod", "IN", parameters); +serviceCtx.putAll(UtilMisc.toMap("userLogin", userLogin, "start", getFrom, "numPeriods", numDays, "periodType", Calendar.DATE, "locale", locale, "timeZone", timeZone)); +if (context.entityExprList) { + serviceCtx.entityExprList = entityExprList; } - result = dispatcher.runSync("getWorkEffortEventsByPeriod", serviceCtx); - context.put("periods",result.get("periods")); context.put("maxConcurrentEntries", result.get("maxConcurrentEntries")); context.put("start", start); Modified: ofbiz/branches/20111205EmailHandling/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Week.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Week.groovy?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Week.groovy (original) +++ ofbiz/branches/20111205EmailHandling/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Week.groovy Mon Mar 26 20:56:02 2012 @@ -18,53 +18,29 @@ */ import java.util.*; -import org.ofbiz.security.*; -import org.ofbiz.entity.*; -import org.ofbiz.base.util.*; -import org.ofbiz.webapp.pseudotag.*; -import org.ofbiz.workeffort.workeffort.*; import java.sql.Timestamp; +import org.ofbiz.base.util.*; -String currentDay = parameters.currentDay; String startParam = parameters.start; - -facilityId = parameters.facilityId; -fixedAssetId = parameters.fixedAssetId; -partyId = parameters.partyId; -workEffortTypeId = parameters.workEffortTypeId; -calendarType = parameters.calendarType; -entityExprList = (List) context.get("entityExprList"); -filterOutCanceledEvents = parameters.filterOutCanceledEvents; -if (!filterOutCanceledEvents) { - filterOutCanceledEvents = Boolean.FALSE; -} - Timestamp start = null; if (UtilValidate.isNotEmpty(startParam)) { start = new Timestamp(Long.parseLong(startParam)); } - if (start == null) { start = UtilDateTime.getWeekStart(nowTimestamp, timeZone, locale); } else { start = UtilDateTime.getWeekStart(start, timeZone, locale); } - Timestamp prev = UtilDateTime.getDayStart(start, -7, timeZone, locale); context.prevMillis = new Long(prev.getTime()).toString(); Timestamp next = UtilDateTime.getDayStart(start, 7, timeZone, locale); context.nextMillis = new Long(next.getTime()).toString(); Timestamp end = UtilDateTime.getDayStart(start, 6, timeZone, locale); - -Map serviceCtx = UtilMisc.toMap("userLogin", userLogin,"start",start,"numPeriods", 7, - "periodType", Calendar.DATE); -serviceCtx.putAll(UtilMisc.toMap("partyId", partyId, "facilityId", facilityId, - "fixedAssetId", fixedAssetId, "workEffortTypeId", workEffortTypeId, "calendarType", calendarType, - "locale", locale, "timeZone", timeZone)); -if (entityExprList) { - serviceCtx.putAll(["entityExprList" : entityExprList]); +Map serviceCtx = dispatcher.getDispatchContext().makeValidContext("getWorkEffortEventsByPeriod", "IN", parameters); +serviceCtx.putAll(UtilMisc.toMap("userLogin", userLogin, "start", start, "numPeriods", 7, "periodType", Calendar.DATE, "locale", locale, "timeZone", timeZone)); +if (context.entityExprList) { + serviceCtx.entityExprList = entityExprList; } - Map result = dispatcher.runSync("getWorkEffortEventsByPeriod",serviceCtx); context.put("periods",result.get("periods")); context.put("maxConcurrentEntries",result.get("maxConcurrentEntries")); Modified: ofbiz/branches/20111205EmailHandling/applications/workeffort/webapp/workeffort/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/workeffort/webapp/workeffort/WEB-INF/controller.xml?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/applications/workeffort/webapp/workeffort/WEB-INF/controller.xml (original) +++ ofbiz/branches/20111205EmailHandling/applications/workeffort/webapp/workeffort/WEB-INF/controller.xml Mon Mar 26 20:56:02 2012 @@ -191,6 +191,12 @@ under the License. <!-- WorkEffort CommunicationEvents requests --> <request-map uri="ListWorkEffortCommEvents"><security https="true" auth="true"/><response name="success" type="view" value="ListWorkEffortCommEvents"/></request-map> + <request-map uri="createCommunicationEvent"> + <security https="true" auth="true"/> + <event type="service" invoke="createCommunicationEventWorkEff"/> + <response name="success" type="view" value="ListWorkEffortCommEvents"/> + <response name="error" type="view" value="ListWorkEffortCommEvents"/> + </request-map> <request-map uri="createWorkEffortCommEvent"> <security https="true" auth="true"/> <event type="service" invoke="createCommunicationEventWorkEff"/> @@ -604,6 +610,7 @@ under the License. <request-map uri="LookupCommEvent"><security https="true" auth="true"/><response name="success" type="view" value="LookupCommEvent"/></request-map> <request-map uri="LookupContactMech"><security https="true" auth="true"/><response name="success" type="view" value="LookupContactMech"/></request-map> <request-map uri="LookupPreferredContactMech"><security https="true" auth="true"/><response name="success" type="view" value="LookupPreferredContactMech"/></request-map> + <request-map uri="LookupContactList"><security https="true" auth="true"/><response name="success" type="view" value="LookupContactList"/></request-map> <request-map uri="LookupProduct"><security https="true" auth="true"/><response name="success" type="view" value="LookupProduct"/></request-map> <request-map uri="LookupVariantProduct"><security https="true" auth="true"/><response name="success" type="view" value="LookupVariantProduct"/></request-map> @@ -748,6 +755,7 @@ under the License. <view-map name="LookupContent" page="component://content/widget/content/ContentScreens.xml#LookupContent" type="screen"/> <view-map name="LookupContactMech" type="screen" page="component://party/widget/partymgr/LookupScreens.xml#LookupContactMech"/> <view-map name="LookupPreferredContactMech" type="screen" page="component://marketing/widget/ContactListScreens.xml#LookupPreferredContactMech"/> + <view-map name="LookupContactList" type="screen" page="component://party/widget/partymgr/PartyContactListScreens.xml#ListLookupContactList"/> <view-map name="EditAgreementWorkEffortApplics" type="screen" page="component://workeffort/widget/WorkEffortScreens.xml#EditAgreementWorkEffortApplics"/> <view-map name="LookupAgreement" page="component://accounting/widget/LookupScreens.xml#LookupAgreement" type="screen"/> Modified: ofbiz/branches/20111205EmailHandling/applications/workeffort/webapp/workeffort/calendar/calendarEventContent.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/workeffort/webapp/workeffort/calendar/calendarEventContent.ftl?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/applications/workeffort/webapp/workeffort/calendar/calendarEventContent.ftl (original) +++ ofbiz/branches/20111205EmailHandling/applications/workeffort/webapp/workeffort/calendar/calendarEventContent.ftl Mon Mar 26 20:56:02 2012 @@ -50,7 +50,11 @@ under the License. </#list> </#if> <#else> - <a href="<@ofbizUrl>${parameters._LAST_VIEW_NAME_}?form=edit&parentTypeId=${parentTypeId?if_exists}&period=${periodType?if_exists}&start=${parameters.start?if_exists}&workEffortId=${workEffort.workEffortId}${addlParam?if_exists}${urlParam?if_exists}</@ofbizUrl>" class="event"> + <#-- Allow containing screens to specify the URL for editing an event --> + <#if !editCalEventUrl?exists> + <#assign editCalEventUrl = parameters._LAST_VIEW_NAME_> + </#if> + <a href="<@ofbizUrl>${editCalEventUrl}?form=edit&parentTypeId=${parentTypeId?if_exists}&period=${periodType?if_exists}&start=${parameters.start?if_exists}&workEffortId=${workEffort.workEffortId}${addlParam?if_exists}${urlParam?if_exists}</@ofbizUrl>" class="event"> ${workEffort.workEffortId} </a> ${workEffort.workEffortName?default("")} Modified: ofbiz/branches/20111205EmailHandling/applications/workeffort/webapp/workeffort/calendar/day.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/workeffort/webapp/workeffort/calendar/day.ftl?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/applications/workeffort/webapp/workeffort/calendar/day.ftl (original) +++ ofbiz/branches/20111205EmailHandling/applications/workeffort/webapp/workeffort/calendar/day.ftl Mon Mar 26 20:56:02 2012 @@ -17,6 +17,10 @@ specific language governing permissions under the License. --> <#if periods?has_content> + <#-- Allow containing screens to specify the URL for creating a new event --> + <#if !newCalEventUrl?exists> + <#assign newCalEventUrl = parameters._LAST_VIEW_NAME_> + </#if> <#if (maxConcurrentEntries < 2)> <#assign entryWidth = 100> <#else> @@ -33,7 +37,7 @@ under the License. <tr<#if currentPeriod> class="current-period"<#else><#if (period.calendarEntries?size > 0)> class="active-period"</#if></#if>> <td class="label"> ${period.start?time?string.short}<br /> - <a href="<@ofbizUrl>${parameters._LAST_VIEW_NAME_}?period=day&form=edit&parentTypeId=${parentTypeId?if_exists}&start=${parameters.start?if_exists}&currentStatusId=CAL_TENTATIVE&estimatedStartDate=${period.start?string("yyyy-MM-dd HH:mm:ss")}&estimatedCompletionDate=${period.end?string("yyyy-MM-dd HH:mm:ss")}${urlParam?if_exists}${addlParam?if_exists}</@ofbizUrl>">${uiLabelMap.CommonAddNew}</a> + <a href="<@ofbizUrl>${newCalEventUrl}?period=day&form=edit&parentTypeId=${parentTypeId?if_exists}&start=${parameters.start?if_exists}&currentStatusId=CAL_TENTATIVE&estimatedStartDate=${period.start?string("yyyy-MM-dd HH:mm:ss")}&estimatedCompletionDate=${period.end?string("yyyy-MM-dd HH:mm:ss")}${urlParam?if_exists}${addlParam?if_exists}</@ofbizUrl>">${uiLabelMap.CommonAddNew}</a> </td> <#list period.calendarEntries as calEntry> <#if calEntry.workEffort.actualStartDate?exists> Modified: ofbiz/branches/20111205EmailHandling/applications/workeffort/webapp/workeffort/calendar/month.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/workeffort/webapp/workeffort/calendar/month.ftl?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/applications/workeffort/webapp/workeffort/calendar/month.ftl (original) +++ ofbiz/branches/20111205EmailHandling/applications/workeffort/webapp/workeffort/calendar/month.ftl Mon Mar 26 20:56:02 2012 @@ -20,6 +20,10 @@ under the License. <#assign styleTd = "style='height: 8em; width: 10em; vertical-align: top; padding: 0.5em;'"> <#if periods?has_content> + <#-- Allow containing screens to specify the URL for creating a new event --> + <#if !newCalEventUrl?exists> + <#assign newCalEventUrl = parameters._LAST_VIEW_NAME_> + </#if> <table cellspacing="0" class="basic-table calendar"> <tr class="header-row"> <td width="1%"> </td> @@ -40,7 +44,7 @@ under the License. </#if> <td ${styleTd} <#if currentPeriod> class="current-period"<#else><#if (period.calendarEntries?size > 0)> class="active-period"</#if></#if>> <span class="h1"><a href='<@ofbizUrl>${parameters._LAST_VIEW_NAME_}?period=day&start=${period.start.time?string("#")}${urlParam?if_exists}${addlParam?if_exists}</@ofbizUrl>'>${period.start?date?string("d")?cap_first}</a></span> - <a class="add-new" href='<@ofbizUrl>${parameters._LAST_VIEW_NAME_}?period=month&form=edit&start=${parameters.start?if_exists}&parentTypeId=${parentTypeId?if_exists}&currentStatusId=CAL_TENTATIVE&estimatedStartDate=${period.start?string("yyyy-MM-dd HH:mm:ss")}&estimatedCompletionDate=${period.end?string("yyyy-MM-dd HH:mm:ss")}${urlParam?if_exists}${addlParam?if_exists}</@ofbizUrl>'>${uiLabelMap.CommonAddNew}</a> + <a class="add-new" href='<@ofbizUrl>${newCalEventUrl}?period=month&form=edit&start=${parameters.start?if_exists}&parentTypeId=${parentTypeId?if_exists}&currentStatusId=CAL_TENTATIVE&estimatedStartDate=${period.start?string("yyyy-MM-dd HH:mm:ss")}&estimatedCompletionDate=${period.end?string("yyyy-MM-dd HH:mm:ss")}${urlParam?if_exists}${addlParam?if_exists}</@ofbizUrl>'>${uiLabelMap.CommonAddNew}</a> <br class="clear"/> <#assign maxNumberOfPersons = 0/> Modified: ofbiz/branches/20111205EmailHandling/applications/workeffort/webapp/workeffort/calendar/week.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/workeffort/webapp/workeffort/calendar/week.ftl?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/applications/workeffort/webapp/workeffort/calendar/week.ftl (original) +++ ofbiz/branches/20111205EmailHandling/applications/workeffort/webapp/workeffort/calendar/week.ftl Mon Mar 26 20:56:02 2012 @@ -17,6 +17,10 @@ specific language governing permissions under the License. --> <#if periods?has_content> + <#-- Allow containing screens to specify the URL for creating a new event --> + <#if !newCalEventUrl?exists> + <#assign newCalEventUrl = parameters._LAST_VIEW_NAME_> + </#if> <#if (maxConcurrentEntries < 2)> <#assign entryWidth = 100> <#else> @@ -33,7 +37,7 @@ under the License. <tr<#if currentPeriod> class="current-period"<#else><#if (period.calendarEntries?size > 0)> class="active-period"</#if></#if>> <td class="centered" width="1%"> <a href="<@ofbizUrl>${parameters._LAST_VIEW_NAME_}?period=day&start=${period.start.time?string("#")}${urlParam?if_exists}${addlParam?if_exists}</@ofbizUrl>">${period.start?date?string("EEEE")?cap_first} ${period.start?date?string.short}</a><br /> - <a href="<@ofbizUrl>${parameters._LAST_VIEW_NAME_}?period=week&form=edit&start=${parameters.start?if_exists}&parentTypeId=${parentTypeId?if_exists}&currentStatusId=CAL_TENTATIVE&estimatedStartDate=${period.start?string("yyyy-MM-dd HH:mm:ss")}&estimatedCompletionDate=${period.end?string("yyyy-MM-dd HH:mm:ss")}${addlParam?if_exists}${urlParam?if_exists}</@ofbizUrl>">${uiLabelMap.CommonAddNew}</a> + <a href="<@ofbizUrl>${newCalEventUrl}?period=week&form=edit&start=${parameters.start?if_exists}&parentTypeId=${parentTypeId?if_exists}&currentStatusId=CAL_TENTATIVE&estimatedStartDate=${period.start?string("yyyy-MM-dd HH:mm:ss")}&estimatedCompletionDate=${period.end?string("yyyy-MM-dd HH:mm:ss")}${addlParam?if_exists}${urlParam?if_exists}</@ofbizUrl>">${uiLabelMap.CommonAddNew}</a> </td> <#list period.calendarEntries as calEntry> <#if calEntry.workEffort.actualStartDate?exists> Modified: ofbiz/branches/20111205EmailHandling/applications/workeffort/widget/CalendarForms.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/workeffort/widget/CalendarForms.xml?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/applications/workeffort/widget/CalendarForms.xml (original) +++ ofbiz/branches/20111205EmailHandling/applications/workeffort/widget/CalendarForms.xml Mon Mar 26 20:56:02 2012 @@ -20,6 +20,7 @@ under the License. <forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd"> + <form name="FilterCalendarEvents" type="single" target="calendar"> <field name="calendarType"> <drop-down allow-empty="false"> @@ -32,23 +33,23 @@ under the License. <field name="partyId"> <lookup target-form-name="LookupPartyName" size="16"/> </field> - <field name="workEffortTypeId"> + <field name="workEffortTypeId" title="${uiLabelMap.PartyEventType}"> <drop-down allow-empty="true"> <entity-options entity-name="WorkEffortType" description="${description}"> <entity-order-by field-name="description"/> </entity-options> </drop-down> </field> - <field name="facilityId"> + <field name="facilityId" title="${uiLabelMap.Facility}"> <drop-down allow-empty="true"> <entity-options entity-name="Facility" description="${facilityName}"> <entity-order-by field-name="facilityName"/> </entity-options> </drop-down> </field> - <field name="fixedAssetId"> + <field name="fixedAssetId" title="${uiLabelMap.AccountingFixedAsset}"> <drop-down allow-empty="true"> - <entity-options entity-name="FixedAsset" description="${fixedAssetId} - ${fixedAssetName}"> + <entity-options entity-name="FixedAsset" description="${fixedAssetName}"> <entity-order-by field-name="fixedAssetId"/> </entity-options> </drop-down> @@ -56,6 +57,7 @@ under the License. <field name="hideEvents"><check/></field> <field name="viewButton" title="${uiLabelMap.CommonView}"><submit/></field> </form> + <!-- Forms Specific to portlet --> <form name="EditCalendar" extends="CommonPortletEdit" extends-resource="component://common/widget/PortletEditForms.xml"> <field name="initialView"> @@ -67,61 +69,79 @@ under the License. </field> <field name="updateButton"><submit/></field> </form> - <form name="editCalEvent" type="single" target="createWorkEffortAndPartyAssign" default-map-name="workEffort"> - <alt-target use-when="workEffort!=null" target="updateWorkEffort"/> - <field name="workEffortId" use-when="workEffort!=null"><hidden/></field> - <field name="partyId"><hidden value="${parameters.userLogin.partyId}"/></field> - <field name="fixedAssetId"><hidden value="${parameters.fixedAssetId}"/></field> - <field name="roleTypeId" use-when="workEffort==null"><hidden value="CAL_OWNER"/></field> - <field name="statusId" use-when="workEffort==null"><hidden value="PRTYASGN_ASSIGNED"/></field> - <field name="workEffortName" title="${uiLabelMap.WorkEffortEventName}"><text/></field> - <field name="description" title="${uiLabelMap.CommonDescription}"><text/></field> - <field name="workEffortTypeId" use-when="parentTypeId!=void"> + + <form name="editCalEvent" type="single" default-map-name="workEffort"> + <actions> + <entity-condition entity-name="StatusItem" list="statusItemList"> + <condition-list combine="or"> + <condition-expr field-name="statusTypeId" value="EVENT_STATUS" /> + <condition-expr field-name="statusTypeId" value="CALENDAR_STATUS" /> + </condition-list> + </entity-condition> + <!-- Allow containing screens to specify the create and update URLs --> + <set field="createCalEventUrl" from-field="createCalEventUrl" default-value="createWorkEffortAndPartyAssign" /> + <set field="updateCalEventUrl" from-field="updateCalEventUrl" default-value="updateWorkEffort" /> + </actions> + <alt-target use-when="workEffort==null" target="${createCalEventUrl}" /> + <alt-target use-when="workEffort!=null" target="${updateCalEventUrl}" /> + <field name="workEffortId" use-when="workEffort!=null"><hidden /></field> + <field name="start"><hidden value="${parameters.start}" /></field> + <field name="partyId"><hidden value="${parameters.userLogin.partyId}" /></field> + <field name="fixedAssetId"><hidden value="${parameters.fixedAssetId}" /></field> + <field name="roleTypeId" use-when="workEffort==null"><hidden value="CAL_OWNER" /></field> + <field name="statusId" use-when="workEffort==null"><hidden value="PRTYASGN_ASSIGNED" /></field> + <field name="workEffortName" title="${uiLabelMap.WorkEffortEventName}"><text /></field> + <field name="description" title="${uiLabelMap.CommonDescription}"><text /></field> + <!-- This is wrong. A calendar item work effort type is an EVENT. "Meeting" is a work effort purpose. --> + <field name="workEffortTypeId" use-when="parentTypeId!=void" title="${uiLabelMap.PartyEventType}"> <drop-down no-current-selected-key="MEETING"> <entity-options entity-name="WorkEffortType" description="${description}"> - <entity-constraint name="parentTypeId" env-name="parentTypeId"/> - <entity-order-by field-name="description"/> + <entity-constraint name="parentTypeId" env-name="parentTypeId" /> + <entity-order-by field-name="description" /> </entity-options> </drop-down> </field> - <field name="workEffortTypeId" use-when="parentTypeId==void"> + <field name="workEffortTypeId" use-when="parentTypeId==void" title="${uiLabelMap.PartyEventType}"> <drop-down> <entity-options entity-name="WorkEffortType" description="${description}"> - <entity-order-by field-name="description"/> + <entity-order-by field-name="description" /> </entity-options> </drop-down> </field> - <field name="currentStatusId" use-when="workEffort!=null"> - <display-entity entity-name="StatusItem" description="${description}" key-field-name="statusId"/> + <field name="currentStatusId" title="${uiLabelMap.CommonStatus}"> + <drop-down no-current-selected-key="CAL_TENTATIVE"> + <list-options key-name="statusId" list-name="statusItemList" description="${description}" /> + </drop-down> </field> - <field name="currentStatusId" use-when="workEffort==null"><hidden value="CAL_TENTATIVE"/></field> <field name="scopeEnumId"> <drop-down no-current-selected-key="WES_PRIVATE"> <entity-options entity-name="Enumeration" key-field-name="enumId" description="${description}"> - <entity-constraint name="enumTypeId" value="WORK_EFF_SCOPE"/> - <entity-order-by field-name="description"/> + <entity-constraint name="enumTypeId" value="WORK_EFF_SCOPE" /> + <entity-order-by field-name="description" /> </entity-options> </drop-down> </field> - <field name="estimatedStartDate"><date-time input-method="time-dropdown" default-value="${workEffort.estimatedStartDate}" /></field> - <field name="estimatedCompletionDate"><date-time input-method="time-dropdown" default-value="${workEffort.estimatedCompletionDate}"/></field> - <field name="actualStartDate" use-when="parentWorkEffortId!=null"><display type="date-time"/></field> - <field name="actualCompletionDate" use-when="parentWorkEffortId!=null"><display type="date-time"/></field> - <field name="addButton" use-when="workEffort==null"><submit/></field> - <field name="updateButton" use-when="workEffort!=null"><submit/></field> + <field name="estimatedStartDate"><date-time input-method="time-dropdown" /></field> + <field name="estimatedCompletionDate"><date-time input-method="time-dropdown" /></field> + <field name="actualStartDate" use-when="workEffort!=null"><date-time input-method="time-dropdown" /></field> + <field name="actualCompletionDate" use-when="workEffort!=null"><date-time input-method="time-dropdown" /></field> + <field name="addButton" use-when="workEffort==null"><submit /></field> + <field name="updateButton" use-when="workEffort!=null"><submit /></field> </form> + <form name="cancelEvent" type="single" target="updateWorkEffort"> <field name="workEffortId"><hidden value="${parameters.workEffortId}"/></field> <field name="currentStatusId"><hidden value="CAL_CANCELLED"/></field> <field name="cancel" title="${uiLabelMap.WorkEffortCancelCalendarEvent}"><submit/></field> </form> + <form name="showCalEvent" type="single" default-map-name="workEffort"> <field name="workEffortName" title="${uiLabelMap.WorkEffortEventName}"><display/></field> <field name="description" title="${uiLabelMap.CommonDescription}"><display/></field> - <field name="workEffortTypeId"> + <field name="workEffortTypeId" title="${uiLabelMap.PartyEventType}"> <display-entity entity-name="WorkEffortType" description="${description}"/> </field> - <field name="currentStatusId" use-when="workEffort!=null"> + <field name="currentStatusId" title="${uiLabelMap.CommonStatus}"> <display-entity entity-name="StatusItem" description="${description}" key-field-name="statusId"/> </field> <field name="scopeEnumId"> @@ -129,9 +149,10 @@ under the License. </field> <field name="estimatedStartDate"><display type="date-time"></display></field> <field name="estimatedCompletionDate"><display type="date-time"></display></field> - <field name="actualStartDate" use-when="parentWorkEffortId!=null"><display type="date-time"/></field> - <field name="actualCompletionDate" use-when="parentWorkEffortId!=null"><display type="date-time"/></field> + <field name="actualStartDate"><display type="date-time"/></field> + <field name="actualCompletionDate"><display type="date-time"/></field> </form> + <form name="showCalEventRoles" type="list" list-name="roles" odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar"> <actions> Modified: ofbiz/branches/20111205EmailHandling/applications/workeffort/widget/CalendarScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/workeffort/widget/CalendarScreens.xml?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/applications/workeffort/widget/CalendarScreens.xml (original) +++ ofbiz/branches/20111205EmailHandling/applications/workeffort/widget/CalendarScreens.xml Mon Mar 26 20:56:02 2012 @@ -50,7 +50,7 @@ under the License. <widgets> <include-screen name="eventDetail"/> <container style="bothclear"> - <screenlet title="${uiLabelMap.WorkEffortDayView}: ${bsh:org.ofbiz.base.util.UtilDateTime.timeStampToString(start, "EEEE MMMM d, yyyy", timeZone, locale)}" navigation-menu-name="Day"> + <screenlet title="${uiLabelMap.WorkEffortDayView}: ${bsh:org.ofbiz.base.util.UtilDateTime.timeStampToString(start, "EEEE MMMM d, yyyy", timeZone, locale)}" navigation-menu-name="Day" padded="false"> <include-menu name="Day" location="component://workeffort/widget/WorkEffortMenus.xml"/> <platform-specific> <html><html-template location="component://workeffort/webapp/workeffort/calendar/day.ftl"/></html> @@ -72,7 +72,7 @@ under the License. <widgets> <include-screen name="eventDetail"/> <container style="bothclear"> - <screenlet title="${uiLabelMap.WorkEffortWeekView}: ${uiLabelMap.CommonWeek} ${bsh:org.ofbiz.base.util.UtilDateTime.timeStampToString(start, "w", timeZone, locale)}" navigation-menu-name="Week"> + <screenlet title="${uiLabelMap.WorkEffortWeekView}: ${uiLabelMap.CommonWeek} ${bsh:org.ofbiz.base.util.UtilDateTime.timeStampToString(start, "w", timeZone, locale)}" navigation-menu-name="Week" padded="false"> <include-menu name="Week" location="component://workeffort/widget/WorkEffortMenus.xml"/> <platform-specific> <html><html-template location="component://workeffort/webapp/workeffort/calendar/week.ftl"/></html> @@ -91,7 +91,7 @@ under the License. <widgets> <include-screen name="eventDetail"/> <container style="bothclear"> - <screenlet title="${uiLabelMap.WorkEffortMonthView}: ${bsh:org.ofbiz.base.util.UtilDateTime.timeStampToString(start, "MMMM yyyy", timeZone, locale)}" navigation-menu-name="Month"> + <screenlet title="${uiLabelMap.WorkEffortMonthView}: ${bsh:org.ofbiz.base.util.UtilDateTime.timeStampToString(start, "MMMM yyyy", timeZone, locale)}" navigation-menu-name="Month" padded="false"> <include-menu name="Month" location="component://workeffort/widget/WorkEffortMenus.xml"/> <platform-specific> <html><html-template location="component://workeffort/webapp/workeffort/calendar/month.ftl"/></html> @@ -140,88 +140,96 @@ under the License. </section> </screen> - <screen name="eventDetail"> <section> + <condition> + <if-compare field="parameters.form" operator="equals" value="edit" /> + </condition> <actions> - <entity-one entity-name="WorkEffort" value-field="workEffort"/> - <script location="component://workeffort/script/isCalOwner.groovy"/> + <entity-one entity-name="WorkEffort" value-field="workEffort" /> </actions> <widgets> <section> - <condition><!-- check if need to display detail screen --> - <and> - <if-compare field="parameters.form" operator="equals" value="edit"/> - <or> - <and> - <not><if-empty field="workEffort"/></not> - <if-compare field="workEffort.currentStatusId" operator="not-equals" value="CAL_CANCELLED"/> - </and> - <if-empty field="workEffort"/> - </or> - </and> + <condition> + <not><if-empty field="workEffort" /></not> + </condition> + <actions> + <script location="component://workeffort/script/isCalOwner.groovy" /> + </actions> + <widgets /> + </section> + <section> + <condition> + <or> + <and> + <not><if-empty field="workEffort" /></not> + <if-compare field="workEffort.currentStatusId" operator="not-equals" value="CAL_CANCELLED" /> + <if-compare field="isCalOwner" operator="equals" value="true" type="Boolean" /> + </and> + <if-empty field="workEffort" /> + <if-has-permission permission="WORKEFFORTMGR" action="ADMIN" /> + </or> + </condition> + <actions> + <set field="useEditForm" value="true" /> + </actions> + <widgets /> + </section> + <section> + <condition> + <if-compare field="useEditForm" operator="equals" value="true" /> </condition> <widgets> - <section><!-- check if edit form needs to be shown, otherwise show view only form --> - <condition> - <and> - <or> - <if-compare field="isCalOwner" operator="equals" value="true" type="Boolean"/> - <if-has-permission permission="WORKEFFORTMGR" action="ADMIN"/> - </or> - <if-compare field="workEffort.currentStatusId" operator="not-equals" value="PTS_COMPLETED"/> - </and> - </condition> - <widgets><!-- edit section --> - <container style="lefthalf" > - <screenlet title="${uiLabelMap.WorkEffortAddCalendarEvent}"> - <section> - <condition> - <not><if-empty field="workEffort"/></not> - </condition> - <widgets> - <include-form name="cancelEvent" location="component://workeffort/widget/CalendarForms.xml"/> - </widgets> - </section> - <include-form name="editCalEvent" location="component://workeffort/widget/CalendarForms.xml"/> - </screenlet> - </container> - <container style="righthalf"> - <screenlet title="${uiLabelMap.WorkEffortParticipants}"> - <include-form name="showCalEventRolesDel" location="component://workeffort/widget/CalendarForms.xml"/> - <section> - <condition> - <and> - <not><if-empty field="workEffort"/></not> - <if-compare field="workEffortTypeId" operator="not-equals" value="WES_PUBLIC"/> - </and> - </condition> - <widgets> - <include-form name="addCalEventRole" location="component://workeffort/widget/CalendarForms.xml"/> - </widgets> - </section> - </screenlet> - </container> - <container style="clear"/> - </widgets> - <fail-widgets><!-- view section --> - <container style="lefthalf"> - <screenlet title="${uiLabelMap.WorkEffortSummary}"> - <include-form name="showCalEvent" location="component://workeffort/widget/CalendarForms.xml"/> - </screenlet> - </container> - <container style="righthalf"> - <screenlet title="${uiLabelMap.WorkEffortParticipants}"> - <include-form name="showCalEventRoles" location="component://workeffort/widget/CalendarForms.xml"/> - </screenlet> - </container> - </fail-widgets> - </section> - </widgets> + <container style="lefthalf"> + <screenlet title="${uiLabelMap.WorkEffortAddCalendarEvent}"> + <section> + <condition> + <not><if-empty field="workEffort" /></not> + </condition> + <widgets> + <include-form name="cancelEvent" location="component://workeffort/widget/CalendarForms.xml" /> + </widgets> + </section> + <include-form name="editCalEvent" location="component://workeffort/widget/CalendarForms.xml" /> + </screenlet> + </container> + <container style="righthalf"> + <screenlet title="${uiLabelMap.WorkEffortParticipants}"> + <include-form name="showCalEventRolesDel" location="component://workeffort/widget/CalendarForms.xml" /> + <section> + <condition> + <and> + <not><if-empty field="workEffort" /></not> + <!-- Commenting this out because it doesn't make any sense. + <if-compare field="workEffortTypeId" operator="not-equals" value="WES_PUBLIC" /> + --> + </and> + </condition> + <widgets> + <include-form name="addCalEventRole" location="component://workeffort/widget/CalendarForms.xml" /> + </widgets> + </section> + </screenlet> + </container> + <container style="clear" /> + </widgets> + <fail-widgets> + <container style="lefthalf"> + <screenlet title="${uiLabelMap.WorkEffortSummary}"> + <include-form name="showCalEvent" location="component://workeffort/widget/CalendarForms.xml" /> + </screenlet> + </container> + <container style="righthalf"> + <screenlet title="${uiLabelMap.WorkEffortParticipants}"> + <include-form name="showCalEventRoles" location="component://workeffort/widget/CalendarForms.xml" /> + </screenlet> + </container> + </fail-widgets> </section> </widgets> </section> </screen> + <screen name="calendarEventContent"> <section> <actions> Modified: ofbiz/branches/20111205EmailHandling/applications/workeffort/widget/CommonScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/workeffort/widget/CommonScreens.xml?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/applications/workeffort/widget/CommonScreens.xml (original) +++ ofbiz/branches/20111205EmailHandling/applications/workeffort/widget/CommonScreens.xml Mon Mar 26 20:56:02 2012 @@ -149,27 +149,23 @@ under the License. <screen name="CommonCalendarDecorator"> <section> <actions> - <set field="headerItem" value="calendar"/> + <set field="headerItem" value="calendar" /> </actions> <widgets> <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}"> <decorator-section name="body"> <section> <condition> - <if-has-permission permission="WORKEFFORTMGR" action="_VIEW"/> + <if-has-permission permission="WORKEFFORTMGR" action="_VIEW" /> </condition> <actions> - <script location="component://workeffort/webapp/workeffort/WEB-INF/actions/calendar/Days.groovy"/> + <script location="component://workeffort/webapp/workeffort/WEB-INF/actions/calendar/Days.groovy" /> </actions> <widgets> - <decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml"> - <decorator-section name="search-options"> - <include-form name="FilterCalendarEvents" location="component://workeffort/widget/CalendarForms.xml"/> - </decorator-section> - <decorator-section name="search-results"> - <decorator-section-include name="body"/> - </decorator-section> - </decorator-screen> + <screenlet id="calendarOptions" name="calendarOptionsScreenlet" collapsible="true" title="${uiLabelMap.WorkEffortCalendarFindEntries}"> + <include-form name="FilterCalendarEvents" location="component://workeffort/widget/CalendarForms.xml" /> + </screenlet> + <decorator-section-include name="body" /> </widgets> <fail-widgets> <label style="h3">${uiLabelMap.WorkEffortViewPermissionError}</label> Modified: ofbiz/branches/20111205EmailHandling/build.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/build.xml?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/build.xml (original) +++ ofbiz/branches/20111205EmailHandling/build.xml Mon Mar 26 20:56:02 2012 @@ -20,10 +20,12 @@ under the License. <project name="OFBiz Main Build" default="build" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant" - xmlns:sonar="antlib:org.sonar.ant"> + xmlns:sonar="antlib:org.sonar.ant:sonar"> <import file="macros.xml"/> <property name="site.dir" value="../site"/> + <property name="ofbiz.admin.port" value="10523"/> + <property name="ofbiz.admin.key" value="so3du5kasd5dn"/> <property name="memory.initial.param" value="-Xms128M"/> <property name="memory.max.param" value="-Xmx512M"/> <property name="pos.memory.max.param" value="-Xmx512M"/> @@ -49,9 +51,9 @@ under the License. </taskdef> </target> <target name="sonar-init"> - <taskdef uri="antlib:org.sonar.ant" resource="org/sonar/ant/antlib.xml"> + <taskdef uri="antlib:org.sonar.ant:sonar" resource="org/sonar/ant/antlib.xml"> <classpath> - <pathelement location="framework/base/lib/sonar-ant-task-1.0.jar" /> + <pathelement location="framework/base/lib/sonar-ant-task-1.3.jar" /> </classpath> </taskdef> </target> @@ -91,7 +93,7 @@ under the License. </delete> </target> <target name="clean-data" - description="Clean all DB data (Derby and HSQL) under runtime/data"> + description="Clean all DB data (Derby) under runtime/data"> <subant target="clean-data"> <filelist dir="." files="framework/build.xml"/> </subant> @@ -278,7 +280,6 @@ under the License. <fileset dir="${ofbiz.home.dir}/framework/testtools/lib" includes="*.jar"/> <fileset dir="${ofbiz.home.dir}/framework/webapp/lib" includes="*.jar"/> <fileset dir="${ofbiz.home.dir}/framework/webapp/build/lib" includes="*.jar"/> - <fileset dir="${ofbiz.home.dir}/framework/webslinger/lib" includes="*.jar"/> <fileset dir="${ofbiz.home.dir}/specialpurpose/ebaystore/lib" includes="*.jar"/> <fileset dir="${ofbiz.home.dir}/specialpurpose/googlecheckout/lib" includes="*.jar"/> <fileset dir="${ofbiz.home.dir}/specialpurpose/ldap/lib" includes="*.jar"/> @@ -312,10 +313,11 @@ under the License. <!-- ================================================================== --> <target name="build-website" - description="For committers : Update dtds and JavaDoc from OFBiz instance to site"> + description="For committers : Update dtds from OFBiz instance to site"> <antcall target="copy-dtds"/> + <!-- now deprecated since Builbot creates and updates those automatically <antcall target="docs"/> - <antcall target="copy-apis"/> + <antcall target="copy-apis"/--> </target> <target name="copy-apis"> @@ -360,7 +362,7 @@ under the License. </target> <!-- ================================================================== --> - <!-- Start OFBiz --> + <!-- Start and Stop OFBiz --> <!-- ================================================================== --> <target name="run" @@ -369,6 +371,30 @@ under the License. <jvmarg value="${memory.initial.param}"/> <jvmarg value="${pos.memory.max.param}"/> <jvmarg value="${memory.maxpermsize.param}"/> + <sysproperty key="ofbiz.admin.port" value="${ofbiz.admin.port}"/> + <sysproperty key="ofbiz.admin.key" value="${ofbiz.admin.key}"/> + </java> + </target> + <target name="stop" + description="This will stop OFBiz"> + <java jar="ofbiz.jar" fork="true"> + <sysproperty key="ofbiz.admin.port" value="${ofbiz.admin.port}"/> + <sysproperty key="ofbiz.admin.key" value="${ofbiz.admin.key}"/> + <arg value="-shutdown"/> + </java> + </target> + <target name="run-debug" depends="build" + description="Starts OFBiz in debugging mode"> + <java jar="ofbiz.jar" fork="true"> + <jvmarg value="${memory.initial.param}"/> + <jvmarg value="${memory.max.param}"/> + <jvmarg value="${memory.maxpermsize.param}"/> + <jvmarg value="-Xnoagent"/> + <jvmarg value="-Djava.compiler=NONE"/> + <jvmarg value="-Xdebug"/> + <jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8091"/> + <sysproperty key="ofbiz.admin.port" value="${ofbiz.admin.port}"/> + <sysproperty key="ofbiz.admin.key" value="${ofbiz.admin.key}"/> </java> </target> <target name="run-pos" @@ -380,6 +406,11 @@ under the License. <arg value="pos"/> </java> </target> + + <!-- ================================================================== --> + <!-- Setup OFBiz Data --> + <!-- ================================================================== --> + <target name="run-install" depends="build" description="This loads all configured data; meant for generic OFBiz development, testing, demonstration, etc purposes"> <java jar="ofbiz.jar" fork="true"> @@ -453,7 +484,7 @@ under the License. </java> </target> <target name="run-install-file" depends="build" - description="This loads data using the command line argument 'file' to load data from a given file"> + description="This loads data using the command line argument 'data-file' to load data from a given file using the default delegator"> <java jar="ofbiz.jar" fork="true"> <jvmarg value="${memory.initial.param}"/> <jvmarg value="${memory.max.param}"/> @@ -463,6 +494,17 @@ under the License. <arg value="file=${data-file}"/> </java> </target> + <target name="run-install-file-in-delegator" depends="build" + description="This loads data using the command line argument 'data-file' to load data from a given file to the command line argument 'delegator'"> + <java jar="ofbiz.jar" fork="true"> + <jvmarg value="${memory.initial.param}"/> + <jvmarg value="${memory.max.param}"/> + <jvmarg value="${memory.maxpermsize.param}"/> + <arg value="install"/> + <arg value="delegator=${delegator}"/> + <arg value="file=${data-file}"/> + </java> + </target> <!-- ================================= target: run-install-tenant ================================= --> @@ -826,18 +868,6 @@ under the License. <antcall target="load-admin-user-login"/> </target> - <target name="run-debug" depends="build" - description="Starts OFBiz in debugging mode"> - <java jar="ofbiz.jar" fork="true"> - <jvmarg value="${memory.initial.param}"/> - <jvmarg value="${memory.max.param}"/> - <jvmarg value="${memory.maxpermsize.param}"/> - <jvmarg value="-Xnoagent"/> - <jvmarg value="-Djava.compiler=NONE"/> - <jvmarg value="-Xdebug"/> - <jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8091"/> - </java> - </target> <target name="run-tests" depends="build" description="Run OFBiz default tests, execute ant run-install before and see results in runtime/logs/test-results/html/all-tests.html."> <java jar="ofbiz.jar" fork="true" resultproperty="test.result"> @@ -936,8 +966,8 @@ under the License. <taskdef resource="tasks.properties"> <classpath> <fileset dir="framework/base/lib"> - <include name="cobertura-1.9.3.jar" /> - <include name="log4j-1.2.15.jar" /> + <include name="cobertura-1.9.4.1.jar" /> + <include name="log4j-1.2.16.jar" /> <include name="scripting/asm*.jar" /> </fileset> </classpath> @@ -964,8 +994,8 @@ under the License. <taskdef resource="tasks.properties"> <classpath> <fileset dir="framework/base/lib"> - <include name="cobertura-1.9.3.jar" /> - <include name="log4j-1.2.15.jar" /> + <include name="cobertura-1.9.4.1.jar" /> + <include name="log4j-1.2.16.jar" /> <include name="scripting/asm*.jar" /> </fileset> </classpath> @@ -991,67 +1021,39 @@ under the License. <arg value="--xml"/> </exec> <xmlproperty file="runtime/svninfo_tmp.xml"/> - <sonar:sonar workDir="runtime/sonar" key="org.apache:ofbiz" version="${info.entry.commit(revision)}"> - <sources> - <!--framework--> - <path location="framework/appserver/src" /> - <path location="framework/base/src" /> - <path location="framework/bi/src" /> - <path location="framework/catalina/src" /> - <path location="framework/common/src" /> - <path location="framework/datafile/src" /> - <path location="framework/entity/src" /> - <path location="framework/entityext/src" /> - <path location="framework/example/src" /> - <path location="framework/geronimo/src" /> - <path location="framework/guiapp/src" /> - <path location="framework/jetty/src" /> - <path location="framework/minilang/src" /> - <path location="framework/security/src" /> - <path location="framework/service/src" /> - <path location="framework/sql/src" /> - <path location="framework/start/src" /> - <path location="framework/testtools/src" /> - <path location="framework/webapp/src" /> - <path location="framework/webslinger/src" /> - <path location="framework/webtools/src" /> - <path location="framework/widget/src" /> - <!--applications--> - <path location="applications/accounting/src" /> - <path location="applications/commonext/src" /> - <path location="applications/content/src" /> - <path location="applications/humanres/src" /> - <path location="applications/manufacturing/src" /> - <path location="applications/marketing/src" /> - <path location="applications/order/src" /> - <path location="applications/party/src" /> - <path location="applications/product/src" /> - <path location="applications/securityext/src" /> - <path location="applications/workeffort/src" /> - <!--specialpurpose--> - <path location="specialpurpose/assetmaint/src" /> - <path location="specialpurpose/ebay/src" /> - <path location="specialpurpose/ebaystore/src" /> - <path location="specialpurpose/ecommerce/src" /> - <path location="specialpurpose/googlebase/src" /> - <path location="specialpurpose/googlecheckout/src" /> - <path location="specialpurpose/hhfacility/src" /> - <path location="specialpurpose/oagis/src" /> - <path location="specialpurpose/pos/src" /> - </sources> - <property key="sonar.dynamicAnalysis" value="reuseReports" /> - <property key="sonar.cobertura.reportPath" value="runtime/logs/cobertura-report/coverage.xml"/> - <property key="sonar.java.source" value="1.6" /> - <property key="sonar.java.target" value="1.6" /> - <property key="sonar.jdbc.url" - value="jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8" /> - <property key="sonar.jdbc.driverClassName" value="com.mysql.jdbc.Driver" /> - <property key="sonar.jdbc.username" value="${sonar.jdbc.username}" /> - <property key="sonar.jdbc.password" value="${sonar.jdbc.password}" /> - - <!-- SERVER ON A REMOTE HOST --> - <property key="sonar.host.url" value="${sonar.host.url}" /> - </sonar:sonar> + + <property name="sonar.sources" value="framework/appserver/src, framework/base/src, framework/bi/src, framework/birt/src, + framework/catalina/src, framework/common/src, framework/datafile/src, framework/entity/src, framework/entityext/src, + framework/example/src, framework/geronimo/src, framework/guiapp/src, framework/jetty/src, framework/jcr/src, + framework/minilang/src, framework/security/src, framework/service/src, framework/sql/src, framework/start/src, + framework/testtools/src, framework/webapp/src, framework/webtools/src, framework/widget/src, + applications/accounting/src, applications/commonext/src, applications/content/src, applications/humanres/src, + applications/manufacturing/src, applications/marketing/src, applications/order/src, applications/party/src, + applications/product/src, applications/securityext/src, applications/workeffort/src, specialpurpose/assetmaint/src, + specialpurpose/ebay/src, specialpurpose/ebaystore/src, specialpurpose/ecommerce/src, specialpurpose/googlebase/src, + specialpurpose/googlecheckout/src, specialpurpose/hhfacility/src, specialpurpose/oagis/src, specialpurpose/pos/src, + specialpurpose/scrum/src" /> + <property name="sonar.tests" value="framework/base/src/org/ofbiz/base/test, framework/entity/src/org/ofbiz/entity/test, + framework/jcr/src/org/ofbiz/jcr/test, framework/service/src/org/ofbiz/service/test, framework/sql/src/org/ofbiz/sql/test, + applications/accounting/src/org/ofbiz/accounting/test, applications/content/src/org/ofbiz/content/test, + applications/product/src/org/ofbiz/product/test, applications/product/src/org/ofbiz/shipment/test, + applications/securityext/src/org/ofbiz/securityext/test" /> + + <!-- list of optional Sonar properties --> + <property name="sonar.projectName" value="Apache OFBiz" /> + <sonar:sonar key="org.apache:ofbiz" version="${info.entry.commit(revision)}" xmlns:sonar="antlib:org.sonar.ant:sonar"/> + <property name="sonar.dynamicAnalysis" value="reuseReports" /> + <property name="sonar.cobertura.reportPath" value="runtime/logs/cobertura-report/coverage.xml"/> + <property name="sonar.java.source" value="1.6" /> + <property name="sonar.java.target" value="1.6" /> + <property name="sonar.jdbc.url" + value="jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8" /> + <property name="sonar.jdbc.driverClassName" value="com.mysql.jdbc.Driver" /> + <property name="sonar.jdbc.username" value="${sonar.jdbc.username}" /> + <property name="sonar.jdbc.password" value="${sonar.jdbc.password}" /> + + <!-- SERVER ON A REMOTE HOST --> + <property name="sonar.host.url" value="${sonar.host.url}" /> </target> <target name="full-sonar"> Modified: ofbiz/branches/20111205EmailHandling/common.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/common.xml?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/common.xml (original) +++ ofbiz/branches/20111205EmailHandling/common.xml Mon Mar 26 20:56:02 2012 @@ -135,7 +135,7 @@ under the License. <classpath> <fileset dir="${ofbiz.home.dir}/framework/base/lib"> <include name="cobertura-1.9.3.jar" /> - <include name="log4j-1.2.15.jar" /> + <include name="log4j-1.2.16.jar" /> </fileset> <fileset dir="${ofbiz.home.dir}/framework/base/lib/scripting"> <include name="asm-3.2.jar" /> Modified: ofbiz/branches/20111205EmailHandling/framework/base/config/both-containers.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/framework/base/config/both-containers.xml?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/framework/base/config/both-containers.xml (original) +++ ofbiz/branches/20111205EmailHandling/framework/base/config/both-containers.xml Mon Mar 26 20:56:02 2012 @@ -26,9 +26,6 @@ under the License. <!-- load the cached classloader container (always second) --> <container name="classloader-container" class="org.ofbiz.base.container.ClassLoaderContainer"/> - <container name="commons-vfs-container" class="org.ofbiz.commons.vfs.CommonsVfsContainer"/> - <container name="webslinger-container" class="org.ofbiz.webslinger.WebslingerContainer"/> - <!-- load JNDI/JOTM; this is no longer needed, leaving this in for now just in case someone wants to drop in JOTM from the specialized directory <container name="jotm-container" class="org.ofbiz.jotm.container.JotmContainer"> <property name="jndi-config" value="iiop.properties"/> @@ -93,9 +90,6 @@ under the License. --> <!-- load catalina (tomcat) and all web applications --> - <!-- TODO: switch to webslinger, for per-site logging - <container name="catalina-container" class="org.ofbiz.webslinger.WebslingerCatalinaContainer"> - --> <container name="catalina-container" class="org.ofbiz.catalina.container.CatalinaContainer"> <!-- static configuration for tomcat --> <property name="delegator-name" value="default"/> Modified: ofbiz/branches/20111205EmailHandling/framework/base/config/cache.properties URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/framework/base/config/cache.properties?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/framework/base/config/cache.properties (original) +++ ofbiz/branches/20111205EmailHandling/framework/base/config/cache.properties Mon Mar 26 20:56:02 2012 @@ -70,7 +70,7 @@ minilang.SimpleMethodsURL.expireTime=100 script.BshLocationParsedCache.expireTime=10000 script.BshBsfParsedCache.expireTime=10000 - +script.ParsedScripts.expireTime=10000 script.GroovyLocationParsedCache.expireTime=10000 # Uncomment this for more flexibility with service changes. Modified: ofbiz/branches/20111205EmailHandling/framework/base/config/jetty-containers.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/framework/base/config/jetty-containers.xml?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/framework/base/config/jetty-containers.xml (original) +++ ofbiz/branches/20111205EmailHandling/framework/base/config/jetty-containers.xml Mon Mar 26 20:56:02 2012 @@ -19,21 +19,17 @@ under the License. --> <ofbiz-containers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-containers.xsd"> + xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-containers.xsd"> + <!-- load the ofbiz component container (always first) --> <container name="component-container" class="org.ofbiz.base.container.ComponentContainer"/> <!-- load the cached classloader container (always second) --> <container name="classloader-container" class="org.ofbiz.base.container.ClassLoaderContainer"/> - <!-- load JNDI/JOTM; this is no longer needed, leaving this in for now just in case someone wants to drop in JOTM from the specialized directory - <container name="jotm-container" class="org.ofbiz.jotm.container.JotmContainer"> - <property name="jndi-config" value="iiop.properties"/> - </container> - --> - <!-- load the naming (JNDI) server --> <container name="naming-container" class="org.ofbiz.base.container.NamingServiceContainer"> + <property name="host" value="0.0.0.0"/> <property name="port" value="1099"/> </container> @@ -52,105 +48,54 @@ under the License. <property name="ssl-client-auth" value="false"/> </container> - <!-- JavaMail Listener Container - Triggers MCA Rules --> - <!-- if delete-mail is set to true, will delete messages after fetching them. otherwise, will try to mark them as seen - mail.store.protocol supports both imap and pop3, but pop3 will not be able to mark messages as seen, so you would need to delete them - Sounds like mail.store.protocol value should be "imaps" for GMail inbound emails to work. - Not tested found here https://sourceforge.net/forum/message.php?msg_id=5879468 --> - <!-- To use the mail listerner just uncomment and go... - <container name="javamail-container" class="org.ofbiz.service.mail.JavaMailContainer"> - <property name="delegator-name" value="default"/> - <property name="dispatcher-name" value="JavaMailDispatcher"/> - <property name="run-as-user" value="system"/> - <property name="poll-delay" value="300000"/> - <property name="delete-mail" value="false"/> - <property name="maxSize" value="100000"/> - <property name="default-listener" value="store-listener"> - <property name="mail.store.protocol" value="imap"/> - <property name="mail.host" value="[host]"/> - <property name="mail.user" value="[user]"/> - <property name="mail.pass" value="[pass]"/> - <property name="mail.debug" value="false"/> - </property> - </container> - --> - - <!-- load Shark Workflow Engine --> - <!-- NOTE: before uncommenting this please see the instructions in the ofbiz/OPTIONAL_LIBRARIES file. - <container name="shark-container" class="org.ofbiz.shark.container.SharkContainer"> - <property name="engine-name" value="Shark"/> - <property name="delegator-name" value="default"/> - <property name="dispatcher-name" value="WFDispatcher"/> - <property name="admin-user" value="system"/> - <property name="admin-pass" value="ofbiz"/> - <property name="iiop-host" value="127.0.0.1"/> - <property name="iiop-port" value="2000"/> - </container> - --> - <!-- load jetty and all web applications --> <container name="jetty-container" class="org.ofbiz.jetty.container.JettyContainer"> - <property name="default-server"> + <property name="default-server" value="server"> <property name="send-server-version" value="false"/> - <property name="http-listener" value="connector"> + <!-- thread pool config --> + <property name="min-threads" value="5"/> + <property name="max-threads" value="100"/> + <property name="max-idle-time-ms" value="30000"/> + <property name="max-stop-time-ms" value="5000"/> + <!-- connectors --> + <!-- + <property name="http-connector" value="connector"> <property name="type" value="http"/> <property name="host" value="0.0.0.0"/> <property name="port" value="8080"/> - <property name="min-threads" value="5"/> - <property name="max-threads" value="100"/> - <property name="max-idle-time" value="30000"/> - <property name="low-threads" value="0"/> - <property name="low-resource-max-idle-time" value="5000"/> </property> - <property name="https-listener" value="connector"> + <property name="https-connector" value="connector"> <property name="type" value="https"/> <property name="host" value="0.0.0.0"/> <property name="port" value="8443"/> - <property name="min-threads" value="5"/> - <property name="max-threads" value="100"/> - <property name="max-idle-time" value="30000"/> - <property name="low-threads" value="0"/> - <property name="low-resource-max-idle-time" value="5000"/> <property name="keystore" value="framework/base/config/ofbizssl.jks"/> <property name="password" value="changeit"/> <property name="key-password" value="changeit"/> <property name="client-auth" value="false"/> </property> - <!-- - <property name="nio-http-listener" value="connector"> + --> + <property name="nio-http-connector" value="connector"> <property name="type" value="http"/> <property name="host" value="0.0.0.0"/> <property name="port" value="8080"/> - <property name="min-threads" value="5"/> - <property name="max-threads" value="100"/> - <property name="max-idle-time" value="30000"/> - <property name="low-threads" value="0"/> - <property name="low-resource-max-idle-time" value="5000"/> </property> - <property name="nio-https-listener" value="connector"> + <property name="nio-https-connector" value="connector"> <property name="type" value="https"/> <property name="host" value="0.0.0.0"/> <property name="port" value="8443"/> - <property name="min-threads" value="5"/> - <property name="max-threads" value="100"/> - <property name="max-idle-time" value="30000"/> - <property name="low-threads" value="0"/> - <property name="low-resource-max-idle-time" value="5000"/> <property name="keystore" value="framework/base/config/ofbizssl.jks"/> <property name="password" value="changeit"/> <property name="key-password" value="changeit"/> <property name="client-auth" value="false"/> </property> - <property name="ajp13-listener" value="connector"> + <!-- + <property name="ajp13-connector" value="connector"> <property name="type" value="ajp13"/> <property name="host" value="0.0.0.0"/> <property name="port" value="8009"/> - <property name="min-threads" value="5"/> - <property name="max-threads" value="100"/> - <property name="max-idle-time" value="30000"/> - <property name="buffer-size" value="8192"/> </property> --> + <!-- request logs --> <property name="request-log" value="request-log"> <property name="filename" value="runtime/logs/yyyy_mm_dd.request.log"/> <property name="append" value="true"/> @@ -161,10 +106,4 @@ under the License. </property> </container> - <!-- load BeanShell remote telnet server --> - <container name="beanshell-container" class="org.ofbiz.base.container.BeanShellContainer"> - <!-- the port below and port-1 will be opened by beanshell --> - <property name="telnet-port" value="9990"/> - <property name="app-name" value="OFBiz"/> - </container> </ofbiz-containers> Modified: ofbiz/branches/20111205EmailHandling/framework/base/config/ofbiz-containers.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/framework/base/config/ofbiz-containers.xml?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/framework/base/config/ofbiz-containers.xml (original) +++ ofbiz/branches/20111205EmailHandling/framework/base/config/ofbiz-containers.xml Mon Mar 26 20:56:02 2012 @@ -26,9 +26,6 @@ under the License. <!-- load the cached classloader container (always second) --> <container name="classloader-container" class="org.ofbiz.base.container.ClassLoaderContainer"/> - <container name="commons-vfs-container" class="org.ofbiz.commons.vfs.CommonsVfsContainer"/> - <container name="webslinger-container" class="org.ofbiz.webslinger.WebslingerContainer"/> - <!-- load JNDI/JOTM; this is no longer needed, leaving this in for now just in case someone wants to drop in JOTM from the specialized directory <container name="jotm-container" class="org.ofbiz.jotm.container.JotmContainer"> <property name="jndi-config" value="iiop.properties"/> @@ -90,10 +87,14 @@ under the License. </container> --> + <!-- Load embedded Jackrabbit content repository. Since this container depends + upon JNDI, it must be started after the naming-container container.--> + <container name="jcr-container" class="org.ofbiz.jcr.loader.JCRContainer"> + <property name="configFilePath" value="framework/jcr/config/jcr-config.xml"/> + <property name="removeOnShutdown" value="false"/> + </container> + <!-- load catalina (tomcat) and all web applications --> - <!-- TODO: switch to webslinger, for per-site logging - <container name="catalina-container" class="org.ofbiz.webslinger.WebslingerCatalinaContainer"> - --> <container name="catalina-container" class="org.ofbiz.catalina.container.CatalinaContainer"> <!-- static configuration for tomcat --> <property name="delegator-name" value="default"/> @@ -255,11 +256,7 @@ under the License. </container> <!-- load the BIRT container --> - <container name="birt-container" class="org.ofbiz.birt.container.BirtContainer"> - <property name="delegator-name" value="default"/> - <property name="dispatcher-name" value="birt-dispatcher"/> - <property name="delegator-group-helper-name" value="org.ofbiz"/> - </container> + <container name="birt-container" class="org.ofbiz.birt.container.BirtContainer"/> <!-- load BeanShell remote telnet server --> <!-- Commented out by default for security reasons --> Modified: ofbiz/branches/20111205EmailHandling/framework/base/config/test-containers.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/framework/base/config/test-containers.xml?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/framework/base/config/test-containers.xml (original) +++ ofbiz/branches/20111205EmailHandling/framework/base/config/test-containers.xml Mon Mar 26 20:56:02 2012 @@ -62,6 +62,13 @@ under the License. </container> --> + <!-- Load embedded Jackrabbit content repository. Since this container depends + upon JNDI, it must be started after the naming-container container.--> + <container name="jcr-container" class="org.ofbiz.jcr.loader.JCRContainer"> + <property name="configFilePath" value="framework/jcr/config/jcr-test-config.xml"/> + <property name="removeOnShutdown" value="true"/> + </container> + <!-- load catalina (tomcat) and all web applications --> <container name="catalina-container" class="org.ofbiz.catalina.container.CatalinaContainer"> <!-- static configuration for tomcat --> Modified: ofbiz/branches/20111205EmailHandling/framework/base/dtd/ofbiz-properties.xsd URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/framework/base/dtd/ofbiz-properties.xsd?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/framework/base/dtd/ofbiz-properties.xsd (original) +++ ofbiz/branches/20111205EmailHandling/framework/base/dtd/ofbiz-properties.xsd Mon Mar 26 20:56:02 2012 @@ -18,22 +18,31 @@ specific language governing permissions under the License. --> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> + <xs:import namespace="http://www.w3.org/XML/1998/namespace" + schemaLocation="http://www.w3.org/2001/xml.xsd"/> <xs:element name="resource"> <xs:complexType> <xs:sequence> - <xs:element minOccurs="0" maxOccurs="unbounded" ref="property"/> + <xs:element minOccurs="1" maxOccurs="unbounded" ref="property"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="property"> <xs:complexType> <xs:sequence> - <xs:element minOccurs="0" maxOccurs="unbounded" ref="value"/> - <xs:attributeGroup ref="attlist.property"/> + <xs:element minOccurs="1" maxOccurs="unbounded" name="value" type="valueType"/> </xs:sequence> + <xs:attributeGroup ref="attlist.property"/> </xs:complexType> </xs:element> <xs:attributeGroup name="attlist.property"> <xs:attribute type="xs:string" name="key" use="required"/> </xs:attributeGroup> + <xs:complexType name="valueType"> + <xs:simpleContent> + <xs:extension base="xs:string"> + <xs:attribute ref="xml:lang"/> + </xs:extension> + </xs:simpleContent> + </xs:complexType> </xs:schema> Modified: ofbiz/branches/20111205EmailHandling/framework/base/src/org/ofbiz/base/config/CoberturaInstrumenter.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/framework/base/src/org/ofbiz/base/config/CoberturaInstrumenter.java?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/framework/base/src/org/ofbiz/base/config/CoberturaInstrumenter.java (original) +++ ofbiz/branches/20111205EmailHandling/framework/base/src/org/ofbiz/base/config/CoberturaInstrumenter.java Mon Mar 26 20:56:02 2012 @@ -25,17 +25,16 @@ import java.lang.reflect.Method; import java.util.Collection; import java.util.Collections; -import org.objectweb.asm.ClassReader; -import org.objectweb.asm.ClassWriter; -import org.objectweb.asm.ClassVisitor; - import net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler; import net.sourceforge.cobertura.coveragedata.ProjectData; +import org.objectweb.asm.ClassReader; +import org.objectweb.asm.ClassVisitor; +import org.objectweb.asm.ClassWriter; import org.ofbiz.base.start.Instrumenter; public final class CoberturaInstrumenter implements Instrumenter { - private static final Constructor INSTRUMENTER_CONSTRUCTOR; + private static final Constructor<?> INSTRUMENTER_CONSTRUCTOR; private static final Method IS_INSTRUMENTED_METHOD; static { try { @@ -77,14 +76,18 @@ public final class CoberturaInstrumenter } public byte[] instrumentClass(byte[] bytes) throws IOException { - ClassReader cr = new ClassReader(bytes); - ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS/* | ClassWriter.COMPUTE_FRAMES*/); - try { - ClassVisitor ci = (ClassVisitor) INSTRUMENTER_CONSTRUCTOR.newInstance(projectData != null ? projectData : ProjectData.getGlobalProjectData(), cw, Collections.EMPTY_LIST, Collections.EMPTY_LIST); - cr.accept(ci, 0); - if (((Boolean) IS_INSTRUMENTED_METHOD.invoke(ci)).booleanValue()) return cw.toByteArray(); - } catch (Throwable t) { - throw (IOException) new IOException(t.getMessage()).initCause(t); + if (forInstrumenting) { + ClassReader cr = new ClassReader(bytes); + ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS/* | ClassWriter.COMPUTE_FRAMES*/); + try { + ClassVisitor ci = (ClassVisitor) INSTRUMENTER_CONSTRUCTOR.newInstance(projectData, cw, Collections.EMPTY_LIST, Collections.EMPTY_LIST); + cr.accept(ci, 0); + if (((Boolean) IS_INSTRUMENTED_METHOD.invoke(ci)).booleanValue()) { + return cw.toByteArray(); + } + } catch (Throwable t) { + throw (IOException) new IOException(t.getMessage()).initCause(t); + } } return bytes; } Modified: ofbiz/branches/20111205EmailHandling/framework/base/src/org/ofbiz/base/container/ComponentContainer.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/framework/base/src/org/ofbiz/base/container/ComponentContainer.java?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/framework/base/src/org/ofbiz/base/container/ComponentContainer.java (original) +++ ofbiz/branches/20111205EmailHandling/framework/base/src/org/ofbiz/base/container/ComponentContainer.java Mon Mar 26 20:56:02 2012 @@ -136,7 +136,10 @@ public class ComponentContainer implemen // set the new classloader/classpath on the current thread if (updateClasspath) { - classPath.instrument(instrumenterFile, instrumenterClassName); + if (UtilValidate.isNotEmpty(instrumenterFile) && UtilValidate.isNotEmpty(instrumenterClassName)) { + classPath.instrument(instrumenterFile, instrumenterClassName); + } + System.setProperty("java.class.path", classPath.toString()); System.setProperty("java.library.path", libraryPath.toString()); ClassLoader cl = classPath.getClassLoader(); Modified: ofbiz/branches/20111205EmailHandling/framework/base/src/org/ofbiz/base/util/FileUtil.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/framework/base/src/org/ofbiz/base/util/FileUtil.java?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/framework/base/src/org/ofbiz/base/util/FileUtil.java (original) +++ ofbiz/branches/20111205EmailHandling/framework/base/src/org/ofbiz/base/util/FileUtil.java Mon Mar 26 20:56:02 2012 @@ -62,8 +62,18 @@ public class FileUtil { return null; } } - String fileNameSeparator = ("\\".equals(File.separator)? "\\" + File.separator: File.separator); - return new File(root, path.replaceAll("/+|\\\\+", fileNameSeparator)); + return new File(root, localizePath(path)); + } + + /** + * Converts a file path to one that is compatible with the host operating system. + * + * @param path The file path to convert. + * @return The converted file path. + */ + public static String localizePath(String path) { + String fileNameSeparator = ("\\".equals(File.separator) ? "\\" + File.separator : File.separator); + return path.replaceAll("/+|\\\\+", fileNameSeparator); } public static void writeString(String fileName, String s) throws IOException { |
| Free forum by Nabble | Edit this page |
