Author: jleroux
Date: Tue Apr 19 20:13:43 2016 New Revision: 1739996 URL: http://svn.apache.org/viewvc?rev=1739996&view=rev Log: A patch from Pierre Smits for "Have configuration options for workeffort" https://issues.apache.org/jira/browse/OFBIZ-6294 Added: ofbiz/trunk/applications/workeffort/config/workeffort.properties (with props) ofbiz/trunk/applications/workeffort/data/WorkEffortSystemPropertyData.xml (with props) Removed: ofbiz/trunk/applications/workeffort/config/workeffortsearch.properties Modified: ofbiz/trunk/applications/workeffort/ofbiz-component.xml ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortKeywordIndex.java Added: ofbiz/trunk/applications/workeffort/config/workeffort.properties URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/config/workeffort.properties?rev=1739996&view=auto ============================================================================== --- ofbiz/trunk/applications/workeffort/config/workeffort.properties (added) +++ ofbiz/trunk/applications/workeffort/config/workeffort.properties Tue Apr 19 20:13:43 2016 @@ -0,0 +1,37 @@ +############################################################################### +# 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. +############################################################################### + +# Assign a weight to each workeffort keyword source during indexing/keywork inuduction +index.weight.WorkEffort.workEffortId=1 +index.weight.WorkEffort.workEffortName=1 +index.weight.WorkEffort.workEffortTypeId=1 +index.weight.WorkEffort.currentStatusId=1 +index.weight.WorkEffort.actualStartDate=1 +index.weight.WorkEffort.actualCompletionDate=1 + +index.weight.WorkEffortNoteAndData.noteInfo=1 + +index.weight.WorkEffortAttribute.attrName=1 +index.weight.WorkEffortAttribute.attrValue=1 + +index.include.WorkEffortContentTypes=CREATED_MEDIA,PROJECT_SPEC,PROPOSAL_MEDIA,SUPPORTING_MEDIA +index.weight.WorkEffortContent.CREATED_MEDIA=1 +index.weight.WorkEffortContent.PROJECT_SPEC=1 +index.weight.WorkEffortContent.PROPOSAL_MEDIA=1 +index.weight.WorkEffortContent.SUPPORTING_MEDIA=1 Propchange: ofbiz/trunk/applications/workeffort/config/workeffort.properties ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/workeffort/config/workeffort.properties ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/applications/workeffort/config/workeffort.properties ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/applications/workeffort/data/WorkEffortSystemPropertyData.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/data/WorkEffortSystemPropertyData.xml?rev=1739996&view=auto ============================================================================== --- ofbiz/trunk/applications/workeffort/data/WorkEffortSystemPropertyData.xml (added) +++ ofbiz/trunk/applications/workeffort/data/WorkEffortSystemPropertyData.xml Tue Apr 19 20:13:43 2016 @@ -0,0 +1,65 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +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. +--> +<entity-engine-xml> + <!-- Assign a weight to each workeffort keyword source during indexing/keywork inuduction --> + <SystemProperty systemResourceId="workeffort" systemPropertyId="index.weight.WorkEffort.workEffortId" systemPropertyValue="1" + description="Index weight for WorkEffort.workEffortId" + /> + <SystemProperty systemResourceId="workeffort" systemPropertyId="index.weight.WorkEffort.workEffortName" systemPropertyValue="1" + description="Index weight for WorkEffort.workEffortName" + /> + <SystemProperty systemResourceId="workeffort" systemPropertyId="index.weight.WorkEffort.workEffortTypeId" systemPropertyValue="1" + description="Index weight for WorkEffort.workEffortTypeId" + /> + <SystemProperty systemResourceId="workeffort" systemPropertyId="index.weight.WorkEffort.currentStatusId" systemPropertyValue="1" + description="Index weight for WorkEffort.currentStatusId" + /> + <SystemProperty systemResourceId="workeffort" systemPropertyId="index.weight.WorkEffort.actualStartDate" systemPropertyValue="1" + description="Index weight for WorkEffort.actualStartDate" + /> + <SystemProperty systemResourceId="workeffort" systemPropertyId="index.weight.WorkEffort.actualCompletionDate" systemPropertyValue="1" + description="Index weight for WorkEffort.actualCompletionDate" + /> + <SystemProperty systemResourceId="workeffort" systemPropertyId="index.weight.WorkEffortNoteAndData.noteInfo" systemPropertyValue="1" + description="Index weight for WorkEffortNoteAndData.noteInfo" + /> + <SystemProperty systemResourceId="workeffort" systemPropertyId="index.weight.WorkEffortAttribute.attrName" systemPropertyValue="1" + description="Index weight for WorkEffortAttribute.attrName" + /> + <SystemProperty systemResourceId="workeffort" systemPropertyId="index.weight.WorkEffortAttribute.attrValue" systemPropertyValue="1" + description="Index weight for WorkEffortAttribute.attrValue" + /> + <SystemProperty systemResourceId="workeffort" systemPropertyId="index.weight.WorkEffortContent.CREATED_MEDIA" systemPropertyValue="1" + description="Index weight for WorkEffortContent.CREATED_MEDIA" + /> + <SystemProperty systemResourceId="workeffort" systemPropertyId="index.weight.WorkEffortContent.PROJECT_SPEC" systemPropertyValue="1" + description="Index weight for WorkEffortContent.PROJECT_SPEC" + /> + <SystemProperty systemResourceId="workeffort" systemPropertyId="index.weight.WorkEffortContent.PROPOSAL_MEDIA" systemPropertyValue="1" + description="Index weight for WorkEffortContent.PROPOSAL_MEDIA" + /> + <SystemProperty systemResourceId="workeffort" systemPropertyId="index.weight.WorkEffortContent.SUPPORTING_MEDIA" systemPropertyValue="1" + description="Index weight for WorkEffortContent.SUPPORTING_MEDIA" + /> + <SystemProperty systemResourceId="workeffort" systemPropertyId="index.include.WorkEffortContentTypes" + systemPropertyValue="CREATED_MEDIA,PROJECT_SPEC,PROPOSAL_MEDIA,SUPPORTING_MEDIA" + description="Index include definitions for WorkEffortContentTypes" + /> +</entity-engine-xml> \ No newline at end of file Propchange: ofbiz/trunk/applications/workeffort/data/WorkEffortSystemPropertyData.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/workeffort/data/WorkEffortSystemPropertyData.xml ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/applications/workeffort/data/WorkEffortSystemPropertyData.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Modified: ofbiz/trunk/applications/workeffort/ofbiz-component.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/ofbiz-component.xml?rev=1739996&r1=1739995&r2=1739996&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/ofbiz-component.xml (original) +++ ofbiz/trunk/applications/workeffort/ofbiz-component.xml Tue Apr 19 20:13:43 2016 @@ -27,11 +27,16 @@ under the License. <entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel_old.xml"/> <entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel_view.xml"/> <entity-resource type="eca" reader-name="main" loader="main" location="entitydef/eecas.xml"/> + <entity-resource type="data" reader-name="seed" loader="main" location="data/WorkEffortTypeData.xml"/> <entity-resource type="data" reader-name="seed" loader="main" location="data/WorkEffortPortletData.xml"/> <entity-resource type="data" reader-name="seed" loader="main" location="data/WorkEffortSecurityPermissionSeedData.xml"/> + + <entity-resource type="data" reader-name="seed-initial" loader="main" location="data/WorkEffortSystemPropertyData.xml"/> + <entity-resource type="data" reader-name="demo" loader="main" location="data/WorkEffortSecurityGroupDemoData.xml"/> <entity-resource type="data" reader-name="demo" loader="main" location="data/WorkEffortDemoData.xml"/> + <service-resource type="model" loader="main" location="servicedef/services.xml"/> <service-resource type="model" loader="main" location="servicedef/services_timesheet.xml"/> <service-resource type="model" loader="main" location="servicedef/services_upgrade.xml"/> Modified: ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortKeywordIndex.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortKeywordIndex.java?rev=1739996&r1=1739995&r2=1739996&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortKeywordIndex.java (original) +++ ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortKeywordIndex.java Tue Apr 19 20:13:43 2016 @@ -57,7 +57,7 @@ public class WorkEffortKeywordIndex { List<String> strings = new LinkedList<String>(); int widWeight = 1; try { - widWeight = Integer.parseInt(EntityUtilProperties.getPropertyValue("workeffortsearch", "index.weight.WorkEffort.workEffortId", "1", delegator)); + widWeight = Integer.parseInt(EntityUtilProperties.getPropertyValue("workeffort", "index.weight.WorkEffort.workEffortId", "1", delegator)); } catch (Exception e) { Debug.logWarning("Could not parse weight number: " + e.toString(), module); } @@ -67,15 +67,15 @@ public class WorkEffortKeywordIndex { addWeightedKeywordSourceString(workEffort, "workEffortTypeId", strings); addWeightedKeywordSourceString(workEffort, "currentStatusId", strings); - if (!"0".equals(EntityUtilProperties.getPropertyValue("workeffortsearch", "index.weight.WorkEffortNoteAndData.noteInfo", "1", delegator))) { + if (!"0".equals(EntityUtilProperties.getPropertyValue("workeffort", "index.weight.WorkEffortNoteAndData.noteInfo", "1", delegator))) { List<GenericValue> workEffortNotes = EntityQuery.use(delegator).from("WorkEffortNoteAndData").where("workEffortId", workEffortId).queryList(); for (GenericValue workEffortNote : workEffortNotes) { addWeightedKeywordSourceString(workEffortNote, "noteInfo", strings); } } //WorkEffortAttribute - if (!"0".equals(EntityUtilProperties.getPropertyValue("workeffortsearch", "index.weight.WorkEffortAttribute.attrName", "1", delegator)) || - !"0".equals(EntityUtilProperties.getPropertyValue("workeffortsearch", "index.weight.WorkEffortAttribute.attrValue", "1", delegator))) { + if (!"0".equals(EntityUtilProperties.getPropertyValue("workeffort", "index.weight.WorkEffortAttribute.attrName", "1", delegator)) || + !"0".equals(EntityUtilProperties.getPropertyValue("workeffort", "index.weight.WorkEffortAttribute.attrValue", "1", delegator))) { List<GenericValue> workEffortAttributes = EntityQuery.use(delegator).from("WorkEffortAttribute").where("workEffortId", workEffortId).queryList(); for (GenericValue workEffortAttribute : workEffortAttributes) { addWeightedKeywordSourceString(workEffortAttribute, "attrName", strings); @@ -83,11 +83,11 @@ public class WorkEffortKeywordIndex { } } - String workEffortContentTypes = EntityUtilProperties.getPropertyValue("workeffortsearch", "index.include.WorkEffortContentTypes", delegator); + String workEffortContentTypes = EntityUtilProperties.getPropertyValue("workeffort", "index.include.WorkEffortContentTypes", delegator); for (String workEffortContentTypeId: workEffortContentTypes.split(",")) { int weight = 1; try { - weight = Integer.parseInt(EntityUtilProperties.getPropertyValue("workeffortsearch", "index.weight.WorkEffortContent." + workEffortContentTypeId, "1", delegator)); + weight = Integer.parseInt(EntityUtilProperties.getPropertyValue("workeffort", "index.weight.WorkEffortContent." + workEffortContentTypeId, "1", delegator)); } catch (Exception e) { Debug.logWarning("Could not parse weight number: " + e.toString(), module); } @@ -140,7 +140,7 @@ public class WorkEffortKeywordIndex { int weight = 1; try { - weight = Integer.parseInt(EntityUtilProperties.getPropertyValue("workeffortsearch", "index.weight." + value.getEntityName() + "." + fieldName, "1", delegator)); + weight = Integer.parseInt(EntityUtilProperties.getPropertyValue("workeffort", "index.weight." + value.getEntityName() + "." + fieldName, "1", delegator)); } catch (Exception e) { Debug.logWarning("Could not parse weight number: " + e.toString(), module); } |
Free forum by Nabble | Edit this page |