Foren

How to change component property (MyAccountPortlet)

K F, geändert vor 7 Jahren.

How to change component property (MyAccountPortlet)

Junior Member Beiträge: 52 Beitrittsdatum: 11.01.17 Neueste Beiträge
I followed
https://web.liferay.com/web/user.26526/blog/-/blogs/removing-panels-from-my-account

everything works fine, but I want also make it available from Add portlet sidebar panel. How to change this property com.liferay.portlet.system in MyAccountPortlet or maybe you know some another solution. Thank you for help in advance.
thumbnail
David H Nebinger, geändert vor 7 Jahren.

RE: How to change component property (MyAccountPortlet) (Antwort)

Liferay Legend Beiträge: 14915 Beitrittsdatum: 02.09.06 Neueste Beiträge
Changing a panel is just a matter of deploying a new component that matches the @Component details of the old one but has a higher service.ranking value. With a higher service ranking, your component overrides the current one and your changes will be introduced.

My blog post is just for removing panels, doesn't really address modifying the existing panels.
K F, geändert vor 7 Jahren.

RE: How to change component property (MyAccountPortlet)

Junior Member Beiträge: 52 Beitrittsdatum: 11.01.17 Neueste Beiträge
David H Nebinger:
Changing a panel is just a matter of deploying a new component that matches the @Component details of the old one but has a higher service.ranking value. With a higher service ranking, your component overrides the current one and your changes will be introduced.

My blog post is just for removing panels, doesn't really address modifying the existing panels.


I've created a module put there component class based on old one with the higher service.ranking value. Deployed and started this new bundle but unfortunately still I cannot add this portlet from the panel. If there is a need I will create a complete copy of this module and make little changes. Could you look into this matter? Below is my new defined component class. Thank you in advance.

import com.liferay.portal.kernel.model.Release;
import com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet;

import javax.portlet.Portlet;

import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;

@Component(
immediate = true,
property = {
"com.liferay.portlet.add-default-resource=true",
"com.liferay.portlet.css-class-wrapper=portlet-users-admin",
"com.liferay.portlet.display-category=category.tools",
"com.liferay.portlet.header-portlet-css=/css/main.css",
"com.liferay.portlet.icon=/icons/my_account.png",
"com.liferay.portlet.preferences-owned-by-group=true",
"com.liferay.portlet.private-request-attributes=false",
"com.liferay.portlet.private-session-attributes=false",
"com.liferay.portlet.render-weight=50",
"com.liferay.portlet.struts-path=users_admin",
"com.liferay.portlet.system=false",
"com.liferay.portlet.use-default-template=true",
"javax.portlet.display-name=My Account",
"javax.portlet.expiration-cache=0",
"javax.portlet.init-param.template-path=/",
"javax.portlet.name=com_liferay_my_account_web_portlet_MyAccountPortlet",
"javax.portlet.resource-bundle=content.Language",
"javax.portlet.security-role-ref=administrator",
"javax.portlet.supports.mime-type=text/html",
"service.ranking:Integer=10"
},
service = Portlet.class
)
public class MyAccountPortletExt extends MVCPortlet {

@Reference(
target = "(&(release.bundle.symbolic.name=com.liferay.my.account.web)(release.schema.version=1.0.0))",
unbind = "-"
)
protected void setRelease(Release release) {
}

}