Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Application not configurable in system settings
Hi all,
Our new application is not configurable, despite implementing the MVC portlet like described in the 7.1 documentation, https://portal.liferay.dev/docs/7-1/tutorials/-/knowledge_base/t/making-applications-configurable.
We made a configuration interface, a bean declaration and configuration category like mentioned in the docu.
But we can not see the an entry in the system settings section "other".
We debugged the portal an saw that the bundle didn't have a categoryPid / pid in the MetaTypeInformation, see
Is there a new documentation for 7.2 or do we have to implement someting additionally? We found nothing ...
Does anybody know what's the problem here?
Thank you very much!
Tested with CE 7.2.1 GA2 and DXP 7.2.10 GA1.
Handling of the configuration interface in general works, because the default value is fetched correct in the configuration.jsp of the portlet.
Implementation:
configuration interface:
bean declaration:
configuration category:
configuration form renderer:
portlet:
Our new application is not configurable, despite implementing the MVC portlet like described in the 7.1 documentation, https://portal.liferay.dev/docs/7-1/tutorials/-/knowledge_base/t/making-applications-configurable.
We made a configuration interface, a bean declaration and configuration category like mentioned in the docu.
But we can not see the an entry in the system settings section "other".
We debugged the portal an saw that the bundle didn't have a categoryPid / pid in the MetaTypeInformation, see
ConfigurationModelRetrieverImpl.collectConfigurationModels()
How this can happen?Is there a new documentation for 7.2 or do we have to implement someting additionally? We found nothing ...
Does anybody know what's the problem here?
Thank you very much!
Tested with CE 7.2.1 GA2 and DXP 7.2.10 GA1.
Handling of the configuration interface in general works, because the default value is fetched correct in the configuration.jsp of the portlet.
Implementation:
configuration interface:
@ExtendedObjectClassDefinition(
category = "facility-references", factoryInstanceLabelAttribute = "ddmStructureName",
scope = ExtendedObjectClassDefinition.Scope.SYSTEM
)
@Meta.OCD(
factory = true,
id = "com.company.portal.facility.references.web.configuration.FacilityReferencesConfiguration",
localization = "content/Language",
name = "facility-references-web-configuration-name"
)
public interface FacilityReferencesConfiguration {
@Meta.AD(deflt = "Facility-Reference", name = "ddm-structure-name", required = false)
String ddmStructureName();
}
bean declaration:
@Component(service = ConfigurationBeanDeclaration.class)
public class FacilityReferencesConfigurationBeanDeclaration implements ConfigurationBeanDeclaration {
@Override
public Class<!--?--> getConfigurationBeanClass() {
return FacilityReferencesConfiguration.class;
}
}
configuration category:
@Component(service = ConfigurationCategory.class)
public class FacilityReferencesConfigurationCategory
implements ConfigurationCategory {
@Override
public String getCategoryIcon() {
return _CATEGORY_ICON;
}
@Override
public String getCategoryKey() {
return _CATEGORY_KEY;
}
@Override
public String getCategorySection() {
return _CATEGORY_SECTION;
}
private static final String _CATEGORY_ICON = "web-content";
private static final String _CATEGORY_KEY = "facility-references";
private static final String _CATEGORY_SECTION = "other";
}
configuration form renderer:
@Component(immediate = true, service = ConfigurationFormRenderer.class)
public class FacilityReferencesConfigurationFormRenderer
implements ConfigurationFormRenderer {
@Override
public String getPid() {
return "com.company.portal.facility.references.web.configuration.FacilityReferencesConfiguration";
}
@Override
public void render(HttpServletRequest request, HttpServletResponse response)
throws IOException {
String formHtml = "<input name="\"ddmStructureName\"">";
PrintWriter writer = response.getWriter();
writer.print(formHtml);
}
@Override
public Map<string, object> getRequestParameters(
HttpServletRequest request) {
Map<string, object> params = new HashMap<>();
String ddmStructureName = ParamUtil.getString(request, "ddmStructureName");
params.put("ddmStructureName", ddmStructureName);
return params;
}
}
</string,></string,>
portlet:
@Component(
configurationPid = "com.company.portal.facility.references.web.configuration.FacilityReferencesConfiguration",
immediate = true,
property = {
"com.liferay.portlet.display-category=category.applications",
"com.liferay.portlet.header-portlet-css=/css/main.css",
"com.liferay.portlet.instanceable=true",
"javax.portlet.display-name=FacilityReferences",
"javax.portlet.init-param.template-path=/",
"javax.portlet.init-param.view-template=/view.jsp",
"javax.portlet.name=" + FacilityReferencesPortletKeys.FACILITYREFERENCES,
"javax.portlet.resource-bundle=content.Language",
"javax.portlet.security-role-ref=power-user,user"
},
service = Portlet.class
)
public class FacilityReferencesPortlet extends MVCPortlet {
@Activate
@Modified
protected void activate(Map<object, object> properties) throws Exception {
configuration = ConfigurableUtil.createConfigurable(FacilityReferencesConfiguration.class, properties);
}
</object,>
What works for me in 7.2 is here: https://github.com/olafk/controlpanel-documentation-web
e.g. the Configuration https://github.com/olafk/controlpanel-documentation-web/blob/master/src/main/java/de/olafkock/liferay/documentation/osgi/tracker/ControlPanelDocumentationConfiguration.java (notice the id attribute)
the configured component https://github.com/olafk/controlpanel-documentation-web/blob/master/src/main/java/de/olafkock/liferay/documentation/osgi/tracker/DummyComponent.java
e.g. the Configuration https://github.com/olafk/controlpanel-documentation-web/blob/master/src/main/java/de/olafkock/liferay/documentation/osgi/tracker/ControlPanelDocumentationConfiguration.java (notice the id attribute)
the configured component https://github.com/olafk/controlpanel-documentation-web/blob/master/src/main/java/de/olafkock/liferay/documentation/osgi/tracker/DummyComponent.java
Hi Olaf,
thank you for the quick answer.
But for me your application doesn't work, the portal doesn't show any entry in the "other" section.I also tried to add a configuration form renderer like mentioned in a sub-chapter of the docu (https://portal.liferay.dev/docs/7-1/tutorials/-/knowledge_base/t/customizing-the-system-settings-user-interface
), but with no success.
I think we will just need the configuration interface , bean declaration and the configuration category , right? Or do we need configuration form renderer or a display context?
Which version of 7.2 do you use? We tested it with CE 7.2.1 GA2 and DXP 7.2.10 GA1.
I added the code of the configuration form renderer and the portlet in the original post.
Thank you.
thank you for the quick answer.
But for me your application doesn't work, the portal doesn't show any entry in the "other" section.I also tried to add a configuration form renderer like mentioned in a sub-chapter of the docu (https://portal.liferay.dev/docs/7-1/tutorials/-/knowledge_base/t/customizing-the-system-settings-user-interface
), but with no success.
I think we will just need the configuration interface , bean declaration and the configuration category , right? Or do we need configuration form renderer or a display context?
Which version of 7.2 do you use? We tested it with CE 7.2.1 GA2 and DXP 7.2.10 GA1.
I added the code of the configuration form renderer and the portlet in the original post.
Thank you.
Now that you say this: I might have changed some settings a while ago - there was some info about changes in a library that I can't remember any more.
My Liferay Workspace's settings.gradle is this (check your versions):
buildscript {
dependencies {
classpath group: "com.liferay", name: "com.liferay.gradle.plugins.workspace", version: "2.1.5"
classpath group: "net.saliman", name: "gradle-properties-plugin", version: "1.4.6"
}
repositories {
maven {
url "https://repository-cdn.liferay.com/nexus/content/groups/public"
}
}
}
apply plugin: "net.saliman.properties"
apply plugin: "com.liferay.workspace"
My Liferay Workspace's settings.gradle is this (check your versions):
buildscript {
dependencies {
classpath group: "com.liferay", name: "com.liferay.gradle.plugins.workspace", version: "2.1.5"
classpath group: "net.saliman", name: "gradle-properties-plugin", version: "1.4.6"
}
repositories {
maven {
url "https://repository-cdn.liferay.com/nexus/content/groups/public"
}
}
}
apply plugin: "net.saliman.properties"
apply plugin: "com.liferay.workspace"
Hi Olaf,
like mentioned in my first reply, it works now on the local instance.
But we have problems now during the build (already on the clean task of the hello world portlet) on the stages, see following log:
Running in /home/sysadmin/workspace/int/liferay-portal
[Pipeline] {
[Pipeline] script
[Pipeline] {
[Pipeline] sh
+ chmod 755 gradlew
[Pipeline] sh
+ ./gradlew clean
Starting a Gradle Daemon (subsequent builds will be faster)
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':modules:hello-portlet'.
Extension of type 'LiferayExtension' does not exist. Currently registered extension types: [ExtraPropertiesExtension]
For both ways we use the same gradle version: https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip
Do you have an idea?
Thank you!
like mentioned in my first reply, it works now on the local instance.
But we have problems now during the build (already on the clean task of the hello world portlet) on the stages, see following log:
Running in /home/sysadmin/workspace/int/liferay-portal
[Pipeline] {
[Pipeline] script
[Pipeline] {
[Pipeline] sh
+ chmod 755 gradlew
[Pipeline] sh
+ ./gradlew clean
Starting a Gradle Daemon (subsequent builds will be faster)
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':modules:hello-portlet'.
Extension of type 'LiferayExtension' does not exist. Currently registered extension types: [ExtraPropertiesExtension]
For both ways we use the same gradle version: https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip
Do you have an idea?
Thank you!
Hi Olaf,
Thanks a lot!
Switching com.liferay.gradle.plugins.workspace to 2.1.5 was the key. Now it works.
Maybe a short hint of this dependency in the docu would be useful for other developers.
Thanks again
Thanks a lot!
Switching com.liferay.gradle.plugins.workspace to 2.1.5 was the key. Now it works.
Maybe a short hint of this dependency in the docu would be useful for other developers.
Thanks again
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™