Planned maintenance is scheduled for the week of June 15th - the exact date and time will be announced soon.
See More Details
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
Groovy language - change staging friendly url
I can change ‘Site Friendly URL’ with the Groovy language code below, but I would like to change ‘Staging Friendly URL’.
import com.liferay.portal.service.GroupLocalServiceUtil;
long liveGroupId = siteidhere;
out.println(GroupLocalServiceUtil.updateFriendlyURL(siteidhere,'/sitename1-staging'))
Reference: GroupLocalServiceUtil (Liferay 7.0.10 portal-kernel API)
Hi Brody, try getting the stagingGroup from the group with the siteId you have, and changing its friendly URL:
import com.liferay.portal.kernel.service.*;
import com.liferay.portal.kernel.model.*;
Group site = GroupLocalServiceUtil.getGroup(SITEID);
Group stagingSite = site.getStagingGroup();
GroupLocalServiceUtil.updateFriendlyURL(stagingSite.getGroupId(), "/edited-guest-staging");
Community
Company
Feedback