Index: rave-portal-resources/src/main/webapp/static/script/rave.js =================================================================== --- rave-portal-resources/src/main/webapp/static/script/rave.js (revision 1370376) +++ rave-portal-resources/src/main/webapp/static/script/rave.js (working copy) @@ -26,6 +26,14 @@ // variable to store whether or not some // UI actions should be propagated back to the server var pageEditor = true; + var pageViewer = { + username: "Unknown", + id:-1 + }; + var pageOwner = { + username: "Unknown", + id:-1 + }; var onWidgetsInitializedHandlers = []; var onProvidersInitializedHandlers = []; @@ -1074,6 +1082,22 @@ return context; } + function setPageViewer(viewer) { + pageViewer = viewer; + } + + function getPageViewer(){ + return pageViewer; + } + + function setPageOwner(owner){ + pageOwner = owner; + } + + function getPageOwner(){ + return pageOwner; + } + function getRegionWidgetById(regionWidgetId) { return widgetByIdMap[regionWidgetId]; } @@ -1264,6 +1288,30 @@ getContext:getContext, /** + * Sets the authenticated page viewer for the Rave web application + * + * @param viewer an object representing the authenticated user viewing the page {username:"bob", id:"1"} + */ + setPageViewer:setPageViewer, + + /** + * Gets the current viewer + */ + getPageViewer:getPageViewer, + + /** + * Sets the owner of the current page + * + * @param owner an object representing the owner of the page + */ + setPageOwner:setPageOwner, + + /** + * Gets the page owner + */ + getPageOwner:getPageOwner, + + /** * Gets a regionwidget by region widget id */ getRegionWidgetById:getRegionWidgetById, Index: rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/personProfile.jsp =================================================================== --- rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/personProfile.jsp (revision 1370376) +++ rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/personProfile.jsp (working copy) @@ -185,6 +185,10 @@ rave.initUI(); rave.layout.init(); rave.personprofile.init(); + rave.setPageOwner({ + username: "${userProfile.username}", + id: "${userProfile.id}" + }); }); Index: rave-portal-resources/src/main/webapp/WEB-INF/tags/rave_js.tag =================================================================== --- rave-portal-resources/src/main/webapp/WEB-INF/tags/rave_js.tag (revision 1370376) +++ rave-portal-resources/src/main/webapp/WEB-INF/tags/rave_js.tag (working copy) @@ -18,11 +18,11 @@ --%> <%@ include file="/WEB-INF/jsp/includes/taglibs.jsp" %> - - - + + + <%-- local rave scripts --%> - + <%-- check to see if the javaScriptDebugMode is on, if so render the individual JS files, otherwise render the minified single file --%> @@ -41,8 +41,14 @@ - + <%-- common javascript to execute on all pages --%>