Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

From a functional point of view, portals are filling the gap between the DAM and Boards. A portal allows to group together different assets and to feature this group within the DAM.

From a DAM perspective, portals is just a tree metadata to index assets. The main relationship for linking an asset to a portal is by checking the asset portals metadata.

In order for portals to have their own landing page, they require some additional properties for storing content.

The portal object

portal is a PONO (Plain Old Noheto Object) defined to meet within a single object, all the needs of a portal to be displayed :

  • it is a tree so it can manage sections, with sorting capabilities (portal, position)

  • it is i18n and can handle indexed description OR HTML description

  • it can be shared with a team like collaborativespace

  • it can be private like a board

  • it can have viewers

  • it can provide a list of assets per entry position

  • its visibility can be easily managed through visibility

  • it allows the front end to store any view option

image-20240930-123518.png
 Source of the portal object

Find below the input to generate this image with plantUml

@startuml
hide empty members
object user
object wkfpkgportal
object Legend
Legend : -native fields
Legend : ~portals related
Legend : # i18n fields

object portal
portal : -id = identity
portal : -created = datetime
portal : -modified = datetime
portal : -parent = sentence
portal : -child = data
portal : -activated = boolean
portal : ~position = integer
portal : ~state = text
portal : ~private = boolean
portal : ~firstitems = text
portal : ~newestitems = text
portal : ~visibility = data
portal : ~logo = file
portal : ~ cover = file
portal : ~name = data
portal : #namefr = data
portal : #namede = data
portal : ~description = text
portal : #descriptionfr = text
portal : #descriptionde = text
portal : ~descriptionhtml = html
portal : #descriptionhtmlfr = html
portal : #descriptionhtmlde = html
portal --> wkfpkgportal : -status
portal --> portal : ~ portal
portal o--> user : ~ team
portal o--> user : ~ viewers
@enduml

Portals fields

name

type

comments

Visibility / Security

status

childwkfpkgportal

It is expected that the workflow defines online as well as archived steps.
It is expected that non-connected users are granted to view online portals.

private

childactivated

When set to true only users defined in team and viewers are allowed to view instances.

team

cmlruser

Defines the list of users allowed to update the instance.

viewers

cmlruser

Defines the list of users allowed to view the instance, even if instance is private

visibility

word

A property used by the Front-End to change the visibility of the instance. 3 different values are handled :

  • private when this value is given, then the instance is marked private and status is switched to draft

  • internal when this value is given, then the instance is marked public and status is switched to draft

  • public when this value is given, then the instance is marked public and status is switched to online

Portal / Section common

portal

childportal

Allows to define portals and sections as a tree

position

integer

Allows to order the sections within a portal

name, namefr, namede

sentence

Name of portal/section

state

text

Used as a state by Front End to store any display option

Portal specific

description, descriptionfr, descriptionde

text

Description of a portal. This property is indexed

logo

image

Logo for the portal

cover

image

Cover image for the portal

Section specific

firstitems

text

newestitems

text

descriptiohtml, descriptionhtmlfr, descriptionhtmlde

html

The portal object regarding assets

image-20241001-085805.png
 Source of relationship with asset

Find below the input to generate this image with plantUml

@startuml
hide empty members
object asset
asset : portals (portal)
object portal
portal : owner (user)
portal : status (wkfpkgportal)
portal : private = boolean
portal : visibility = data
portal : team (user)
portal : viewers (user)
portal : portal (portal)
portal --> portal : portal
asset o--> portal : portals
@enduml

Additional structures and changes to the model

Home widgets

Overview

image-20241001-103436.png
 source of home widgets

Find below the input to generate this image with plantUml

@startuml
hide empty members
object vueapphomewidget
object homewidgetelttype
object portal
object vueapphomewidgettype
object wxmcart
vueapphomewidget : name = data
vueapphomewidget : position = integer
vueapphomewidget : headercart[1-4] = data
vueapphomewidget : buttoncart[1-4] = data
vueapphomewidget : descriptioncart[1-4] = text
vueapphomewidget : usecartdescription = boolean
vueapphomewidget : titlecart[1-4] = sentence
vueapphomewidget --> vueapphomewidgettype : type
vueapphomewidget --> wxmcart : cart[1-4]
vueapphomewidget --> portal : portal[1-4]
vueapphomewidget --> homewidgetelttype : elttype[1-4]
@enduml

