1
1
= Liferay Portal DB setup core
2
2
: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
4
4
:TOC:
5
5
6
6
image: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
136
136
<companywebid>liferay.com</companywebid>
137
137
</company>
138
138
</configuration>
139
+ </setup>
139
140
----
140
141
=== Features
141
142
@@ -147,6 +148,8 @@ If you develop new link:https://learn.liferay.com/dxp/latest/en/headless-deliver
147
148
.Add new or update existing Service Access Policy by name
148
149
[source, xml]
149
150
----
151
+ <?xml version="1.0" encoding="UTF-8"?>
152
+ <setup xmlns="http://www.ableneo.com/liferay/setup">
150
153
<company-settings>
151
154
<service-access-policies>
152
155
<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
156
159
</allowed-service-signatures>
157
160
</service-access-policy>
158
161
</service-access-policies>
159
- </company>
162
+ </company-settings>
163
+ </setup>
160
164
----
161
165
<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_]
162
166
163
167
.Delete existing Service Access Policy by name
164
168
[source,xml]
165
169
----
170
+ <?xml version="1.0" encoding="UTF-8"?>
171
+ <setup xmlns="http://www.ableneo.com/liferay/setup">
166
172
<company-settings>
167
173
<service-access-policies>
168
174
<delete-service-access-policy name="WIZARD_GUEST_ACCESS"/>
169
175
</service-access-policies>
170
176
</company-settings>
177
+ </setup>
171
178
----
172
179
==== Permissions
173
180
Resource permissions.
174
181
[source, xml]
175
182
----
183
+ <?xml version="1.0" encoding="UTF-8"?>
184
+ <setup xmlns="http://www.ableneo.com/liferay/setup">
176
185
<resource-permissions>
177
186
<resource resource-id="my.custom.resource.string">
178
187
<actionId name="SPECIAL_PERMISSION">
@@ -181,6 +190,7 @@ Resource permissions.
181
190
</actionId>
182
191
</resource>
183
192
</resource-permissions>
193
+ </setup>
184
194
----
185
195
Resource permissions are set per company are verifiable with followin API call.
186
196
[source, java]
@@ -196,6 +206,8 @@ permissionChecker.hasPermission(
196
206
Portlet permissions.
197
207
[source, xml]
198
208
----
209
+ <?xml version="1.0" encoding="UTF-8"?>
210
+ <setup xmlns="http://www.ableneo.com/liferay/setup">
199
211
<resource-permissions>
200
212
<resource resource-id="myportlet_WAR_portlets">
201
213
<actionId name="VIEW">
@@ -204,44 +216,62 @@ Portlet permissions.
204
216
</actionId>
205
217
</resource>
206
218
</resource-permissions>
219
+ </setup>
207
220
----
208
221
==== Roles
209
222
[source, xml]
210
223
----
224
+ <?xml version="1.0" encoding="UTF-8"?>
225
+ <setup xmlns="http://www.ableneo.com/liferay/setup">
211
226
<roles>
212
227
<role name="Regular Role"/>
213
228
<role name="Site Role" type="site"/>
214
- <roles>
229
+ </roles>
230
+ </setup>
215
231
----
216
232
==== Expando attribute
217
233
Following snippet creates expando attribute `canonical-url` with permissions to view by guest user.
218
234
[source, xml]
219
235
----
236
+ <?xml version="1.0" encoding="UTF-8"?>
237
+ <setup xmlns="http://www.ableneo.com/liferay/setup">
220
238
<custom-fields>
221
239
<field name="canonical-url" type="string" class-name="com.liferay.portal.kernel.model.Layout">
222
240
<role-permission role-name="Guest" permission="view"/>
223
241
</field>
224
242
</custom-fields>
243
+ </setup>
225
244
----
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
+
228
248
[source, xml]
229
249
----
250
+ <?xml version="1.0" encoding="UTF-8"?>
251
+ <setup xmlns="http://www.ableneo.com/liferay/setup">
230
252
<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 -->
232
258
</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 -- >
235
261
<name-translation locale="en_US" text="Admin"/>
236
262
</site>
237
263
</sites>
264
+ </setup>
238
265
----
239
266
==== Journal Article structure and template
240
267
Files `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.
241
268
[source, xml]
242
269
----
270
+ <?xml version="1.0" encoding="UTF-8"?>
271
+ <setup xmlns="http://www.ableneo.com/liferay/setup">
243
272
244
- <site site-friendly-url="/admin">
273
+ <sites>
274
+ <site site-friendly-url="/admin" name="Admin">
245
275
<article-structure key="NEW-STRUCTURE-KEY"
246
276
path="new_structure.xml"
247
277
name="New Structure"/>
@@ -250,15 +280,19 @@ Files `new_structure.xml` and `new_structure_template.ftl` are deployed as a par
250
280
path="new_structure_template.ftl"
251
281
article-structure-key="NEW-STRUCTURE-KEY" name="New Structure Template" cacheable="true"/>
252
282
253
- <name>Admin</name>
254
283
</site>
284
+ </sites>
285
+ </setup>
255
286
----
256
287
==== Articles
257
288
File `artcle.xml` is deployed as a part of a module that is using the `db-setup-core` library and reside in it's classpath.
258
289
[source, xml]
259
290
----
291
+ <?xml version="1.0" encoding="UTF-8"?>
292
+ <setup xmlns="http://www.ableneo.com/liferay/setup">
293
+
260
294
<sites>
261
- <site>
295
+ <site global="true" >
262
296
<article
263
297
title="Article Title"
264
298
path="article.xml"
@@ -269,19 +303,24 @@ File `artcle.xml` is deployed as a part of a module that is using the `db-setup-
269
303
</article>
270
304
</site>
271
305
</sites>
306
+ </setup>
272
307
----
273
308
==== Document
274
309
Document's file itself is determined by `file-system-name` attribute which defines resource on classpath.
275
310
[source, xml]
276
311
----
312
+ <?xml version="1.0" encoding="UTF-8"?>
313
+ <setup xmlns="http://www.ableneo.com/liferay/setup">
314
+
277
315
<sites>
278
- <site>
316
+ <site name="Guest" >
279
317
<document file-system-name="image.svg"
280
318
document-folder-name="/Images"
281
319
document-filename="image.svg"
282
320
document-title="image.svg"/>
283
321
</site>
284
322
</sites>
323
+ </setup>
285
324
----
286
325
287
326
=== Liferay Portal requirements
@@ -316,12 +355,14 @@ They are probably not perfect, please let me know if anything feels wrong or inc
316
355
317
356
== Changelog
318
357
319
- === Version 7.4.3860
358
+ === Version 7.4.3125.0
320
359
321
360
==== Features & bug fixes
322
361
* switched to JDK21
323
362
* api compatible with Liferay 7.4.3.125
324
363
* fixed category import (updating parent)
364
+ * fixed working with global/default sites <<_site_selection>>
365
+ * updated docs
325
366
326
367
=== Version 7.4.3860
327
368
@@ -365,10 +406,17 @@ They are probably not perfect, please let me know if anything feels wrong or inc
365
406
.Fixed configuration
366
407
[source, xml]
367
408
----
409
+ <?xml version="1.0" encoding="UTF-8"?>
410
+ <setup xmlns="http://www.ableneo.com/liferay/setup">
411
+
368
412
<resource-permissions>
369
413
<resource resource-id="custom.resource.id-not.a.portlet.id">
370
414
<actionId name="SOME_PERMISSION">
371
415
<role name="Some Portal Role"/>
416
+ </actionId>
417
+ </resource>
418
+ </resource-permissions>
419
+ </setup>
372
420
----
373
421
374
422
==== Refactorings & project changes
0 commit comments