morciuch 2003/06/06 10:33:03 Modified: src/java/org/apache/jetspeed/modules/actions/controllers MultiColumnControllerAction.java src/java/org/apache/jetspeed/services PsmlManager.java src/java/org/apache/jetspeed/services/psmlmanager CastorPsmlManagerService.java PsmlManagerService.java src/java/org/apache/jetspeed/services/psmlmanager/db DatabasePsmlManagerService.java xdocs changes.xml Log: Fixed the problem with references not being removed from user's profile until psml is refreshed (see Bugzilla bug# 15413). Tested this both with castor and dbpsml configurations. Revision Changes Path 1.27 +15 -1 jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/controllers/MultiColumnControllerAction.java Index: MultiColumnControllerAction.java =================================================================== RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/controllers/MultiColumnControllerAction.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- MultiColumnControllerAction.java 7 May 2003 15:16:47 -0000 1.26 +++ MultiColumnControllerAction.java 6 Jun 2003 17:33:03 -0000 1.27 @@ -72,6 +72,7 @@ import org.apache.jetspeed.services.rundata.JetspeedRunData; import org.apache.jetspeed.services.Registry; import org.apache.jetspeed.services.statemanager.SessionState; +import org.apache.jetspeed.services.PsmlManager; // Turbine stuff import org.apache.turbine.modules.ActionLoader; @@ -104,6 +105,8 @@ public class MultiColumnControllerAction extends VelocityControllerAction { + private static final String REFERENCES_REMOVED = "references-removed"; + /** * Subclasses must override this method to provide default behavior * for the portlet action @@ -420,6 +423,14 @@ try { ((JetspeedRunData) data).getCustomizedProfile().store(); + + // Because of the way references are stored in memory, we have to completely refresh + // the profile after a references is removed (otherwise it will continue being displayed) + String referencesRemoved = (String) customizationState.getAttribute(REFERENCES_REMOVED); + if (referencesRemoved != null && referencesRemoved.equals("true")) + { + PsmlManager.refresh(((JetspeedRunData) data).getCustomizedProfile()); + } } catch (Exception e) { @@ -446,6 +457,8 @@ PortletSet customizedSet = (PortletSet) jdata.getCustomized(); + customizationState.setAttribute(REFERENCES_REMOVED, "false"); + int col = data.getParameters().getInt("col", -1); int row = data.getParameters().getInt("row", -1); List[] columns = (List[]) customizationState.getAttribute("customize-columns"); @@ -483,6 +496,7 @@ { if (portlets.getReference(i) == identityElement) { + customizationState.setAttribute(REFERENCES_REMOVED, "true"); portlets.removeReference(i); } } 1.9 +11 -1 jakarta-jetspeed/src/java/org/apache/jetspeed/services/PsmlManager.java Index: PsmlManager.java =================================================================== RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/PsmlManager.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- PsmlManager.java 28 Jun 2002 05:37:32 -0000 1.8 +++ PsmlManager.java 6 Jun 2003 17:33:03 -0000 1.9 @@ -220,5 +220,15 @@ return getService().export(consumer, locator); } + /** + * Refreshes a PSML document for the given locator + * + * @param locator The locator descriptor of the document to be retrieved. + */ + public static PSMLDocument refresh( ProfileLocator locator ) + { + return getService().refresh(locator); + } + } 1.40 +36 -5 jakarta-jetspeed/src/java/org/apache/jetspeed/services/psmlmanager/CastorPsmlManagerService.java Index: CastorPsmlManagerService.java =================================================================== RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/psmlmanager/CastorPsmlManagerService.java,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- CastorPsmlManagerService.java 17 Apr 2003 15:28:57 -0000 1.39 +++ CastorPsmlManagerService.java 6 Jun 2003 17:33:03 -0000 1.40 @@ -334,11 +334,24 @@ } /** - * Returns a PSML document for the given locator - * + * Returns a cached PSML document for the given locator + * * @param locator The locator descriptor of the document to be retrieved. + * @return PSML document from cache (or disk if not yet cached) */ - public PSMLDocument getDocument( ProfileLocator locator ) + public PSMLDocument getDocument( ProfileLocator locator) + { + return getDocument(locator, true); + } + + /** + * Returns a PSML document for the given locator + * + * @param locator The locator descriptor of the document to be retrieved. + * @param getCached Look in the cache (true) or umarshall a fresh copy from disk (false) + * @return + */ + protected PSMLDocument getDocument( ProfileLocator locator, boolean getCached ) { if (locator == null) { @@ -368,7 +381,10 @@ PSMLDocument doc = null; Profile profile = null; - profile = (Profile)documents.getDocument(name); + if (getCached == true) + { + profile = (Profile)documents.getDocument(name); + } if (profile == null) { @@ -403,6 +419,21 @@ } return doc; + } + + /** + * Loads a PSML document from disk bypassing the cache + * + * @param locator + * @return PSML document from disk + */ + public PSMLDocument refresh(ProfileLocator locator) + { + if (Log.getLogger().isDebugEnabled()) + { + Log.debug("CastorPsmlManagerService: psml document refreshed from disk: " + locator.getPath()); + } + return getDocument(locator, false); } /** 1.11 +8 -1 jakarta-jetspeed/src/java/org/apache/jetspeed/services/psmlmanager/PsmlManagerService.java Index: PsmlManagerService.java =================================================================== RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/psmlmanager/PsmlManagerService.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- PsmlManagerService.java 4 Mar 2003 00:05:09 -0000 1.10 +++ PsmlManagerService.java 6 Jun 2003 17:33:03 -0000 1.11 @@ -175,5 +175,12 @@ */ public int export(PsmlManagerService consumer, QueryLocator locator); + /** + * Returns a PSML document for the given locator bypassing the cache (if applicable) + * + * @param locator The locator descriptor of the document to be retrieved. + */ + public PSMLDocument refresh( ProfileLocator locator ); + } 1.33 +2 -2 jakarta-jetspeed/src/java/org/apache/jetspeed/services/psmlmanager/db/DatabasePsmlManagerService.java Index: DatabasePsmlManagerService.java =================================================================== RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/psmlmanager/db/DatabasePsmlManagerService.java,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- DatabasePsmlManagerService.java 17 Apr 2003 15:28:57 -0000 1.32 +++ DatabasePsmlManagerService.java 6 Jun 2003 17:33:03 -0000 1.33 @@ -932,7 +932,7 @@ * document to be retrieved. * @return psmldoc The PSMLDocument object */ - private PSMLDocument refresh(ProfileLocator locator) + public PSMLDocument refresh(ProfileLocator locator) { // go to database and get the blob, and marshal the Portlets 1.168 +4 -1 jakarta-jetspeed/xdocs/changes.xml Index: changes.xml =================================================================== RCS file: /home/cvs/jakarta-jetspeed/xdocs/changes.xml,v retrieving revision 1.167 retrieving revision 1.168 diff -u -r1.167 -r1.168 --- changes.xml 4 Jun 2003 15:59:15 -0000 1.167 +++ changes.xml 6 Jun 2003 17:33:03 -0000 1.168 @@ -24,6 +24,9 @@ </li> --> <li> + Add - Bug # 15413 - 2003/06/06 - Fix for deleting references in portlet set customizer (MO) +</li> +<li> Add - Bug # 20458 - 2003/06/04 - Added My Pages feature (MO) </li> <li>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]