Page tree

(info) OXAppSuite 7.8+


What are we trying to solve?

This document will demonstrate a configuration that shows how the portal configuration can differ by brand using a single OX installation.

We'll be configuring the portal for two fictional brands ("acme" and "weyland_yutani"). Using the "eager" widget configuration, both brands will preconfigure a portal for their users.

Note that all the other styles of widget declarations (as documented here: https://oxpedia.org/wiki/index.php?title=AppSuite:Configuring_portal_plugins) will work in the same way as the "eager" widgets.

## Acme
Acme will preconfigure:
* Inbox
* My Latest Files
* User Data

## Weyland Yutani
Weyland-Yutani will preconfigure:
* Inbox
* Birthdays
* Appointments

# High level solution description

The secret ingrediant for this configuration is the UI property io.ox/portal//widgetSet, which acts as an additional namespace in the regular widget configuration

(see: https://oxpedia.org/wiki/index.php?title=AppSuite:Configuring_portal_plugins). In essence we have to do three things:

1 Define a global value for the widgetSet property
2 Override this in contextSets for acme and weyland_yutani
3 Write portal.yml style widget definitions in these namespaces

# Creating the contexts and users

First, let's create a context and user with the associated taxonomy for both brands:

/opt/open-xchange/sbin/createcontext -A ... -P ... -u oxadmin -d "Context Admin" -g Admin -s User -p secret -e oxadmin@e1 -q 1 -N e1 --access-combination-name=all -c 11 --taxonomy/types=acme

/opt/open-xchange/sbin/createcontext -A ... -P ... -u oxadmin -d "Context Admin" -g Admin -s User -p secret -e oxadmin@e2 -q 1 -N e2 --access-combination-name=all -c 12 --taxonomy/types=weyland_yutani

and one user in each:

/opt/open-xchange/sbin/createuser -A oxadmin -P secret -c 11 -u user -d "User" -g User -s Test -p secret -e user@e1 --access-combination-name=all

/opt/open-xchange/sbin/createuser -A oxadmin -P secret -c 12 -u user -d "User" -g User -s Test -p secret -e user@e2 --access-combination-name=all

This creates a context "e1" with context id 11 in the brand "acme" and a context "e2" with context id 12 in the brand "weyland_yutani". We'll have the creatively names user@e1 in the acme brand and user@e2 in the weyland_yutani brand.

# Configuring the widgetSet property

In /opt/open-xchange/etc/settings/appsuite.properties set the following property:

io.ox/portal//widgetSet=""

This sets the widgetSet for all contexts to the empty string, meaning, our additional configuration for the two brands will not have a side effect on already existing portal configuration. Now, let's override the widgetSet in the brands.

/opt/open-xchange/etc/contextSets/acme.yml:
acme:
     io.ox/portal//widgetSet: /acme
     withTags: acme

/opt/open-xchange/etc/contextSets/weyland_yutani.yml:
weyland_yutani:
     io.ox/portal//widgetSet: /weyland_yutani
     withTags: weyland_yutani

This sets the widgetSet for all contexts tagged "acme" to "/acme" and, conversely for all contexts tagged "weyland_yutani" to "/weyland_yutani". Note the leading slash in the value. For more information about the config cascade, visit http://oxpedia.org/wiki/index.php?title=ConfigCascade

# Portal Configuration

Now let's have a look at the /opt/open-xchange/etc/settings/portal.yml that configures these widget sets:

io.ox/portal//widgets/eager/acme/gen_0:
    mail_0:
        color: "blue"
        enabled: true
        index: 100
        inverse: false
        plugin: "plugins/portal/mail/register"
        type: "mail"
    recentfiles_0:
        color: "lightgreen"
        enabled: true
        index: 200
        inverse: false
        plugin: "plugins/portal/recentfiles/register"
        type: "recentfiles"
    userSettings_0:
        color: "red"
        enabled: true
        index: 300
        inverse: false
        plugin: "plugins/portal/userSettings/register"
        type: "userSettings"

io.ox/portal//widgets/eager/weyland_yutani/gen_0:
    mail_0:
        color: "blue"
        enabled: true

        index: 100

        inverse: false

        plugin: "plugins/portal/mail/register"

        type: "mail"

    birthdays_0:
        color: "lightgreen"

        enabled: true

        index: 200

        inverse: false

        plugin: "plugins/portal/birthdays/regi
ster"
        type: "birthdays"

    calendar_0:
        color: "red"

        enabled: true

        index: 300

        inverse: false

        plugin: "plugins/portal/calendar/regis
ter"
        type: "calendar"


The first block configures the acme widgets. Note the additional /acme part of the path, that's the same value as the widgetSet attribute for these contexts.

The second block takes care of the configuration for weyland_yutani contexts.

Similarly you could define protected widgets below:

io.ox/portal//widgets/protected/acme:
...

or
io.ox/portal//widgets/protected/weyland_yutani:
...

# Conclusion

This document demonstrated a configuration for different portal pages based on brands using the config cascade to set the "widgetSet" UI property, which defines a namespace for portal configurations.