Compare commits
11
Commits
trunk
...
release22.01
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
32d4f793fa | ||
|
|
e4b383cd88 | ||
|
|
1052d9a983 | ||
|
|
60f2664441 | ||
|
|
0a635267e5 | ||
|
|
68c7a4107d | ||
|
|
2f2a448d71 | ||
|
|
656b9c20c7 | ||
|
|
f29c84c052 | ||
|
|
bef13b56ef | ||
|
|
1edb5f71ed |
@@ -28,4 +28,5 @@ under the License.
|
||||
<SecurityGroupPermission fromDate="2001-05-13 12:00:00.0" groupId="ASSETMAINTTECH" permissionId="ASSETMAINT_UPDATE"/>
|
||||
|
||||
<SecurityGroupPermission fromDate="2001-05-13 12:00:00.0" groupId="FULLADMIN" permissionId="ASSETMAINT_ADMIN"/>
|
||||
<SecurityGroupPermission fromDate="2001-01-01 00:00:00.0" groupId="VIEWADMIN" permissionId="ASSETMAINT_VIEW"/>
|
||||
</entity-engine-xml>
|
||||
|
||||
+7
-8
@@ -20,6 +20,7 @@ package org.apache.ofbiz.assetmaint.test
|
||||
|
||||
import java.sql.Timestamp
|
||||
import java.text.SimpleDateFormat
|
||||
|
||||
import org.apache.ofbiz.base.util.UtilDateTime
|
||||
import org.apache.ofbiz.entity.GenericValue
|
||||
import org.apache.ofbiz.service.testtools.OFBizTestCase
|
||||
@@ -38,9 +39,9 @@ class FixedAssetMaintTests extends OFBizTestCase {
|
||||
serviceCtx.productMaintSeqId = "seq03" // product maintenance
|
||||
serviceCtx.intervalMeterTypeId = "ODOMETER"
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS")
|
||||
String estimatedStartDate = "2009-12-18 00:00:00.000"
|
||||
serviceCtx.estimatedStartDate = new Timestamp(sdf.parse(estimatedStartDate).getTime());
|
||||
serviceCtx.estimatedStartDate = new Timestamp(sdf.parse(estimatedStartDate).getTime())
|
||||
|
||||
String estimatedCompletionDate = "2009-12-18 01:00:00.000"
|
||||
serviceCtx.estimatedCompletionDate = new Timestamp(sdf.parse(estimatedCompletionDate).getTime())
|
||||
@@ -71,9 +72,9 @@ class FixedAssetMaintTests extends OFBizTestCase {
|
||||
serviceCtx.productMaintTypeId = "OIL_CHANGE"
|
||||
serviceCtx.intervalMeterTypeId = "ODOMETER"
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS")
|
||||
String estimatedStartDate = "2009-12-18 00:00:00.000"
|
||||
serviceCtx.estimatedStartDate = new Timestamp(sdf.parse(estimatedStartDate).getTime());
|
||||
serviceCtx.estimatedStartDate = new Timestamp(sdf.parse(estimatedStartDate).getTime())
|
||||
|
||||
String estimatedCompletionDate = "2009-12-18 01:00:00.000"
|
||||
serviceCtx.estimatedCompletionDate = new Timestamp(sdf.parse(estimatedCompletionDate).getTime())
|
||||
@@ -107,7 +108,7 @@ class FixedAssetMaintTests extends OFBizTestCase {
|
||||
serviceCtx.productMaintTypeId = "OIL_CHANGE"
|
||||
serviceCtx.intervalMeterTypeId = "ODOMETER"
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS")
|
||||
String estimatedCompletionDate = "2009-12-22 01:00:00.000" // Changed estimatedCompletionDate to test update service
|
||||
serviceCtx.estimatedCompletionDate = new Timestamp(sdf.parse(estimatedCompletionDate).getTime())
|
||||
|
||||
@@ -117,8 +118,6 @@ class FixedAssetMaintTests extends OFBizTestCase {
|
||||
serviceCtx.userLogin = userLogin
|
||||
Map serviceResult = dispatcher.runSync('updateFixedAssetMaintAndWorkEffort', serviceCtx)
|
||||
|
||||
fixedAssetMaint.clear()
|
||||
fixedAssetMaint = from("FixedAssetMaint").where("fixedAssetId", fixedAssetId).queryFirst()
|
||||
GenericValue workEffort = from("WorkEffort").where("workEffortId", fixedAssetMaint.scheduleWorkEffortId).queryOne()
|
||||
|
||||
assert fixedAssetMaint
|
||||
@@ -145,4 +144,4 @@ class FixedAssetMaintTests extends OFBizTestCase {
|
||||
assert workEffort.currentStatusId == "CAL_COMPLETED"
|
||||
assert workEffort.actualCompletionDate == serviceCtx.actualCompletionDate
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ under the License.
|
||||
</entity-one>
|
||||
<!-- parameters for the performFind service -->
|
||||
<set field="parameters.forumId" from-field="parameters.forumId" default-value="${parameters.contentId}"/>
|
||||
<set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer"/>
|
||||
<set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer" default-value="0" />
|
||||
<set field="viewSizeDefaultValue" value="${groovy: modelTheme.getDefaultViewSize()}" type="Integer"/>
|
||||
<set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="${viewSizeDefaultValue}"/>
|
||||
<entity-condition entity-name="ContentAssocViewTo" list="forumMessages" >
|
||||
@@ -95,7 +95,7 @@ under the License.
|
||||
<parameter param-name="forumId" from-field="parameters.forumId"/>
|
||||
<parameter param-name="forumMessageIdTo" value=""/>
|
||||
<parameter param-name="threadView" from-field="parameters.threadView"/>
|
||||
<parameter param-name="VIEW_INDEX" from-field="parameters.VIEW_INDEX"/>
|
||||
<parameter param-name="VIEW_INDEX" from-field="viewIndex"/>
|
||||
</link>
|
||||
</widgets>
|
||||
</section>
|
||||
|
||||
@@ -206,6 +206,7 @@ under the License.
|
||||
</drop-down>
|
||||
</field>
|
||||
<field name="exampleName" title="${uiLabelMap.FormFieldTitle_exampleName}" required-field="true"><text /></field>
|
||||
<field name="exampleName" title="${uiLabelMap.FormFieldTitle_exampleName}" required-field="true" widget-style="required"><text placeholder="${uiLabelMap.FormFieldTitle_exampleName}"/></field>
|
||||
<field name="description" title="${uiLabelMap.CommonDescription}"/>
|
||||
<field name="longDescription" title="${uiLabelMap.ExampleLongDescription}"/>
|
||||
<field name="anotherText">
|
||||
|
||||
+3
-3
@@ -20,7 +20,7 @@ dependencies {
|
||||
// 1. Remember to change the version LUCENE_VERSION in SearchWorker class when upgrading.
|
||||
// 2. luceneMatchVersion should be updated in solrconfig.xml
|
||||
// 3. Also Solr et Lucene should use the same version,
|
||||
pluginLibsCompile 'org.apache.lucene:lucene-core:8.11.1'
|
||||
pluginLibsCompile 'org.apache.lucene:lucene-queryparser:8.11.1'
|
||||
pluginLibsCompile 'org.apache.lucene:lucene-analyzers-common:8.11.1'
|
||||
pluginLibsCompile 'org.apache.lucene:lucene-core:8.11.2'
|
||||
pluginLibsCompile 'org.apache.lucene:lucene-queryparser:8.11.2'
|
||||
pluginLibsCompile 'org.apache.lucene:lucene-analyzers-common:8.11.2'
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public final class SearchWorker {
|
||||
|
||||
private static final String MODULE = SearchWorker.class.getName();
|
||||
|
||||
private static final Version LUCENE_VERSION = Version.LUCENE_8_11_1;
|
||||
private static final Version LUCENE_VERSION = Version.LUCENE_8_11_2;
|
||||
|
||||
private SearchWorker() { }
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
<request-map uri="createProject">
|
||||
<security https="true" auth="true"/>
|
||||
<event type="service" invoke="createProject"/>
|
||||
<response name="success" type="request-redirect-noparam" value="projectView"/>
|
||||
<response name="success" type="view" value="projectView"/>
|
||||
<response name="error" type="view" value="EditProject"/>
|
||||
</request-map>
|
||||
<request-map uri="updateProject">
|
||||
@@ -569,8 +569,14 @@
|
||||
<request-map uri="addWorkEffortPartyAssign">
|
||||
<security https="true" auth="true"/>
|
||||
<event type="service" invoke="assignPartyToWorkEffort"/>
|
||||
<response name="success" type="view" value="listResourcesProject"/>
|
||||
<response name="error" type="view" value="listResourcesProject"/>
|
||||
<response name="success" type="view" value="ListWorkEffortPartyAssigns"/>
|
||||
<response name="error" type="view" value="ListWorkEffortPartyAssigns"/>
|
||||
</request-map>
|
||||
<request-map uri="deleteWorkEffortPartyAssign">
|
||||
<security https="true" auth="true"/>
|
||||
<event type="service" invoke="deletePartyToWorkEffortAssignment"/>
|
||||
<response name="success" type="view" value="ListWorkEffortPartyAssigns"/>
|
||||
<response name="error" type="view" value="ListWorkEffortPartyAssigns"/>
|
||||
</request-map>
|
||||
<request-map uri="addTaskPartyAssign">
|
||||
<security https="true" auth="true"/>
|
||||
@@ -679,7 +685,7 @@
|
||||
<response name="success" type="view" value="EditWorkEffortSurveyAppls"/>
|
||||
<response name="error" type="view" value="EditWorkEffortSurveyAppls"/>
|
||||
</request-map>
|
||||
|
||||
|
||||
<!-- end of request mappings -->
|
||||
|
||||
<!-- View Mappings -->
|
||||
|
||||
@@ -579,7 +579,7 @@
|
||||
<field name="thruDate" title="${uiLabelMap.CommonThruDate}"><display type="date-time"/></field>
|
||||
<field name="expireButton" widget-style="smallSubmit" use-when="${thruDate==null || (thruDate > nowTimestamp)}"><submit button-type="button"/></field>
|
||||
</form>
|
||||
<form name="AddWorkEffortPartyAssign" target="createWorkEffortPartyAssign" title="" type="single"
|
||||
<form name="AddWorkEffortPartyAssign" target="addWorkEffortPartyAssign" title="" type="single"
|
||||
header-row-style="header-row" default-table-style="basic-table">
|
||||
<actions>
|
||||
<entity-condition entity-name="PartyRoleAndPartyDetail" distinct="true" list="projectResources">
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
*******************************************************************************/
|
||||
package org.apache.ofbiz.ws.rs.util;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -298,8 +299,9 @@ public final class OpenApiUtil {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
schema = (Schema<?>) schemaClass.newInstance();
|
||||
} catch (InstantiationException | IllegalAccessException e) {
|
||||
schema = (Schema<?>) schemaClass.getDeclaredConstructor().newInstance();
|
||||
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException
|
||||
| SecurityException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -377,8 +379,9 @@ public final class OpenApiUtil {
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
schema = (Schema<?>) schemaClass.newInstance();
|
||||
} catch (InstantiationException | IllegalAccessException e) {
|
||||
schema = (Schema<?>) schemaClass.getDeclaredConstructor().newInstance();
|
||||
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException
|
||||
| SecurityException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (schemaClass != null) {
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ dependencies {
|
||||
// 1. Remember to change the version LUCENE_VERSION in SearchWorker class when upgrading.
|
||||
// 2. luceneMatchVersion should be updated in solrconfig.xml
|
||||
// 3. Also Solr et Lucene should use the same version,
|
||||
pluginLibsCompile 'org.apache.solr:solr-core:8.11.1'
|
||||
pluginLibsCompile 'org.apache.solr:solr-core:8.11.2'
|
||||
pluginLibsCompile 'com.google.guava:guava:28.0-jre'
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
that you fully re-index after changing this setting as it can
|
||||
affect both how text is indexed and queried.
|
||||
-->
|
||||
<luceneMatchVersion>8.11.1</luceneMatchVersion>
|
||||
<luceneMatchVersion>8.11.2</luceneMatchVersion>
|
||||
|
||||
<!-- <lib/> directives can be used to instruct Solr to load any Jars
|
||||
identified and use them to resolve any "plugins" specified in
|
||||
|
||||
@@ -76,6 +76,7 @@ public abstract class SolrProductSearch {
|
||||
String solrIndexName = (String) context.get("indexName");
|
||||
|
||||
if (SolrUtil.isSolrEcaEnabled()) {
|
||||
System.setProperty("SolrDispatchFilter", "runsAfterControlFilter");
|
||||
// Debug.logVerbose("Solr: addToSolr: Running indexing for productId '" + productId + "'", MODULE);
|
||||
try {
|
||||
GenericValue product = EntityQuery.use(delegator).from("Product").where("productId", productId).queryOne();
|
||||
@@ -98,6 +99,7 @@ public abstract class SolrProductSearch {
|
||||
Debug.logError(gse, gse.getMessage(), MODULE);
|
||||
result = ServiceUtil.returnError(gse.toString());
|
||||
}
|
||||
System.clearProperty("SolrDispatchFilter");
|
||||
} else {
|
||||
final String statusMsg = "Solr ECA indexing disabled; skipping indexing for productId '" + productId + "'";
|
||||
if (Debug.verboseOn()) {
|
||||
|
||||
@@ -20,10 +20,10 @@
|
||||
|
||||
package org.apache.ofbiz.solr.test;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ofbiz.entity.GenericValue;
|
||||
import org.apache.ofbiz.entity.util.EntityQuery;
|
||||
@@ -73,8 +73,6 @@ public class SolrTests extends OFBizTestCase {
|
||||
throw new Exception(errorMessage);
|
||||
}
|
||||
assertTrue("Could not query search index", ServiceUtil.isSuccess(sresp));
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -82,6 +80,7 @@ public class SolrTests extends OFBizTestCase {
|
||||
* @throws Exception the exception
|
||||
*/
|
||||
public void testAddToSolrIndex() throws Exception {
|
||||
System.setProperty("SolrDispatchFilter", "runsAfterControlFilter");
|
||||
context = new HashMap<>();
|
||||
context.put("productId", validTestProductId);
|
||||
response = getDispatcher().runSync("addToSolrIndex", context);
|
||||
@@ -91,6 +90,7 @@ public class SolrTests extends OFBizTestCase {
|
||||
}
|
||||
assertTrue("Could not add Product to Index", ServiceUtil.isSuccess(
|
||||
response));
|
||||
System.clearProperty("SolrDispatchFilter");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -98,6 +98,7 @@ public class SolrTests extends OFBizTestCase {
|
||||
* @throws Exception the exception
|
||||
*/
|
||||
public void testAddToSolrIndexInvalidProduct() throws Exception {
|
||||
System.setProperty("SolrDispatchFilter", "runsAfterControlFilter");
|
||||
context = new HashMap<>();
|
||||
context.put("productId", invalidTestProductId);
|
||||
response = getDispatcher().runSync("addToSolrIndex", context);
|
||||
@@ -107,6 +108,7 @@ public class SolrTests extends OFBizTestCase {
|
||||
}
|
||||
assertTrue("Could not test the addition of an invalid product to the Solr index", ServiceUtil.isSuccess(
|
||||
response));
|
||||
System.clearProperty("SolrDispatchFilter");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -114,6 +116,7 @@ public class SolrTests extends OFBizTestCase {
|
||||
* @throws Exception the exception
|
||||
*/
|
||||
public void testAddListToSolrIndex() throws Exception {
|
||||
System.setProperty("SolrDispatchFilter", "runsAfterControlFilter");
|
||||
List<Map<String, Object>> products = new ArrayList<>();
|
||||
Map<String, Object> product1 = new HashMap<>();
|
||||
Map<String, Object> product2 = new HashMap<>();
|
||||
@@ -134,7 +137,7 @@ public class SolrTests extends OFBizTestCase {
|
||||
throw new Exception(errorMessage);
|
||||
}
|
||||
assertTrue("Could not add products to index", ServiceUtil.isSuccess(response));
|
||||
|
||||
System.clearProperty("SolrDispatchFilter");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -142,6 +145,7 @@ public class SolrTests extends OFBizTestCase {
|
||||
* @throws Exception the exception
|
||||
*/
|
||||
public void testAddListToSolrIndexInvalidProducts() throws Exception {
|
||||
System.setProperty("SolrDispatchFilter", "runsAfterControlFilter");
|
||||
List<Map<String, Object>> products = new ArrayList<>();
|
||||
Map<String, Object> product1 = new HashMap<>();
|
||||
Map<String, Object> product2 = new HashMap<>();
|
||||
@@ -165,7 +169,7 @@ public class SolrTests extends OFBizTestCase {
|
||||
throw new Exception(errorMessage);
|
||||
}
|
||||
assertTrue("Could not test adding invalid products to index", ServiceUtil.isSuccess(response));
|
||||
|
||||
System.clearProperty("SolrDispatchFilter");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -94,9 +94,8 @@ public class OFBizSolrContextFilter extends SolrDispatchFilter {
|
||||
@Override
|
||||
public void init(FilterConfig config) throws ServletException {
|
||||
Properties props = System.getProperties();
|
||||
props.setProperty("solr.log.dir", UtilProperties.getPropertyValue("solrconfig", "solr.log.dir", "runtime/logs/solr"));
|
||||
props.setProperty("solr.log.level", UtilProperties.getPropertyValue("solrconfig", "solr.log.level", "INFO"));
|
||||
props.setProperty("solr/home", UtilProperties.getPropertyValue("solrconfig", "solr/home"));
|
||||
String ofbizHome = (String) props.get("ofbiz.home");
|
||||
config.getServletContext().setAttribute(SOLRHOME_ATTRIBUTE, ofbizHome + props.getProperty("solr/home"));
|
||||
super.init(config);
|
||||
}
|
||||
/** Do filter */
|
||||
|
||||
Reference in New Issue
Block a user