From ac91965779d7cb6527eb4e119c7ae8413cff6143 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Wed, 3 Nov 2010 15:36:33 +0800 Subject: [PATCH] Fixed extension query by extension id. --- org.adempiere.base/src/org/adempiere/base/Core.java | 10 +++++----- .../src/org/adempiere/base/ServiceQuery.java | 1 + .../src/org/adempiere/base/equinox/ExtensionList.java | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/org.adempiere.base/src/org/adempiere/base/Core.java b/org.adempiere.base/src/org/adempiere/base/Core.java index 0d64ce8709..ec42a79894 100644 --- a/org.adempiere.base/src/org/adempiere/base/Core.java +++ b/org.adempiere.base/src/org/adempiere/base/Core.java @@ -46,18 +46,18 @@ public class Core { public static ProcessCall getProcess(String className) { if (isExtension(className)) className = className.substring(Core.OSGI_PREFIX.length()); - + ServiceQuery query = new ServiceQuery(); - query.put("id", className); + query.put(ServiceQuery.EXTENSION_ID, className); return Service.locate(ProcessCall.class, "org.adempiere.base.Process", query); } - + public static ModelValidator getModelValidator(String className) { if (isExtension(className)) className = className.substring(Core.OSGI_PREFIX.length()); - + ServiceQuery query = new ServiceQuery(); - query.put("id", className); + query.put(ServiceQuery.EXTENSION_ID, className); return Service.locate(ModelValidator.class, "org.adempiere.base.ModelValidator", query); } diff --git a/org.adempiere.base/src/org/adempiere/base/ServiceQuery.java b/org.adempiere.base/src/org/adempiere/base/ServiceQuery.java index 3cb1f42a6e..74bd10a424 100644 --- a/org.adempiere.base/src/org/adempiere/base/ServiceQuery.java +++ b/org.adempiere.base/src/org/adempiere/base/ServiceQuery.java @@ -6,4 +6,5 @@ public class ServiceQuery extends HashMap { private static final long serialVersionUID = -3624488575106821781L; + public static final String EXTENSION_ID = "Extension.ID"; } diff --git a/org.adempiere.base/src/org/adempiere/base/equinox/ExtensionList.java b/org.adempiere.base/src/org/adempiere/base/equinox/ExtensionList.java index fd93726d85..2a65d700f8 100644 --- a/org.adempiere.base/src/org/adempiere/base/equinox/ExtensionList.java +++ b/org.adempiere.base/src/org/adempiere/base/equinox/ExtensionList.java @@ -59,7 +59,7 @@ public class ExtensionList implements Iterable{ private boolean accept(IConfigurationElement element) { for (String name : filters.keySet()) { String expected = filters.get(name); - if (name.equals("Extension.ID")) { + if (name.equals(ServiceQuery.EXTENSION_ID)) { String id = element.getDeclaringExtension().getUniqueIdentifier(); if (!expected.equals(id)) return false;