...
Registered Services
Below is a list of notable services used within the plugin PACKAGED_Portals for the portals feature.
...
The service com.wedia.packaged.portals.extensions.PortalsTrigger
contains the logic for managing manages triggers related to the "portal" object. It ensures that the appropriate actions are performed whenever certain events (here , such as 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 There are three possible values for that this property: public, private, and internal. If an unknown value is set inside that for this property, it will be replaced by with a value that will be inferred from the current instance properties.
The properties controlled by the visibility property attribute are status and private. :
Visibility | Status | Private |
---|---|---|
public | Online state ( |
default: Online : 6) | Value is not considered |
; online status prevails |
over the value of the private |
field | |
private | Default state ( |
default: Draft : 2) | True |
internal | Default state ( |
default: Draft : 2) | False |
Synchronization
...
Between Portal and Its Sections
With the help of the service trigger on the portal object, some certain properties are automatically propagated from the parent portal to its sections. Those These properties are include team, viewers, private, status, and activated.
On the other hand, if If a section has one of these properties set to a value different from its parent portal, it will be rolled back reverted to the portal’s value for that property.
...
Sending Notifications to
...
Viewers/
...
Team
The trigger on the portal is also used to send responsible for sending notifications when one of the properties team or viewers property is updated with a new user.
Assets
The plugin PACKAGED_Portals
plugin provides a trigger on assets related to portals (objects that have the tag damobject
and a field portals
that points tagged as damobject
with a portals
field pointing to the portal
object). That This trigger is executed whenever an asset is inserted or updated.
It handles essentially Primarily, it ensures the correct assignment /or removal of assets to /or from the portal’s sections when inserting or updating assets, through the portals
property, ensuring that the management of the property updating the portal.newestitems
is correctly updated property with the uuids UUIDs of the newly added /or removed assetassets.
The trigger also makes sure that Additionally, the trigger checks if instances assigned to the portals
property are updatable by the current surfer. If it’s this is not the case, an error will be thrown during the instance save of the instanceprocess.
Note |
---|
Only sections are kept inside the property portals. 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 namedportals
and that points to theportal
object. It handles the management of assignments/removal of portal’s sections when inserting or updating assets, through theportals
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
...
retained in this property; non-section instances are filtered out and removed. |
API for Assigning/Removing Assets to/from Portal’s Sections
A key API service within the portals feature is the one that assigns assets to a portal’s section. The removal process follows the same principle.
Endpoint:
api/packaged/portals/assignToPortal/{uuid_of_section}
It accepts a list of UUIDs as a payload (application/json) representing the assets to be assigned:
Code Block |
---|
{ "assets": ["uuid1", "uuid2", "uuid3"] // List of asset UUIDs to assign to the portal } |
Before executing, the service performs several checks:
Check if the surfer is connected - returns a 401 status code if this fails.
Check if the current surfer is allowed to update the portal instance - returns a 403 status code if this fails.
Check if the payload is valid - returns a 400 status code if this fails.
Check if the portal specified in the payload exists - returns a 400 status code if this fails.
Unhandled errors - return a 500 status code.
If the number of submitted assets exceeds the limit defined by the plugin parameter max_assets_async
, the assignment will be processed asynchronously. Otherwise:
If an asset instance among those provided is lockable for an update, it will be automatically assigned to the portal.
Otherwise, the assignment will be recorded in a queue to be processed later by a scheduled thread pool execution.
...
Expand | ||
---|---|---|
| ||
Custom Section Service
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.
...