This page will walk you through the different steps for setting up a fresh DAM project with portal interface.
Prerequisites
The WEDIA environment has been setup by esaas team.
The default product team NAR has been restored.
You have Administrators access to the system
You have cloned the portal git repository
Up to 11.27.0
Up to 11.27.0, following plugins were not activated by default from the default NAR embed in application. You will need to activate them:
PACKAGED_CW_FeedbackService → provides REST APIs for collecting feedback from portal
PACKAGED_CW_SavedSearch → provides REST APIs for saving and sharing searches on portal
PACKAGED_Portal_ErrorLogger → provides REST APIs allowing to log portal errors on server
PACKAGED_RegistrationEmails → provides email templates and workflow for subscription on portal
PACKAGED_VueAppI18n → provides i18n bundle for portal
PACKAGED_VueApp_Helper → provides services for retrieving portal configuration
Configure plugins
Following plugins must be configured:
PACKAGED_DAM_Utils
dam_objects_selector: Make sure the plugin contains value:
damimport,#damobject,massimportitem,transfer
Up to 11.27.1 the plugin is not configured to get damimport,#damobject,massimportitem,transfer
as its default value
PACKAGED_CW_FeedbackService
mail_from: email address that will be used as sender of feedback messages. You can set here a non existing email address as it will be used as the sender email. It is recommended to set an email address different from one environment to another (int vs staging vs prod) that will ease your filtering rules in your mail client.
mail_to: coma separated list of email addresses to whom the feedback email will be sent to.
This plugin requires SMTP parameters to be correctly defined within wedia global configuration.
PACKAGED_RegistrationEmails
Up to 11.27.0, the default value for account_request_object was defined to user. Further releases define userregistration as default value. Depending on how you want to manage user registrations, you might need to change the value of this parameter.
It is recommended to store account requests in a different object than actual accounts. userregistration is delivered in the default NAR file and should be used.
Create a REST application
If the portal application needs to provide anonymous access, you will first need to create a user with appropriate role that will be used for anonymous connections on the portal.
Create a rest application:
From /admin interface
Click “REST API”
Click “Applications”
Click “New”
Depending whether you need anonymous access on the portal app or not, choose either
a user (if you want to allow anonymous access)
a role (if you don’t want to allow anonymous access)
Click “Save”
Click “Save”
Copy the credentials
Once you close the credentials dialog, you cannot retrieve the secret anymore
Within your portal source .env
file, define VUE_APP_API_APP_NAME
, VUE_APP_API_APP_KEY
, and VUE_APP_API_APP_SECRET
with those values:
VUE_APP_API_APP_NAME=<customer>-portal-app VUE_APP_API_APP_KEY=11bd6c6894aef346460843b6ba4647bf41a83666 VUE_APP_API_APP_SECRET=34add9dbc8a7917940cc328a01753da22f482d93
Accessing the server
If you need to access the server from a different host name (ex: localhost), you will need to change some settings to allow your application to work from a different server:
CORS
Set up CORS rules to allow consuming resources from the wedia server out of a page served by another webserver:
From /admin interface
Click “CORS”
Click “Create”
Fill in the form with appropriate information:
Name: give a name to you rule
Description : give a description to your rule
Activation: check box
Managed rules: put
*
Authorised origin: fill in according to your access needs (ex:
http*://localhost:*
)Authorised verbs: put
*
Authorised headers: put
*
Exposed headers: put
Content-Disposition,X-Picture-Width,X-Picture-Height,Edge-Cache-Tag,Content-Length,Content-Type,X-Edge-Location
Maximum age: put
30
Authentication information: check box
Click “Enregistrer”
After 11.27.1 rule “PORTAL DEV” is delivered by default. You just need to activate it.
RESTAPI Cookie settings
If you are running the portal application in development from your local machine, you will need to change settings of the WXM_RESTAPI plugin
:
From /admin interface
Click on Plugins
Find row with
WXM_RESTAPI
plugin name and click ConfigureSelect Parameters tab
Search for JWTCookie parameters
Change
JWTCookieSameSiteLocal
tonone
Portal source configuration
In order to run portal locally, but to access a remote wedia server, you will need to define VUE_APP_API_URL
in your .env.development
file
VUE_APP_API_URL=<schema>://<host-name>:<port>
You must specify the port, even if you are using the default port for the schema
If you want to be able to deploy your plugin your from a single command, you can also define DEPLOY_SERVER
in .env
file
DEPLOY_SERVER=<schema>://<host-name>[:<port>]
Make sure the plugin exists on the server:
From /admin interface
Click on Plugins
Look for a plugin named PACKAGED_Portal
If it doesn’t exist
Click “Create or import plugin”
Give the name “PACKAGED_Portal”
Click “Create plugin”
Click “Activate”
Whereas the default name of the generated plugin is PACKAGED_Portal, it is possible to change this name in the .env
file, for the variable VUE_APP_CONFIG_PLUGIN
Create the plugin accordingly.
Having done this, you are able to deploy your portal by running from your portal project dir the following command:
npm run build-plugin-deploy
Ensure a resource allows to access user data
portal needs to access user data to retrieve some information about connected user. Depending on your configuration, you might need to create a specific resource on the REST API so that user data are available.
When you have configured the properties that you want to expose through the REST API, if you have included a property that has user
nature, then the user resource is already exposed. You will not need to configure an additional resource.
Nevertheless, you need to make sure that the properties defined below are accessible through the dam/data/user
resource
From /admin interface
Click “REST API”
Click “Restful services”
Click “New”
Give resource name value
user
Click JSON editor tab (at bottom)
Paste given JSON
Click “Save”
user resource description
{ "objectname": "user", "description": "", "auto": false, "read": true, "list": true, "create": false, "update": false, "delete": false, "secured": true, "props": { "id": { "read": true, "list": true }, "name": { "read": true, "list": true }, "lastname": { "read": true, "list": true }, "firstname": { "read": true, "list": true }, "avatar": { "read": true, "list": true }, "email": { "read": true, "list": true }, "society": { "read": true, "list": true }, "job": { "read": true, "list": true }, "country.name": { "read": true, "list": true }, "role.name": { "read": true, "list": true }, "role.createpubliccart": { "read": true, "list": true }, "role.watermark": { "read": true, "list": false }, "role.resolutions.id": { "read": true, "list": false }, "role.resolutions.name": { "read": true, "list": false }, "role.resolutions.shortname": { "read": true, "list": false }, "role.resolutions.description": { "read": true, "list": false }, "role.resolutions.nature": { "read": true, "list": false }, "role.resolutions.nature.id": { "read": true, "list": false }, "role.resolutions.nature.name": { "read": true, "list": false }, "role.resolutions.position": { "read": true, "list": false }, "role.resolutions.variation": { "read": true, "list": false }, "role.resolutionsview.variation": { "read": true, "list": false }, "type.id": { "read": true, "list": true }, "type.name": { "read": true, "list": true } } }
Check rewriting rules
As a default, the portal is bound to /portal path on your server. You can change this default path by configuring the environment variable VUE_APP_BASE_URL
According to the value of this variable, you might need to adapt corresponding rewriting rules:
From /admin interface
Click “URL Rewriting”
Check that following rules are configured with from starting with the base URL (/portal) and to are pointing the plugin name (PACKAGED_Portal)
SSO portal HTML
SSO asset-picker HTML
SSO portal Office picker HTML
SSO portal JSP
STATIC portal
STATIC asset-picker
STATIC portal office picker
ROOTS portal HTML
ROOTS portal JSP
ROOTS portal HTML Office Picker
ROOTS portal HTML Asset Picker Dynamic
ROOTS portal HTML Asset Picker