From portal-commits at lists.jboss.org Sat Jan 20 09:59:28 2007 Content-Type: multipart/mixed; boundary="===============5222387317509735847==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r6057 - in trunk: core/src/main/org/jboss/portal/core/impl/model/content/portlet and 6 other directories. Date: Sat, 20 Jan 2007 09:59:28 -0500 Message-ID: --===============5222387317509735847== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2007-01-20 09:59:28 -0500 (Sat, 20 Jan 2007) New Revision: 6057 Added: trunk/core-cms/src/main/org/jboss/portal/core/cms/editor/ trunk/core-cms/src/main/org/jboss/portal/core/cms/editor/CMSContentEdito= r.java Modified: trunk/core-cms/build.xml trunk/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml trunk/core/src/main/org/jboss/portal/core/impl/model/content/cms/CMSCont= ent.java trunk/core/src/main/org/jboss/portal/core/impl/model/content/portlet/Por= tletContent.java trunk/core/src/main/org/jboss/portal/core/model/content/Content.java trunk/core/src/resources/portal-core-war/WEB-INF/jsp/dashboard/editpage.= jsp Log: now content editor can list any content type. started to do the cms content editor Modified: trunk/core/src/main/org/jboss/portal/core/impl/model/content/cms/= CMSContent.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/src/main/org/jboss/portal/core/impl/model/content/cms/CMSCon= tent.java 2007-01-20 12:29:35 UTC (rev 6056) +++ trunk/core/src/main/org/jboss/portal/core/impl/model/content/cms/CMSCon= tent.java 2007-01-20 14:59:28 UTC (rev 6057) @@ -24,7 +24,10 @@ = import org.jboss.portal.core.model.content.Content; import org.jboss.portal.core.model.content.spi.ContentState; +import org.jboss.portal.common.util.LocalizedString; = +import java.util.Locale; + /** * @author Julien Viet * @version $Revision: 1.1 $ @@ -40,6 +43,11 @@ this.state =3D state; } = + public LocalizedString getDisplayName() + { + return new LocalizedString(state.getURI() + " cms", Locale.ENGLISH); + } + /** * * @return Modified: trunk/core/src/main/org/jboss/portal/core/impl/model/content/port= let/PortletContent.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/src/main/org/jboss/portal/core/impl/model/content/portlet/Po= rtletContent.java 2007-01-20 12:29:35 UTC (rev 6056) +++ trunk/core/src/main/org/jboss/portal/core/impl/model/content/portlet/Po= rtletContent.java 2007-01-20 14:59:28 UTC (rev 6057) @@ -24,7 +24,10 @@ = import org.jboss.portal.core.model.content.Content; import org.jboss.portal.core.model.content.spi.ContentState; +import org.jboss.portal.common.util.LocalizedString; = +import java.util.Locale; + /** * @author Julien Viet * @version $Revision: 1.1 $ @@ -48,6 +51,11 @@ this.state =3D state; } = + public LocalizedString getDisplayName() + { + return new LocalizedString(state.getURI() + " portlet", Locale.ENGLI= SH); + } + /** * * @return Modified: trunk/core/src/main/org/jboss/portal/core/model/content/Content.j= ava =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/main/org/jboss/portal/core/model/content/Content.java 20= 07-01-20 12:29:35 UTC (rev 6056) +++ trunk/core/src/main/org/jboss/portal/core/model/content/Content.java 20= 07-01-20 14:59:28 UTC (rev 6057) @@ -22,6 +22,8 @@ *************************************************************************= *****/ package org.jboss.portal.core.model.content; = +import org.jboss.portal.common.util.LocalizedString; + /** * The content. * @@ -30,4 +32,5 @@ */ public interface Content { + LocalizedString getDisplayName(); } Modified: trunk/core/src/resources/portal-core-war/WEB-INF/jsp/dashboard/ed= itpage.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/resources/portal-core-war/WEB-INF/jsp/dashboard/editpage= .jsp 2007-01-20 12:29:35 UTC (rev 6056) +++ trunk/core/src/resources/portal-core-war/WEB-INF/jsp/dashboard/editpage= .jsp 2007-01-20 14:59:28 UTC (rev 6057) @@ -12,6 +12,7 @@ <%@ page import=3D"java.io.PrintWriter" %> <%@ page import=3D"org.jboss.portal.core.portlet.dashboard.ContentEditorRe= gistry" %> <%@ page import=3D"org.jboss.portal.core.portlet.dashboard.ContentEditor" = %> +<%@ page import=3D"org.jboss.portal.core.model.content.Content" %> <%@ page language=3D"java" extends=3D"org.jboss.portal.core.servlet.jsp.Po= rtalJsp" %> <%@ taglib uri=3D"http://java.sun.com/portlet" prefix=3D"portlet" %> <%@ taglib uri=3D"/WEB-INF/portal-lib.tld" prefix=3D"n" %> @@ -252,14 +253,11 @@ { Window window =3D (Window)j.next(); ContentType contentType =3D window.getContentType(); - if (ContentType.PORTLET.equals(contentType)) - { - PortletContent portletContent =3D (PortletContent)win= dow.getContent(); + Content portletContent =3D window.getContent(); %> - <% - } } %> Modified: trunk/core-cms/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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-cms/build.xml 2007-01-20 12:29:35 UTC (rev 6056) +++ trunk/core-cms/build.xml 2007-01-20 14:59:28 UTC (rev 6057) @@ -344,14 +344,14 @@ description=3D"Deploy." depends=3D"output"> - + = - + = + = - + = Added: trunk/core-cms/src/main/org/jboss/portal/core/cms/editor/CMSContentE= ditor.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-cms/src/main/org/jboss/portal/core/cms/editor/CMSContentEdit= or.java (rev 0) +++ trunk/core-cms/src/main/org/jboss/portal/core/cms/editor/CMSContentEdit= or.java 2007-01-20 14:59:28 UTC (rev 6057) @@ -0,0 +1,77 @@ +/*************************************************************************= ***** + * 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.cms.editor; + +import org.jboss.portal.core.portlet.dashboard.AddWindowContext; +import org.jboss.portal.core.portlet.dashboard.AbstractContentEditor; +import org.jboss.portal.cms.CMS; +import org.jboss.portal.cms.Command; +import org.jboss.portal.cms.model.File; + +import javax.portlet.RenderRequest; +import javax.portlet.ActionRequest; +import java.io.PrintWriter; +import java.util.List; + +/** + * @author Julien Viet + * @version $Revision: 1.1 $ + */ +public class CMSContentEditor extends AbstractContentEditor +{ + + /** . */ + private CMS cms; + + public CMS getCMS() + { + return cms; + } + + public void setCMS(CMS cms) + { + this.cms =3D cms; + } + + public void show(RenderRequest req, PrintWriter writer) + { + Command cmd =3D cms.getCommandFactory().createFileGetListCommand("/"= ); + List list =3D (List)cms.execute(cmd); + writer.println(""); + } + + public void add(ActionRequest req, AddWindowContext ctx) + { + // todo + } +} Modified: trunk/core-cms/src/resources/portal-cms-sar/META-INF/jboss-servic= e.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml = 2007-01-20 12:29:35 UTC (rev 6056) +++ trunk/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml = 2007-01-20 14:59:28 UTC (rev 6057) @@ -626,4 +626,18 @@ optional-attribute-name=3D"StackFactory">portal:service=3DInterce= ptorStackFactory,type=3DServer = + + + portal:registry=3DContentEditor + portal:service=3DCMS + cms + --===============5222387317509735847==--