Faces

Faces of vueapphomewidget have been updated to have BO forms with better behaviour.
Only faces for rowX2, rowX3, rowX4 elements have been updated. Faces for carousel and waffle are still the same. Here you will find a plantuml graph explaining the behaviour.

image-20241004-150532.png

Download assets of a portal

Overview

The media download functionality allows users to download a selection of assets from a portal as a ZIP file. The process involves creating a download request and then retrieving the file through a download link.

Registering the download request

To initiate a media download, a download request must be registered. This is done by requesting the service api/packaged/portals/zip/register/{portalUUID}, which creates an instance of the portaldownload object. This object contains all the necessary information to prepare the ZIP file.

The service will generate a portaldownload object, which holds details like:

  1. name: The name of the ZIP file (without the extension).

  2. portal: The unique identifier (UUID) of the portals/section from which assets are downloaded.

  3. uuids: The UUIDs of the selected media files for download.

  4. data: Additional metadata about the request such as download options, file transformation profiles, etc.

  5. expires: The expiration date for the download link.
    Once it reaches its expiration date, the instance will be automatically deleted. The expiration date is obtained by adding to the date of the request creation, the value of the parameter portal_download_expiration of the plugin PACKAGED_Portals (the Default value is 7 days).

  6. query: If provided, this specifies a query to select assets for dynamic download. If filled, the value set in the uuids property is ignored.

 source of portal download

Find below the input to generate this image with plantUml

@startuml
hide empty members
object portaldownload
portaldownload : name = data
portaldownload : portal = data
portaldownload : uuids = text
portaldownload : data = text
portaldownload : expires = datetime
portaldownload : query = text
@enduml
image-20241001-103830.png

Downloading the media

  1. The download service lets users retrieve the ZIP file from a portaldownload instance.

  2. The download link uses the UUID of the portaldownload instance created during the register step.

  3. API Example: GET api/packaged/portals/zip/download/{portalDownloadUUID}

  4. Optional parameter :

    • filename: Custom name for the ZIP file

Registered Services

Below is a list of services used within the plugin PACKAGED_Portals for the portals feature.

Triggers

Portal

The service com.wedia.packaged.portals.extensions.PortalsTrigger contains the logic for managing triggers related to the "portal" object. It ensures that the appropriate actions are performed whenever certain events (here insertion or update) occur on the portal object.

  • Visibility

The visibility property of the portal object controls the visibility state of an instance. Three values are possible for that property: public, private, and internal. If an unknown value is set inside that property, it will be replaced by a value that will be inferred from the current instance properties.

The properties controlled by the visibility property are status and private.

Visibility

Status

Private

public

Online state (by default Online : 6)

Value is not considered as the online status prevails on the private value

private

Default state (by default Draft : 2)

True

internal

Default state (by default Draft : 2)

False

  • Synchronization between page and sections

With the help of the service trigger on the portal object, some properties are automatically propagated from the parent portal to its sections.

Those properties are team, viewers, private, status and activated.

On the other hand, if a section has one of these properties set to a value different from its parent portal, it will be rolled back to the portal’s value for that property.

  • Send notification to viewers/team

The trigger on portal is also used to send notifications when one of the properties team or viewers is updated with a new user.

Assets

The plugin PACKAGED_Portals provides a trigger on assets related to portals (objects that have the tag damobject and a field portals that points to the portal object). That trigger is executed whenever an asset is inserted or updated.

It handles essentially the correct assignment/removal to/from portal’s sections when inserting or updating assets, through the portals property, ensuring that the management of the property portal.newestitems is correctly updated with the uuids of the newly added/removed asset.

The trigger also makes sure that instances assigned to portals property are updatable by surfer. If it’s not the case, an error will be thrown during save.

Only sections are kept inside that property. Instances that are not sections are filtered and removed.


1. Portal Object Trigger Service

  • Service Class: com.wedia.packaged.portals.extensions.PortalsTrigger

  • Interface: com.noheto.extensions.interfaces.services.IObjectTriggerBusinessService

  • Description:
    This service contains the logic for managing object triggers related to the "portal" object. It ensures that the appropriate actions are performed whenever certain events (here insertion or update) occur on the portal object.

