Plugin Personal Pages - Integration Manual v1.8.0

  1. Prerequisites
  2. Installation
  3. Graphic integration
  4. Attributes LDAP and indexing LDAP by default
  5. Definition of a new "person card" content type


Your CMS user manager must be linked to a LDAP directory.

There are 2 LDAP managers:

  • org.ametys.runtime.plugins.core.Ldap
  • org.ametys.runtime.plugins.core.CredentialsAwareLdap


  • Stop the server
  • Download jars from plugin and add them (ametys-plugin-mypage-1.8.0.jar and ametys- plugin-mypage-resources-1.780.jar) to your application's WEB-INF/lib directory. Ametys

  • Add buttons and menus for opening and managing personal pages in the file WEB-INF/params/cms-ribbon-default.xml. The identifiers are org.ametys.mypage.person.Open and org.ametys.mypage.person.SearchMenu.
    We recommend adding it to the Home tab, in the "Advanced tools" group.

    			<control id="org.ametys.mypage.person.Open"/>
                <control id="org.ametys.mypage.person.SearchMenu"/>
  • To enable users to edit their own page, a profile named "MYPAGE_PROFILE" must be created, with the following rights :
    • in the "Personal pages" category, select"Manage my personal page";
    • depending on the worfklow, all the rights required to modify, delete and advance content through the workflow to the state considered valid for publication on the website. In the demo application, these rights are: "Edit", "Propose", "Refuse", "Validate" and "Delete".
  • Personal pages are managed as a type of content. However, this type of content is not intended to be inserted into site pages.
    You must therefore explicitly remove it from the "Add content" menu. To do this, make sure that the content type org.ametys.plugins.mypage.Content.person belongs to the list of available content types defined by the WEB-INF/param/content-types-default.xml.

    <?xml version="1.0" encoding="UTF-8"?>
    <content-types mode="exclude">
          <content-type id="org.ametys.plugins.newsletter.Content.newsletter"/>
    	  <content-type id="org.ametys.plugins.mypage.Content.person"/>
  • Restart the server

Graphic integration

This extension requires your layout to contain a "mypage" template with a main area named "default". You must create this template if it does not already exist in your charter.
For simple integration, the template.xsl of this new template can simply import the style sheet of the page template


<xsl:stylesheet version="1.0"
        xmlns:date="" extension-element-prefixes="date"
    <xsl:import href="skin://templates/page/stylesheets/template.xsl" />


Attributes LDAP and indexing LDAP by default

The default "person record" content type defines 6 fields to be extracted from the LDAP directory, 4 of which are indexed for search purposes.

Field AmetysAttribute LDAPIndexed

Definition of a new "person card" content type

The plugin Personal Pages site introduces a new type of "person file" content, composed of fields from the LDAP directory and classic Ametys fields.

This content type is a special type of content that cannot be overloaded using the classic overload mechanism. Whenever you want to modify, add or delete fields (LDAP or Ametys) of this content type, you will have to redefine the content type entirely in your application.

To do this, declare in the plugin.xml of a plugin, a org.ametys.cms.contenttype.ContentTypeExtensionPoint using the org.ametys.plugins.mypage.contenttype.LdapPersonContentType

If you need to create a new plugin, follow the instructions on the Architecture page of plugin Ametys .

Take your inspiration from the content type org.ametys.plugins.mypage.Content.person defined by plugin Personal pages. We strongly recommend that you copy and paste your declaration and modify only the necessary fields.

<extension point="org.ametys.cms.contenttype.ContentTypeExtensionPoint"
   <cms:content-type private="true">
        <cms:label i18n="true">plugin.mypage:PLUGINS_MYPAGE_CONTENT_TYPE_PERSON_LABEL</cms:label>
        <cms:description i18n="true">plugin.mypage:PLUGINS_MYPAGE_CONTENT_TYPE_PERSON_DESCRIPTION</cms:description>

		<!-- Exemple de champ issu du LDAP -->
        <cms:directory-attribute name="lastname" alpha-search="true" order="1">
             <label i18n="true">plugin.mypage:PLUGINS_MYPAGE_CONTENT_PERSON_LASTNAME</label>
             <description i18n="true">plugin.mypage:PLUGINS_MYPAGE_CONTENT_PERSON_LASTNAME_DESC</description>

		<!-- Exemple de champ Ametys classique -->
		<cms:metadata name="fax" type="string">
             <label i18n="true">plugin.mypage:PLUGINS_MYPAGE_CONTENT_PERSON_FAX</label>
             <description i18n="true">plugin.mypage:PLUGINS_MYPAGE_CONTENT_PERSON_FAX_DESC</description>

        <!-- Exemple d'attribut LDAP à indexer pour la recherche -->
            <cms:attribute-ref name="lastname" />
            <cms:attribute-ref name="firstname" />
            <cms:attribute-ref name="role" />
            <cms:attribute-ref name="affectation" />

To render your content type, add a pipeline to your plugin sitemap.xmap file:

<map:match pattern="mycontenttypeperson.*">
    <map:redirect-to uri="cocoon://_plugins/web/content-type.person.{1}?pluginName=mypage"/>

To then use your "person card" content type instead of the "org.ametys.plugins.mypage.Content.person"Create a person-content-type.xml in the WEB-INF/param file in your CMS application. This file must contain the following lines:

<?xml version="1.0" encoding="UTF-8"?>

Finally, we need to deactivate the old "person card" content type extension. To do this, modify the runtime.xml in the WEB-INF/param de votre application CMS. Dans la partie <plugins> <exclude>, rajouter la ligne suivante :





Back to top

Personal pages