├── deploy
└── .gitkeep
├── costum-config-category
├── .gitignore
├── src
│ └── main
│ │ ├── resources
│ │ └── content
│ │ │ └── Language.properties
│ │ └── java
│ │ └── de
│ │ └── abiegel
│ │ └── configuration
│ │ └── category
│ │ └── foo
│ │ ├── FooCategory.java
│ │ └── MyConfigurationFieldOptionsProvider.java
├── images
│ ├── unkown-category.PNG
│ └── unknown-contributor.PNG
├── bnd.bnd
└── pom.xml
├── liferay-scoped-company
├── .gitignore
├── images
│ ├── dynamic.png
│ ├── fooableThings.PNG
│ ├── system-settings.PNG
│ └── instance-settings.PNG
├── src
│ └── main
│ │ ├── java
│ │ └── de
│ │ │ └── abiegel
│ │ │ └── configuration
│ │ │ └── osgi
│ │ │ └── company
│ │ │ ├── Fooable.java
│ │ │ ├── ConfiguredComponentConfigurationBeanDeclaration.java
│ │ │ ├── FooCategory.java
│ │ │ ├── CompanyConfiguredComponentConfig.java
│ │ │ └── ConfiguredComponent.java
│ │ └── resources
│ │ └── content
│ │ └── Language.properties
├── bnd.bnd
├── README.md
└── pom.xml
├── liferay-scoped-group
├── .gitignore
├── images
│ ├── fooableThings.PNG
│ └── system-settings.PNG
├── src
│ └── main
│ │ ├── java
│ │ └── de
│ │ │ └── abiegel
│ │ │ └── configuration
│ │ │ └── osgi
│ │ │ └── group
│ │ │ ├── Fooable.java
│ │ │ ├── ConfiguredComponentConfigurationBeanDeclaration.java
│ │ │ ├── GroupConfiguredComponentConfig.java
│ │ │ ├── FooCategory.java
│ │ │ └── ConfiguredComponent.java
│ │ └── resources
│ │ └── content
│ │ └── Language.properties
├── README.md
├── bnd.bnd
└── pom.xml
├── liferay-scoped-system
├── .gitignore
├── images
│ ├── config-export.PNG
│ ├── fooableThings.PNG
│ └── system-settings.PNG
├── src
│ └── main
│ │ ├── java
│ │ └── de
│ │ │ └── abiegel
│ │ │ └── configuration
│ │ │ └── osgi
│ │ │ └── system
│ │ │ ├── Fooable.java
│ │ │ ├── ConfiguredComponentConfigurationBeanDeclaration.java
│ │ │ ├── FooCategory.java
│ │ │ ├── SystemConfiguredComponentConfig.java
│ │ │ └── ConfiguredComponent.java
│ │ └── resources
│ │ └── content
│ │ └── Language.properties
├── bnd.bnd
├── README.md
└── pom.xml
├── .vscode
└── settings.json
├── liferay-scoped-portlet-instance
├── .gitignore
├── images
│ ├── export.PNG
│ ├── view-view.PNG
│ ├── fooableThings.PNG
│ ├── system-settings.PNG
│ └── configuration-view.PNG
├── src
│ └── main
│ │ ├── java
│ │ └── de
│ │ │ └── abiegel
│ │ │ └── configuration
│ │ │ └── osgi
│ │ │ └── example
│ │ │ ├── Fooable.java
│ │ │ ├── settings
│ │ │ └── definition
│ │ │ │ ├── ConfiguredComponentConfigurationBeanDeclaration.java
│ │ │ │ └── OsgiConfiguredPortletInstanceConfigurationPidMapping.java
│ │ │ ├── ConfiguredComponentConfig.java
│ │ │ ├── FooCategory.java
│ │ │ ├── PortletConfigurationAction.java
│ │ │ └── OsgiConfiguredPortlet.java
│ │ └── resources
│ │ ├── content
│ │ └── Language.properties
│ │ └── META-INF
│ │ └── resources
│ │ └── osgiconfiguredportlet
│ │ ├── view.jsp
│ │ ├── configuration.jsp
│ │ └── init.jsp
├── bnd.bnd
├── README.md
└── pom.xml
├── osgi-core-annotation
├── .gitignore
├── images
│ ├── exampleconfig.PNG
│ └── dxp7-1-thirdparty.PNG
├── src
│ └── main
│ │ ├── java
│ │ └── de
│ │ │ └── abiegel
│ │ │ └── configuration
│ │ │ └── osgi
│ │ │ ├── Fooable.java
│ │ │ ├── ConfiguredComponentConfig.java
│ │ │ └── ConfiguredComponent.java
│ │ └── resources
│ │ └── content
│ │ └── Language.properties
├── bnd.bnd
├── README.md
└── pom.xml
├── osgi-core-variable-substitution
├── .gitignore
├── images
│ ├── exampleconfig.PNG
│ └── dxp7-1-thirdparty.PNG
├── src
│ └── main
│ │ ├── resources
│ │ ├── config
│ │ │ └── de.abiegel.configuration.osgi.core.variable.substitution.ConfiguredComponentConfig.config
│ │ └── content
│ │ │ └── Language.properties
│ │ └── java
│ │ └── de
│ │ └── abiegel
│ │ └── configuration
│ │ └── osgi
│ │ └── core
│ │ └── variable
│ │ └── substitution
│ │ ├── Fooable.java
│ │ ├── ConfiguredComponentConfig.java
│ │ └── ConfiguredComponent.java
├── bnd.bnd
├── README.md
└── pom.xml
├── ddm-form-definition
├── README.md
├── images
│ └── fooableThings.PNG
├── src
│ └── main
│ │ ├── java
│ │ └── de
│ │ │ └── abiegel
│ │ │ └── configuration
│ │ │ └── osgi
│ │ │ └── liferay
│ │ │ └── ddm
│ │ │ └── form
│ │ │ ├── Fooable.java
│ │ │ ├── ConfiguredComponentConfigurationBeanDeclaration.java
│ │ │ ├── FooConfigurationDDMFormDeclaration.java
│ │ │ ├── DDMFormCategory.java
│ │ │ ├── CompanyConfiguredComponentConfig.java
│ │ │ ├── ConfiguredComponent.java
│ │ │ └── MyFooConfigurationForm.java
│ │ └── resources
│ │ └── content
│ │ └── Language.properties
├── bnd.bnd
└── pom.xml
├── configuration-form-renderer
├── images
│ ├── config.PNG
│ └── category.PNG
├── src
│ └── main
│ │ ├── java
│ │ └── de
│ │ │ └── abiegel
│ │ │ └── configuration
│ │ │ └── osgi
│ │ │ └── liferay
│ │ │ └── configuration
│ │ │ └── form
│ │ │ └── renderer
│ │ │ ├── Fooable.java
│ │ │ ├── constants
│ │ │ └── VocabularyConfigurationKeys.java
│ │ │ ├── VocabularyConfigurationBeanDeclaration.java
│ │ │ ├── VocabularyConfiguration.java
│ │ │ ├── ConfiguredComponent.java
│ │ │ ├── VocabularyConfigurationCategory.java
│ │ │ ├── VocabularyConfigurationDisplayContext.java
│ │ │ └── VocabularyConfigurationFormRenderer.java
│ │ └── resources
│ │ ├── META-INF
│ │ └── resources
│ │ │ ├── init.jsp
│ │ │ └── configuration.jsp
│ │ └── content
│ │ └── Language.properties
├── bnd.bnd
├── README.md
└── pom.xml
├── start.sh
├── .gitignore
├── docker-compose.yml
├── pom.xml
├── README.md
└── LICENSE
/deploy/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/costum-config-category/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle/
2 | build/
3 | target/
--------------------------------------------------------------------------------
/liferay-scoped-company/.gitignore:
--------------------------------------------------------------------------------
1 | /target/
2 | /.classpath
3 | /.project
4 |
--------------------------------------------------------------------------------
/liferay-scoped-group/.gitignore:
--------------------------------------------------------------------------------
1 | /target/
2 | /.classpath
3 | /.project
4 |
--------------------------------------------------------------------------------
/liferay-scoped-system/.gitignore:
--------------------------------------------------------------------------------
1 | /target/
2 | /.classpath
3 | /.project
4 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "java.configuration.updateBuildConfiguration": "automatic"
3 | }
--------------------------------------------------------------------------------
/liferay-scoped-portlet-instance/.gitignore:
--------------------------------------------------------------------------------
1 | /target/
2 | /.classpath
3 | /.project
4 | /.vscode/
--------------------------------------------------------------------------------
/osgi-core-annotation/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle/
2 | build/
3 | target/
4 | /.classpath
5 | /.project
6 |
--------------------------------------------------------------------------------
/osgi-core-variable-substitution/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle/
2 | build/
3 | target/
4 | /.classpath
5 | /.project
6 |
--------------------------------------------------------------------------------
/costum-config-category/src/main/resources/content/Language.properties:
--------------------------------------------------------------------------------
1 | category-section.my-foo-title=Fooable Things
2 | category.my-foo=Fooable Things
--------------------------------------------------------------------------------
/ddm-form-definition/README.md:
--------------------------------------------------------------------------------
1 | # Company Scoped Configurations
2 |
3 | 
4 |
5 |
--------------------------------------------------------------------------------
/liferay-scoped-company/images/dynamic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrebiegel/liferay-configuration-api/HEAD/liferay-scoped-company/images/dynamic.png
--------------------------------------------------------------------------------
/configuration-form-renderer/images/config.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrebiegel/liferay-configuration-api/HEAD/configuration-form-renderer/images/config.PNG
--------------------------------------------------------------------------------
/ddm-form-definition/images/fooableThings.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrebiegel/liferay-configuration-api/HEAD/ddm-form-definition/images/fooableThings.PNG
--------------------------------------------------------------------------------
/liferay-scoped-group/images/fooableThings.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrebiegel/liferay-configuration-api/HEAD/liferay-scoped-group/images/fooableThings.PNG
--------------------------------------------------------------------------------
/osgi-core-annotation/images/exampleconfig.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrebiegel/liferay-configuration-api/HEAD/osgi-core-annotation/images/exampleconfig.PNG
--------------------------------------------------------------------------------
/configuration-form-renderer/images/category.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrebiegel/liferay-configuration-api/HEAD/configuration-form-renderer/images/category.PNG
--------------------------------------------------------------------------------
/liferay-scoped-company/images/fooableThings.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrebiegel/liferay-configuration-api/HEAD/liferay-scoped-company/images/fooableThings.PNG
--------------------------------------------------------------------------------
/liferay-scoped-group/images/system-settings.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrebiegel/liferay-configuration-api/HEAD/liferay-scoped-group/images/system-settings.PNG
--------------------------------------------------------------------------------
/liferay-scoped-system/images/config-export.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrebiegel/liferay-configuration-api/HEAD/liferay-scoped-system/images/config-export.PNG
--------------------------------------------------------------------------------
/liferay-scoped-system/images/fooableThings.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrebiegel/liferay-configuration-api/HEAD/liferay-scoped-system/images/fooableThings.PNG
--------------------------------------------------------------------------------
/costum-config-category/images/unkown-category.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrebiegel/liferay-configuration-api/HEAD/costum-config-category/images/unkown-category.PNG
--------------------------------------------------------------------------------
/liferay-scoped-company/images/system-settings.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrebiegel/liferay-configuration-api/HEAD/liferay-scoped-company/images/system-settings.PNG
--------------------------------------------------------------------------------
/liferay-scoped-portlet-instance/images/export.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrebiegel/liferay-configuration-api/HEAD/liferay-scoped-portlet-instance/images/export.PNG
--------------------------------------------------------------------------------
/liferay-scoped-system/images/system-settings.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrebiegel/liferay-configuration-api/HEAD/liferay-scoped-system/images/system-settings.PNG
--------------------------------------------------------------------------------
/osgi-core-annotation/images/dxp7-1-thirdparty.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrebiegel/liferay-configuration-api/HEAD/osgi-core-annotation/images/dxp7-1-thirdparty.PNG
--------------------------------------------------------------------------------
/liferay-scoped-company/images/instance-settings.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrebiegel/liferay-configuration-api/HEAD/liferay-scoped-company/images/instance-settings.PNG
--------------------------------------------------------------------------------
/liferay-scoped-portlet-instance/images/view-view.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrebiegel/liferay-configuration-api/HEAD/liferay-scoped-portlet-instance/images/view-view.PNG
--------------------------------------------------------------------------------
/costum-config-category/images/unknown-contributor.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrebiegel/liferay-configuration-api/HEAD/costum-config-category/images/unknown-contributor.PNG
--------------------------------------------------------------------------------
/liferay-scoped-portlet-instance/images/fooableThings.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrebiegel/liferay-configuration-api/HEAD/liferay-scoped-portlet-instance/images/fooableThings.PNG
--------------------------------------------------------------------------------
/osgi-core-annotation/src/main/java/de/abiegel/configuration/osgi/Fooable.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi;
2 |
3 | public interface Fooable {
4 | void foo();
5 | }
6 |
--------------------------------------------------------------------------------
/osgi-core-variable-substitution/images/exampleconfig.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrebiegel/liferay-configuration-api/HEAD/osgi-core-variable-substitution/images/exampleconfig.PNG
--------------------------------------------------------------------------------
/liferay-scoped-portlet-instance/images/system-settings.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrebiegel/liferay-configuration-api/HEAD/liferay-scoped-portlet-instance/images/system-settings.PNG
--------------------------------------------------------------------------------
/osgi-core-variable-substitution/images/dxp7-1-thirdparty.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrebiegel/liferay-configuration-api/HEAD/osgi-core-variable-substitution/images/dxp7-1-thirdparty.PNG
--------------------------------------------------------------------------------
/liferay-scoped-group/src/main/java/de/abiegel/configuration/osgi/group/Fooable.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi.group;
2 |
3 | public interface Fooable {
4 | void foo();
5 | }
6 |
--------------------------------------------------------------------------------
/liferay-scoped-portlet-instance/images/configuration-view.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrebiegel/liferay-configuration-api/HEAD/liferay-scoped-portlet-instance/images/configuration-view.PNG
--------------------------------------------------------------------------------
/liferay-scoped-company/src/main/java/de/abiegel/configuration/osgi/company/Fooable.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi.company;
2 |
3 | public interface Fooable {
4 | void foo();
5 | }
6 |
--------------------------------------------------------------------------------
/liferay-scoped-system/src/main/java/de/abiegel/configuration/osgi/system/Fooable.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi.system;
2 |
3 | public interface Fooable {
4 | void foo();
5 | }
6 |
--------------------------------------------------------------------------------
/ddm-form-definition/src/main/java/de/abiegel/configuration/osgi/liferay/ddm/form/Fooable.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi.liferay.ddm.form;
2 |
3 | public interface Fooable {
4 | void foo();
5 | }
6 |
--------------------------------------------------------------------------------
/liferay-scoped-portlet-instance/src/main/java/de/abiegel/configuration/osgi/example/Fooable.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi.example;
2 |
3 | public interface Fooable {
4 | void foo();
5 | }
6 |
--------------------------------------------------------------------------------
/osgi-core-variable-substitution/src/main/resources/config/de.abiegel.configuration.osgi.core.variable.substitution.ConfiguredComponentConfig.config:
--------------------------------------------------------------------------------
1 | defaultEnvVar=${env:PATH}
2 | defaultSystemPropVar=${os.name}
3 |
--------------------------------------------------------------------------------
/start.sh:
--------------------------------------------------------------------------------
1 | curl https://www-eu.apache.org/dist//felix/org.apache.felix.webconsole-4.3.16-all.jar --output ./deploy/org.apache.felix.webconsole-4.3.16-all.jar && mvn clean package && mv ./*/target/*.jar deploy/ && docker-compose up
--------------------------------------------------------------------------------
/osgi-core-variable-substitution/src/main/java/de/abiegel/configuration/osgi/core/variable/substitution/Fooable.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi.core.variable.substitution;
2 |
3 | public interface Fooable {
4 | void foo();
5 | }
6 |
--------------------------------------------------------------------------------
/osgi-core-annotation/bnd.bnd:
--------------------------------------------------------------------------------
1 | Bundle-Name: de.abiegel.configuration.osgi.core.annotation
2 | Bundle-SymbolicName: de.abiegel.configuration.osgi.core.annotation
3 | -plugin.bundle: com.liferay.ant.bnd.resource.bundle.ResourceBundleLoaderAnalyzerPlugin
--------------------------------------------------------------------------------
/configuration-form-renderer/src/main/java/de/abiegel/configuration/osgi/liferay/configuration/form/renderer/Fooable.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi.liferay.configuration.form.renderer;
2 |
3 | public interface Fooable {
4 | void foo();
5 | }
6 |
--------------------------------------------------------------------------------
/liferay-scoped-group/README.md:
--------------------------------------------------------------------------------
1 | # Group Scoped Configurations
2 |
3 | 
4 |
5 | 
6 |
--------------------------------------------------------------------------------
/ddm-form-definition/bnd.bnd:
--------------------------------------------------------------------------------
1 | Bundle-Name: de.abiegel.configuration.osgi.company
2 | Bundle-SymbolicName: de.abiegel.configuration.osgi.company
3 | -metatype: *
4 | -plugin.bundle: com.liferay.ant.bnd.resource.bundle.ResourceBundleLoaderAnalyzerPlugin
5 | -sources: true
--------------------------------------------------------------------------------
/liferay-scoped-group/bnd.bnd:
--------------------------------------------------------------------------------
1 | Bundle-Name: de.abiegel.configuration.osgi.group
2 | Bundle-SymbolicName: de.abiegel.configuration.osgi.group
3 | -metatype: *
4 | -plugin.bundle: com.liferay.ant.bnd.resource.bundle.ResourceBundleLoaderAnalyzerPlugin
5 | -sources: true
--------------------------------------------------------------------------------
/liferay-scoped-system/bnd.bnd:
--------------------------------------------------------------------------------
1 | Bundle-Name: de.abiegel.configuration.osgi.system
2 | Bundle-SymbolicName: de.abiegel.configuration.osgi.system
3 | -metatype: *
4 | -plugin.bundle: com.liferay.ant.bnd.resource.bundle.ResourceBundleLoaderAnalyzerPlugin
5 | -sources: true
--------------------------------------------------------------------------------
/liferay-scoped-company/bnd.bnd:
--------------------------------------------------------------------------------
1 | Bundle-Name: de.abiegel.configuration.osgi.company
2 | Bundle-SymbolicName: de.abiegel.configuration.osgi.company
3 | -metatype: *
4 | -plugin.bundle: com.liferay.ant.bnd.resource.bundle.ResourceBundleLoaderAnalyzerPlugin
5 | -sources: true
--------------------------------------------------------------------------------
/osgi-core-variable-substitution/bnd.bnd:
--------------------------------------------------------------------------------
1 | Bundle-Name: de.abiegel.configuration.osgi
2 | Bundle-SymbolicName: de.abiegel.configuration.osgi.core.variable.substitution
3 | -plugin.bundle: com.liferay.ant.bnd.resource.bundle.ResourceBundleLoaderAnalyzerPlugin
4 | Liferay-Configuration-Path: /config
--------------------------------------------------------------------------------
/configuration-form-renderer/src/main/resources/META-INF/resources/init.jsp:
--------------------------------------------------------------------------------
1 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core"
2 | prefix="c" %>
3 | <%@ taglib uri="http://liferay.com/tld/aui"
4 | prefix="aui" %>
5 | <%@ taglib uri="http://liferay.com/tld/ui"
6 | prefix="liferay-ui" %>
7 |
--------------------------------------------------------------------------------
/liferay-scoped-company/README.md:
--------------------------------------------------------------------------------
1 | # Company Scoped Configurations
2 |
3 | 
4 |
5 | 
6 |
7 | 
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /bin/
2 | .project
3 | .settings/
4 | .classpath
5 | target/
6 | pom.xml.tag
7 | pom.xml.releaseBackup
8 | pom.xml.versionsBackup
9 | pom.xml.next
10 | release.properties
11 | dependency-reduced-pom.xml
12 | buildNumber.properties
13 | .mvn/timing.properties
14 | .mvn/wrapper/maven-wrapper.jar
15 | .vscode/
16 | .DS_Store
17 |
--------------------------------------------------------------------------------
/liferay-scoped-system/README.md:
--------------------------------------------------------------------------------
1 | # System Scoped Configurations
2 |
3 | 
4 |
5 | 
6 |
7 |
8 | 
9 |
--------------------------------------------------------------------------------
/configuration-form-renderer/src/main/resources/content/Language.properties:
--------------------------------------------------------------------------------
1 | category.vocabulary-configuration= Vocabulary configuration
2 | category-section.vocabulary-configuration=Vocabulary configuration
3 | country-vocabulary-warning= LIFE IS SHORT
4 | putzmeister-configuration=Vocabulary configuration
5 | vocabulary-configuration=Vocabulary
6 | vocabulary-label=Select Vocabulary from Global site.
7 |
--------------------------------------------------------------------------------
/osgi-core-annotation/src/main/resources/content/Language.properties:
--------------------------------------------------------------------------------
1 | foo-default-name=Foo Config Basic
2 | foo-default-name-entry=Foo Config Entry
3 | foo-default-name-desc=Foo Config Description. The Foo Config encapsulates all configurations needed.
4 | foo-default-name-entry-desc=Foo Config Entry Description. The Entry configurates the Foo for the Bar. totally pointless but localized.
5 |
6 |
--------------------------------------------------------------------------------
/liferay-scoped-portlet-instance/bnd.bnd:
--------------------------------------------------------------------------------
1 | Bundle-Name: de.abiegel.configuration.osgi.portlet.instance
2 | Bundle-SymbolicName: de.abiegel.configuration.osgi.portlet.instance
3 | -contract: JavaPortlet
4 | -jsp: *.jsp,*.jspf
5 | # Without that bnd wont find the annotations
6 | -metatype: *
7 | -plugin.bundle: com.liferay.ant.bnd.resource.bundle.ResourceBundleLoaderAnalyzerPlugin
8 | -plugin.jsp: com.liferay.ant.bnd.jsp.JspAnalyzerPlugin
9 | -sources: true
10 |
--------------------------------------------------------------------------------
/liferay-scoped-group/src/main/resources/content/Language.properties:
--------------------------------------------------------------------------------
1 | foo-default-name=Foo Config Group
2 | foo-default-name-entry=Foo Config Entry
3 | foo-default-name-desc=Foo Config Description. The Foo Config encapsulates all configurations needed.
4 | foo-default-name-entry-desc=Foo Config Entry Description. The Entry configurates the Foo for the Bar. totally pointless but localized.
5 | category-section.my-foo-title=Fooable Things
6 | category.my-foo=Fooable Things
7 |
--------------------------------------------------------------------------------
/liferay-scoped-system/src/main/resources/content/Language.properties:
--------------------------------------------------------------------------------
1 | foo-default-name=Foo Config System
2 | foo-default-name-entry=Foo Config Entry
3 | foo-default-name-desc=Foo Config Description. The Foo Config encapsulates all configurations needed.
4 | foo-default-name-entry-desc=Foo Config Entry Description. The Entry configurates the Foo for the Bar. totally pointless but localized.
5 |
6 | category-section.my-foo-title=Fooable Things
7 | category.my-foo=Fooable Things
8 |
--------------------------------------------------------------------------------
/osgi-core-variable-substitution/src/main/resources/content/Language.properties:
--------------------------------------------------------------------------------
1 | foo-default-name=Foo Config Basic
2 | foo-default-name-entry=Foo Config Entry
3 | foo-default-env-entry=Foo Config Env Entry
4 | foo-default-system-entry=Foo Config System Property Entry
5 | foo-default-name-desc=Foo Config Description. The Foo Config encapsulates all configurations needed.
6 | foo-default-name-entry-desc=Foo Config Entry Description. The Entry configurates the Foo for the Bar. totally pointless but localized.
7 |
8 |
--------------------------------------------------------------------------------
/configuration-form-renderer/src/main/java/de/abiegel/configuration/osgi/liferay/configuration/form/renderer/constants/VocabularyConfigurationKeys.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi.liferay.configuration.form.renderer.constants;
2 |
3 |
4 | public class VocabularyConfigurationKeys {
5 |
6 | public static final String SERVICE_NAME = "de.abiegel.configuration.osgi.liferay.configuration.form.renderer";
7 | public static final String CONFIGURATION_NAME = "de.abiegel.configuration.osgi.liferay.configuration.form.renderer.VocabularyConfiguration";
8 | }
--------------------------------------------------------------------------------
/costum-config-category/bnd.bnd:
--------------------------------------------------------------------------------
1 | Bundle-Name: de.abiegel.configuration.category.foo
2 | Bundle-SymbolicName: de.abiegel.configuration.category.foo
3 | -plugin.resourcebundle: com.liferay.ant.bnd.resource.bundle.ResourceBundleLoaderAnalyzerPlugin
4 | Provide-Capability:\
5 | liferay.resource.bundle;resource.bundle.aggregate:String="(bundle.symbolic.name=de.abiegel.configuration.category.foo),(bundle.symbolic.name=com.liferay.configuration.admin.web)";bundle.symbolic.name=com.liferay.configuration.admin.web;resource.bundle.base.name="content.Language";service.ranking:Long="2";\
--------------------------------------------------------------------------------
/configuration-form-renderer/bnd.bnd:
--------------------------------------------------------------------------------
1 | Bundle-Name: de.abiegel.configuration.osgi.liferay.configuration.form.renderer
2 | Bundle-SymbolicName: de.abiegel.configuration.osgi.liferay.configuration.form.renderer
3 | -metatype: *
4 | -plugin.bundle: com.liferay.ant.bnd.resource.bundle.ResourceBundleLoaderAnalyzerPlugin
5 | -sources: true
6 | Export-Package:\
7 | de.abiegel.configuration.osgi.liferay.configuration.form.renderer,\
8 | de.abiegel.configuration.osgi.liferay.configuration.form.renderer.constants
9 | Web-ContextPath: /abiegel-configuration-form-renderer
10 |
--------------------------------------------------------------------------------
/liferay-scoped-company/src/main/resources/content/Language.properties:
--------------------------------------------------------------------------------
1 | foo-default-name=Foo Config Company
2 | foo-default-name-entry=Foo Config Entry
3 | foo-default-name-desc=Foo Config Description. The Foo Config encapsulates all configurations needed.
4 | foo-default-name-entry-desc=Foo Config Entry Description. The Entry configurates the Foo for the Bar. totally pointless but localized.
5 | category-section.my-foo-title=Fooable Things
6 | category.my-foo=Fooable Things
7 | foo-default-name-entry-list= Foo Dynamic List Entry
8 | foo-default-name-entry-list-desc=This list is dynamically populated.
9 |
10 |
--------------------------------------------------------------------------------
/ddm-form-definition/src/main/resources/content/Language.properties:
--------------------------------------------------------------------------------
1 | foo-default-name=DDM Form Annotation Driven UI Company
2 | foo-default-name-entry=Foo Config Entry
3 | foo-default-name-desc=Foo Config Description. The Foo Config encapsulates all configurations needed.
4 | foo-default-name-entry-desc=Foo Config Entry Description. The Entry configurates the Foo for the Bar. totally pointless but localized.
5 | category-section.my-foo-title=Fooable Things
6 | category.ddm-form=DDM Form Annotation Driven UI
7 | foo-default-name-entry-list= Foo Dynamic List Entry
8 | foo-default-name-entry-list-desc=This list is dynamically populated.
9 |
10 |
--------------------------------------------------------------------------------
/osgi-core-annotation/README.md:
--------------------------------------------------------------------------------
1 | # OSGI Configuration example
2 |
3 | The example consists of an Java annotation annotated with pure osgi metadata.
4 | In Liferay DXP these components will be useable in:
5 | _Control Panel > System Settings_
6 |
7 | The default location is the Category Section _Plattform_ and the Category _Third Party_.
8 |
9 | 
10 |
11 | The default scope is the system scope.
12 | 
13 |
14 |
15 |
--------------------------------------------------------------------------------
/configuration-form-renderer/src/main/java/de/abiegel/configuration/osgi/liferay/configuration/form/renderer/VocabularyConfigurationBeanDeclaration.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi.liferay.configuration.form.renderer;
2 |
3 | import com.liferay.portal.kernel.settings.definition.ConfigurationBeanDeclaration;
4 | import org.osgi.service.component.annotations.Component;
5 |
6 | /**
7 | * This class is needed by OSGi to obtain the proper ConfigurationFormRenderer
8 | */
9 | @Component
10 | public class VocabularyConfigurationBeanDeclaration implements ConfigurationBeanDeclaration {
11 |
12 | @Override
13 | public Class> getConfigurationBeanClass() {
14 | return VocabularyConfiguration.class;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/osgi-core-annotation/src/main/java/de/abiegel/configuration/osgi/ConfiguredComponentConfig.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi;
2 |
3 | import org.osgi.service.metatype.annotations.AttributeDefinition;
4 | import org.osgi.service.metatype.annotations.AttributeType;
5 | import org.osgi.service.metatype.annotations.ObjectClassDefinition;
6 |
7 |
8 | @ObjectClassDefinition(name = "foo-default-name", description = "foo-default-name-desc" , localization="content/Language")
9 | public @interface ConfiguredComponentConfig {
10 |
11 | @AttributeDefinition(name = "foo-default-name-entry", required = true, type = AttributeType.STRING, description = "foo-default-name-entry-desc")
12 | String defaultName() default "Foo";
13 | }
14 |
--------------------------------------------------------------------------------
/liferay-scoped-group/src/main/java/de/abiegel/configuration/osgi/group/ConfiguredComponentConfigurationBeanDeclaration.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi.group;
2 |
3 | import org.osgi.service.component.annotations.Component;
4 |
5 | import com.liferay.portal.kernel.settings.definition.ConfigurationBeanDeclaration;
6 |
7 | /**
8 | *
9 | * @author abiegel
10 | * @see https://dev.liferay.com/de/develop/tutorials/-/knowledge_base/7-1/scoping-configurations
11 | */
12 | @Component
13 | public class ConfiguredComponentConfigurationBeanDeclaration implements ConfigurationBeanDeclaration {
14 |
15 | @Override
16 | public Class> getConfigurationBeanClass() {
17 | return GroupConfiguredComponentConfig.class;
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/ddm-form-definition/src/main/java/de/abiegel/configuration/osgi/liferay/ddm/form/ConfiguredComponentConfigurationBeanDeclaration.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi.liferay.ddm.form;
2 |
3 | import org.osgi.service.component.annotations.Component;
4 |
5 | import com.liferay.portal.kernel.settings.definition.ConfigurationBeanDeclaration;
6 |
7 | /**
8 | *
9 | * @author abiegel
10 | * @see https://dev.liferay.com/de/develop/tutorials/-/knowledge_base/7-1/scoping-configurations
11 | */
12 | @Component
13 | public class ConfiguredComponentConfigurationBeanDeclaration implements ConfigurationBeanDeclaration {
14 |
15 | @Override
16 | public Class> getConfigurationBeanClass() {
17 | return CompanyConfiguredComponentConfig.class;
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/liferay-scoped-system/src/main/java/de/abiegel/configuration/osgi/system/ConfiguredComponentConfigurationBeanDeclaration.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi.system;
2 |
3 | import org.osgi.service.component.annotations.Component;
4 |
5 | import com.liferay.portal.kernel.settings.definition.ConfigurationBeanDeclaration;
6 |
7 | /**
8 | *
9 | * @author abiegel
10 | * @see https://dev.liferay.com/de/develop/tutorials/-/knowledge_base/7-1/scoping-configurations
11 | */
12 | @Component
13 | public class ConfiguredComponentConfigurationBeanDeclaration implements ConfigurationBeanDeclaration {
14 |
15 | @Override
16 | public Class> getConfigurationBeanClass() {
17 | return SystemConfiguredComponentConfig.class;
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/liferay-scoped-company/src/main/java/de/abiegel/configuration/osgi/company/ConfiguredComponentConfigurationBeanDeclaration.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi.company;
2 |
3 | import org.osgi.service.component.annotations.Component;
4 |
5 | import com.liferay.portal.kernel.settings.definition.ConfigurationBeanDeclaration;
6 |
7 | /**
8 | *
9 | * @author abiegel
10 | * @see https://dev.liferay.com/de/develop/tutorials/-/knowledge_base/7-1/scoping-configurations
11 | */
12 | @Component
13 | public class ConfiguredComponentConfigurationBeanDeclaration implements ConfigurationBeanDeclaration {
14 |
15 | @Override
16 | public Class> getConfigurationBeanClass() {
17 | return CompanyConfiguredComponentConfig.class;
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/ddm-form-definition/src/main/java/de/abiegel/configuration/osgi/liferay/ddm/form/FooConfigurationDDMFormDeclaration.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi.liferay.ddm.form;
2 |
3 | import com.liferay.configuration.admin.definition.ConfigurationDDMFormDeclaration;
4 |
5 | import org.osgi.service.component.annotations.Component;
6 |
7 | @Component(
8 | immediate = true,
9 | property = "configurationPid=de.abiegel.configuration.osgi.liferay.ddm.form.CompanyConfiguredComponentConfig",
10 | service = ConfigurationDDMFormDeclaration.class
11 | )
12 | public class FooConfigurationDDMFormDeclaration
13 | implements ConfigurationDDMFormDeclaration {
14 |
15 | @Override
16 | public Class> getDDMFormClass() {
17 | return MyFooConfigurationForm.class;
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: '3'
2 | services:
3 | liferay:
4 | #image: liferay/portal:7.3.6-ga7
5 | image: liferay/dxp:7.3.10-dxp-1
6 | environment:
7 | - LIFERAY_TERMS_PERIOD_OF_PERIOD_USE_PERIOD_REQUIRED=false
8 | - LIFERAY_PASSWORDS_PERIOD_DEFAULT_PERIOD_POLICY_PERIOD_CHANGE_PERIOD_REQUIRED=false
9 | - LIFERAY_USERS_PERIOD_REMINDER_PERIOD_QUERIES_PERIOD_ENABLED=false
10 | - LIFERAY_USERS_PERIOD_REMINDER_PERIOD_QUERIES_PERIOD_REQUIRED=false
11 | - LIFERAY_USERS_PERIOD_REMINDER_PERIOD_QUERIES_PERIOD_CUSTOM_PERIOD_QUESTION_PERIOD_ENABLED=false
12 | - LIFERAY_SETUP_PERIOD_WIZARD_PERIOD_ENABLED=false
13 | ports:
14 | - 8080:8080
15 | volumes:
16 | - ./deploy:/etc/liferay/mount/deploy
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/liferay-scoped-system/src/main/java/de/abiegel/configuration/osgi/system/FooCategory.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi.system;
2 |
3 | import org.osgi.service.component.annotations.Component;
4 |
5 | import com.liferay.configuration.admin.category.ConfigurationCategory;
6 |
7 | //@Component
8 | public class FooCategory implements ConfigurationCategory {
9 |
10 | @Override
11 | public String getCategoryKey() {
12 |
13 | return "my-foo";
14 | }
15 |
16 | @Override
17 | public String getCategorySection() {
18 | return "my-foo-title";
19 | }
20 | /**
21 | * choose one of
22 | * @see https://clayui.com/docs/components/icons.html
23 | */
24 | @Override
25 | public String getCategoryIcon() {
26 |
27 | return "third-party";
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/costum-config-category/src/main/java/de/abiegel/configuration/category/foo/FooCategory.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.category.foo;
2 |
3 | import org.osgi.service.component.annotations.Component;
4 |
5 | import com.liferay.configuration.admin.category.ConfigurationCategory;
6 |
7 | @Component
8 | public class FooCategory implements ConfigurationCategory {
9 |
10 | @Override
11 | public String getCategoryKey() {
12 |
13 | return "my-foo";
14 | }
15 |
16 | @Override
17 | public String getCategorySection() {
18 | return "my-foo-title";
19 | }
20 |
21 | /**
22 | * choose one of
23 | * @see https://clayui.com/docs/components/icons.html
24 | */
25 | @Override
26 | public String getCategoryIcon() {
27 |
28 | return "third-party";
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/configuration-form-renderer/src/main/resources/META-INF/resources/configuration.jsp:
--------------------------------------------------------------------------------
1 | <%@ include file="init.jsp" %>
2 |
3 |
6 |
7 |
9 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/liferay-scoped-portlet-instance/src/main/resources/content/Language.properties:
--------------------------------------------------------------------------------
1 | foo-default-name=Foo Config Portlet
2 | foo-default-name-entry=Foo Config Entry
3 | foo-default-name-desc=Foo Config Description. The Foo Config encapsulates all configurations needed.
4 | foo-default-name-entry-desc=Foo Config Entry Description. The Entry configurates the Foo for the Bar. totally pointless but localized.
5 |
6 | category-section.my-foo-title=Fooable Things
7 | category.my-foo=Fooable Things
8 |
9 | javax.portlet.title.blade_portlet_jsp_JSPPortlet=OSGI Configured Portlet
10 | javax.portlet.display-name.blade_portlet_jsp_JSPPortlet=OSGI Configured Portlet
11 | javax.portlet.short-title.blade_portlet_jsp_JSPPortlet=OSGI Configured Portlet
12 | javax.portlet.keywords.blade_portlet_jsp_JSPPortlet=BLADE,jsp
13 | blade_portlet_jsp_JSPPortlet.caption=Hello from OSGI Configured Portlet!
14 |
--------------------------------------------------------------------------------
/liferay-scoped-portlet-instance/src/main/java/de/abiegel/configuration/osgi/example/settings/definition/ConfiguredComponentConfigurationBeanDeclaration.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi.example.settings.definition;
2 |
3 | import org.osgi.service.component.annotations.Component;
4 |
5 | import de.abiegel.configuration.osgi.example.ConfiguredComponentConfig;
6 |
7 | import com.liferay.portal.kernel.settings.definition.ConfigurationBeanDeclaration;
8 |
9 | /**
10 | *
11 | * @author abiegel
12 | * @see https://dev.liferay.com/de/develop/tutorials/-/knowledge_base/7-1/scoping-configurations
13 | */
14 | @Component
15 | public class ConfiguredComponentConfigurationBeanDeclaration implements ConfigurationBeanDeclaration {
16 |
17 | @Override
18 | public Class> getConfigurationBeanClass() {
19 | return ConfiguredComponentConfig.class;
20 | }
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/liferay-scoped-portlet-instance/README.md:
--------------------------------------------------------------------------------
1 | # Portlet Instance Scoped Configurations
2 | Since DXP 7.2:
3 | Use PortletDisplay. This is the recommended approach for configurations at the PORTLET_INSTANCE scope, but only works at that scope.
4 | the ConfigurationProviderUtil will not work here (in 7.2)
5 |
6 | "https://portal.liferay.dev/docs/7-2/frameworks/-/knowledge_base/f/reading-scoped-configuration-values"
7 |
8 |
9 | The Config can be viewes in System and Instance settings
10 | ## System Settings - Views
11 | 
12 |
13 | 
14 | ## Portlet - Views
15 |
16 | 
17 | 
18 |
19 | ## Configuration View
20 |
21 | 
22 |
--------------------------------------------------------------------------------
/liferay-scoped-group/src/main/java/de/abiegel/configuration/osgi/group/GroupConfiguredComponentConfig.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi.group;
2 |
3 | import com.liferay.portal.configuration.metatype.annotations.ExtendedObjectClassDefinition;
4 | import com.liferay.portal.configuration.metatype.annotations.ExtendedObjectClassDefinition.Scope;
5 |
6 | import aQute.bnd.annotation.metatype.Meta.AD;
7 | import aQute.bnd.annotation.metatype.Meta.OCD;
8 |
9 |
10 | @ExtendedObjectClassDefinition(scope = Scope.GROUP, category = "my-foo")
11 | @OCD( id = "de.abiegel.configuration.osgi.group.GroupConfiguredComponentConfig", localization = "content/Language", name = "foo-default-name", description= "foo-default-name-desc")
12 | public @interface GroupConfiguredComponentConfig {
13 |
14 | @AD(required = false, name = "foo-default-name-entry", deflt = "FOO", description= "foo-default-name-entry-desc")
15 | String defaultName() default "Foo";
16 | }
17 |
--------------------------------------------------------------------------------
/liferay-scoped-system/src/main/java/de/abiegel/configuration/osgi/system/SystemConfiguredComponentConfig.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi.system;
2 |
3 | import com.liferay.portal.configuration.metatype.annotations.ExtendedObjectClassDefinition;
4 | import com.liferay.portal.configuration.metatype.annotations.ExtendedObjectClassDefinition.Scope;
5 |
6 | import aQute.bnd.annotation.metatype.Meta.AD;
7 | import aQute.bnd.annotation.metatype.Meta.OCD;
8 |
9 |
10 | @ExtendedObjectClassDefinition(scope = Scope.SYSTEM, category = "my-foo")
11 | @OCD( id = "de.abiegel.configuration.osgi.system.SystemConfiguredComponentConfig", localization = "content/Language", name = "foo-default-name", description= "foo-default-name-desc")
12 | public @interface SystemConfiguredComponentConfig {
13 |
14 | @AD(required = false, name = "foo-default-name-entry", deflt = "FOO", description= "foo-default-name-entry-desc")
15 | String defaultName() default "Foo";
16 | }
17 |
--------------------------------------------------------------------------------
/liferay-scoped-portlet-instance/src/main/java/de/abiegel/configuration/osgi/example/ConfiguredComponentConfig.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi.example;
2 |
3 | import com.liferay.portal.configuration.metatype.annotations.ExtendedObjectClassDefinition;
4 | import com.liferay.portal.configuration.metatype.annotations.ExtendedObjectClassDefinition.Scope;
5 |
6 | import aQute.bnd.annotation.metatype.Meta.AD;
7 | import aQute.bnd.annotation.metatype.Meta.OCD;
8 |
9 |
10 | @ExtendedObjectClassDefinition( scope = Scope.PORTLET_INSTANCE, category = "my-foo")
11 | @OCD( id = "de.abiegel.configuration.osgi.example.ConfiguredComponentConfig", localization = "content/Language", name = "foo-default-name", description= "foo-default-name-desc")
12 | public @interface ConfiguredComponentConfig {
13 |
14 | @AD(required = false, name = "foo-default-name-entry", deflt = "FOO", description= "foo-default-name-entry-desc")
15 | String defaultName() default "Foo";
16 | }
17 |
--------------------------------------------------------------------------------
/ddm-form-definition/src/main/java/de/abiegel/configuration/osgi/liferay/ddm/form/DDMFormCategory.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi.liferay.ddm.form;
2 |
3 | import org.osgi.service.component.annotations.Component;
4 |
5 | import com.liferay.configuration.admin.category.ConfigurationCategory;
6 |
7 | @Component
8 | public class DDMFormCategory implements ConfigurationCategory {
9 |
10 | @Override
11 | public String getCategoryKey() {
12 |
13 | return "ddm-form";
14 | }
15 |
16 | @Override
17 | public String getCategorySection() {
18 | return "my-foo-title";
19 | }
20 |
21 | /**
22 | * choose one of
23 | * @see https://clayui.com/docs/components/icons.html
24 | */
25 | @Override
26 | public String getCategoryIcon() {
27 |
28 | return "third-party";
29 | }
30 |
31 | /**
32 | * What is that for ??
33 | */
34 | @Override
35 | public String getBundleSymbolicName() {
36 | return "de.abiegel.configuration.osgi.liferay.ddm.form";
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/liferay-scoped-company/src/main/java/de/abiegel/configuration/osgi/company/FooCategory.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi.company;
2 |
3 | import org.osgi.service.component.annotations.Component;
4 |
5 | import com.liferay.configuration.admin.category.ConfigurationCategory;
6 |
7 | //@Component
8 | public class FooCategory implements ConfigurationCategory {
9 |
10 | @Override
11 | public String getCategoryKey() {
12 |
13 | return "my-foo";
14 | }
15 |
16 | @Override
17 | public String getCategorySection() {
18 | return "my-foo-title";
19 | }
20 |
21 | /**
22 | * choose one of
23 | * @see https://clayui.com/docs/components/icons.html
24 | */
25 | @Override
26 | public String getCategoryIcon() {
27 |
28 | return "third-party";
29 | }
30 |
31 | /**
32 | * What is that for ??
33 | */
34 | @Override
35 | public String getBundleSymbolicName() {
36 | return "de.abiegel.configuration.osgi.company";
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/liferay-scoped-portlet-instance/src/main/java/de/abiegel/configuration/osgi/example/FooCategory.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi.example;
2 |
3 | import org.osgi.service.component.annotations.Component;
4 |
5 | import com.liferay.configuration.admin.category.ConfigurationCategory;
6 |
7 | //@Component
8 | public class FooCategory implements ConfigurationCategory {
9 |
10 | @Override
11 | public String getCategoryKey() {
12 |
13 | return "my-foo";
14 | }
15 |
16 | @Override
17 | public String getCategorySection() {
18 | return "my-foo-title";
19 | }
20 | /**
21 | * choose one of
22 | * @see https://clayui.com/docs/components/icons.html
23 | */
24 | @Override
25 | public String getCategoryIcon() {
26 |
27 | return "third-party";
28 | }
29 |
30 | /**
31 | * What is that for ??
32 | */
33 | @Override
34 | public String getBundleSymbolicName() {
35 | return "de.abiegel.configuration.osgi.example";
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/liferay-scoped-group/src/main/java/de/abiegel/configuration/osgi/group/FooCategory.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi.group;
2 |
3 | import org.osgi.service.component.annotations.Component;
4 |
5 | import com.liferay.configuration.admin.category.ConfigurationCategory;
6 |
7 | //@Component
8 | public class FooCategory implements ConfigurationCategory {
9 |
10 | @Override
11 | public String getCategoryKey() {
12 |
13 | return "my-foo";
14 | }
15 |
16 | @Override
17 | public String getCategorySection() {
18 | return "my-foo-title";
19 | }
20 |
21 | /**
22 | * choose one of
23 | * @see https://clayui.com/docs/components/icons.html
24 | */
25 | @Override
26 | public String getCategoryIcon() {
27 |
28 | return "third-party";
29 | }
30 | //FIXME: please
31 | /**
32 | * What is that for ??
33 | */
34 | @Override
35 | public String getBundleSymbolicName() {
36 | return "de.abiegel.configuration.osgi.group";
37 | }
38 |
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/osgi-core-variable-substitution/src/main/java/de/abiegel/configuration/osgi/core/variable/substitution/ConfiguredComponentConfig.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi.core.variable.substitution;
2 |
3 | import org.osgi.service.metatype.annotations.AttributeDefinition;
4 | import org.osgi.service.metatype.annotations.AttributeType;
5 | import org.osgi.service.metatype.annotations.ObjectClassDefinition;
6 |
7 |
8 | @ObjectClassDefinition(name = "foo-default-name", description = "foo-default-name-desc" , localization="content/Language")
9 | public @interface ConfiguredComponentConfig {
10 |
11 | @AttributeDefinition(name = "foo-default-env-entry", required = true, type = AttributeType.STRING, description = "foo-default-name-entry-desc")
12 | String defaultEnvVar() default "Foo";
13 |
14 |
15 | @AttributeDefinition(name = "foo-default-system-entry", required = true, type = AttributeType.STRING, description = "foo-default-name-entry-desc" )
16 | String defaultSystemPropVar() default "Foo";
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/configuration-form-renderer/README.md:
--------------------------------------------------------------------------------
1 | # Configuration Form Renderer
2 |
3 | A Configuration Form Renderer allows rendering a specific UI. If yout want to execute a Action you have to use an Configuration ScreenContributor.
4 |
5 | As it can be seen .. liferay generate also the default UI in LIferay DXP.
6 | HINT If you are trying to circumvent that by setting generateUI .. Is will completely hide the configuration category (but the category section is there)
7 |
8 | ```java
9 | @ExtendedObjectClassDefinition(
10 | //generateUI = false,
11 | category = "vocabulary-configuration",
12 | scope = ExtendedObjectClassDefinition.Scope.COMPANY
13 | )
14 | ```
15 |
16 | 
17 |
18 | 
19 |
20 | ## Sources
21 |
22 | * https://help.liferay.com/hc/en-us/articles/360028726212-Customizing-the-Configuration-User-Interface
23 | * https://help.liferay.com/hc/en-us/articles/360029045771-Configuration-Form-Renderer
24 |
25 |
26 |
--------------------------------------------------------------------------------
/configuration-form-renderer/src/main/java/de/abiegel/configuration/osgi/liferay/configuration/form/renderer/VocabularyConfiguration.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi.liferay.configuration.form.renderer;
2 |
3 | import aQute.bnd.annotation.metatype.Meta;
4 |
5 | import static de.abiegel.configuration.osgi.liferay.configuration.form.renderer.constants.VocabularyConfigurationKeys.CONFIGURATION_NAME;
6 |
7 | import com.liferay.portal.configuration.metatype.annotations.ExtendedObjectClassDefinition;
8 |
9 | @ExtendedObjectClassDefinition(
10 | generateUI = false,
11 | category = "vocabulary-configuration",
12 | scope = ExtendedObjectClassDefinition.Scope.COMPANY
13 | )
14 | @Meta.OCD(id = CONFIGURATION_NAME,
15 | localization = "content/Language",
16 | name = "vocabulary-configuration")
17 | public interface VocabularyConfiguration {
18 |
19 | @Meta.AD(
20 | deflt = "-1",
21 | name = "vocabulary",
22 | required = false,
23 | description = "Vocabulary selection"
24 | )
25 | long vocabulary();
26 | }
27 |
--------------------------------------------------------------------------------
/osgi-core-variable-substitution/README.md:
--------------------------------------------------------------------------------
1 | # OSGI Configuration example with variable substitution
2 |
3 | NOT RUNNING IN LIFERAY DXP 7.3
4 |
5 | The example consists of an Java annotation annotated with pure osgi metadata.
6 | In Liferay DXP these components will be useable in:
7 | _Control Panel > System Settings_
8 |
9 | The default location is the Category Section _Plattform_ and the Category _Third Party_.
10 |
11 | 
12 |
13 | The default scope is the system scope.
14 | 
15 |
16 | The sample demonstrates how to use environment & system properties in config files.
17 |
18 | ```
19 | defaultEnvVar=${env:PATH}
20 | defaultSystemPropVar=${os.name}
21 | ```
22 |
23 |
24 | ## Sources
25 |
26 | * https://karaf.apache.org/manual/latest/#_configuration_3
27 | * https://felix.apache.org/documentation/subprojects/apache-felix-file-install.html
--------------------------------------------------------------------------------
/liferay-scoped-portlet-instance/src/main/java/de/abiegel/configuration/osgi/example/settings/definition/OsgiConfiguredPortletInstanceConfigurationPidMapping.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi.example.settings.definition;
2 |
3 | import org.osgi.service.component.annotations.Component;
4 |
5 | import de.abiegel.configuration.osgi.example.ConfiguredComponentConfig;
6 |
7 | import com.liferay.portal.kernel.settings.definition.ConfigurationPidMapping;
8 |
9 | /**
10 | *
11 | * connects the osgi configuration with the instance the internal instance in the setup ui provides , without that the default value is not going to be displayed
12 | *
13 | */
14 | @Component
15 | public class OsgiConfiguredPortletInstanceConfigurationPidMapping implements ConfigurationPidMapping {
16 |
17 | @Override
18 | public Class> getConfigurationBeanClass() {
19 | return ConfiguredComponentConfig.class;
20 | }
21 |
22 | @Override
23 | public String getConfigurationPid() {
24 | return "de_abiegel_configuration_osgi_example_OsgiConfiguredPortlet";
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/liferay-scoped-portlet-instance/src/main/resources/META-INF/resources/osgiconfiguredportlet/view.jsp:
--------------------------------------------------------------------------------
1 | <%--
2 | /**
3 | * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
4 | *
5 | * This library is free software; you can redistribute it and/or modify it under
6 | * the terms of the GNU Lesser General Public License as published by the Free
7 | * Software Foundation; either version 2.1 of the License, or (at your option)
8 | * any later version.
9 | *
10 | * This library is distributed in the hope that it will be useful, but WITHOUT
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 | * details.
14 | */
15 | --%>
16 |
17 | <%@ include file="/osgiconfiguredportlet/init.jsp" %>
18 |
19 |
20 |
21 |
22 |
23 |
24 | Config by ConfigurationProviderUtil: Configured Entry Name : <%= configuration.defaultName() %>
25 | Config by portletDisplay: Configured Entry Name : <%= instanceConfiguration.defaultName() %>
26 |
--------------------------------------------------------------------------------
/osgi-core-annotation/src/main/java/de/abiegel/configuration/osgi/ConfiguredComponent.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi;
2 |
3 | import org.osgi.service.component.annotations.Activate;
4 | import org.osgi.service.component.annotations.Component;
5 | import org.osgi.service.component.annotations.Modified;
6 | import org.osgi.service.metatype.annotations.Designate;
7 |
8 | import com.liferay.portal.kernel.log.Log;
9 | import com.liferay.portal.kernel.log.LogFactoryUtil;
10 |
11 | /**
12 | * @author usiabiegel
13 | */
14 | @Designate(ocd = ConfiguredComponentConfig.class)
15 | @Component(configurationPid = {
16 | "de.abiegel.configuration.osgi.ConfiguredComponentConfig" }, immediate = true, service = Fooable.class)
17 | public class ConfiguredComponent implements Fooable {
18 |
19 | private static final Log logger = LogFactoryUtil.getLog(ConfiguredComponent.class);
20 |
21 | private ConfiguredComponentConfig configuration;
22 |
23 | @Activate
24 | @Modified
25 | protected void readConfig(ConfiguredComponentConfig config) {
26 | this.configuration = config;
27 | }
28 |
29 | @Override
30 | public void foo(){
31 | logger.fatal("evil things can be done with " + configuration.defaultName());
32 | }
33 |
34 | }
--------------------------------------------------------------------------------
/osgi-core-variable-substitution/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 | 4.0.0
7 | de.abiegel.configuration.osgi.core.variable.substitution
8 |
9 |
10 | de.abiegel.configuration.osgi
11 | 1.0.0
12 | ../
13 | de.abiegel.configuration.osgi.example
14 |
15 |
16 |
17 | com.liferay.portal
18 | com.liferay.portal.kernel
19 | provided
20 |
21 |
22 | org.osgi
23 | org.osgi.service.component.annotations
24 | 1.3.0
25 | provided
26 |
27 |
28 | org.osgi
29 | org.osgi.service.metatype.annotations
30 | 1.3.0
31 | provided
32 |
33 |
34 |
--------------------------------------------------------------------------------
/liferay-scoped-company/src/main/java/de/abiegel/configuration/osgi/company/CompanyConfiguredComponentConfig.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi.company;
2 |
3 | import com.liferay.portal.configuration.metatype.annotations.ExtendedObjectClassDefinition;
4 | import com.liferay.portal.configuration.metatype.annotations.ExtendedObjectClassDefinition.Scope;
5 |
6 | import aQute.bnd.annotation.metatype.Meta.AD;
7 | import aQute.bnd.annotation.metatype.Meta.OCD;
8 |
9 | @ExtendedObjectClassDefinition(scope = Scope.COMPANY, category = "my-foo")
10 | @OCD(id = "de.abiegel.configuration.osgi.company.CompanyConfiguredComponentConfig", localization = "content/Language", name = "foo-default-name", description = "foo-default-name-desc")
11 | public @interface CompanyConfiguredComponentConfig {
12 |
13 | @AD(required = false, name = "foo-default-name-entry", deflt = "FOO", description = "foo-default-name-entry-desc")
14 | String defaultName() default "Foo";
15 |
16 | @AD(deflt = "enabled-with-warning", name = "foo-default-name-entry-list",description = "foo-default-name-entry-list-desc", optionLabels = { "enabled", "enabled-with-warning",
17 | "disabled" }, optionValues = { "enabled", "enabled-with-warning", "disabled" }, required = false)
18 | String entryList();
19 | }
20 |
--------------------------------------------------------------------------------
/osgi-core-annotation/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 | 4.0.0
7 | de.abiegel.configuration.osgi.core.annotation
8 |
9 |
10 | de.abiegel.configuration.osgi
11 | 1.0.0
12 | ../
13 | de.abiegel.configuration.osgi.example
14 |
15 |
16 |
17 | com.liferay.portal
18 | com.liferay.portal.kernel
19 | provided
20 |
21 |
22 | org.osgi
23 | org.osgi.service.component.annotations
24 | 1.3.0
25 | provided
26 |
27 |
28 | org.osgi
29 | org.osgi.service.metatype.annotations
30 | 1.3.0
31 | provided
32 |
33 |
34 |
--------------------------------------------------------------------------------
/costum-config-category/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 | de.abiegel.configuration.osgi
7 | de.abiegel.configuration.osgi.example
8 | 1.0.0
9 | ../
10 |
11 | 4.0.0
12 | de.abiegel.configuration.category
13 |
14 |
15 | com.liferay
16 | com.liferay.asset.auto.tagger.api
17 |
18 |
19 | com.liferay
20 | com.liferay.configuration.admin.api
21 | provided
22 |
23 |
24 | com.liferay.portal
25 | com.liferay.portal.kernel
26 | provided
27 |
28 |
29 | org.osgi
30 | org.osgi.service.component.annotations
31 | 1.3.0
32 | provided
33 |
34 |
35 |
--------------------------------------------------------------------------------
/liferay-scoped-portlet-instance/src/main/resources/META-INF/resources/osgiconfiguredportlet/configuration.jsp:
--------------------------------------------------------------------------------
1 | <%@ include file="/osgiconfiguredportlet/init.jsp"%>
2 |
3 | <%@ page import="com.liferay.portal.kernel.util.Constants"%>
4 |
5 |
7 |
8 |
10 |
11 |
12 |
14 |
15 |
17 |
18 |
20 |
21 |
22 |
23 |
25 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/osgi-core-variable-substitution/src/main/java/de/abiegel/configuration/osgi/core/variable/substitution/ConfiguredComponent.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi.core.variable.substitution;
2 |
3 | import com.liferay.portal.kernel.log.Log;
4 | import com.liferay.portal.kernel.log.LogFactoryUtil;
5 |
6 | import org.osgi.service.component.annotations.Activate;
7 | import org.osgi.service.component.annotations.Component;
8 | import org.osgi.service.component.annotations.ConfigurationPolicy;
9 | import org.osgi.service.component.annotations.Modified;
10 | import org.osgi.service.metatype.annotations.Designate;
11 |
12 | /**
13 | * @author usiabiegel
14 | */
15 | @Designate(ocd = ConfiguredComponentConfig.class)
16 | @Component(configurationPid = {
17 | "de.abiegel.configuration.osgi.core.variable.substitution.ConfiguredComponentConfig" }, immediate = true, service = Fooable.class, configurationPolicy = ConfigurationPolicy.REQUIRE)
18 | public class ConfiguredComponent implements Fooable {
19 |
20 | private static final Log logger = LogFactoryUtil.getLog(ConfiguredComponent.class);
21 |
22 | private ConfiguredComponentConfig configuration;
23 |
24 | @Activate
25 | @Modified
26 | protected void readConfig(final ConfiguredComponentConfig config) {
27 | this.configuration = config;
28 | }
29 |
30 | @Override
31 | public void foo() {
32 | logger.fatal("Env var Property entry" + configuration.defaultEnvVar());
33 | logger.fatal("System Property entry" + configuration.defaultSystemPropVar());
34 | }
35 |
36 | }
--------------------------------------------------------------------------------
/ddm-form-definition/src/main/java/de/abiegel/configuration/osgi/liferay/ddm/form/CompanyConfiguredComponentConfig.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi.liferay.ddm.form;
2 |
3 | import com.liferay.portal.configuration.metatype.annotations.ExtendedObjectClassDefinition;
4 | import com.liferay.portal.configuration.metatype.annotations.ExtendedObjectClassDefinition.Scope;
5 |
6 | import aQute.bnd.annotation.metatype.Meta.AD;
7 | import aQute.bnd.annotation.metatype.Meta.OCD;
8 |
9 | @ExtendedObjectClassDefinition(scope = Scope.COMPANY, category = "my-foo")
10 | @OCD(id = "de.abiegel.configuration.osgi.liferay.ddm.form.CompanyConfiguredComponentConfig", localization = "content/Language", name = "foo-default-name", description = "foo-default-name-desc")
11 | public @interface CompanyConfiguredComponentConfig {
12 |
13 | @AD(required = false, name = "foo-default-name-entry", deflt = "FOO", description = "foo-default-name-entry-desc")
14 | public String[] textArrayValues();
15 |
16 | @AD(required = false, name = "foo-default-name-entry", deflt = "", description = "foo-default-name-entry-desc")
17 | public String date();
18 |
19 | @AD(required = false, name = "foo-default-name-entry", deflt = "", description = "foo-default-name-entry-desc")
20 | public String select();
21 | @AD(required = false, name = "foo-default-name-entry", deflt = "", description = "foo-default-name-entry-desc")
22 | public String numeric();
23 | @AD(required = false, name = "foo-default-name-entry", deflt = "", description = "foo-default-name-entry-desc")
24 | public boolean checkbox();
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/liferay-scoped-system/src/main/java/de/abiegel/configuration/osgi/system/ConfiguredComponent.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi.system;
2 |
3 | import org.osgi.service.component.annotations.Activate;
4 | import org.osgi.service.component.annotations.Component;
5 | import org.osgi.service.component.annotations.Modified;
6 | import org.osgi.service.component.annotations.Reference;
7 |
8 | import com.liferay.portal.kernel.log.Log;
9 | import com.liferay.portal.kernel.log.LogFactoryUtil;
10 | import com.liferay.portal.kernel.module.configuration.ConfigurationException;
11 | import com.liferay.portal.kernel.module.configuration.ConfigurationProvider;
12 |
13 | /**
14 | * @author usiabiegel
15 | */
16 |
17 | @Component(configurationPid = {
18 | "de.abiegel.configuration.osgi.system.SystemConfiguredComponentConfig" }, immediate = true, service = Fooable.class)
19 | public class ConfiguredComponent implements Fooable {
20 |
21 | private static final Log logger = LogFactoryUtil.getLog(ConfiguredComponent.class);
22 |
23 | @Reference
24 | private ConfigurationProvider configurationProvider;
25 |
26 | private SystemConfiguredComponentConfig configuration;
27 | @Activate
28 | @Modified
29 | protected void readConfig() {
30 | try {
31 | this.configuration = configurationProvider.getSystemConfiguration(SystemConfiguredComponentConfig.class);
32 | } catch (ConfigurationException e) {
33 | logger.fatal("Cannot Acces config", e);
34 | }
35 | }
36 |
37 | @Override
38 | public void foo(){
39 | logger.fatal("evil things can be done with " + configuration.defaultName());
40 | }
41 |
42 | }
--------------------------------------------------------------------------------
/configuration-form-renderer/src/main/java/de/abiegel/configuration/osgi/liferay/configuration/form/renderer/ConfiguredComponent.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi.liferay.configuration.form.renderer;
2 |
3 | import org.osgi.service.component.annotations.Activate;
4 | import org.osgi.service.component.annotations.Component;
5 | import org.osgi.service.component.annotations.Modified;
6 | import org.osgi.service.component.annotations.Reference;
7 |
8 | import com.liferay.portal.kernel.log.Log;
9 | import com.liferay.portal.kernel.log.LogFactoryUtil;
10 | import com.liferay.portal.kernel.module.configuration.ConfigurationException;
11 | import com.liferay.portal.kernel.module.configuration.ConfigurationProvider;
12 |
13 | /**
14 | * @author usiabiegel
15 | */
16 |
17 | @Component( configurationPid = {
18 | "de.abiegel.configuration.osgi.liferay.configuration.form.renderer.VocabularyConfiguration" }, immediate = true, service = Fooable.class)
19 | public class ConfiguredComponent implements Fooable{
20 |
21 | private static final Log logger = LogFactoryUtil.getLog(ConfiguredComponent.class);
22 |
23 | @Reference
24 | private ConfigurationProvider configurationProvider;
25 |
26 | private VocabularyConfiguration configuration;
27 | @Activate
28 | @Modified
29 | protected void readConfig() {
30 | try {
31 | this.configuration = configurationProvider.getSystemConfiguration(VocabularyConfiguration.class);
32 | } catch (ConfigurationException e) {
33 | logger.fatal("Cannot Acces config", e);
34 | }
35 | }
36 |
37 |
38 | public void foo(){
39 | logger.fatal("evil things can be done with " + configuration);
40 | }
41 |
42 | }
--------------------------------------------------------------------------------
/configuration-form-renderer/src/main/java/de/abiegel/configuration/osgi/liferay/configuration/form/renderer/VocabularyConfigurationCategory.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi.liferay.configuration.form.renderer;
2 |
3 | import com.liferay.configuration.admin.category.ConfigurationCategory;
4 | import org.osgi.service.component.annotations.Component;
5 |
6 | @Component(service = ConfigurationCategory.class)
7 | public class VocabularyConfigurationCategory implements ConfigurationCategory {
8 |
9 | private static final String CATEGORY_ICON = "cog";
10 | private static final String CATEGORY_KEY = "vocabulary-configuration";
11 | private static final String CATEGORY_SECTION = "vocabulary-configuration";
12 |
13 | /**
14 | * Gets a string with the name of the icon used in the instance setting's main panel
15 | *
16 | * @return a string representing the name of the icon
17 | */
18 | @Override
19 | public String getCategoryIcon() {
20 | return CATEGORY_ICON;
21 | }
22 |
23 | /**
24 | * Gets a string with the key of the category used in the instance setting's main panel
25 | *
26 | * @return a string representing the key of the category
27 | */
28 | @Override
29 | public String getCategoryKey() {
30 | return CATEGORY_KEY;
31 | }
32 |
33 | /**
34 | * Gets a string with the name of the section used instance setting's main panel
35 | *
36 | * @return a string representing the name of the category section
37 | */
38 | @Override
39 | public String getCategorySection() {
40 | return CATEGORY_SECTION;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/liferay-scoped-portlet-instance/src/main/java/de/abiegel/configuration/osgi/example/PortletConfigurationAction.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi.example;
2 |
3 | import javax.servlet.ServletContext;
4 | import javax.servlet.http.HttpServletRequest;
5 |
6 | import com.liferay.portal.kernel.log.Log;
7 | import com.liferay.portal.kernel.log.LogFactoryUtil;
8 | import com.liferay.portal.kernel.portlet.ConfigurationAction;
9 | import com.liferay.portal.kernel.portlet.DefaultConfigurationAction;
10 | import com.liferay.portal.kernel.portlet.BaseJSPSettingsConfigurationAction;
11 | import org.osgi.service.component.annotations.Component;
12 | import org.osgi.service.component.annotations.ConfigurationPolicy;
13 | import org.osgi.service.component.annotations.Reference;
14 |
15 | @Component(configurationPid = "de.abiegel.configuration.osgi.example.ConfiguredComponentConfig", configurationPolicy = ConfigurationPolicy.OPTIONAL, immediate = true, property = {
16 | "javax.portlet.name=de_abiegel_configuration_osgi_example_OsgiConfiguredPortlet" }, service = ConfigurationAction.class)
17 | public class PortletConfigurationAction extends DefaultConfigurationAction {
18 |
19 | private static final Log logger = LogFactoryUtil.getLog(PortletConfigurationAction.class);
20 |
21 | @Override
22 | public String getJspPath(HttpServletRequest httpServletRequest) {
23 | return "/osgiconfiguredportlet/configuration.jsp";
24 | }
25 |
26 | @Override
27 | @Reference(target = "(osgi.web.symbolicname=de.abiegel.configuration.osgi.portlet.instance)", unbind = "-")
28 | public void setServletContext(ServletContext servletContext) {
29 | super.setServletContext(servletContext);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/liferay-scoped-group/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 | 4.0.0
6 | de.abiegel.configuration.osgi.liferay.scoped.group
7 |
8 | de.abiegel.configuration.osgi
9 | 1.0.0
10 | ../
11 | de.abiegel.configuration.osgi.example
12 |
13 |
14 |
15 | com.liferay
16 | com.liferay.configuration.admin.api
17 | provided
18 |
19 |
20 | com.liferay.portal
21 | com.liferay.portal.kernel
22 | provided
23 |
24 |
25 | org.osgi
26 | org.osgi.service.component.annotations
27 | 1.3.0
28 | provided
29 |
30 |
31 | org.osgi
32 | org.osgi.service.metatype.annotations
33 | 1.3.0
34 | provided
35 |
36 |
37 | biz.aQute.bnd
38 | biz.aQute.bndlib
39 | ${biz.aQute.bndlib.version}
40 | provided
41 |
42 |
43 | com.liferay
44 | com.liferay.portal.configuration.metatype.api
45 | provided
46 |
47 |
48 |
--------------------------------------------------------------------------------
/liferay-scoped-system/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 | 4.0.0
6 | de.abiegel.configuration.osgi.liferay.scoped.system
7 |
8 | de.abiegel.configuration.osgi
9 | 1.0.0
10 | ../
11 | de.abiegel.configuration.osgi.example
12 |
13 |
14 |
15 | com.liferay
16 | com.liferay.configuration.admin.api
17 | provided
18 |
19 |
20 | com.liferay.portal
21 | com.liferay.portal.kernel
22 | provided
23 |
24 |
25 | org.osgi
26 | org.osgi.service.component.annotations
27 | 1.3.0
28 | provided
29 |
30 |
31 | org.osgi
32 | org.osgi.service.metatype.annotations
33 | 1.3.0
34 | provided
35 |
36 |
37 | biz.aQute.bnd
38 | biz.aQute.bndlib
39 | ${biz.aQute.bndlib.version}
40 | provided
41 |
42 |
43 | com.liferay
44 | com.liferay.portal.configuration.metatype.api
45 | provided
46 |
47 |
48 |
--------------------------------------------------------------------------------
/liferay-scoped-company/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 | 4.0.0
7 | de.abiegel.configuration.osgi.liferay.scoped.company
8 |
9 | de.abiegel.configuration.osgi
10 | 1.0.0
11 | ../
12 | de.abiegel.configuration.osgi.example
13 |
14 |
15 |
16 | com.liferay
17 | com.liferay.configuration.admin.api
18 | provided
19 |
20 |
21 | com.liferay.portal
22 | com.liferay.portal.kernel
23 | provided
24 |
25 |
26 | org.osgi
27 | org.osgi.service.component.annotations
28 | 1.3.0
29 | provided
30 |
31 |
32 | org.osgi
33 | org.osgi.service.metatype.annotations
34 | 1.3.0
35 | provided
36 |
37 |
38 | biz.aQute.bnd
39 | biz.aQute.bndlib
40 | ${biz.aQute.bndlib.version}
41 | provided
42 |
43 |
44 | com.liferay
45 | com.liferay.portal.configuration.metatype.api
46 | provided
47 |
48 |
49 |
--------------------------------------------------------------------------------
/ddm-form-definition/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 | 4.0.0
7 | de.abiegel.configuration.osgi.liferay.ddm.form
8 |
9 | de.abiegel.configuration.osgi
10 | 1.0.0
11 | ../
12 | de.abiegel.configuration.osgi.example
13 |
14 |
15 |
16 | com.liferay
17 | com.liferay.configuration.admin.api
18 | provided
19 |
20 |
21 | com.liferay
22 | com.liferay.dynamic.data.mapping.api
23 | provided
24 |
25 |
26 | com.liferay.portal
27 | com.liferay.portal.kernel
28 | provided
29 |
30 |
31 | org.osgi
32 | org.osgi.service.component.annotations
33 | 1.3.0
34 | provided
35 |
36 |
37 | org.osgi
38 | org.osgi.service.metatype.annotations
39 | 1.3.0
40 | provided
41 |
42 |
43 | biz.aQute.bnd
44 | biz.aQute.bndlib
45 | ${biz.aQute.bndlib.version}
46 | provided
47 |
48 |
49 | com.liferay
50 | com.liferay.portal.configuration.metatype.api
51 | provided
52 |
53 |
54 |
--------------------------------------------------------------------------------
/liferay-scoped-group/src/main/java/de/abiegel/configuration/osgi/group/ConfiguredComponent.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.osgi.group;
2 |
3 | import com.liferay.portal.kernel.exception.PortalException;
4 | import com.liferay.portal.kernel.log.Log;
5 | import com.liferay.portal.kernel.log.LogFactoryUtil;
6 | import com.liferay.portal.kernel.model.Company;
7 | import com.liferay.portal.kernel.module.configuration.ConfigurationException;
8 | import com.liferay.portal.kernel.module.configuration.ConfigurationProvider;
9 | import com.liferay.portal.kernel.service.CompanyLocalService;
10 | import com.liferay.portal.kernel.util.PropsKeys;
11 | import com.liferay.portal.kernel.util.PropsUtil;
12 |
13 | import org.osgi.service.component.annotations.Activate;
14 | import org.osgi.service.component.annotations.Component;
15 | import org.osgi.service.component.annotations.Modified;
16 | import org.osgi.service.component.annotations.Reference;
17 |
18 | /**
19 | * @author usiabiegel
20 | */
21 | @Component(configurationPid = {
22 | "de.abiegel.configuration.osgi.group.GroupConfiguredComponentConfig" }, immediate = true, service = Fooable.class)
23 | public class ConfiguredComponent implements Fooable {
24 |
25 | private static final Log logger = LogFactoryUtil.getLog(ConfiguredComponent.class);
26 |
27 | @Reference
28 | private ConfigurationProvider configurationProvider;
29 |
30 | @Reference
31 | private CompanyLocalService companyLocalService;
32 |
33 | private GroupConfiguredComponentConfig configuration;
34 |
35 | @Activate
36 | @Modified
37 | protected void readConfig() {
38 | long groupId = 0;
39 | try {
40 | Company company = companyLocalService.getCompanyByMx(PropsUtil.get(PropsKeys.COMPANY_DEFAULT_WEB_ID));
41 | this.configuration = configurationProvider.getGroupConfiguration(GroupConfiguredComponentConfig.class,
42 | company.getGroup().getGroupId());
43 | } catch ( PortalException e) {
44 | logger.fatal("Cannot Acces config", e);
45 | }
46 | }
47 |
48 |
49 | @Override
50 | public void foo(){
51 | logger.fatal("evil things can be done with " + configuration.defaultName());
52 | }
53 |
54 | }
--------------------------------------------------------------------------------
/liferay-scoped-portlet-instance/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 | de.abiegel.configuration.osgi.liferay.scoped.portlet
7 |
8 | de.abiegel.configuration.osgi
9 | de.abiegel.configuration.osgi.example
10 | 1.0.0
11 | ../
12 |
13 |
14 |
15 | javax.servlet
16 | javax.servlet-api
17 | 3.0.1
18 | provided
19 |
20 |
21 | com.liferay
22 | com.liferay.configuration.admin.api
23 | provided
24 |
25 |
26 | com.liferay.portal
27 | com.liferay.portal.kernel
28 | provided
29 |
30 |
31 | org.osgi
32 | org.osgi.service.component.annotations
33 | 1.3.0
34 | provided
35 |
36 |
37 | org.osgi
38 | org.osgi.service.metatype.annotations
39 | 1.3.0
40 | provided
41 |
42 |
43 | biz.aQute.bnd
44 | biz.aQute.bndlib
45 | ${biz.aQute.bndlib.version}
46 | provided
47 |
48 |
49 | com.liferay
50 | com.liferay.portal.configuration.metatype.api
51 | provided
52 |
53 |
54 | javax.portlet
55 | portlet-api
56 | 2.0
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/liferay-scoped-portlet-instance/src/main/resources/META-INF/resources/osgiconfiguredportlet/init.jsp:
--------------------------------------------------------------------------------
1 | <%--
2 | /**
3 | * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
4 | *
5 | * This library is free software; you can redistribute it and/or modify it under
6 | * the terms of the GNU Lesser General Public License as published by the Free
7 | * Software Foundation; either version 2.1 of the License, or (at your option)
8 | * any later version.
9 | *
10 | * This library is distributed in the hope that it will be useful, but WITHOUT
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 | * details.
14 | */
15 | --%>
16 |
17 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
18 |
19 | <%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
20 |
21 | <%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %><%@
22 | taglib uri="http://liferay.com/tld/portlet" prefix="liferay-portlet" %><%@
23 | taglib uri="http://liferay.com/tld/theme" prefix="liferay-theme" %><%@
24 | taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %>
25 | <%@taglib uri="http://liferay.com/tld/frontend" prefix="liferay-frontend" %>
26 | <%@page import="com.liferay.portal.kernel.module.configuration.ConfigurationProviderUtil" %>
27 | <%@page import="com.liferay.portal.kernel.settings.ParameterMapSettingsLocator" %>
28 | <%@page import="com.liferay.portal.kernel.settings.PortletInstanceSettingsLocator" %>
29 | <%@page import="de.abiegel.configuration.osgi.example.ConfiguredComponentConfig" %>
30 | <%@page import="com.liferay.portal.kernel.util.GetterUtil" %>
31 |
32 |
33 |
34 |
35 | <%
36 | ConfiguredComponentConfig configuration = ConfigurationProviderUtil.getConfiguration(ConfiguredComponentConfig.class, new ParameterMapSettingsLocator(request.getParameterMap(), new PortletInstanceSettingsLocator(themeDisplay.getLayout(), portletDisplay.getPortletResource())));
37 |
38 | ConfiguredComponentConfig instanceConfiguration =
39 | portletDisplay.getPortletInstanceConfiguration(
40 | ConfiguredComponentConfig.class);
41 | %>
42 |
43 |
--------------------------------------------------------------------------------
/configuration-form-renderer/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 | 4.0.0
7 | de.abiegel.configuration.osgi.liferay.configuration.form.renderer
8 |
9 | de.abiegel.configuration.osgi
10 | 1.0.0
11 | ../
12 | de.abiegel.configuration.osgi.example
13 |
14 |
15 |
16 | com.liferay
17 | com.liferay.portal.configuration.metatype.api
18 | provided
19 |
20 |
21 | com.liferay
22 | com.liferay.frontend.taglib
23 |
24 |
25 | com.liferay
26 | com.liferay.configuration.admin.api
27 | provided
28 |
29 |
30 | com.liferay.portal
31 | com.liferay.portal.kernel
32 | provided
33 |
34 |
35 | org.osgi
36 | org.osgi.service.component.annotations
37 | 1.3.0
38 | provided
39 |
40 |
41 | org.osgi
42 | org.osgi.service.metatype.annotations
43 | 1.3.0
44 | provided
45 |
46 |
47 | biz.aQute.bnd
48 | biz.aQute.bndlib
49 | ${biz.aQute.bndlib.version}
50 | provided
51 |
52 |
53 | javax.servlet
54 | javax.servlet-api
55 | 3.0.1
56 | provided
57 |
58 |
59 | javax.portlet
60 | portlet-api
61 | 2.0
62 |
63 |
64 |
--------------------------------------------------------------------------------
/costum-config-category/src/main/java/de/abiegel/configuration/category/foo/MyConfigurationFieldOptionsProvider.java:
--------------------------------------------------------------------------------
1 | package de.abiegel.configuration.category.foo;
2 |
3 | import java.util.List;
4 | import java.util.Locale;
5 | import java.util.stream.Collectors;
6 | import java.util.stream.Stream;
7 |
8 | import com.liferay.asset.auto.tagger.text.extractor.TextExtractor;
9 | import com.liferay.asset.auto.tagger.text.extractor.TextExtractorTracker;
10 | import com.liferay.asset.kernel.AssetRendererFactoryRegistryUtil;
11 | import com.liferay.asset.kernel.model.AssetRendererFactory;
12 | import com.liferay.configuration.admin.definition.ConfigurationFieldOptionsProvider;
13 | import com.liferay.portal.kernel.security.auth.CompanyThreadLocal;
14 |
15 | import org.osgi.service.component.annotations.Component;
16 | import org.osgi.service.component.annotations.Reference;
17 |
18 | @Component(property = { "configuration.field.name=entryList",
19 | "configuration.pid=de.abiegel.configuration.osgi.company.CompanyConfiguredComponentConfig"
20 | }, service = ConfigurationFieldOptionsProvider.class)
21 | public class MyConfigurationFieldOptionsProvider implements ConfigurationFieldOptionsProvider {
22 |
23 | @Reference
24 | private TextExtractorTracker _textExtractorTracker;
25 |
26 | @Override
27 | public List