JBoss Portal SVN: r11449 - in branches/JBoss_Portal_Branch_2_7/core-admin/src: resources/portal-admin-war/WEB-INF and 1 other directory.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-07-15 07:31:57 -0400 (Tue, 15 Jul 2008)
New Revision: 11449
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml
Log:
Fixed issue with JSF embedded in EAP 4.3
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2008-07-15 10:21:47 UTC (rev 11448)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2008-07-15 11:31:57 UTC (rev 11449)
@@ -86,7 +86,7 @@
// Configuration
/** . */
- private String namespace;
+ private String namespace = "";
// Wired services
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2008-07-15 10:21:47 UTC (rev 11448)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2008-07-15 11:31:57 UTC (rev 11449)
@@ -56,10 +56,13 @@
<managed-bean-name>portalobjectmgr</managed-bean-name>
<managed-bean-class>org.jboss.portal.core.admin.ui.PortalObjectManagerBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
+ <!--
+ JSF 1.2_08 interpretes <value></value> as "null", it wasn't the case before.
<managed-property>
<property-name>namespace</property-name>
<value></value>
</managed-property>
+ -->
<managed-property>
<property-name>roleModule</property-name>
<value>#{applicationScope.RoleModule}</value>
15 years, 12 months
JBoss Portal SVN: r11448 - branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-07-15 06:21:47 -0400 (Tue, 15 Jul 2008)
New Revision: 11448
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/DefaultPortalCommandFactory.java
Log:
Prabhat found NPE. If it happens again we'll know if the context or the container is null
Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/DefaultPortalCommandFactory.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/DefaultPortalCommandFactory.java 2008-07-15 05:09:34 UTC (rev 11447)
+++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/DefaultPortalCommandFactory.java 2008-07-15 10:21:47 UTC (rev 11448)
@@ -69,7 +69,12 @@
ControllerCommand cmd = nextFactory.doMapping(controllerContext, invocation, host, contextPath, requestPath);
if (cmd == null)
{
- Portal portal = (Portal)container.getContext().getDefaultPortal();
+ Context context = container.getContext();
+ if (context == null)
+ {
+ throw new IllegalStateException("Context does not exist");
+ }
+ Portal portal = (Portal)context.getDefaultPortal();
if (portal == null)
{
throw new IllegalStateException("Default portal does not exist");
15 years, 12 months
JBoss Portal SVN: r11447 - branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2008-07-15 01:09:34 -0400 (Tue, 15 Jul 2008)
New Revision: 11447
Modified:
branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/create.jsp
branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/edit.jsp
branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp
Log:
JBPORTAL-1929 , JBPORTAL-1982 - Relative links in CMS content munged by WYSIWYG editor
Modified: branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/create.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/create.jsp 2008-07-14 21:25:06 UTC (rev 11446)
+++ branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/create.jsp 2008-07-15 05:09:34 UTC (rev 11447)
@@ -53,8 +53,8 @@
content_css : "<%= sCSSURL %>",
plugin_insertdate_dateFormat : "%Y-%m-%d",
plugin_insertdate_timeFormat : "%H:%M:%S",
- relative_urls : "false",
- document_base_url : "<%= sDocBase %>",
+ relative_urls : "true",
+ convert_urls: "false",
extended_valid_elements :
"style[type],a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],font[face|size|color],hr[class|width|size|noshade]"
});
Modified: branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/edit.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/edit.jsp 2008-07-14 21:25:06 UTC (rev 11446)
+++ branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/edit.jsp 2008-07-15 05:09:34 UTC (rev 11447)
@@ -38,8 +38,8 @@
content_css : "<%= sCSSURL %>",
plugin_insertdate_dateFormat : "%Y-%m-%d",
plugin_insertdate_timeFormat : "%H:%M:%S",
- relative_urls : "false",
- document_base_url : "<%= sDocBase %>",
+ relative_urls : "true",
+ convert_urls: "false",
extended_valid_elements :
"style[type],a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],font[face|size|color],hr[class|width|size|noshade]"
});
Modified: branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp 2008-07-14 21:25:06 UTC (rev 11446)
+++ branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp 2008-07-15 05:09:34 UTC (rev 11447)
@@ -120,8 +120,8 @@
content_css : "<%= sCSSURL %>",
plugin_insertdate_dateFormat : "%Y-%m-%d",
plugin_insertdate_timeFormat : "%H:%M:%S",
- relative_urls : "false",
- document_base_url : "<%= sDocBase %>",
+ relative_urls : "true",
+ convert_urls: "false",
extended_valid_elements :
"style[type],a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],font[face|size|color],hr[class|width|size|noshade]"
});
15 years, 12 months
JBoss Portal SVN: r11446 - in branches/JBoss_Portal_Branch_2_6: cms/src/main/org/jboss/portal/cms/impl/jcr and 2 other directories.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2008-07-14 17:25:06 -0400 (Mon, 14 Jul 2008)
New Revision: 11446
Modified:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/interceptors/ACLInterceptor.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCMS.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ACLEnforcer.java
branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
Log:
JBPORTAL-2033 - User with only read-permissions on a folder cannot read a folder
Modified: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/interceptors/ACLInterceptor.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/interceptors/ACLInterceptor.java 2008-07-14 20:52:35 UTC (rev 11445)
+++ branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/interceptors/ACLInterceptor.java 2008-07-14 21:25:06 UTC (rev 11446)
@@ -232,44 +232,52 @@
JCRCommand command = (JCRCommand)securityContext.getAttribute("command");
try
{
- if (filteredResponse instanceof Folder)
+ //UI-level filtering of resources for the CMSAdmin tool
+ if(JCRCMS.isUISecurityFilterActive())
{
- Folder folder = (Folder)filteredResponse;
- List filteredFolders = new ArrayList();
- List filteredFiles = new ArrayList();
- securityContext.removeAttribute("command");
- if (folder.getFolders() != null)
+ if (filteredResponse instanceof Folder)
{
- for (Iterator itr = folder.getFolders().iterator(); itr.hasNext();)
+ Folder folder = (Folder)filteredResponse;
+ List filteredFolders = new ArrayList();
+ List filteredFiles = new ArrayList();
+ securityContext.removeAttribute("command");
+ if (folder.getFolders() != null)
{
- Folder cour = (Folder)itr.next();
- securityContext.setAttribute("applyFilter", cour.getBasePath());
- PortalPermission cmsPermission = new CMSPermission(securityContext);
- boolean allow = this.authorizationManager.checkPermission(cmsPermission);
- if (allow)
+ for (Iterator itr = folder.getFolders().iterator(); itr.hasNext();)
{
- filteredFolders.add(cour);
+ Folder cour = (Folder)itr.next();
+ securityContext.setAttribute("applyFilter", cour.getBasePath());
+ securityContext.setAttribute("isFolder", Boolean.TRUE);
+ PortalPermission cmsPermission = new CMSPermission(securityContext);
+ boolean allow = this.authorizationManager.checkPermission(cmsPermission);
+ if (allow)
+ {
+ filteredFolders.add(cour);
+ }
}
}
- }
- if (folder.getFiles() != null)
- {
- for (Iterator itr = folder.getFiles().iterator(); itr.hasNext();)
+ if (folder.getFiles() != null)
{
- File cour = (File)itr.next();
- securityContext.setAttribute("applyFilter", cour.getBasePath());
- PortalPermission cmsPermission = new CMSPermission(securityContext);
- boolean allow = this.authorizationManager.checkPermission(cmsPermission);
- if (allow)
+ for (Iterator itr = folder.getFiles().iterator(); itr.hasNext();)
{
- filteredFiles.add(cour);
+ File cour = (File)itr.next();
+ securityContext.setAttribute("applyFilter", cour.getBasePath());
+ securityContext.setAttribute("isFolder", Boolean.FALSE);
+ PortalPermission cmsPermission = new CMSPermission(securityContext);
+ boolean allow = this.authorizationManager.checkPermission(cmsPermission);
+ if (allow)
+ {
+ filteredFiles.add(cour);
+ }
}
}
+ folder.setFolders(filteredFolders);
+ folder.setFiles(filteredFiles);
}
- folder.setFolders(filteredFolders);
- folder.setFiles(filteredFiles);
}
- else if ((filteredResponse instanceof List) && (command instanceof SearchCommand))
+
+ //Filtering of resources in the context of Search
+ if ((filteredResponse instanceof List) && (command instanceof SearchCommand))
{
List list = (List)filteredResponse;
List filteredFiles = new ArrayList();
Modified: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCMS.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCMS.java 2008-07-14 20:52:35 UTC (rev 11445)
+++ branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCMS.java 2008-07-14 21:25:06 UTC (rev 11446)
@@ -132,6 +132,30 @@
{
turnOffWorkflow.set(null);
}
+
+ /**
+ *
+ */
+ protected static ThreadLocal applyUISecurityFilter = new ThreadLocal();
+ public static void enableUISecurityFilter()
+ {
+ applyUISecurityFilter.set(Boolean.TRUE);
+ }
+ public static void disableUISecurityFilter()
+ {
+ applyUISecurityFilter.set(null);
+ }
+ public static boolean isUISecurityFilterActive()
+ {
+ boolean isUISecurityFilterActive = false;
+
+ if(applyUISecurityFilter.get() != null && ((Boolean)applyUISecurityFilter.get()))
+ {
+ isUISecurityFilterActive = true;
+ }
+
+ return isUISecurityFilterActive;
+ }
public JCRCMS()
{
Modified: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ACLEnforcer.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ACLEnforcer.java 2008-07-14 20:52:35 UTC (rev 11445)
+++ branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ACLEnforcer.java 2008-07-14 21:25:06 UTC (rev 11446)
@@ -35,7 +35,6 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -146,7 +145,15 @@
if (cmsSecurityContext.getAttribute("applyFilter") != null)
{
String path = (String)cmsSecurityContext.getAttribute("applyFilter");
- hasAccess = this.computeToolAccess(loggedInUser, path);
+ Boolean isFolder = (Boolean)cmsSecurityContext.getAttribute("isFolder");
+ if(isFolder)
+ {
+ hasAccess = this.hasReadAccess(loggedInUser, path);
+ }
+ else
+ {
+ hasAccess = this.hasWriteAccess(loggedInUser, path);
+ }
}
else if (cmsSecurityContext.getAttribute("path") != null)
{
@@ -211,22 +218,33 @@
path = ((FileGetListCommand)command).sFilePath;
}
- hasReadAccess = this.computeAccess(user, path, "read");
- if (!hasReadAccess)
+ hasReadAccess = this.hasReadAccess(user, path);
+
+ return hasReadAccess;
+ }
+
+ /**
+ *
+ * @param user
+ * @param path
+ * @return
+ */
+ private boolean hasReadAccess(User user, String path)
+ {
+ boolean hasAccess = this.computeAccess(user, path, "read");
+ if (!hasAccess)
{
//make sure implied write is not available
- hasReadAccess = this.computeAccess(user, path, "write");
- if (!hasReadAccess)
+ hasAccess = this.computeAccess(user, path, "write");
+ if (!hasAccess)
{
//make sure implied manage is not available
- hasReadAccess = this.computeAccess(user, path, "manage");
+ hasAccess = this.computeAccess(user, path, "manage");
}
}
-
- return hasReadAccess;
+ return hasAccess;
}
- //-------------------------------------------------------------------------------------------------------------------------------------------
/**
* @param user
* @param command
@@ -275,8 +293,24 @@
return hasWriteAccess;
}
+
+ /**
+ *
+ * @param user
+ * @param path
+ * @return
+ */
+ private boolean hasWriteAccess(User user, String path)
+ {
+ boolean hasAccess = this.computeAccess(user, path, "write");
+ if (!hasAccess)
+ {
+ //make sure implied manage is not available
+ hasAccess = this.computeAccess(user, path, "manage");
+ }
+ return hasAccess;
+ }
- //-----------------------------------------------------------------------------------------------------------------------------------------
/**
* @param user
* @param command
@@ -315,8 +349,7 @@
return hasManageAccess;
}
-
- //-----------------------------------------------------------------------------------------------------------------------------------------
+ //----------------------------------------------------------------------------------------------------------------------------------------------------------------------
/**
*
*/
@@ -461,82 +494,9 @@
}
/**
- * This is used to filter out cms resources in the CMS Admin tool, so that the user can see only the resources that
- * he has write/manage access to
- *
* @param user
- * @param path
* @return
*/
- private boolean computeToolAccess(User user, String path)
- {
- boolean toolAccess = false;
-
- //to prevent any administration issues, if the user is the 'cmsRoot'
- //treat him like a super user with access to everything in the cms
- User root = this.authorizationManager.getProvider().getRoot();
- if (user != null && user.getUserName() != null && user.getUserName().equals(root.getUserName()))
- {
- return true;
- }
-
- //get the permissions available for the user in question
- Collection userPermissions = this.getPermissions(user);
-
- //check against permissions that are explicitly specified on this node (file or folder)
- Collection specificPermissions = this.getPermissions(path);
- for (Iterator itr = specificPermissions.iterator(); itr.hasNext();)
- {
- Permission specificPermission = (Permission)itr.next();
- if ((specificPermission.getService().equals("cms")) &&
- (specificPermission.getAction().equals("write") || specificPermission.getAction().equals("manage"))
- )
- {
- for (Iterator itr2 = userPermissions.iterator(); itr2.hasNext();)
- {
- Permission userPermission = (Permission)itr2.next();
- if ((userPermission.getService().equals("cms")) &&
- (userPermission.getAction().equals("write") || userPermission.getAction().equals("manage"))
- )
- {
- String pathCriteria = userPermission.findCriteriaValue("path");
- if (pathCriteria.equals(path))
- {
- //this means this user has read access to this path
- toolAccess = true;
- }
- }
- }
- }
- }
-
- if (specificPermissions != null && !specificPermissions.isEmpty())
- {
- //explicit permissions on this node have been specified....
- //which override any permissions that could be inherited via the path hierarchy
- return toolAccess;
- }
-
- //if i am here...calculate based on permissions inherited via path hierarchy
- Collection writeOrMoreCriteria = this.getWriteOrMore(userPermissions);
- for (Iterator itr = writeOrMoreCriteria.iterator(); itr.hasNext();)
- {
- Criteria cour = (Criteria)itr.next();
- if (this.doesPathMatchPattern(path, cour.getValue()))
- {
-
- toolAccess = true;
- break;
- }
- }
-
- return toolAccess;
- }
-
- /**
- * @param user
- * @return
- */
private boolean computeWorkflowManagementAccess(User user, Set managerRoles)
{
if (managerRoles == null || managerRoles.isEmpty())
@@ -614,106 +574,6 @@
}
/**
- * @param allPermissions
- * @return
- */
- private Collection getWriteOrMore(Collection allPermissions)
- {
- Collection writeOrMore = new HashSet();
-
- if (allPermissions != null)
- {
- for (Iterator itr = allPermissions.iterator(); itr.hasNext();)
- {
- Permission cour = (Permission)itr.next();
- if ((cour.getService().equals("cms")) &&
- (cour.getAction().equals("write") || cour.getAction().equals("manage"))
- )
- {
- writeOrMore.addAll(cour.getCriteria());
- }
- }
- }
-
- return writeOrMore;
- }
-
- /**
- * @param path
- * @param pattern
- * @return
- */
- private boolean doesPathMatchPattern(String path, String pattern)
- {
- boolean match = true;
-
- //format the path first before starting to match it with the specified pattern
- if (!path.startsWith("/"))
- {
- path = "/" + path;
- }
- if (!path.endsWith("/"))
- {
- path = path + "/";
- }
-
- StringTokenizer patternTokenizer = new StringTokenizer(pattern, "/");
- StringTokenizer pathTokenizer = new StringTokenizer(path, "/");
- StringBuffer pathMatched = new StringBuffer("/");
- StringBuffer patternMatched = new StringBuffer();
- if (pattern.startsWith("/"))
- {
- patternMatched.append("/");
- }
- while (
- patternTokenizer.hasMoreTokens() &&
- pathTokenizer.hasMoreTokens()
- )
- {
- String patternToken = patternTokenizer.nextToken();
- String pathToken = pathTokenizer.nextToken();
-
- //setup token tracking
- pathMatched.append(pathToken + "/");
- if (patternTokenizer.hasMoreTokens())
- {
- patternMatched.append(patternToken + "/");
- }
- else
- {
- patternMatched.append(patternToken);
- }
-
- //perform token matching
- if (!match)
- {
- continue;
- }
- int wildCardIndex = patternToken.indexOf('*');
- //if wildCard is not relevant
- if (wildCardIndex <= 0)
- {
- //if wildCardIndex == 0 then this token matches...
- if (wildCardIndex != 0 && !pathToken.equals(patternToken))
- {
- match = false;
- }
- }
- else
- {
- String wildPath = pathToken.substring(0, wildCardIndex);
- String wildPattern = patternToken.substring(0, wildCardIndex);
- if (!wildPath.equals(wildPattern))
- {
- match = false;
- }
- }
- }
-
- return match;
- }
-
- /**
* @param action
* @param impliedTarget
* @return
Modified: branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2008-07-14 20:52:35 UTC (rev 11445)
+++ branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2008-07-14 21:25:06 UTC (rev 11446)
@@ -44,6 +44,7 @@
import org.jboss.portal.cms.util.NodeUtil;
import org.jboss.portal.cms.workflow.ApprovePublish;
import org.jboss.portal.cms.workflow.CMSWorkflowUtil;
+import org.jboss.portal.cms.impl.jcr.JCRCMS;
import org.jboss.portal.core.cms.ui.Util;
import org.jboss.portal.core.cms.command.StreamContentCommand;
import org.jboss.portal.core.controller.ControllerContext;
@@ -148,19 +149,16 @@
this.resources = config.getResourceBundle(Locale.getDefault());
}
-
-
+ /**
+ *
+ */
protected void doView(final JBossRenderRequest rReq, final JBossRenderResponse rRes)
throws PortletException, IOException, UnavailableException
{
//check and make sure the CMSAdminPortlet is accessible to the current user
if (!this.isPortletAccessible(rReq))
{
- rRes.setContentType("text/html");
- PrintWriter writer = rRes.getWriter();
- String sHTML = "<h2>Access Denied</h2>";
- writer.write(sHTML);
- writer.close();
+ this.showAccessDeniedScreen(rRes);
return;
}
@@ -170,29 +168,27 @@
{
if (!this.isSecurityConsoleAccessible(rReq))
{
- rRes.setContentType("text/html");
- PrintWriter writer = rRes.getWriter();
- String sHTML = "<h2>Access Denied</h2>";
- writer.write(sHTML);
- writer.close();
+ this.showAccessDeniedScreen(rRes);
return;
}
}
-
try
{
if (rReq.getParameter("accessDenied") != null)
{
- throw new PortletException("Access to this resource is denied");
+ this.showAccessDeniedScreen(rRes);
}
- internalDoView(rReq, rRes);
+ else
+ {
+ internalDoView(rReq, rRes);
+ }
}
catch (CMSException e)
{
if (e.toString().indexOf("Access to this resource is denied") != -1)
{
- throw new PortletException("Access to this resource is denied");
+ this.showAccessDeniedScreen(rRes);
}
else
{
@@ -200,6 +196,30 @@
}
}
}
+
+ /**
+ *
+ * @param renderResponse
+ * @throws IOException
+ */
+ private void showAccessDeniedScreen(JBossRenderResponse renderResponse) throws IOException
+ {
+ renderResponse.setContentType("text/html");
+ PrintWriter writer = null;
+ try
+ {
+ writer = renderResponse.getWriter();
+ String sHTML = "<h2>Access Denied</h2>";
+ writer.write(sHTML);
+ }
+ finally
+ {
+ if(writer != null)
+ {
+ writer.close();
+ }
+ }
+ }
private void internalDoView(JBossRenderRequest rReq, JBossRenderResponse rRes)
throws CMSException, PortletException, IOException
@@ -217,11 +237,13 @@
{
sPath = "/";
}
-
+
+ JCRCMS.enableUISecurityFilter();
Command listCMD = CMSService.getCommandFactory().createFolderGetListCommand(sPath);
Folder mainFolder = (Folder)CMSService.execute(listCMD);
List folders = mainFolder.getFolders();
List files = mainFolder.getFiles();
+ JCRCMS.disableUISecurityFilter();
rRes.setContentType("text/html");
rReq.setAttribute("folders", folders);
@@ -1788,4 +1810,9 @@
this.setApprovePublish(null);
}
}
+
+ private void filterResourceBySecurity(List resources, PortalCMSSecurityContext securityContext)
+ {
+
+ }
}
\ No newline at end of file
15 years, 12 months
JBoss Portal SVN: r11445 - branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-07-14 16:52:35 -0400 (Mon, 14 Jul 2008)
New Revision: 11445
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/RefreshResult.java
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
Log:
- JBPORTAL-1800: Improved InvalidRegistration handling.
- RefreshResult has now a default SUCCESS status.
- Added some documentation.
Modified: branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2008-07-14 20:52:19 UTC (rev 11444)
+++ branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2008-07-14 20:52:35 UTC (rev 11445)
@@ -301,8 +301,10 @@
if (forceRefresh || isRefreshNeeded(true))
{
log.debug("Refreshing info for producer '" + getId() + "'");
- // Refresh occurs until proven otherwise! :)
- RefreshResult result = new RefreshResult(RefreshResult.Status.SUCCESS);
+
+
+ RefreshResult result = new RefreshResult(); // success by default!
+
try
{
persistentEndpointInfo.refresh();
@@ -316,6 +318,7 @@
// save changes to endpoint
registry.updateProducerInfo(this);
+ // get the service description from the producer
try
{
// if we don't yet have registration information, get an unregistered service description
@@ -324,17 +327,20 @@
}
catch (OperationFailedFault operationFailedFault)
{
+ // if we have local registration info, the OperationFailedFault might indicate a need to call modifyRegistration
if (hasLocalRegistrationInfo())
{
log.debug("OperationFailedFault occurred, might indicate a need to modify registration");
+
// attempt to get unregistered service description
serviceDescription = getServiceDescription(true);
result.setServiceDescription(serviceDescription);
- // validate the registration information
+ // re-validate the registration information
RefreshResult registrationResult = internalRefreshRegistration(serviceDescription, false, true, true);
if (registrationResult.hasIssues())
{
+ // if the registration validation has issues, we need to modify our local information
isModifyRegistrationRequired = true;
setActiveAndSave(false);
}
@@ -354,52 +360,76 @@
serviceDescription = rethrowAsInvokerUnvailable(operationFailedFault);
}
}
+ catch (InvalidRegistrationFault invalidRegistrationFault)
+ {
+ log.debug("InvalidRegistrationFault occurred");
- // do we need to call initCookie or not?
- requiresInitCookie = serviceDescription.getRequiresInitCookie();
+ // attempt to get unregistered service description
+ serviceDescription = getServiceDescription(true);
+ result.setServiceDescription(serviceDescription);
- // custom mode descriptions
- customModes = toMap(serviceDescription.getCustomModeDescriptions());
+ // check our registration information against what is sent in the service description
+ RefreshResult registrationResult = internalRefreshRegistration(serviceDescription, false, true, true);
+ if (registrationResult.hasIssues())
+ {
+ setActiveAndSave(false);
+ rethrowAsInvokerUnvailable(invalidRegistrationFault);
+ }
- // custom window state descriptions
- customWindowStates = toMap(serviceDescription.getCustomWindowStateDescriptions());
+ return refreshInfo(false, serviceDescription, result);
+ }
- // do we need to register?
- if (serviceDescription.isRequiresRegistration())
+ return refreshInfo(forceRefresh, serviceDescription, result);
+ }
+
+ return new RefreshResult(RefreshResult.Status.BYPASSED);
+ }
+
+ private RefreshResult refreshInfo(boolean forceRefresh, ServiceDescription serviceDescription, RefreshResult result)
+ throws PortletInvokerException
+ {
+ // do we need to call initCookie or not?
+ requiresInitCookie = serviceDescription.getRequiresInitCookie();
+
+ // custom mode descriptions
+ customModes = toMap(serviceDescription.getCustomModeDescriptions());
+
+ // custom window state descriptions
+ customWindowStates = toMap(serviceDescription.getCustomWindowStateDescriptions());
+
+ // do we need to register?
+ if (serviceDescription.isRequiresRegistration())
+ {
+ // refresh and force check for extra props if the registered SD failed
+ // todo: deal with forcing check of extra registration properties properly (if needed)
+ RefreshResult registrationResult = internalRefreshRegistration(serviceDescription, true, forceRefresh, false);
+ registry.updateProducerInfo(this);
+
+ // attempt to register and determine if the current service description can be used to extract POPs
+ if (!registrationResult.hasIssues())
{
- // refresh and force check for extra props if the registered SD failed
- // todo: deal with forcing check of extra registration properties properly (if needed)
- RefreshResult registrationResult = internalRefreshRegistration(serviceDescription, true, forceRefresh, false);
- registry.updateProducerInfo(this);
-
- // attempt to register and determine if the current service description can be used to extract POPs
+ registrationResult = register(serviceDescription, false);
if (!registrationResult.hasIssues())
{
- registrationResult = register(serviceDescription, false);
- if (!registrationResult.hasIssues())
- {
- // registration occurred, so we should ask for a new service description
- serviceDescription = getServiceDescription(false);
- }
-
- // extract the POPs
- extractOfferedPortlets(serviceDescription);
+ // registration occurred, so we should ask for a new service description
+ serviceDescription = getServiceDescription(false);
}
- result.setRegistrationResult(registrationResult);
-
- return result;
- }
- else
- {
- log.debug("Registration not required");
- persistentRegistrationInfo = new RegistrationInfo(this, false);
+ // extract the POPs
extractOfferedPortlets(serviceDescription);
- return result;
}
+
+ result.setRegistrationResult(registrationResult);
+
+ return result;
}
-
- return new RefreshResult(RefreshResult.Status.BYPASSED);
+ else
+ {
+ log.debug("Registration not required");
+ persistentRegistrationInfo = new RegistrationInfo(this, false);
+ extractOfferedPortlets(serviceDescription);
+ return result;
+ }
}
private Map<String, ItemDescription> toMap(ItemDescription[] itemDescriptions)
@@ -652,7 +682,7 @@
this.persistentExpirationCacheSeconds = expirationCacheSeconds;
}
- private ServiceDescription getUnmanagedServiceDescription(boolean asUnregistered) throws PortletInvokerException, OperationFailedFault
+ private ServiceDescription getUnmanagedServiceDescription(boolean asUnregistered) throws PortletInvokerException, OperationFailedFault, InvalidRegistrationFault
{
GetServiceDescription request = getServiceDescriptionRequest(asUnregistered);
@@ -681,6 +711,8 @@
if (e instanceof InvalidRegistrationFault)
{
resetRegistration();
+
+ throw (InvalidRegistrationFault)e;
}
else if (e instanceof OperationFailedFault)
{
@@ -701,6 +733,10 @@
{
return rethrowAsInvokerUnvailable(operationFailedFault);
}
+ catch (InvalidRegistrationFault invalidRegistrationFault)
+ {
+ return rethrowAsInvokerUnvailable(invalidRegistrationFault);
+ }
}
private ServiceDescription rethrowAsInvokerUnvailable(Exception e) throws InvokerUnavailableException
@@ -744,7 +780,8 @@
persistentRegistrationInfo.resetRegistration();
}
- refresh(true);
+ invalidateCache();
+ registry.updateProducerInfo(this);
}
// make package only after package reorg
@@ -876,10 +913,7 @@
try
{
persistentEndpointInfo.getRegistrationService().deregister(getRegistrationContext());
- persistentRegistrationInfo.resetRegistration();
log.info("Consumer with id '" + persistentId + "' deregistered.");
-
- invalidateCache();
}
catch (Exception e)
{
@@ -887,7 +921,7 @@
}
finally
{
- registry.updateProducerInfo(this);
+ resetRegistration();
}
}
else
Modified: branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/RefreshResult.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/RefreshResult.java 2008-07-14 20:52:19 UTC (rev 11444)
+++ branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/RefreshResult.java 2008-07-14 20:52:35 UTC (rev 11445)
@@ -42,9 +42,10 @@
private Status status;
private RefreshResult registrationResult;
+ /** A RefreshResult is assumed successful unless proven otherwise. Same as RefreshResult(SUCCESS). */
public RefreshResult()
{
- status = UNKNOWN;
+ this(SUCCESS);
}
public RefreshResult(Status status)
Modified: branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2008-07-14 20:52:19 UTC (rev 11444)
+++ branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2008-07-14 20:52:35 UTC (rev 11445)
@@ -396,6 +396,7 @@
persistentRegistrationProperties = getOrCreateRegistrationPropertiesMap(true);
RegistrationRefreshResult result = new RegistrationRefreshResult();
+ result.setServiceDescription(serviceDescription);
// if we're not merging, we need to copy the current properties so that we can collect validation results.
if (!mergeWithLocalInfo)
@@ -490,8 +491,9 @@
else
{
RegistrationRefreshResult result = new RegistrationRefreshResult();
- result.setStatus(RefreshResult.Status.SUCCESS);
+ result.setStatus(RefreshResult.Status.BYPASSED);
result.setRegistrationProperties(persistentRegistrationProperties);
+ result.setServiceDescription(serviceDescription);
return result;
}
}
Modified: branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2008-07-14 20:52:19 UTC (rev 11444)
+++ branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2008-07-14 20:52:35 UTC (rev 11445)
@@ -26,7 +26,6 @@
import org.jboss.portal.api.event.PortalEventContext;
import org.jboss.portal.common.invocation.InvocationException;
import org.jboss.portal.common.util.ParameterValidation;
-import org.jboss.portal.common.value.StringValue;
import org.jboss.portal.jems.as.system.AbstractJBossService;
import org.jboss.portal.portlet.InvokerUnavailableException;
import org.jboss.portal.portlet.NoSuchPortletException;
@@ -204,7 +203,7 @@
}
ClonePortlet clonePortlet = WSRPTypeFactory.createClonePortlet(getRegistrationContext(),
- WSRPUtils.convertToWSRPPortletContext(portletContext), UserAccess.getUserContext());
+ WSRPUtils.convertToWSRPPortletContext(portletContext), UserAccess.getUserContext());
try
{
return WSRPUtils.convertToPortalPortletContext(getPortletManagementService().clonePortlet(clonePortlet));
@@ -235,7 +234,7 @@
log.debug("Attempting to destroy clones: " + handles);
DestroyPortlets destroyPortlets = WSRPTypeFactory.createDestroyPortlets(getRegistrationContext(),
- handles.toArray(new String[handles.size()]));
+ handles.toArray(new String[handles.size()]));
try
{
@@ -286,7 +285,7 @@
ParameterValidation.throwIllegalArgExceptionIfNull(portletContext, "PortletContext");
GetPortletProperties getPortletProperties = WSRPTypeFactory.createGetPortletProperties(getRegistrationContext(),
- WSRPUtils.convertToWSRPPortletContext(portletContext));
+ WSRPUtils.convertToWSRPPortletContext(portletContext));
getPortletProperties.setNames(keys);
try
@@ -330,7 +329,7 @@
}
public PortletContext setProperties(PortletContext portletContext, PropertyChange[] changes) throws IllegalArgumentException,
- PortletInvokerException, UnsupportedOperationException
+ PortletInvokerException, UnsupportedOperationException
{
ParameterValidation.throwIllegalArgExceptionIfNull(portletContext, "PortletContext");
ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(changes, "Property changes");
@@ -339,7 +338,7 @@
if (portlet == null)
{
throw new PortletInvokerException("Cannot set properties on portlet '" + portletContext.getId()
- + "' because there is no such portlet.");
+ + "' because there is no such portlet.");
}
PropertyList propertyList = WSRPTypeFactory.createPropertyList();
@@ -358,7 +357,7 @@
case PropertyChange.PREF_UPDATE:
// todo: deal with language more appropriately
updates.add(WSRPTypeFactory.createProperty(change.getKey(),
- WSRPUtils.toString(Locale.getDefault()), change.getValue().get(0)));
+ WSRPUtils.toString(Locale.getDefault()), change.getValue().get(0)));
break;
default:
@@ -368,7 +367,7 @@
propertyList.setProperties(updates.toArray(new Property[updates.size()]));
propertyList.setResetProperties(resets.toArray(new ResetProperty[resets.size()]));
SetPortletProperties setPortletProperties =
- WSRPTypeFactory.createSetPortletProperties(getRegistrationContext(), WSRPUtils.convertToWSRPPortletContext(portletContext), propertyList);
+ WSRPTypeFactory.createSetPortletProperties(getRegistrationContext(), WSRPUtils.convertToWSRPPortletContext(portletContext), propertyList);
try
{
@@ -443,6 +442,7 @@
{
// reset registration data and try again
producerInfo.resetRegistration();
+ producerInfo.refresh(true);
}
RegistrationContext getRegistrationContext() throws PortletInvokerException
@@ -640,7 +640,7 @@
WSRPPortletInfo info = getPortletInfo(invocation);
if (info != null && info.isDoesUrlTemplateProcessing()
- && (!info.isTemplatesStoredInSession() || runtimeContext.getSessionID() == null))
+ && (!info.isTemplatesStoredInSession() || runtimeContext.getSessionID() == null))
{
// we need to supply the templates since the portlet does URL processing and either doesn't store
// templates in the session or no session has been established yet
15 years, 12 months
JBoss Portal SVN: r11444 - branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-07-14 16:52:19 -0400 (Mon, 14 Jul 2008)
New Revision: 11444
Modified:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/RefreshResult.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
Log:
- JBPORTAL-1800: Improved InvalidRegistration handling.
- RefreshResult has now a default SUCCESS status.
- Added some documentation.
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2008-07-14 20:44:27 UTC (rev 11443)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2008-07-14 20:52:19 UTC (rev 11444)
@@ -301,8 +301,10 @@
if (forceRefresh || isRefreshNeeded(true))
{
log.debug("Refreshing info for producer '" + getId() + "'");
- // Refresh occurs until proven otherwise! :)
- RefreshResult result = new RefreshResult(RefreshResult.Status.SUCCESS);
+
+
+ RefreshResult result = new RefreshResult(); // success by default!
+
try
{
persistentEndpointInfo.refresh();
@@ -316,6 +318,7 @@
// save changes to endpoint
registry.updateProducerInfo(this);
+ // get the service description from the producer
try
{
// if we don't yet have registration information, get an unregistered service description
@@ -324,17 +327,20 @@
}
catch (OperationFailedFault operationFailedFault)
{
+ // if we have local registration info, the OperationFailedFault might indicate a need to call modifyRegistration
if (hasLocalRegistrationInfo())
{
log.debug("OperationFailedFault occurred, might indicate a need to modify registration");
+
// attempt to get unregistered service description
serviceDescription = getServiceDescription(true);
result.setServiceDescription(serviceDescription);
- // validate the registration information
+ // re-validate the registration information
RefreshResult registrationResult = internalRefreshRegistration(serviceDescription, false, true, true);
if (registrationResult.hasIssues())
{
+ // if the registration validation has issues, we need to modify our local information
isModifyRegistrationRequired = true;
setActiveAndSave(false);
}
@@ -354,52 +360,76 @@
serviceDescription = rethrowAsInvokerUnvailable(operationFailedFault);
}
}
+ catch (InvalidRegistrationFault invalidRegistrationFault)
+ {
+ log.debug("InvalidRegistrationFault occurred");
- // do we need to call initCookie or not?
- requiresInitCookie = serviceDescription.getRequiresInitCookie();
+ // attempt to get unregistered service description
+ serviceDescription = getServiceDescription(true);
+ result.setServiceDescription(serviceDescription);
- // custom mode descriptions
- customModes = toMap(serviceDescription.getCustomModeDescriptions());
+ // check our registration information against what is sent in the service description
+ RefreshResult registrationResult = internalRefreshRegistration(serviceDescription, false, true, true);
+ if (registrationResult.hasIssues())
+ {
+ setActiveAndSave(false);
+ rethrowAsInvokerUnvailable(invalidRegistrationFault);
+ }
- // custom window state descriptions
- customWindowStates = toMap(serviceDescription.getCustomWindowStateDescriptions());
+ return refreshInfo(false, serviceDescription, result);
+ }
- // do we need to register?
- if (serviceDescription.isRequiresRegistration())
+ return refreshInfo(forceRefresh, serviceDescription, result);
+ }
+
+ return new RefreshResult(RefreshResult.Status.BYPASSED);
+ }
+
+ private RefreshResult refreshInfo(boolean forceRefresh, ServiceDescription serviceDescription, RefreshResult result)
+ throws PortletInvokerException
+ {
+ // do we need to call initCookie or not?
+ requiresInitCookie = serviceDescription.getRequiresInitCookie();
+
+ // custom mode descriptions
+ customModes = toMap(serviceDescription.getCustomModeDescriptions());
+
+ // custom window state descriptions
+ customWindowStates = toMap(serviceDescription.getCustomWindowStateDescriptions());
+
+ // do we need to register?
+ if (serviceDescription.isRequiresRegistration())
+ {
+ // refresh and force check for extra props if the registered SD failed
+ // todo: deal with forcing check of extra registration properties properly (if needed)
+ RefreshResult registrationResult = internalRefreshRegistration(serviceDescription, true, forceRefresh, false);
+ registry.updateProducerInfo(this);
+
+ // attempt to register and determine if the current service description can be used to extract POPs
+ if (!registrationResult.hasIssues())
{
- // refresh and force check for extra props if the registered SD failed
- // todo: deal with forcing check of extra registration properties properly (if needed)
- RefreshResult registrationResult = internalRefreshRegistration(serviceDescription, true, forceRefresh, false);
- registry.updateProducerInfo(this);
-
- // attempt to register and determine if the current service description can be used to extract POPs
+ registrationResult = register(serviceDescription, false);
if (!registrationResult.hasIssues())
{
- registrationResult = register(serviceDescription, false);
- if (!registrationResult.hasIssues())
- {
- // registration occurred, so we should ask for a new service description
- serviceDescription = getServiceDescription(false);
- }
-
- // extract the POPs
- extractOfferedPortlets(serviceDescription);
+ // registration occurred, so we should ask for a new service description
+ serviceDescription = getServiceDescription(false);
}
- result.setRegistrationResult(registrationResult);
-
- return result;
- }
- else
- {
- log.debug("Registration not required");
- persistentRegistrationInfo = new RegistrationInfo(this, false);
+ // extract the POPs
extractOfferedPortlets(serviceDescription);
- return result;
}
+
+ result.setRegistrationResult(registrationResult);
+
+ return result;
}
-
- return new RefreshResult(RefreshResult.Status.BYPASSED);
+ else
+ {
+ log.debug("Registration not required");
+ persistentRegistrationInfo = new RegistrationInfo(this, false);
+ extractOfferedPortlets(serviceDescription);
+ return result;
+ }
}
private Map<String, ItemDescription> toMap(ItemDescription[] itemDescriptions)
@@ -652,7 +682,7 @@
this.persistentExpirationCacheSeconds = expirationCacheSeconds;
}
- private ServiceDescription getUnmanagedServiceDescription(boolean asUnregistered) throws PortletInvokerException, OperationFailedFault
+ private ServiceDescription getUnmanagedServiceDescription(boolean asUnregistered) throws PortletInvokerException, OperationFailedFault, InvalidRegistrationFault
{
GetServiceDescription request = getServiceDescriptionRequest(asUnregistered);
@@ -681,6 +711,8 @@
if (e instanceof InvalidRegistrationFault)
{
resetRegistration();
+
+ throw (InvalidRegistrationFault)e;
}
else if (e instanceof OperationFailedFault)
{
@@ -701,6 +733,10 @@
{
return rethrowAsInvokerUnvailable(operationFailedFault);
}
+ catch (InvalidRegistrationFault invalidRegistrationFault)
+ {
+ return rethrowAsInvokerUnvailable(invalidRegistrationFault);
+ }
}
private ServiceDescription rethrowAsInvokerUnvailable(Exception e) throws InvokerUnavailableException
@@ -744,7 +780,8 @@
persistentRegistrationInfo.resetRegistration();
}
- refresh(true);
+ invalidateCache();
+ registry.updateProducerInfo(this);
}
// make package only after package reorg
@@ -876,10 +913,7 @@
try
{
persistentEndpointInfo.getRegistrationService().deregister(getRegistrationContext());
- persistentRegistrationInfo.resetRegistration();
log.info("Consumer with id '" + persistentId + "' deregistered.");
-
- invalidateCache();
}
catch (Exception e)
{
@@ -887,7 +921,7 @@
}
finally
{
- registry.updateProducerInfo(this);
+ resetRegistration();
}
}
else
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/RefreshResult.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/RefreshResult.java 2008-07-14 20:44:27 UTC (rev 11443)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/RefreshResult.java 2008-07-14 20:52:19 UTC (rev 11444)
@@ -42,9 +42,10 @@
private Status status;
private RefreshResult registrationResult;
+ /** A RefreshResult is assumed successful unless proven otherwise. Same as RefreshResult(SUCCESS). */
public RefreshResult()
{
- status = UNKNOWN;
+ this(SUCCESS);
}
public RefreshResult(Status status)
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2008-07-14 20:44:27 UTC (rev 11443)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2008-07-14 20:52:19 UTC (rev 11444)
@@ -396,6 +396,7 @@
persistentRegistrationProperties = getOrCreateRegistrationPropertiesMap(true);
RegistrationRefreshResult result = new RegistrationRefreshResult();
+ result.setServiceDescription(serviceDescription);
// if we're not merging, we need to copy the current properties so that we can collect validation results.
if (!mergeWithLocalInfo)
@@ -490,8 +491,9 @@
else
{
RegistrationRefreshResult result = new RegistrationRefreshResult();
- result.setStatus(RefreshResult.Status.SUCCESS);
+ result.setStatus(RefreshResult.Status.BYPASSED);
result.setRegistrationProperties(persistentRegistrationProperties);
+ result.setServiceDescription(serviceDescription);
return result;
}
}
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2008-07-14 20:44:27 UTC (rev 11443)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2008-07-14 20:52:19 UTC (rev 11444)
@@ -204,7 +204,7 @@
}
ClonePortlet clonePortlet = WSRPTypeFactory.createClonePortlet(getRegistrationContext(),
- WSRPUtils.convertToWSRPPortletContext(portletContext), UserAccess.getUserContext());
+ WSRPUtils.convertToWSRPPortletContext(portletContext), UserAccess.getUserContext());
try
{
return WSRPUtils.convertToPortalPortletContext(getPortletManagementService().clonePortlet(clonePortlet));
@@ -235,7 +235,7 @@
log.debug("Attempting to destroy clones: " + handles);
DestroyPortlets destroyPortlets = WSRPTypeFactory.createDestroyPortlets(getRegistrationContext(),
- handles.toArray(new String[handles.size()]));
+ handles.toArray(new String[handles.size()]));
try
{
@@ -286,7 +286,7 @@
ParameterValidation.throwIllegalArgExceptionIfNull(portletContext, "PortletContext");
GetPortletProperties getPortletProperties = WSRPTypeFactory.createGetPortletProperties(getRegistrationContext(),
- WSRPUtils.convertToWSRPPortletContext(portletContext));
+ WSRPUtils.convertToWSRPPortletContext(portletContext));
getPortletProperties.setNames(keys);
try
@@ -328,7 +328,7 @@
}
public PortletContext setProperties(PortletContext portletContext, PropertyChange[] changes) throws IllegalArgumentException,
- PortletInvokerException, UnsupportedOperationException
+ PortletInvokerException, UnsupportedOperationException
{
ParameterValidation.throwIllegalArgExceptionIfNull(portletContext, "PortletContext");
ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(changes, "Property changes");
@@ -337,7 +337,7 @@
if (portlet == null)
{
throw new PortletInvokerException("Cannot set properties on portlet '" + portletContext.getId()
- + "' because there is no such portlet.");
+ + "' because there is no such portlet.");
}
PropertyList propertyList = WSRPTypeFactory.createPropertyList();
@@ -356,7 +356,7 @@
case PropertyChange.PREF_UPDATE:
// todo: deal with language more appropriately
updates.add(WSRPTypeFactory.createProperty(change.getKey(),
- WSRPUtils.toString(Locale.getDefault()), change.getValue().asString()));
+ WSRPUtils.toString(Locale.getDefault()), change.getValue().asString()));
break;
default:
@@ -366,7 +366,7 @@
propertyList.setProperties(updates.toArray(new Property[updates.size()]));
propertyList.setResetProperties(resets.toArray(new ResetProperty[resets.size()]));
SetPortletProperties setPortletProperties =
- WSRPTypeFactory.createSetPortletProperties(getRegistrationContext(), WSRPUtils.convertToWSRPPortletContext(portletContext), propertyList);
+ WSRPTypeFactory.createSetPortletProperties(getRegistrationContext(), WSRPUtils.convertToWSRPPortletContext(portletContext), propertyList);
try
{
@@ -441,6 +441,7 @@
{
// reset registration data and try again
producerInfo.resetRegistration();
+ producerInfo.refresh(true);
}
RegistrationContext getRegistrationContext() throws PortletInvokerException
@@ -638,7 +639,7 @@
WSRPPortletInfo info = getPortletInfo(invocation);
if (info != null && info.isDoesUrlTemplateProcessing()
- && (!info.isTemplatesStoredInSession() || runtimeContext.getSessionID() == null))
+ && (!info.isTemplatesStoredInSession() || runtimeContext.getSessionID() == null))
{
// we need to supply the templates since the portlet does URL processing and either doesn't store
// templates in the session or no session has been established yet
15 years, 12 months
JBoss Portal SVN: r11443 - branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-07-14 16:44:27 -0400 (Mon, 14 Jul 2008)
New Revision: 11443
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java
Log:
- JBPORTAL-2073: Properly reset the registration properties.
Modified: branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java 2008-07-14 20:42:55 UTC (rev 11442)
+++ branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java 2008-07-14 20:44:27 UTC (rev 11443)
@@ -81,6 +81,12 @@
public void setRegistrationRequired(boolean requiresRegistration)
{
+ // if we switch from requiring registration to no registration, erase registration properties
+ if (this.requiresRegistration && !requiresRegistration)
+ {
+ clearRegistrationProperties();
+ }
+
this.requiresRegistration = requiresRegistration;
}
15 years, 12 months
JBoss Portal SVN: r11442 - branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-07-14 16:42:55 -0400 (Mon, 14 Jul 2008)
New Revision: 11442
Modified:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java
Log:
- JBPORTAL-2073: Properly reset the registration properties.
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java 2008-07-14 20:32:11 UTC (rev 11441)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java 2008-07-14 20:42:55 UTC (rev 11442)
@@ -81,6 +81,12 @@
public void setRegistrationRequired(boolean requiresRegistration)
{
+ // if we switch from requiring registration to no registration, erase registration properties
+ if (this.requiresRegistration && !requiresRegistration)
+ {
+ clearRegistrationProperties();
+ }
+
this.requiresRegistration = requiresRegistration;
}
15 years, 12 months
JBoss Portal SVN: r11441 - docs/branches/JBoss_Portal_Branch_2_7/userGuide/en/images/intro.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-07-14 16:32:11 -0400 (Mon, 14 Jul 2008)
New Revision: 11441
Added:
docs/branches/JBoss_Portal_Branch_2_7/userGuide/en/images/intro/cms_portlet.png
docs/branches/JBoss_Portal_Branch_2_7/userGuide/en/images/intro/login_ss.png
Removed:
docs/branches/JBoss_Portal_Branch_2_7/userGuide/en/images/intro/cms_portlet.gif
docs/branches/JBoss_Portal_Branch_2_7/userGuide/en/images/intro/login_ss.gif
Modified:
docs/branches/JBoss_Portal_Branch_2_7/userGuide/en/images/intro/adminportal.png
docs/branches/JBoss_Portal_Branch_2_7/userGuide/en/images/intro/dashboard.png
docs/branches/JBoss_Portal_Branch_2_7/userGuide/en/images/intro/dashboard_copy_to.png
docs/branches/JBoss_Portal_Branch_2_7/userGuide/en/images/intro/logged.png
Log:
Updated some of the pics
Modified: docs/branches/JBoss_Portal_Branch_2_7/userGuide/en/images/intro/adminportal.png
===================================================================
(Binary files differ)
Deleted: docs/branches/JBoss_Portal_Branch_2_7/userGuide/en/images/intro/cms_portlet.gif
===================================================================
(Binary files differ)
Added: docs/branches/JBoss_Portal_Branch_2_7/userGuide/en/images/intro/cms_portlet.png
===================================================================
(Binary files differ)
Property changes on: docs/branches/JBoss_Portal_Branch_2_7/userGuide/en/images/intro/cms_portlet.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: docs/branches/JBoss_Portal_Branch_2_7/userGuide/en/images/intro/dashboard.png
===================================================================
(Binary files differ)
Modified: docs/branches/JBoss_Portal_Branch_2_7/userGuide/en/images/intro/dashboard_copy_to.png
===================================================================
(Binary files differ)
Modified: docs/branches/JBoss_Portal_Branch_2_7/userGuide/en/images/intro/logged.png
===================================================================
(Binary files differ)
Deleted: docs/branches/JBoss_Portal_Branch_2_7/userGuide/en/images/intro/login_ss.gif
===================================================================
(Binary files differ)
Added: docs/branches/JBoss_Portal_Branch_2_7/userGuide/en/images/intro/login_ss.png
===================================================================
(Binary files differ)
Property changes on: docs/branches/JBoss_Portal_Branch_2_7/userGuide/en/images/intro/login_ss.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 12 months
JBoss Portal SVN: r11440 - docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-07-14 15:10:01 -0400 (Mon, 14 Jul 2008)
New Revision: 11440
Modified:
docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/xmldescriptors.xml
Log:
Correct path
Modified: docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/xmldescriptors.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/xmldescriptors.xml 2008-07-14 15:07:09 UTC (rev 11439)
+++ docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/xmldescriptors.xml 2008-07-14 19:10:01 UTC (rev 11440)
@@ -850,7 +850,7 @@
<para>
<mediaobject>
<imageobject>
- <imagedata align="center" fileref="images/tutorials/first_portlet/desc_relationship.gif"
+ <imagedata align="center" fileref="images/tutorials/first_portlet/desc_relationship.png"
valign="middle" scalefit="1"/>
</imageobject>
</mediaobject>
@@ -1051,7 +1051,7 @@
<para>
<mediaobject>
<imageobject>
- <imagedata align="center" fileref="images/tutorials/first_portlet/desc_relationship.gif"
+ <imagedata align="center" fileref="images/tutorials/first_portlet/desc_relationship.png"
valign="middle" scalefit="1"/>
</imageobject>
</mediaobject>
15 years, 12 months