The external users view

The view role

The user view allow the logged in user to list and manage users which are in the same organization.

The view security

This view is secured by the security provider implementation configured on the Workplace instance (see The security provider). If the configured security provider dont allow the logged on user to display the view, an error message is displayed.

Add the view in an easysite page

The external users view can be easily display in an easysite page adding the easysite component named “External user autonomous administration”. This component belongs to the “Workplace” component category in the easysite management tool.

The default view configuration

The default XML definition of this view in the workplace-navigation.xml is as below :

<view name="workplaceExternalUserAdmin" action="view" label="LG_WORKPLACE_USER_ADMIN" provider="com.moovapps.workplace.impl.navigation.providers.view.ExternalUserAdminViewProvider" paginable="true" filterable="true" selectable="true" exportable="true">
    <button name="create" label="LG_CREATE">
        <security provider="com.moovapps.workplace.impl.navigation.providers.security.UserAdminSecurityProvider" />
        <action class="workplaceExternalUserAdmin" name="edit" />
    </button>
    <button name="delete" label="LG_DELETE" style="style2">
        <security provider="com.moovapps.workplace.impl.navigation.providers.security.UserAdminSecurityProvider" />
        <action name="delete" />
    </button>
    <image name="delete">
        <security provider="com.moovapps.workplace.impl.navigation.providers.security.UserAdminSecurityProvider" />
        <action name="delete" />
    </image>
    <image name="properties">
        <security provider="com.moovapps.workplace.impl.navigation.providers.security.UserAdminSecurityProvider" />
        <action class="workplaceExternalUserAdmin" name="edit" />
    </image>
    <column name="login" label="LG_USER_LOGIN"/>
    <column name="fullName" label="LG_USER_FULLNAME"/>
    <column name="email" label="LG_EMAIL"/>
    <!--
    <column name="firstName" label="common.firstname"/>
    <column name="lastName" label="common.lastname"/>
    <column name="phoneNumber" label="directory.user.phone"/>
    <column name="mobilePhoneNumber" label="directory.user.mobile"/>
    <column name="nickName" label="directory.user.nickname"/>
    <column name="sex" label="directory.user.sex"/>
    <column name="birthDate" label="directory.user.birthday" ctrl="com.axemble.vdp.ui.core.document.fields.DateField"/>
    <column name="title" label="directory.user.title"/>
    <column name="employeeNumber" label="directory.user.employeenumber"/>
    <column name="contractType" label="directory.user.contracttype"/>
    <column name="userFunction" label="directory.user.function"/>
    <column name="socialCategory" label="directory.user.socialcategory"/>
    <column name="faxNumber" label="directory.user.fax"/>
    <column name="language" label="common.language"/>
    <column name="address1" label="directory.user.address1"/>
    <column name="address2" label="directory.user.address2"/>
    <column name="zipCode" label="directory.user.zipcode"/>
    <column name="city" label="directory.user.city"/>
    <column name="country" label="directory.user.country"/>
    <column name="description" label="common.description" ctrl="com.axemble.vdp.ui.core.document.fields.TextAreaField"/>
    <column name="manager" label="directory.user.manager" ctrl="com.axemble.vdp.ui.core.document.fields.SingleDirectoryField"/>
    <column name="assistant" label="directory.user.assistant" ctrl="com.axemble.vdp.ui.core.document.fields.SingleDirectoryField"/>
    <column name="hierarchicalManager" label="directory.user.hierarchicalManager" ctrl="com.axemble.vdp.ui.core.document.fields.SingleDirectoryField"/>
    <column name="enable" label="LG_ACTIVE" ctrl="com.axemble.vdp.ui.core.document.fields.CheckBoxField"/>
    <column name="groups" label="common.groups" />
    <column name="activationDate" label="directory.user.activationDate" ctrl="com.axemble.vdp.ui.core.document.fields.DateField"/>
    <column name="expirationDate" label="directory.user.expirationDate" ctrl="com.axemble.vdp.ui.core.document.fields.DateField"/>
    -->
</view>

The view is secured by the default IUserAdminSecurityProvider implementation and display three attributes for each displayed user : login, fullname and email.

This default configuration use the default ExternalUserAdminViewProvider to retrieve and display users data.

Override the default view configuration

All attributes supported by the ExternalUserAdminViewProvider are listed, but some are commented in the workplace-navigation.xml in order to be hidden in the default behaviour.
To add some columns in the view, you must copy the commented lines and insert them in your custom navigation xml file as below :

<?xml version="1.0" encoding="ISO-8859-1"?>
<definition name="Custom External users view">
	<screens>
		<view override="workplaceExternalUserAdmin.view">
			<column name="login" label="LG_USER_LOGIN"/>
			<column name="title" label="directory.user.title"/>
			<column name="firstName" label="common.firstname"/>
			<column name="lastName" label="common.lastname"/>
			<column name="email" label="common.email"/>
		</view>
	</screens>
</definition>

If you want to remove delete buttons for example, you can override actions buttons in your custom navigation xml file as below :

<?xml version="1.0" encoding="ISO-8859-1"?>
<definition name="VDoc Process Java - Custom">
	<screens>
            <view override="workplaceExternalUserAdmin.view">
              
              <button name="delete"  override="delete" />
              <image name="delete" override="delete" />
              
              <column name="login" label="LG_USER_LOGIN"/>
              <column name="title" label="directory.user.title"/>
              <column name="firstName" label="common.firstname"/>
              <column name="lastName" label="common.lastname"/>
              <column name="email" label="common.email"/>
		</view>
	</screens>
</definition>

If you need to add unsupported fields in the view (as extended attribute for example) you wil have to develop your own provider.

For example, if you need to add an extended attribute named sample , you will have add the field in your custom custom navigation xml file as below :

<?xml version="1.0" encoding="ISO-8859-1"?>
<definition name="Custom External users view">
	<screens>
		<view override="workplaceExternalUserAdmin.view" provider="com.moovapps.sample.navigation.providers.view.SampleExternalUserAdminViewProvider">
			<column name="login" label="LG_USER_LOGIN"/>
			<column name="title" label="directory.user.title"/>
			<column name="firstName" label="common.firstname"/>
			<column name="lastName" label="common.lastname"/>
			<column name="email" label="common.email"/>
			<column name="sample" label="LG_SAMPLE"/>
		</view>
	</screens>
</definition> 

and to implement a viewProvider as below :

package com.moovapps.sample.navigation.providers.view;

import com.moovapps.workplace.impl.navigation.providers.view.ExternalUserAdminViewProvider;

import com.axemble.vdoc.directory.domain.User;
import com.axemble.vdoc.sdk.interfaces.runtime.INavigateContext;
import com.axemble.vdp.ui.framework.composites.base.CtlAbstractView;
import com.axemble.vdp.ui.framework.composites.base.models.views.ViewModelItem;

public class SampleExternalUserAdminViewProvider extends ExternalUserAdminViewProvider {


	public SampleExternalUserAdminViewProvider(INavigateContext context, CtlAbstractView view) {
		super(context, view);
	}
	
	@Override
	public ViewModelItem fetchLine(final User user) {
	
		ViewModelItem viewModelItem = super.fetchLine(user);
		viewModelItem.setValue("sample", user.getExtendedAttributes().getValue("sample"));
	
		return viewModelItem;
	}
	

}