release version 1.10.0
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.base.connecting</groupId>
|
||||
<artifactId>generator</artifactId>
|
||||
<version>1.9.0</version>
|
||||
<version>1.10.0</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
@ -18,6 +18,7 @@
|
||||
<properties>
|
||||
<bundle.osgi.export.pkg>
|
||||
ru.entaxy.base.generator.template,
|
||||
ru.entaxy.base.generator.template.exception,
|
||||
ru.entaxy.esb.platform.runtime.base.connecting.generator
|
||||
</bundle.osgi.export.pkg>
|
||||
<bundle.osgi.private.pkg>
|
||||
@ -46,11 +47,6 @@
|
||||
<version>1.4.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ru.entaxy.esb.system.core</groupId>
|
||||
<artifactId>template</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* generator-api
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2023 EmDev LLC
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* generator-api
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2023 EmDev LLC
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* generator-api
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2023 EmDev LLC
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* generator-api
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2023 EmDev LLC
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* generator-api
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2023 EmDev LLC
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* generator-api
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2023 EmDev LLC
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
@ -41,100 +41,99 @@ import org.osgi.service.component.annotations.Reference;
|
||||
import org.osgi.service.component.annotations.ReferenceCardinality;
|
||||
import org.osgi.service.component.annotations.ReferencePolicy;
|
||||
|
||||
import ru.entaxy.base.generator.template.LegacyTemplate;
|
||||
import ru.entaxy.base.generator.template.TemplateService;
|
||||
import ru.entaxy.esb.system.core.template.Template;
|
||||
|
||||
@Component(immediate = true)
|
||||
public class LegacyTemplateAdapter {
|
||||
|
||||
BundleContext bundleContext = null;
|
||||
|
||||
List<Template> delayedTemplates = new ArrayList<>();
|
||||
|
||||
Map<Template, ServiceRegistration<ru.entaxy.base.generator.template.Template>> services = new HashMap<>();
|
||||
|
||||
protected class TemplateWrapper implements ru.entaxy.base.generator.template.Template {
|
||||
|
||||
Template template;
|
||||
|
||||
public TemplateWrapper(Template template) {
|
||||
this.template = template;
|
||||
}
|
||||
BundleContext bundleContext = null;
|
||||
|
||||
@Override
|
||||
public URL getTemplateLocation() {
|
||||
return template.getTemplateLocation();
|
||||
}
|
||||
List<LegacyTemplate> delayedTemplates = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return template.getTemplateName();
|
||||
}
|
||||
Map<LegacyTemplate, ServiceRegistration<ru.entaxy.base.generator.template.Template>> services = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "ftl";
|
||||
}
|
||||
protected class TemplateWrapper implements ru.entaxy.base.generator.template.Template {
|
||||
|
||||
@Override
|
||||
public String getTemplateName() {
|
||||
return template.getTemplateName();
|
||||
}
|
||||
LegacyTemplate template;
|
||||
|
||||
@Override
|
||||
public String getTemplateFileName() {
|
||||
return template.getTemplateFileName();
|
||||
}
|
||||
public TemplateWrapper(LegacyTemplate template) {
|
||||
this.template = template;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTemplateFullName() {
|
||||
return template.getTemplateFileName() + ".ftl";
|
||||
}
|
||||
@Override
|
||||
public URL getTemplateLocation() {
|
||||
return template.getTemplateLocation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> getAdditionalProperties() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Reference(cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC, unbind = "removeTemplate")
|
||||
public void addTemplate(Template template) {
|
||||
if (bundleContext == null)
|
||||
delayedTemplates.add(template);
|
||||
else
|
||||
wrapTemplate(template);
|
||||
}
|
||||
|
||||
public void removeTemplate(Template template) {
|
||||
this.services.remove(template);
|
||||
}
|
||||
|
||||
@Activate
|
||||
public void activate(BundleContext context) {
|
||||
this.bundleContext = context;
|
||||
processDelayed();
|
||||
}
|
||||
|
||||
protected void processDelayed() {
|
||||
for (Template t: delayedTemplates)
|
||||
wrapTemplate(t);
|
||||
delayedTemplates.clear();
|
||||
}
|
||||
|
||||
protected void wrapTemplate(Template template) {
|
||||
URL url = template.getTemplateLocation();
|
||||
Dictionary<String, String> props = new Hashtable<>();
|
||||
props.put(TemplateService.PROP_ID, template.getTemplateName());
|
||||
props.put(TemplateService.PROP_NAME, template.getTemplateName());
|
||||
props.put(TemplateService.PROP_DESCRIPTION, template.getTemplateName());
|
||||
props.put(TemplateService.PROP_TYPE, "ftl");
|
||||
props.put("origin.location", url.toString());
|
||||
props.put("origin.filename", template.getTemplateFileName());
|
||||
ServiceRegistration<ru.entaxy.base.generator.template.Template> service =
|
||||
this.bundleContext.registerService(ru.entaxy.base.generator.template.Template.class
|
||||
, new TemplateWrapper(template)
|
||||
, props);
|
||||
this.services.put(template, service);
|
||||
}
|
||||
@Override
|
||||
public String getId() {
|
||||
return template.getTemplateName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "ftl";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTemplateName() {
|
||||
return template.getTemplateName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTemplateFileName() {
|
||||
return template.getTemplateFileName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTemplateFullName() {
|
||||
return template.getTemplateFileName() + ".ftl";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> getAdditionalProperties() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Reference(cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC, unbind = "removeTemplate")
|
||||
public void addTemplate(LegacyTemplate template) {
|
||||
if (bundleContext == null)
|
||||
delayedTemplates.add(template);
|
||||
else
|
||||
wrapTemplate(template);
|
||||
}
|
||||
|
||||
public void removeTemplate(LegacyTemplate template) {
|
||||
this.services.remove(template);
|
||||
}
|
||||
|
||||
@Activate
|
||||
public void activate(BundleContext context) {
|
||||
this.bundleContext = context;
|
||||
processDelayed();
|
||||
}
|
||||
|
||||
protected void processDelayed() {
|
||||
for (LegacyTemplate t : delayedTemplates)
|
||||
wrapTemplate(t);
|
||||
delayedTemplates.clear();
|
||||
}
|
||||
|
||||
protected void wrapTemplate(LegacyTemplate template) {
|
||||
URL url = template.getTemplateLocation();
|
||||
Dictionary<String, String> props = new Hashtable<>();
|
||||
props.put(TemplateService.PROP_ID, template.getTemplateName());
|
||||
props.put(TemplateService.PROP_NAME, template.getTemplateName());
|
||||
props.put(TemplateService.PROP_DESCRIPTION, template.getTemplateName());
|
||||
props.put(TemplateService.PROP_TYPE, "ftl");
|
||||
props.put("origin.location", url.toString());
|
||||
props.put("origin.filename", template.getTemplateFileName());
|
||||
ServiceRegistration<ru.entaxy.base.generator.template.Template> service =
|
||||
this.bundleContext.registerService(ru.entaxy.base.generator.template.Template.class,
|
||||
new TemplateWrapper(template), props);
|
||||
this.services.put(template, service);
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* generator-api
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2023 EmDev LLC
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* generator-api
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2023 EmDev LLC
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* generator-api
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2023 EmDev LLC
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* generator-api
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2023 EmDev LLC
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* generator-api
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2023 EmDev LLC
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* generator-api
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2023 EmDev LLC
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* generator-api
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2023 EmDev LLC
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* generator-api
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2023 EmDev LLC
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* generator-api
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2023 EmDev LLC
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* generator-api
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2023 EmDev LLC
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* generator-api
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2023 EmDev LLC
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* generator-api
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2023 EmDev LLC
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
|
Reference in New Issue
Block a user