From portal-commits at lists.jboss.org Mon Mar 26 12:11:31 2007 Content-Type: multipart/mixed; boundary="===============8723802657375830968==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r6829 - in trunk/core-admin/src: resources/portal-admin-war/WEB-INF/jsf and 1 other directory. Date: Mon, 26 Mar 2007 12:11:30 -0400 Message-ID: --===============8723802657375830968== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: thomas.heute(a)jboss.com Date: 2007-03-26 12:11:30 -0400 (Mon, 26 Mar 2007) New Revision: 6829 Added: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/RenameA= ction.java trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/renameObject= .xhtml Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectNaviga= tion.xhtml Log: Let the admin rename a page or window. Added: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/Ren= ameAction.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/Rename= Action.java (rev 0) +++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/Rename= Action.java 2007-03-26 16:11:30 UTC (rev 6829) @@ -0,0 +1,106 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.core.admin.ui.actions; + +import java.util.Set; + +import org.jboss.portal.core.admin.ui.PortalObjectManagerBean; +import org.jboss.portal.core.model.portal.DuplicatePortalObjectException; +import org.jboss.portal.core.model.portal.NoSuchPortalObjectException; +import org.jboss.portal.core.model.portal.PortalObject; +import org.jboss.portal.core.model.portal.PortalObjectId; +import org.jboss.portal.security.spi.provider.DomainConfigurator; + +/** + * @author Thomas Heute + * @version $Revision: 5763 $ + */ +public class RenameAction +{ + private String newName; + = + /** . */ + private PortalObjectManagerBean portalObjectManager; + + private DomainConfigurator domainConfigurator; + + public void setNewName(String newName) + { + this.newName =3D newName; + } + + public String getNewName() + { + return newName; + } + + + public DomainConfigurator getDomainConfigurator() + { + return domainConfigurator; + } + + public void setDomainConfigurator(DomainConfigurator domainConfigurator) + { + this.domainConfigurator =3D domainConfigurator; + } + public PortalObjectManagerBean getPortalObjectManager() + { + return portalObjectManager; + } + + public void setPortalObjectManager(PortalObjectManagerBean portalObject= Manager) + { + this.portalObjectManager =3D portalObjectManager; + } + + public String execute() + { + PortalObject portalObject =3D (PortalObject)portalObjectManager.getS= electedObject(); + PortalObject parent =3D portalObject.getParent(); + try { + // Clone portal object + PortalObject newObject =3D portalObject.copy(parent, newName, tru= e); + + // Copy security settings + Set set =3D domainConfigurator.getSecurityBindings(portalObject.g= etId().toString(PortalObjectId.CANONICAL_FORMAT)); + domainConfigurator.setSecurityBindings(newObject.getId().toString= (PortalObjectId.CANONICAL_FORMAT), set); + = + // Destroy previous object + parent.destroyChild(portalObject.getName()); + } catch (IllegalArgumentException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (DuplicatePortalObjectException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (NoSuchPortalObjectException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + portalObjectManager.selectObject(parent); + return "objects"; + } + + = +} Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objec= tNavigation.xhtml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectNavig= ation.xhtml 2007-03-26 15:22:25 UTC (rev 6828) +++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectNavig= ation.xhtml 2007-03-26 16:11:30 UTC (rev 6829) @@ -71,7 +71,10 @@ | - | + | + + + | @@ -101,6 +104,9 @@ + | + + | Added: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/renameOb= ject.xhtml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/renameObjec= t.xhtml (rev 0) +++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/renameObjec= t.xhtml 2007-03-26 16:11:30 UTC (rev 6829) @@ -0,0 +1,16 @@ +
+ + +

Renaming:

+ + + + +
+
+
--===============8723802657375830968==--