掲示板

How to change component property (MyAccountPortlet)

7年前 に K F によって更新されました。

How to change component property (MyAccountPortlet)

Junior Member 投稿: 52 参加年月日: 17/01/11 最新の投稿
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
7年前 に David H Nebinger によって更新されました。

RE: How to change component property (MyAccountPortlet) (回答)

Liferay Legend 投稿: 14916 参加年月日: 06/09/02 最新の投稿
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.
7年前 に K F によって更新されました。

RE: How to change component property (MyAccountPortlet)

Junior Member 投稿: 52 参加年月日: 17/01/11 最新の投稿
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) {
}

}