RE: MAKING APPLICATIONS CONFIGURABLE in Liferay 7.1

Do Lap Nguyen, modified 6 Years ago. New Member Posts: 2 Join Date: 4/24/19 Recent Posts
hi Guys,

I am facing issue in Liferay 7.1.2 GA3 (CE)
i follow the instructions  https://dev.liferay.com/de/develop/tutorials/-/knowledge_base/7-1/categorizing-the-configuration#creating-new-sections-and-categoriesComponent
[code]@Component
    public class DynamicDataMappingConfigurationCategory
        implements ConfigurationCategory {

        @Override
        public String getCategoryIcon() {
            return "dynamic-data-list";
        }

        @Override
        public String getCategoryKey() {
            return _KEY;
        }

        @Override
        public String getCategorySection() {
            return _CATEGORY_SET_KEY;
        }

        private static final String _CATEGORY_SET_KEY = "content-management";

        private static final String _KEY = "dynamic-data-mapping";

    }
I want to override method 
getCategoryIcon()
and return 
dynamic-data-list
icon but it didn't work

 Can someone point me in the direction of the documentation that explains how to do it, or give me some idea how to remove them? Thank you for any help or advice you may be able to give.
thumbnail
Andrew Jardine, modified 6 Years ago. Liferay Legend Posts: 2416 Join Date: 12/22/10 Recent Posts
Hi Do,

Just a shot in the dark here -- everything you have done looks correct. I compared what you wrote with some of the portal source and the only (notable) difference I can see is on you @Component annotation. Can you try changing it to this to see if it helps?
​​​​​​​@Component(service = ConfigurationCategory.class)
Do Lap Nguyen, modified 6 Years ago. New Member Posts: 2 Join Date: 4/24/19 Recent Posts
Thanks for reply  Andrew
it's still not working.

All I want to do is change the  "icon-cog" by "diary"
 in the "OTHER" folder.
I try the following lines of code . it didn't work for me either 

@Component(service = ConfigurationCategory.class)

public class LdapAdditionalConfigurationCategory 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 = "diary";

    private static final String _CATEGORY_KEY = "ldap-additional-settings";

    private static final String _CATEGORY_SECTION = "security";
}

Attachments:

thumbnail
Andrew Jardine, modified 6 Years ago. Liferay Legend Posts: 2416 Join Date: 12/22/10 Recent Posts
Hi Do, 

I just tried it on my side and I managed to get it working by also adding a higher service ranking to the service
@Component(
        immediate = true,
        property = {
          "service.ranking:Integer=1000"
        },
        service = ConfigurationCategory.class
)

.. it's a strange solution, but it worked for me.​​​​​
André Biegel, modified 6 Years ago. Junior Member Posts: 31 Join Date: 11/11/13 Recent Posts
hey .. i also stumpled upon that .. 
there is the way i solved it ... but i cant create a new section .. the label is not going to get displayed correctly
greetz André

 https://github.com/andrebiegel/liferay-configuration-api
thumbnail
Andrew Jardine, modified 6 Years ago. Liferay Legend Posts: 2416 Join Date: 12/22/10 Recent Posts
That's weird. For me it wasn't working until I added the service ranking. As soon as I did that though both the icon and categories I configured started to take effect. Maybe try adding that to your example and see if it makes a difference for you?
André Biegel, modified 6 Years ago. Junior Member Posts: 31 Join Date: 11/11/13 Recent Posts
with Fixpack 10 it seems to work  without the ranking .. changes are on github...
thumbnail
Andrew Jardine, modified 6 Years ago. Liferay Legend Posts: 2416 Join Date: 12/22/10 Recent Posts
Ah -- good to know. But that would only be something that is readily available for use if you are a DXP customer I guess. We're getting pretty close to 7.2 so I don't know if there will be any additional 7.1 releases now -- so if you are a CE user, I guess you're stuck using the service ranking. Or, maybe this is just another reason to pressure the boss to upgrade to DXP ;)