Setting up a new portal DAM project
This page will walk you through the different steps for setting up a fresh DAM project with portal interface.
Prior to 2021.5.2
, minimum node version for compiling portal was v10.16.3
Starting from 2021.5.2, minimum node version for compiling portal is v12.22.7
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.
Create a REST application
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
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”
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>
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”
Having done this, you are able to deploy your portal by running from your portal project dir the following command:
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.
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
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