2. Assets Object Trigger Service

  • Service Class: com.wedia.packaged.portals.extensions.AssetsTrigger

  • Interface: com.noheto.extensions.interfaces.services.IObjectTriggerBusinessService

  • Description:
    This service manages the triggers associated with DAM Objects that have a property named portals and that points to the portal object. It handles the management of assignments/removal of portal’s sections when inserting or updating assets, through the portals property.

3. Plugin Lifecycle Management Service

  • Service Class: com.wedia.packaged.portals.extensions.PluginLifecycle

  • Interface: com.noheto.extensions.interfaces.services.IPluginLifeCycleBusinessService

  • Description:
    This service handles the lifecycle of the plugin, initializing various singletons and thread pools when the plugin PACKAGED_Portals starts or stops.

4. Portals API Service

  • Service Class: com.wedia.packaged.portals.extensions.PortalsAPIService

  • Interface: com.noheto.extensions.interfaces.services.AbstractPluginApiService

  • Description:
    This service acts as the entry point for the public APIs related to portals. It exposes functionality that allows the front or external systems/users to interact with the portals and perform operations such as assignments/removal of assets to/from sections, media downloads, etc.

5. Portals Admin API Service

  • Service Class : com.wedia.packaged.portals.extensions.PortalsAdminAPIService

  • Interface: com.noheto.extensions.interfaces.services.AbstractPluginApiService

  • Description:
    This service serves as the entry point for administrative APIs related to the portals. It allows administrators to configure, manage, and monitor portal-related features and availability.

6. WXM_RESTAPI Extension Service

  • Service Identifier: com.noheto.restapi.startup.ApiBusinessServiceStartup

    • Service Class: com.wedia.packaged.portals.extensions.PortalsCustomSection

  • Interface: com.noheto.extensions.interfaces.services.InstallableService

  • Description:
    This service extends the standard APIs provided by the WXM_RESTAPI plugin. It is mainly used to provide a $custom section when using DAM/DATA services on portal object in order to provide additional pieces of information for the front.

Security

From a security perspective, we observe standard security rules. Additionally, we assume that assigning an asset to a portal should be allowed when the user is allowed to update the target portal.

The default starter-kit configuration relies on permissions available / configurable based on the role type.

Role types default permissions

insert rules

Administrators and Contributors types are allowed to create portals

objectdata/insert/$anycreation

NBCOMMONELEMENTS(',27,28,', surfer.roleid) > 0
AND
LOWER(objectname) = 'portal'

Other users can’t create portals

update rules

Administrators are allowed to update any portal

objectdata/insert/$anystatus/$anyowner

NBCOMMONELEMENTS(',27,', surfer.roleid) > 0
AND
LOWER(objectname) = 'portal'

Other roles are allowed to update their portals and portals they are team members of :

objectdata/update/$anystatus/$selfowner

objectdata/update/$anystatus/$teammember

LOWER(objectname) = 'portal'
AND
(
  object.owner = surfer.id
  OR
  NBCOMMONELEMENTS(object.team, surfer.id) > 0
)

View rules

Administrators are allowed to view any portal

objectdata/insert/$anystatus/$anyowner

NBCOMMONELEMENTS(',27,', surfer.roleid) > 0
AND
LOWER(objectname) = 'portal'

Other roles are allowed to view their portals, portals they are team members of, portal they are members of viewers, internal portals and public portal :

objectdata/view/$online/$anyowner

objectdata/view/$public/$anyowner

objectdata/view/$anystatus/$selfowner

objectdata/view/$anystatus/$teammember

objectdata/view/$anystatus/$viewer

LOWER(objectname) = 'portal'
AND
surfer.connected
AND
(
  object.status = 6
  OR
  object.private = 2
  OR
  object.owner = surfer.id
  OR
  NBCOMMONELEMENTS(object.team, surfer.id) > 0
  OR
  NBCOMMONELEMENTS(object.viewers, surfer.id) > 0
)

Extending portals

Adding metadata to the portal object

  • No labels