Groovy language - change staging friendly url
Groovy language - change staging friendly url
https://liferay.dev/c/message_boards/find_thread?p_l_id=119785333&threadId=121404474
2024-03-29T13:10:51Z
2024-03-29T13:10:51Z
RE: Groovy language - change staging friendly url
Russell Bohl
https://liferay.dev/c/message_boards/find_message?p_l_id=119785333&messageId=121428913
2022-05-24T21:32:53Z
2022-05-24T21:32:52Z
<p>Hi Brody, try getting the stagingGroup from the group with the siteId
you have, and changing its friendly URL:</p>
<pre>
<code class="language-java">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");</code></pre>
Russell Bohl
2022-05-24T21:32:52Z
Groovy language - change staging friendly url
BRODY HIGGS JR
https://liferay.dev/c/message_boards/find_message?p_l_id=119785333&messageId=121404473
2022-04-21T20:36:20Z
2022-04-21T20:36:19Z
<p style="margin-bottom: 11.0px;">
<span style="font-size: 11.0pt;">
<span style="line-height: 107.0%;">
<span style="font-family: Calibri , sans-serif;">I can change
‘Site Friendly URL’ with the Groovy language code below, but I
would like to change ‘Staging Friendly URL’.</span></span></span></p>
<p style="margin-bottom: 11.0px;">
<span style="font-size: 11.0pt;">
<span style="line-height: 107.0%;">
<span style="font-family: Calibri , sans-serif;">import com.liferay.portal.service.GroupLocalServiceUtil;</span></span></span></p>
<p style="margin-bottom: 11.0px;">
<span style="font-size: 11.0pt;">
<span style="line-height: 107.0%;">
<span style="font-family: Calibri , sans-serif;">long liveGroupId
= siteidhere;</span></span></span></p>
<p style="margin-bottom: 11.0px;">
<span style="font-size: 11.0pt;">
<span style="line-height: 107.0%;">
<span style="font-family: Calibri , sans-serif;">out.println(GroupLocalServiceUtil.updateFriendlyURL(siteidhere,'/sitename1-staging'))</span></span></span></p>
<p style="margin-bottom: 11.0px;">Reference: <a
href="https://docs.liferay.com/dxp/digital-enterprise/7.0-sp1/javadocs/portal-kernel/com/liferay/portal/kernel/service/GroupLocalServiceUtil.html?msclkid=93337fefc1b211ecaa2c552b13546bb4">GroupLocalServiceUtil
(Liferay 7.0.10 portal-kernel API)</a></p>