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.
Oops!
Copy to clipboard failed. Open the code and copy it manually.
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.
Oops!
Copy to clipboard failed. Open the code and copy it manually.
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
Oops!
Copy to clipboard failed. Open the code and copy it manually.
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 Ametys
Attribute LDAP
Indexed
lastname
sn
yes
firstname
givenName
yes
email
mail
no
telephone
telephoneNumber
no
role
supannRole
yes
assignment
supannAssignment
yes
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
Take your inspiration from the content type org.ametys.plugins.mypage.Content.persondefined by plugin Personal pages. We strongly recommend that you copy and paste your declaration and modify only the necessary fields.
Oops!
Copy to clipboard failed. Open the code and copy it manually.
<extension point="org.ametys.cms.contenttype.ContentTypeExtensionPoint"
id="mycontenttypeperson"
class="org.ametys.plugins.mypage.contenttype.LdapPersonContentType">
<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>
<cms:icons>
<cms:small>img/person_16.png</cms:small>
<cms:medium>img/person_32.png</cms:medium>
<cms:large>img/person_48.png</cms:large>
</cms:icons>
<!-- 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>
<attribute>sn</attribute>
</cms:directory-attribute>
...
<!-- 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>
</cms:metadata>
...
<!-- Exemple d'attribut LDAP à indexer pour la recherche -->
<cms:ldap-indexation>
<cms:attribute-ref name="lastname" />
<cms:attribute-ref name="firstname" />
<cms:attribute-ref name="role" />
<cms:attribute-ref name="affectation" />
</cms:ldap-indexation>
</cms:content-type>
</extension>
<extension point="org.ametys.cms.contenttype.ContentTypeExtensionPoint"
id="mycontenttypeperson"
class="org.ametys.plugins.mypage.contenttype.LdapPersonContentType">
<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>
<cms:icons>
<cms:small>img/person_16.png</cms:small>
<cms:medium>img/person_32.png</cms:medium>
<cms:large>img/person_48.png</cms:large>
</cms:icons>
<!-- 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>
<attribute>sn</attribute>
</cms:directory-attribute>
...
<!-- 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>
</cms:metadata>
...
<!-- Exemple d'attribut LDAP à indexer pour la recherche -->
<cms:ldap-indexation>
<cms:attribute-ref name="lastname" />
<cms:attribute-ref name="firstname" />
<cms:attribute-ref name="role" />
<cms:attribute-ref name="affectation" />
</cms:ldap-indexation>
</cms:content-type>
</extension>
<extension point="org.ametys.cms.contenttype.ContentTypeExtensionPoint"
id="mycontenttypeperson"
class="org.ametys.plugins.mypage.contenttype.LdapPersonContentType">
<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>
<cms:icons>
<cms:small>img/person_16.png</cms:small>
<cms:medium>img/person_32.png</cms:medium>
<cms:large>img/person_48.png</cms:large>
</cms:icons>
<!-- 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>
<attribute>sn</attribute>
</cms:directory-attribute>
...
<!-- 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>
</cms:metadata>
...
<!-- Exemple d'attribut LDAP à indexer pour la recherche -->
<cms:ldap-indexation>
<cms:attribute-ref name="lastname" />
<cms:attribute-ref name="firstname" />
<cms:attribute-ref name="role" />
<cms:attribute-ref name="affectation" />
</cms:ldap-indexation>
</cms:content-type>
</extension>
To render your content type, add a pipeline to your plugin sitemap.xmap file:
Oops!
Copy to clipboard failed. Open the code and copy it manually.
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:
Oops!
Copy to clipboard failed. Open the code and copy it manually.
Finally, we need to deactivate the old "person card" content type extension. To do this, modify theruntime.xmlin the WEB-INF/param de votre application CMS. Dans la partie <plugins> <exclude>, rajouter la ligne suivante :
Oops!
Copy to clipboard failed. Open the code and copy it manually.