From do-not-reply at jboss.org Tue Aug 16 05:13:51 2011 Content-Type: multipart/mixed; boundary="===============6203109810877795132==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: gatein-commits at lists.jboss.org Subject: [gatein-commits] gatein SVN: r7147 - in portal/branches/api/component/api-impl/src: main/java/org/gatein/portal/api/impl/portal and 1 other directories. Date: Tue, 16 Aug 2011 05:13:51 -0400 Message-ID: <201108160913.p7G9DppN030277@svn01.web.mwc.hst.phx2.redhat.com> --===============6203109810877795132== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien_viet Date: 2011-08-16 05:13:51 -0400 (Tue, 16 Aug 2011) New Revision: 7147 Modified: portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/a= pi/impl/GateInImpl.java portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/a= pi/impl/portal/DashboardSiteImpl.java portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/a= pi/impl/portal/GroupSiteImpl.java portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/a= pi/impl/portal/PortalImpl.java portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/a= pi/impl/portal/SiteImpl.java portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/a= pi/impl/portal/NavigationTestCase.java Log: improve site id Modified: portal/branches/api/component/api-impl/src/main/java/org/gatein/p= ortal/api/impl/GateInImpl.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 --- portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/= api/impl/GateInImpl.java 2011-08-16 08:57:17 UTC (rev 7146) +++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/= api/impl/GateInImpl.java 2011-08-16 09:13:51 UTC (rev 7147) @@ -264,7 +264,7 @@ = public Portal getDefaultPortal() { - return getPortal(siteId(Site.PORTAL, "classic")); // todo: check + return getPortal(Site.Id.createPortal("classic")); // todo: check } = public IterableIdentifiableCollection getSites() @@ -372,9 +372,9 @@ sb.append("/").append(name); } String groupId =3D sb.toString(); - Site.Id siteId =3D siteId(Site.GROUP, groupId); + Site.Id siteId =3D Site.Id.createGroup(groupId); = - return new GroupSiteImpl(siteId, groupId, this); + return new GroupSiteImpl(siteId, this); } = public IterableIdentifiableCollection getGroupSites(String userId) @@ -479,9 +479,9 @@ = public Site getDashboard(String userId) { - Site.Id siteId =3D siteId(Site.DASHBOARD, userId); + Site.Id siteId =3D Site.Id.createDashboard(userId); = - return new DashboardSiteImpl(siteId, userId, this); + return new DashboardSiteImpl(siteId, this); } = public > T get(Id id) @@ -653,11 +653,6 @@ } */ = - public Site.Id siteId(Type siteType, String portalName) - { - return new Site.Id(siteType, portalName); - } - public Page.Id pageId(Site.Id ownerSite, String pageName) { ParameterValidation.throwIllegalArgExceptionIfNull(ownerSite, "Owner= Site Id"); Modified: portal/branches/api/component/api-impl/src/main/java/org/gatein/p= ortal/api/impl/portal/DashboardSiteImpl.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 --- portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/= api/impl/portal/DashboardSiteImpl.java 2011-08-16 08:57:17 UTC (rev 7146) +++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/= api/impl/portal/DashboardSiteImpl.java 2011-08-16 09:13:51 UTC (rev 7147) @@ -30,9 +30,9 @@ /** @author Chris Laprun */ public class DashboardSiteImpl extends SiteImpl { - public DashboardSiteImpl(Site.Id siteId, String name, GateInImpl gateIn) + public DashboardSiteImpl(Site.Id siteId, GateInImpl gateIn) { - super(siteId, name, gateIn); + super(siteId, gateIn); } = @Override Modified: portal/branches/api/component/api-impl/src/main/java/org/gatein/p= ortal/api/impl/portal/GroupSiteImpl.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 --- portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/= api/impl/portal/GroupSiteImpl.java 2011-08-16 08:57:17 UTC (rev 7146) +++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/= api/impl/portal/GroupSiteImpl.java 2011-08-16 09:13:51 UTC (rev 7147) @@ -31,9 +31,9 @@ /** @author Chris Laprun */ public class GroupSiteImpl extends SiteImpl { - public GroupSiteImpl(Site.Id siteId, String name, GateInImpl gateIn) + public GroupSiteImpl(Site.Id siteId, GateInImpl gateIn) { - super(siteId, name, gateIn); + super(siteId, gateIn); } = @Override Modified: portal/branches/api/component/api-impl/src/main/java/org/gatein/p= ortal/api/impl/portal/PortalImpl.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 --- portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/= api/impl/portal/PortalImpl.java 2011-08-16 08:57:17 UTC (rev 7146) +++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/= api/impl/portal/PortalImpl.java 2011-08-16 09:13:51 UTC (rev 7147) @@ -37,7 +37,7 @@ = public PortalImpl(PortalData portal, GateInImpl gateIn) { - super(gateIn.siteId(getAPITypeFrom(portal.getKey()), portal.getKey()= .getId()), portal.getName(), gateIn); + super(Site.Id.create(getAPITypeFrom(portal.getKey()), portal.getKey(= ).getId()), gateIn); } = public ContentRegistry getContentRegistry() Modified: portal/branches/api/component/api-impl/src/main/java/org/gatein/p= ortal/api/impl/portal/SiteImpl.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 --- portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/= api/impl/portal/SiteImpl.java 2011-08-16 08:57:17 UTC (rev 7146) +++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/= api/impl/portal/SiteImpl.java 2011-08-16 09:13:51 UTC (rev 7147) @@ -61,9 +61,9 @@ /** . */ final PageContainer pages; = - public SiteImpl(Site.Id siteId, String name, GateInImpl gateIn) + public SiteImpl(Site.Id siteId, GateInImpl gateIn) { - super(siteId, name, gateIn); + super(siteId, siteId.getName(), gateIn); = // this.pages =3D new PageContainer(); Modified: portal/branches/api/component/api-impl/src/test/java/org/gatein/p= ortal/api/impl/portal/NavigationTestCase.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 --- portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/= api/impl/portal/NavigationTestCase.java 2011-08-16 08:57:17 UTC (rev 7146) +++ portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/= api/impl/portal/NavigationTestCase.java 2011-08-16 09:13:51 UTC (rev 7147) @@ -94,7 +94,7 @@ = public void testEmptyNavigation() { - Site site =3D gatein.getPortal(new Site.Id(Site.PORTAL, "classic")); + Site site =3D gatein.getPortal(Site.Id.createPortal("classic")); assertNotNull(site); Site.Id id =3D site.getId(); assertEquals(Site.PORTAL, id.getType()); @@ -114,7 +114,7 @@ navService.saveNode(root, null); = // - Site site =3D gatein.getPortal(new Site.Id(Site.PORTAL, "classic")); + Site site =3D gatein.getPortal(Site.Id.createPortal("classic")); Navigation rootNav =3D site.getNavigation(); Iterator i =3D rootNav.getChildren().iterator(= ); assertTrue(i.hasNext()); @@ -132,7 +132,7 @@ navService.saveNode(root, null); = // - Site site =3D gatein.getPortal(new Site.Id(Site.PORTAL, "classic")); + Site site =3D gatein.getPortal(Site.Id.createPortal("classic")); Page homePage =3D site.getPage("homepage"); assertNotNull(homePage); = --===============6203109810877795132==--