Author: cziegeler Date: Mon Jan 17 03:28:16 2005 New Revision: 125408 URL: http://svn.apache.org/viewcvs?view=rev&rev=125408 Log: Fix copying of profile Modified: cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java
Modified: cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java?view=diff&rev=125408&p1=cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java&r1=125407&p2=cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java&r2=125408 ============================================================================== --- cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java (original) +++ cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java Mon Jan 17 03:28:16 2005 @@ -591,4 +591,31 @@ return key; } + + /* (non-Javadoc) + * @see org.apache.cocoon.portal.profile.ProfileManager#storeProfile(org.apache.cocoon.portal.layout.Layout, java.lang.String) + */ + public void storeProfile(Layout rootLayout, String layoutKey) { + PortalService service = null; + + try { + UserProfile oldProfile = this.getUserProfile(null); + service = (PortalService) this.manager.lookup(PortalService.ROLE); + if ( null == layoutKey ) { + layoutKey = service.getDefaultLayoutKey(); + } + // FIXME for now we just copy the root profile, except the root layout + UserProfile newProfile = new UserProfile(); + newProfile.setCopletBaseDatas(oldProfile.getCopletBaseDatas()); + newProfile.setCopletDatas(oldProfile.getCopletDatas()); + newProfile.setCopletInstanceDatas(oldProfile.getCopletInstanceDatas()); + newProfile.setRootLayout(rootLayout); + + this.storeUserProfile(layoutKey, service, newProfile); + } catch (Exception ce) { + throw new CascadingRuntimeException("Exception during loading of profile.", ce); + } finally { + this.manager.release(service); + } + } }