11= Liferay Portal DB setup core
22:liferay-version: 7.4.3.125
3- :current-db-setup-core-version: 7.4.3863
3+ :current-db-setup-core-version: 7.4.3125.0
44:TOC:
55
66image:https://maven-badges.herokuapp.com/maven-central/com.ableneo.liferay/com.ableneo.liferay.db.setup.core/badge.svg?color=blue[Maven Central,link=https://search.maven.org/search?q=g:com.ableneo.liferay%20AND%20a:com.ableneo.liferay.db.setup.core]
@@ -136,6 +136,7 @@ All data definitions in the setup XML file are applied according to the `configu
136136 <companywebid>liferay.com</companywebid>
137137 </company>
138138 </configuration>
139+ </setup>
139140----
140141=== Features
141142
@@ -147,6 +148,8 @@ If you develop new link:https://learn.liferay.com/dxp/latest/en/headless-deliver
147148.Add new or update existing Service Access Policy by name
148149[source, xml]
149150----
151+ <?xml version="1.0" encoding="UTF-8"?>
152+ <setup xmlns="http://www.ableneo.com/liferay/setup">
150153<company-settings>
151154 <service-access-policies>
152155 <service-access-policy name="MY_ACCESS_POLICY" enabled="true" unauthenticated="true">
@@ -156,23 +159,29 @@ If you develop new link:https://learn.liferay.com/dxp/latest/en/headless-deliver
156159 </allowed-service-signatures>
157160 </service-access-policy>
158161 </service-access-policies>
159- </company>
162+ </company-settings>
163+ </setup>
160164----
161165<1> `allowed-service-signatures` provides the same functionality as link:https://learn.liferay.com/dxp/latest/en/installation-and-upgrades/securing-liferay/securing-web-services/setting-service-access-policies.html#creating-a-service-access-policy[_Advanced Mode_]
162166
163167.Delete existing Service Access Policy by name
164168[source,xml]
165169----
170+ <?xml version="1.0" encoding="UTF-8"?>
171+ <setup xmlns="http://www.ableneo.com/liferay/setup">
166172<company-settings>
167173 <service-access-policies>
168174 <delete-service-access-policy name="WIZARD_GUEST_ACCESS"/>
169175 </service-access-policies>
170176</company-settings>
177+ </setup>
171178----
172179==== Permissions
173180Resource permissions.
174181[source, xml]
175182----
183+ <?xml version="1.0" encoding="UTF-8"?>
184+ <setup xmlns="http://www.ableneo.com/liferay/setup">
176185<resource-permissions>
177186 <resource resource-id="my.custom.resource.string">
178187 <actionId name="SPECIAL_PERMISSION">
@@ -181,6 +190,7 @@ Resource permissions.
181190 </actionId>
182191 </resource>
183192</resource-permissions>
193+ </setup>
184194----
185195Resource permissions are set per company are verifiable with followin API call.
186196[source, java]
@@ -196,6 +206,8 @@ permissionChecker.hasPermission(
196206Portlet permissions.
197207[source, xml]
198208----
209+ <?xml version="1.0" encoding="UTF-8"?>
210+ <setup xmlns="http://www.ableneo.com/liferay/setup">
199211<resource-permissions>
200212 <resource resource-id="myportlet_WAR_portlets">
201213 <actionId name="VIEW">
@@ -204,44 +216,62 @@ Portlet permissions.
204216 </actionId>
205217 </resource>
206218</resource-permissions>
219+ </setup>
207220----
208221==== Roles
209222[source, xml]
210223----
224+ <?xml version="1.0" encoding="UTF-8"?>
225+ <setup xmlns="http://www.ableneo.com/liferay/setup">
211226<roles>
212227 <role name="Regular Role"/>
213228 <role name="Site Role" type="site"/>
214- <roles>
229+ </roles>
230+ </setup>
215231----
216232==== Expando attribute
217233Following snippet creates expando attribute `canonical-url` with permissions to view by guest user.
218234[source, xml]
219235----
236+ <?xml version="1.0" encoding="UTF-8"?>
237+ <setup xmlns="http://www.ableneo.com/liferay/setup">
220238<custom-fields>
221239 <field name="canonical-url" type="string" class-name="com.liferay.portal.kernel.model.Layout">
222240 <role-permission role-name="Guest" permission="view"/>
223241 </field>
224242</custom-fields>
243+ </setup>
225244----
226- ==== Site
227- Site element must always have `site-friendly-url` attribute. Guest site is determined by `default` attribute with `true` value. All content like *pages*, *articles*, *documents* etc. is always created within a specific site.
245+ ==== Site selection
246+ All content like *pages*, *articles*, *documents* etc. is always created within a specific site. You can create new or refer to existing site.
247+
228248[source, xml]
229249----
250+ <?xml version="1.0" encoding="UTF-8"?>
251+ <setup xmlns="http://www.ableneo.com/liferay/setup">
230252<sites>
231- <site default="true" site-friendly-url="/guest">
253+ <site default="true">
254+ <!-- default company site -->
255+ </site>
256+ <site global="true">
257+ <!-- global company site -->
232258 </site>
233- <site default="false" site-friendly-url="/admin">
234- <name>Admin</name >
259+ <site default="false" site-friendly-url="/admin" name="Admin" >
260+ <!-- specific site -- >
235261 <name-translation locale="en_US" text="Admin"/>
236262 </site>
237263</sites>
264+ </setup>
238265----
239266==== Journal Article structure and template
240267Files `new_structure.xml` and `new_structure_template.ftl` are deployed as a part of a module that is using the `db-setup-core` library and reside in it's classpath.
241268[source, xml]
242269----
270+ <?xml version="1.0" encoding="UTF-8"?>
271+ <setup xmlns="http://www.ableneo.com/liferay/setup">
243272
244- <site site-friendly-url="/admin">
273+ <sites>
274+ <site site-friendly-url="/admin" name="Admin">
245275 <article-structure key="NEW-STRUCTURE-KEY"
246276 path="new_structure.xml"
247277 name="New Structure"/>
@@ -250,15 +280,19 @@ Files `new_structure.xml` and `new_structure_template.ftl` are deployed as a par
250280 path="new_structure_template.ftl"
251281 article-structure-key="NEW-STRUCTURE-KEY" name="New Structure Template" cacheable="true"/>
252282
253- <name>Admin</name>
254283 </site>
284+ </sites>
285+ </setup>
255286----
256287==== Articles
257288File `artcle.xml` is deployed as a part of a module that is using the `db-setup-core` library and reside in it's classpath.
258289[source, xml]
259290----
291+ <?xml version="1.0" encoding="UTF-8"?>
292+ <setup xmlns="http://www.ableneo.com/liferay/setup">
293+
260294<sites>
261- <site>
295+ <site global="true" >
262296 <article
263297 title="Article Title"
264298 path="article.xml"
@@ -269,19 +303,24 @@ File `artcle.xml` is deployed as a part of a module that is using the `db-setup-
269303 </article>
270304 </site>
271305</sites>
306+ </setup>
272307----
273308==== Document
274309Document's file itself is determined by `file-system-name` attribute which defines resource on classpath.
275310[source, xml]
276311----
312+ <?xml version="1.0" encoding="UTF-8"?>
313+ <setup xmlns="http://www.ableneo.com/liferay/setup">
314+
277315<sites>
278- <site>
316+ <site name="Guest" >
279317 <document file-system-name="image.svg"
280318 document-folder-name="/Images"
281319 document-filename="image.svg"
282320 document-title="image.svg"/>
283321 </site>
284322</sites>
323+ </setup>
285324----
286325
287326=== Liferay Portal requirements
@@ -316,12 +355,14 @@ They are probably not perfect, please let me know if anything feels wrong or inc
316355
317356== Changelog
318357
319- === Version 7.4.3860
358+ === Version 7.4.3125.0
320359
321360==== Features & bug fixes
322361* switched to JDK21
323362* api compatible with Liferay 7.4.3.125
324363* fixed category import (updating parent)
364+ * fixed working with global/default sites <<_site_selection>>
365+ * updated docs
325366
326367=== Version 7.4.3860
327368
@@ -365,10 +406,17 @@ They are probably not perfect, please let me know if anything feels wrong or inc
365406.Fixed configuration
366407[source, xml]
367408----
409+ <?xml version="1.0" encoding="UTF-8"?>
410+ <setup xmlns="http://www.ableneo.com/liferay/setup">
411+
368412 <resource-permissions>
369413 <resource resource-id="custom.resource.id-not.a.portlet.id">
370414 <actionId name="SOME_PERMISSION">
371415 <role name="Some Portal Role"/>
416+ </actionId>
417+ </resource>
418+ </resource-permissions>
419+ </setup>
372420----
373421
374422==== Refactorings & project changes
0 commit comments