Fixed extension query by extension id.
This commit is contained in:
parent
0313df9b70
commit
ac91965779
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -6,4 +6,5 @@ public class ServiceQuery extends HashMap<String, String> {
|
|||
|
||||
private static final long serialVersionUID = -3624488575106821781L;
|
||||
|
||||
public static final String EXTENSION_ID = "Extension.ID";
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ public class ExtensionList<T> implements Iterable<T>{
|
|||
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;
|
||||
|
|
Loading…
Reference in New Issue