From 965ae347b3bc98b0bfb4136b399e85b35fcda3ee Mon Sep 17 00:00:00 2001 From: jensp Date: Sun, 3 Nov 2019 11:58:47 +0000 Subject: [PATCH] Docuementation for ccm-cms-publicpersonalprofile.ftl git-svn-id: https://svn.libreccm.org/ccm/trunk@6297 8810af33-2d31-482b-a856-94f89814c4df --- .../ccm-cms-publicpersonalprofile.ftl | 361 +++++++++++++++++- 1 file changed, 358 insertions(+), 3 deletions(-) diff --git a/ccm-cms-publicpersonalprofile/web/themes/freemarker/ccm-cms-publicpersonalprofile.ftl b/ccm-cms-publicpersonalprofile/web/themes/freemarker/ccm-cms-publicpersonalprofile.ftl index 7b4e16ecd..3cd6b8f7b 100644 --- a/ccm-cms-publicpersonalprofile/web/themes/freemarker/ccm-cms-publicpersonalprofile.ftl +++ b/ccm-cms-publicpersonalprofile/web/themes/freemarker/ccm-cms-publicpersonalprofile.ftl @@ -6,46 +6,129 @@ "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> <#return model["./ppp:profile/ppp:ownerName"]> +<#--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> <#return data["./profileOwner/owner"]> +<#--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> <#return owner["./surname"]> +<#--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> <#return owner["./givenname"]> +<#--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> <#return owner["./titlePre"]> +<#--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> <#return owner["./titlePost"]> +<#--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> <#return data["./position"]> +<#--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> <#return data["./interests"]> +<#--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> <#return data["./misc"]> +<#--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> <#return owner["./contacts/contact"]> +<#--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> <#if (data["./ppp:profile/ppp:profileImage"]?size > 0)> <#return data["./ppp:profile/ppp:profileImage/imageAttachments[1]/*"]> @@ -54,8 +137,14 @@ -<#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)> <#assign imageId=data["./ppp:profile/ppp:profileImage/imageAttachments[1]/image/id"]> <#return dispatcherPrefix + '/cms-service/stream/image/?image_id=' + imageId> @@ -65,22 +154,57 @@ +<#--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> <#return data["./ppp:profile/ppp:ownerName"]> +<#--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> <#return data["./ppp:profile/personalPublications"]> +<#--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> <#return data["./ppp:profile/personalPublications/availablePublicationGroups/availablePublicationGroup"]> +<#--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> <#return group["./@name"]> +<#--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> <#if (model["ppp:profile/personalPublications/publications/@all"]?size > 0 && model["ppp:profile/personalPublications/publications/@all"] == "all")> @@ -90,18 +214,46 @@ +<#--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> <#return data["./ppp:profile/personalPublications/publications/publicationGroup"]> +<#--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> <#return data["./publications"]> +<#--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> <#return (model["/bebop:page/ppp:profile/personalPublications/publications/publicationGroup/nav:paginator"]?size > 0)> +<#--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> <#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"] + "&"> @@ -110,79 +262,205 @@ +<#--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> <#return model["/bebop:page/ppp:profile/personalPublications/publications/publicationGroup/nav:paginator/@pageCount"]?number> +<#--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> <#return model["/bebop:page/ppp:profile/personalPublications/publications/publicationGroup/nav:paginator/@pageNumber"]?number> +<#--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> <#return model["/bebop:page/ppp:profile/personalPublications/publications/publicationGroup/nav:paginator/@pageParam"]> +<#--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> <#return model["/bebop:page/ppp:profile/personalPublications/publications/publicationGroup/nav:paginator/@pageSize"]?number> +<#--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> <#return model["/bebop:page/ppp:profile/personalPublications/publications/publicationGroup/nav:paginator/@objectBegin"]?number> +<#--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> <#return model["/bebop:page/ppp:profile/personalPublications/publications/publicationGroup/nav:paginator/@objectCount"]?number> +<#--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> <#return model["/bebop:page/ppp:profile/personalPublications/publications/publicationGroup/nav:paginator/@objectEnd"]?number> +<#--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> <#return getPublicationsPaginatorBaseUrl(profile) + getPublicationsPaginatorPageParam(profile) + "=" + (getPublicationsPaginatorPageNumber(profile) - 1)> +<#--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> <#return getPublicationsPaginatorBaseUrl(profile) + getPublicationsPaginatorPageParam(profile) + "=1"> +<#--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> <#return getPublicationsPaginatorBaseUrl(profile) + getPublicationsPaginatorPageParam(profile) + "=" + (getPublicationsPaginatorPageNumber(profile) + 1)> +<#--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> <#return getPublicationsPaginatorBaseUrl(profile) + getPublicationsPaginatorPageParam(profile) + "=" + getPublicationsPaginatorPageCount(profile)> +<#--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> <#return data["./ppp:profile/personalProjects/availableProjectGroups/availableProjectGroup"]> +<#--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> <#return group["./@name"]> +<#--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> - <#if (model["/bebop:page/ppp:profile/personalPublications/publications/@all"]?size > 0 - && model["/bebop:page/ppp:profile/personalPublications/publications/@all"] == "all")> + <#if (model["/bebop:page/ppp:profile/personalProjects/projects/@all"]?size > 0 + && model["/bebop:page/ppp:profile/personalProjects/projects/@all"] == "all")> <#return "#" + group["./@name"]> <#else> <#return "?group=" + group["./@name"]> +<#--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> <#return data["./ppp:profile/personalProjects/projects/projectGroup"]> +<#--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> <#return data["./project"]> +<#--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> <#return (model["./bebop:page/ppp:profile/personalProjects/projects/projectGroup/nav:paginator"]?size > 0)> +<#--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> <#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"] + "&"> @@ -191,46 +469,123 @@ +<#--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> <#return model["/bebop:page/ppp:profile/personalProjects/projects/projectGroup/nav:paginator/@pageCount"]?number> +<#--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> <#return model["/bebop:page/ppp:profile/personalProjects/projects/projectGroup/nav:paginator/@pageNumber"]?number> +<#--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> <#return model["/bebop:page/ppp:profile/personalProjects/projects/projectGroup/nav:paginator/@pageParam"]> +<#--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> <#return model["/bebop:page/ppp:profile/personalProjects/projects/projectGroup/nav:paginator/@pageSize"]?number> +<#--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> <#return model["/bebop:page/ppp:profile/personalProjects/projects/projectGroup/nav:paginator/@objectBegin"]?number> +<#--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> <#return model["/bebop:page/ppp:profile/personalProjects/projects/projectGroup/nav:paginator/@objectCount"]?number> +<#--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> <#return model["/bebop:page/ppp:profile/personalProjects/projects/projectGroup/nav:paginator/@objectEnd"]?number> +<#--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> <#return getProjectsPaginatorBaseUrl(profile) + getProjectsPaginatorPageParam(profile) + "=" + (getProjectsPaginatorPageNumber(profile) - 1)> +<#--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> <#return getProjectsPaginatorBaseUrl(profile) + getProjectsPaginatorPageParam(profile) + "=1"> +<#--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> <#return getProjectsPaginatorBaseUrl(profile) + getProjectsPaginatorPageParam(profile) + "=" + (getProjectsPaginatorPageNumber(profile) + 1)> +<#--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> <#return getProjectsPaginatorBaseUrl(profile) + getProjectsPaginatorPageParam(profile) + "=" + getProjectsPaginatorPageCount(profile)>