Docuementation for ccm-cms-publicpersonalprofile.ftl

git-svn-id: https://svn.libreccm.org/ccm/trunk@6297 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2019-11-03 11:58:47 +00:00
parent a31e9825e4
commit 965ae347b3
1 changed files with 358 additions and 3 deletions

View File

@ -6,46 +6,129 @@
"ui": "http://www.arsdigita.com/ui/1.0"} "ui": "http://www.arsdigita.com/ui/1.0"}
> >
<#--filedoc
Provides functions for proceesing public person profiles.
-->
<#--doc
Gets the full owner name.
@param model The model of the public personal profile to use.
@return The full name of the profile owner.
-->
<#function getProfileOwnerFullName model> <#function getProfileOwnerFullName model>
<#return model["./ppp:profile/ppp:ownerName"]> <#return model["./ppp:profile/ppp:ownerName"]>
</#function> </#function>
<#--doc
Gets the model of the profile owner.
@param model The model of the public personal profile to use.
@return The model of the profile owner.
-->
<#function getProfileOwner data> <#function getProfileOwner data>
<#return data["./profileOwner/owner"]> <#return data["./profileOwner/owner"]>
</#function> </#function>
<#--doc
Gets the surname of the profile owner.
@param owner The profile owner model as returned by `getProfileOwner`.
@return The surname of the profile owner.
-->
<#function getProfileOwnerSurname owner> <#function getProfileOwnerSurname owner>
<#return owner["./surname"]> <#return owner["./surname"]>
</#function> </#function>
<#--doc
Gets the given name of the profile owner.
@param owner The profile owner model as returned by `getProfileOwner`.
@return The given name of the profile owner.
-->
<#function getProfileOwnerGivenName owner> <#function getProfileOwnerGivenName owner>
<#return owner["./givenname"]> <#return owner["./givenname"]>
</#function> </#function>
<#--doc
Gets the name prefix of the profile owner.
@param owner The profile owner model as returned by `getProfileOwner`.
@return The name prefix of the profile owner.
-->
<#function getProfileOwnerTitlePre owner> <#function getProfileOwnerTitlePre owner>
<#return owner["./titlePre"]> <#return owner["./titlePre"]>
</#function> </#function>
<#--doc
Gets the name suffix of the profile owner.
@param owner The profile owner model as returned by `getProfileOwner`.
@return The name suffix of the profile owner.
-->
<#function getProfileOwnerTitlePost owner> <#function getProfileOwnerTitlePost owner>
<#return owner["./titlePost"]> <#return owner["./titlePost"]>
</#function> </#function>
<#--doc
Gets the value of the `position` property of the profile.
@param model The model of the public personal profile to use.
@return The value of the `position`property.
-->
<#function getProfilePosition data> <#function getProfilePosition data>
<#return data["./position"]> <#return data["./position"]>
</#function> </#function>
<#--doc
Gets the value of the `interests` property of the profile.
@param model The model of the public personal profile to use.
@return The value of the `interests`property.
-->
<#function getProfileInterests data> <#function getProfileInterests data>
<#return data["./interests"]> <#return data["./interests"]>
</#function> </#function>
<#--doc
Gets the value of the `misc` property of the profile.
@param model The model of the public personal profile to use.
@return The value of the `misc`property.
-->
<#function getProfileMisc data> <#function getProfileMisc data>
<#return data["./misc"]> <#return data["./misc"]>
</#function> </#function>
<#--doc
Gets the contact assoicated with the owner of the profile. The contact
can be further processed using the functions provided by the
ccm-cms-types-contact module.
@param model The model of public personal profile to use.
@return The model of the contact asssociated with the profile owner.
-->
<#function getProfileOwnerContact owner> <#function getProfileOwnerContact owner>
<#return owner["./contacts/contact"]> <#return owner["./contacts/contact"]>
</#function> </#function>
<#--doc
Gets the image associated with the profile.
@param model The model of public personal profile to use.
@return The model of the image associated with the profile.
-->
<#function getProfileImage data> <#function getProfileImage data>
<#if (data["./ppp:profile/ppp:profileImage"]?size > 0)> <#if (data["./ppp:profile/ppp:profileImage"]?size > 0)>
<#return data["./ppp:profile/ppp:profileImage/imageAttachments[1]/*"]> <#return data["./ppp:profile/ppp:profileImage/imageAttachments[1]/*"]>
@ -54,8 +137,14 @@
</#if> </#if>
</#function> </#function>
<#function getProfileImageUrl data> <#--doc
Gets the URL of the profile image.
@param data The model of the profile image as returned by `getProfileImage`.
@return The URL of the profile image.
-->
<#function getProfileImageUrl data>
<#if (data["./ppp:profile/ppp:profileImage"]?size > 0)> <#if (data["./ppp:profile/ppp:profileImage"]?size > 0)>
<#assign imageId=data["./ppp:profile/ppp:profileImage/imageAttachments[1]/image/id"]> <#assign imageId=data["./ppp:profile/ppp:profileImage/imageAttachments[1]/image/id"]>
<#return dispatcherPrefix + '/cms-service/stream/image/?image_id=' + imageId> <#return dispatcherPrefix + '/cms-service/stream/image/?image_id=' + imageId>
@ -65,22 +154,57 @@
</#if> </#if>
</#function> </#function>
<#--doc
Gets the name of the profile owner.
@param data The model of the public personal profile to use.
@return The name of the profile owner.
-->
<#function getProfileOwnerName data> <#function getProfileOwnerName data>
<#return data["./ppp:profile/ppp:ownerName"]> <#return data["./ppp:profile/ppp:ownerName"]>
</#function> </#function>
<#--doc
Gets the personal publications of the profile owner.
@param data The model of the public personal profile to use.
@return The models of the publications of the profile owner.
-->
<#function getPersonalPublications data> <#function getPersonalPublications data>
<#return data["./ppp:profile/personalPublications"]> <#return data["./ppp:profile/personalPublications"]>
</#function> </#function>
<#--doc
Gets the available publication groups.
@param data The model of the public personal profile to use.
@return The models of the available publication groups.
-->
<#function getPersonalPublicationsAvailablePublicationGroups data> <#function getPersonalPublicationsAvailablePublicationGroups data>
<#return data["./ppp:profile/personalPublications/availablePublicationGroups/availablePublicationGroup"]> <#return data["./ppp:profile/personalPublications/availablePublicationGroups/availablePublicationGroup"]>
</#function> </#function>
<#--doc
Gets the ID of a publication group.
@param The model of the publication group to use.
@return The ID of the provided publication group.
-->
<#function getPublicationGroupId group> <#function getPublicationGroupId group>
<#return group["./@name"]> <#return group["./@name"]>
</#function> </#function>
<#--doc
Gets the link for a publication group.
@param The model of the publication group to use.
@return The link for the provided publication group.
-->
<#function getPublicationGroupLink group> <#function getPublicationGroupLink group>
<#if (model["ppp:profile/personalPublications/publications/@all"]?size > 0 <#if (model["ppp:profile/personalPublications/publications/@all"]?size > 0
&& model["ppp:profile/personalPublications/publications/@all"] == "all")> && model["ppp:profile/personalPublications/publications/@all"] == "all")>
@ -90,18 +214,46 @@
</#if> </#if>
</#function> </#function>
<#--doc
Gets the available publication groups.
@param data The model of the public personal profile to use.
@return The models of the available publication groups.
-->
<#function getPublicationGroups data> <#function getPublicationGroups data>
<#return data["./ppp:profile/personalPublications/publications/publicationGroup"]> <#return data["./ppp:profile/personalPublications/publications/publicationGroup"]>
</#function> </#function>
<#--doc
Gets the publications in group..
@param data The model of the publication group to use.
@return The models of the publication in the provided group.
-->
<#function getPublicationsOfGroup data> <#function getPublicationsOfGroup data>
<#return data["./publications"]> <#return data["./publications"]>
</#function> </#function>
<#--doc
Checks if a paginator for the publications is available.
@param profile The model of the public personal profile to use.
@return `true` if a paginator is available, `false` otherwise.
-->
<#function hasPublicationsPaginator profile> <#function hasPublicationsPaginator profile>
<#return (model["/bebop:page/ppp:profile/personalPublications/publications/publicationGroup/nav:paginator"]?size > 0)> <#return (model["/bebop:page/ppp:profile/personalPublications/publications/publicationGroup/nav:paginator"]?size > 0)>
</#function> </#function>
<#--doc
Gets the base URL for the paginator.
@param profile The model of the public personal profile to use.
@return The base URL for the paginator.
-->
<#function getPublicationsPaginatorBaseUrl profile> <#function getPublicationsPaginatorBaseUrl profile>
<#if (model["/bebop:page/ppp:profile/personalPublications/publications/publicationGroup/nav:paginator/@baseURL"]?contains("?"))> <#if (model["/bebop:page/ppp:profile/personalPublications/publications/publicationGroup/nav:paginator/@baseURL"]?contains("?"))>
<#return model["/bebop:page/ppp:profile/personalPublications/publications/publicationGroup/nav:paginator/@baseURL"] + "&"> <#return model["/bebop:page/ppp:profile/personalPublications/publications/publicationGroup/nav:paginator/@baseURL"] + "&">
@ -110,79 +262,205 @@
</#if> </#if>
</#function> </#function>
<#--doc
Gets the number of pages of the publications paginator.
@param profile The model of the public personal profile to use.
@return The number of pages.
-->
<#function getPublicationsPaginatorPageCount profile> <#function getPublicationsPaginatorPageCount profile>
<#return model["/bebop:page/ppp:profile/personalPublications/publications/publicationGroup/nav:paginator/@pageCount"]?number> <#return model["/bebop:page/ppp:profile/personalPublications/publications/publicationGroup/nav:paginator/@pageCount"]?number>
</#function> </#function>
<#--doc
Gets the current page of the publications paginator.
@param profile The model of the public personal profile to use.
@return The current page.
-->
<#function getPublicationsPaginatorPageNumber profile> <#function getPublicationsPaginatorPageNumber profile>
<#return model["/bebop:page/ppp:profile/personalPublications/publications/publicationGroup/nav:paginator/@pageNumber"]?number> <#return model["/bebop:page/ppp:profile/personalPublications/publications/publicationGroup/nav:paginator/@pageNumber"]?number>
</#function> </#function>
<#--doc
Gets the name of the `page` parameter of the publications paginator.
@param profile The model of the public personal profile to use.
@return The name of the `page` parameter.
-->
<#function getPublicationsPaginatorPageParam profile> <#function getPublicationsPaginatorPageParam profile>
<#return model["/bebop:page/ppp:profile/personalPublications/publications/publicationGroup/nav:paginator/@pageParam"]> <#return model["/bebop:page/ppp:profile/personalPublications/publications/publicationGroup/nav:paginator/@pageParam"]>
</#function> </#function>
<#--doc
Gets the maximum number of publications per page.
@param profile The model of the public personal profile to use.
@return The maximum number of publications per page.
-->
<#function getPublicationsPaginatorPageSize profile> <#function getPublicationsPaginatorPageSize profile>
<#return model["/bebop:page/ppp:profile/personalPublications/publications/publicationGroup/nav:paginator/@pageSize"]?number> <#return model["/bebop:page/ppp:profile/personalPublications/publications/publicationGroup/nav:paginator/@pageSize"]?number>
</#function> </#function>
<#--doc
Gets the index of the first publication shown.
@param profile The model of the public personal profile to use.
@return The index of the first publication.
-->
<#function getPublicationsPaginatorObjectBegin profile> <#function getPublicationsPaginatorObjectBegin profile>
<#return model["/bebop:page/ppp:profile/personalPublications/publications/publicationGroup/nav:paginator/@objectBegin"]?number> <#return model["/bebop:page/ppp:profile/personalPublications/publications/publicationGroup/nav:paginator/@objectBegin"]?number>
</#function> </#function>
<#--doc
Gets the number of publications.
@param profile The model of the public personal profile to use.
@return The number of publications.
-->
<#function getPublicationsPaginatorObjectCount profile> <#function getPublicationsPaginatorObjectCount profile>
<#return model["/bebop:page/ppp:profile/personalPublications/publications/publicationGroup/nav:paginator/@objectCount"]?number> <#return model["/bebop:page/ppp:profile/personalPublications/publications/publicationGroup/nav:paginator/@objectCount"]?number>
</#function> </#function>
<#--doc
Gets the index of the last publication shown.
@param profile The model of the public personal profile to use.
@return The index of the last publication.
-->
<#function getPublicationsPaginatorObjectEnd profile> <#function getPublicationsPaginatorObjectEnd profile>
<#return model["/bebop:page/ppp:profile/personalPublications/publications/publicationGroup/nav:paginator/@objectEnd"]?number> <#return model["/bebop:page/ppp:profile/personalPublications/publications/publicationGroup/nav:paginator/@objectEnd"]?number>
</#function> </#function>
<#--doc
Gets the link to the previous page.
@param profile The model of the public personal profile to use.
@return The link to the previous page.
-->
<#function getPublicationsPaginatorPrevPageLink profile> <#function getPublicationsPaginatorPrevPageLink profile>
<#return getPublicationsPaginatorBaseUrl(profile) + getPublicationsPaginatorPageParam(profile) + "=" + (getPublicationsPaginatorPageNumber(profile) - 1)> <#return getPublicationsPaginatorBaseUrl(profile) + getPublicationsPaginatorPageParam(profile) + "=" + (getPublicationsPaginatorPageNumber(profile) - 1)>
</#function> </#function>
<#--doc
Gets the link to the first page.
@param profile The model of the public personal profile to use.
@return The link to the first page.
-->
<#function getPublicationsPaginatonFirstPageLink profile> <#function getPublicationsPaginatonFirstPageLink profile>
<#return getPublicationsPaginatorBaseUrl(profile) + getPublicationsPaginatorPageParam(profile) + "=1"> <#return getPublicationsPaginatorBaseUrl(profile) + getPublicationsPaginatorPageParam(profile) + "=1">
</#function> </#function>
<#--doc
Gets the link to the next page.
@param profile The model of the public personal profile to use.
@return The link to the next page.
-->
<#function getPublicationsPaginatorNextPageLink profile> <#function getPublicationsPaginatorNextPageLink profile>
<#return getPublicationsPaginatorBaseUrl(profile) + getPublicationsPaginatorPageParam(profile) + "=" + (getPublicationsPaginatorPageNumber(profile) + 1)> <#return getPublicationsPaginatorBaseUrl(profile) + getPublicationsPaginatorPageParam(profile) + "=" + (getPublicationsPaginatorPageNumber(profile) + 1)>
</#function> </#function>
<#--doc
Gets the link to the last page.
@param profile The model of the public personal profile to use.
@return The link to the last page.
-->
<#function getPublicationsPaginatorLastPageLink profile> <#function getPublicationsPaginatorLastPageLink profile>
<#return getPublicationsPaginatorBaseUrl(profile) + getPublicationsPaginatorPageParam(profile) + "=" + getPublicationsPaginatorPageCount(profile)> <#return getPublicationsPaginatorBaseUrl(profile) + getPublicationsPaginatorPageParam(profile) + "=" + getPublicationsPaginatorPageCount(profile)>
</#function> </#function>
<#--doc
Gets the available project groups.
@param data The model of the public personal profile to use.
@return The models of the available project groups.
-->
<#function getAvailableProjectGroups data> <#function getAvailableProjectGroups data>
<#return data["./ppp:profile/personalProjects/availableProjectGroups/availableProjectGroup"]> <#return data["./ppp:profile/personalProjects/availableProjectGroups/availableProjectGroup"]>
</#function> </#function>
<#--doc
Gets the ID of a project group.
@param The model of the project group to use.
@return The ID of the provided project group.
-->
<#function getProjectGroupId group> <#function getProjectGroupId group>
<#return group["./@name"]> <#return group["./@name"]>
</#function> </#function>
<#--doc
Gets the link for a project group.
@param The model of the project group to use.
@return The link for the provided project group.
-->
<#function getProjectGroupLink group> <#function getProjectGroupLink group>
<#if (model["/bebop:page/ppp:profile/personalPublications/publications/@all"]?size > 0 <#if (model["/bebop:page/ppp:profile/personalProjects/projects/@all"]?size > 0
&& model["/bebop:page/ppp:profile/personalPublications/publications/@all"] == "all")> && model["/bebop:page/ppp:profile/personalProjects/projects/@all"] == "all")>
<#return "#" + group["./@name"]> <#return "#" + group["./@name"]>
<#else> <#else>
<#return "?group=" + group["./@name"]> <#return "?group=" + group["./@name"]>
</#if> </#if>
</#function> </#function>
<#--doc
Gets the available project groups.
@param data The model of the public personal profile to use.
@return The models of the available project groups.
-->
<#function getProjectGroups data> <#function getProjectGroups data>
<#return data["./ppp:profile/personalProjects/projects/projectGroup"]> <#return data["./ppp:profile/personalProjects/projects/projectGroup"]>
</#function> </#function>
<#--doc
Gets the project in group..
@param data The model of the project group to use.
@return The models of the project in the provided group.
-->
<#function getProjectsOfGroup data> <#function getProjectsOfGroup data>
<#return data["./project"]> <#return data["./project"]>
</#function> </#function>
<#--doc
Checks if a paginator for the projects is available.
@param profile The model of the public personal profile to use.
@return `true` if a paginator is available, `false` otherwise.
-->
<#function hasProjectsPaginator profile> <#function hasProjectsPaginator profile>
<#return (model["./bebop:page/ppp:profile/personalProjects/projects/projectGroup/nav:paginator"]?size > 0)> <#return (model["./bebop:page/ppp:profile/personalProjects/projects/projectGroup/nav:paginator"]?size > 0)>
</#function> </#function>
<#--doc
Gets the base URL for the paginator.
@param profile The model of the public personal profile to use.
@return The base URL for the paginator.
-->
<#function getProjectsPaginatorBaseUrl profile> <#function getProjectsPaginatorBaseUrl profile>
<#if (model["/bebop:page/ppp:profile/personalProjects/projects/projectGroup/nav:paginator/@baseURL"]?contains("?"))> <#if (model["/bebop:page/ppp:profile/personalProjects/projects/projectGroup/nav:paginator/@baseURL"]?contains("?"))>
<#return model["/bebop:page/bebop:page/ppp:profile/personalProjects/projects/projectGroup/nav:paginator/@baseURL"] + "&"> <#return model["/bebop:page/bebop:page/ppp:profile/personalProjects/projects/projectGroup/nav:paginator/@baseURL"] + "&">
@ -191,46 +469,123 @@
</#if> </#if>
</#function> </#function>
<#--doc
Gets the number of pages of the projects paginator.
@param profile The model of the public personal profile to use.
@return The number of pages.
-->
<#function getProjectsPaginatorPageCount profile> <#function getProjectsPaginatorPageCount profile>
<#return model["/bebop:page/ppp:profile/personalProjects/projects/projectGroup/nav:paginator/@pageCount"]?number> <#return model["/bebop:page/ppp:profile/personalProjects/projects/projectGroup/nav:paginator/@pageCount"]?number>
</#function> </#function>
<#--doc
Gets the current page of the projects paginator.
@param profile The model of the public personal profile to use.
@return The current page.
-->
<#function getProjectsPaginatorPageNumber profile> <#function getProjectsPaginatorPageNumber profile>
<#return model["/bebop:page/ppp:profile/personalProjects/projects/projectGroup/nav:paginator/@pageNumber"]?number> <#return model["/bebop:page/ppp:profile/personalProjects/projects/projectGroup/nav:paginator/@pageNumber"]?number>
</#function> </#function>
<#--doc
Gets the name of the `page` parameter of the projects paginator.
@param profile The model of the public personal profile to use.
@return The name of the `page` parameter.
-->
<#function getProjectsPaginatorPageParam profile> <#function getProjectsPaginatorPageParam profile>
<#return model["/bebop:page/ppp:profile/personalProjects/projects/projectGroup/nav:paginator/@pageParam"]> <#return model["/bebop:page/ppp:profile/personalProjects/projects/projectGroup/nav:paginator/@pageParam"]>
</#function> </#function>
<#--doc
Gets the maximum number of projects per page.
@param profile The model of the public personal profile to use.
@return The maximum number of projects per page.
-->
<#function getProjectsPaginatorPageSize profile> <#function getProjectsPaginatorPageSize profile>
<#return model["/bebop:page/ppp:profile/personalProjects/projects/projectGroup/nav:paginator/@pageSize"]?number> <#return model["/bebop:page/ppp:profile/personalProjects/projects/projectGroup/nav:paginator/@pageSize"]?number>
</#function> </#function>
<#--doc
Gets the index of the first project shown.
@param profile The model of the public personal profile to use.
@return The index of the first project.
-->
<#function getProjectsPaginatorObjectBegin profile> <#function getProjectsPaginatorObjectBegin profile>
<#return model["/bebop:page/ppp:profile/personalProjects/projects/projectGroup/nav:paginator/@objectBegin"]?number> <#return model["/bebop:page/ppp:profile/personalProjects/projects/projectGroup/nav:paginator/@objectBegin"]?number>
</#function> </#function>
<#--doc
Gets the number of projects.
@param profile The model of the public personal profile to use.
@return The number of projects.
-->
<#function getProjectsPaginatorObjectCount profile> <#function getProjectsPaginatorObjectCount profile>
<#return model["/bebop:page/ppp:profile/personalProjects/projects/projectGroup/nav:paginator/@objectCount"]?number> <#return model["/bebop:page/ppp:profile/personalProjects/projects/projectGroup/nav:paginator/@objectCount"]?number>
</#function> </#function>
<#--doc
Gets the index of the last project shown.
@param profile The model of the public personal profile to use.
@return The index of the last project.
-->
<#function getProjectsPaginatorObjectEnd profile> <#function getProjectsPaginatorObjectEnd profile>
<#return model["/bebop:page/ppp:profile/personalProjects/projects/projectGroup/nav:paginator/@objectEnd"]?number> <#return model["/bebop:page/ppp:profile/personalProjects/projects/projectGroup/nav:paginator/@objectEnd"]?number>
</#function> </#function>
<#--doc
Gets the link to the previous page.
@param profile The model of the public personal profile to use.
@return The link to the previous page.
-->
<#function getProjectsPaginatorPrevPageLink profile> <#function getProjectsPaginatorPrevPageLink profile>
<#return getProjectsPaginatorBaseUrl(profile) + getProjectsPaginatorPageParam(profile) + "=" + (getProjectsPaginatorPageNumber(profile) - 1)> <#return getProjectsPaginatorBaseUrl(profile) + getProjectsPaginatorPageParam(profile) + "=" + (getProjectsPaginatorPageNumber(profile) - 1)>
</#function> </#function>
<#--doc
Gets the link to the first page.
@param profile The model of the public personal profile to use.
@return The link to the first page.
-->
<#function getProjectsPaginatonFirstPageLink profile> <#function getProjectsPaginatonFirstPageLink profile>
<#return getProjectsPaginatorBaseUrl(profile) + getProjectsPaginatorPageParam(profile) + "=1"> <#return getProjectsPaginatorBaseUrl(profile) + getProjectsPaginatorPageParam(profile) + "=1">
</#function> </#function>
<#--doc
Gets the link to the next page.
@param profile The model of the public personal profile to use.
@return The link to the next page.
-->
<#function getProjectsPaginatorNextPageLink profile> <#function getProjectsPaginatorNextPageLink profile>
<#return getProjectsPaginatorBaseUrl(profile) + getProjectsPaginatorPageParam(profile) + "=" + (getProjectsPaginatorPageNumber(profile) + 1)> <#return getProjectsPaginatorBaseUrl(profile) + getProjectsPaginatorPageParam(profile) + "=" + (getProjectsPaginatorPageNumber(profile) + 1)>
</#function> </#function>
<#--doc
Gets the link to the last page.
@param profile The model of the public personal profile to use.
@return The link to the last page.
-->
<#function getProjectsPaginatorLastPageLink profile> <#function getProjectsPaginatorLastPageLink profile>
<#return getProjectsPaginatorBaseUrl(profile) + getProjectsPaginatorPageParam(profile) + "=" + getProjectsPaginatorPageCount(profile)> <#return getProjectsPaginatorBaseUrl(profile) + getProjectsPaginatorPageParam(profile) + "=" + getProjectsPaginatorPageCount(profile)>
</#function> </#function>