Foren
Adding and Calling a JSP in the Document Library
Nate Shaw, geändert vor 10 Jahren.
Adding and Calling a JSP in the Document Library
Junior Member Beiträge: 49 Beitrittsdatum: 26.10.10 Neueste Beiträge
Hi everyone.
I am trying to add a new JSP to the document_library portlet and then call that JSP from an existing document_library JSP. However, I can't seem to figure out how to do it. It seems like it should be a pretty simple matter, but all of the varying documentation I look at give me slightly different information. I am doing this work in a hook and am working in 6.1-ga2.
Here are the relevant pieces of code from the calling JSP:
So, as you can see, I added a new menu item to the folder action list, create the URL for it to call and then open that URL in a new pop-up window when the user clicks the menu item. I then went and created my new JSP file: /document_library/propagate_permissions,jsp.
When I deploy my hook and test the code, I see the pop-up window, but it is blank, empty white.
I then looked at adding the struts-config-ext.xml file as suggested by https://www.liferay.com/es/documentation/liferay-portal/6.1/development/-/ai/lp-6-1-dgen06-overriding-and-adding-struts-actions-0. However, when I started looking at that, it appeared as if I would have to then add configuration to the tiles-def.xml file, which seems to be overkill for what I am trying to do.
Can anyone help me figure this out? It seems like it should not be that hard to create a new JSP and call it from another JSP. What am I missing?
I am trying to add a new JSP to the document_library portlet and then call that JSP from an existing document_library JSP. However, I can't seem to figure out how to do it. It seems like it should be a pretty simple matter, but all of the varying documentation I look at give me slightly different information. I am doing this work in a hook and am working in 6.1-ga2.
Here are the relevant pieces of code from the calling JSP:
<c:if test="<%= showPermissionsURL %>">
<liferay-ui:icon cssClass="<%= randomNamespace + "-propPerm-action" %>" image="share" message="Propagate Permissions" alt="Propagate Permissions" url="javascript:;" />
</c:if>
<portlet:renderurl var="propagatePermissionsURL" windowstate="<%= LiferayWindowState.POP_UP.toString() %>">
<portlet:param name="struts_action" value="/document_library/propagate_permissions" />
<%--<portlet:param name="redirect" value="<%= currentURL %>" />--%>
<portlet:param name="folderId" value="<%= String.valueOf(folderId) %>" />
</portlet:renderurl>
<aui:script>
var propPerm = A.one('.<%= randomNamespace %>-propPerm-action');
if (propPerm) {
propPerm.on(
'click',
function(event) {
var propagatePermissionsWindow = window.open('<%= propagatePermissionsURL %>', 'propagatePermissions', 'directories=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no');
propagatePermissionsWindow.focus();
}
);
}
</aui:script>
So, as you can see, I added a new menu item to the folder action list, create the URL for it to call and then open that URL in a new pop-up window when the user clicks the menu item. I then went and created my new JSP file: /document_library/propagate_permissions,jsp.
When I deploy my hook and test the code, I see the pop-up window, but it is blank, empty white.
I then looked at adding the struts-config-ext.xml file as suggested by https://www.liferay.com/es/documentation/liferay-portal/6.1/development/-/ai/lp-6-1-dgen06-overriding-and-adding-struts-actions-0. However, when I started looking at that, it appeared as if I would have to then add configuration to the tiles-def.xml file, which seems to be overkill for what I am trying to do.
Can anyone help me figure this out? It seems like it should not be that hard to create a new JSP and call it from another JSP. What am I missing?