Author: julien(a)jboss.com
Date: 2007-02-21 17:55:25 -0500 (Wed, 21 Feb 2007)
New Revision: 6370
Added:
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/AbstractContentEditor.java
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/AbstractFaceletContentEditor.java
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditor.java
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorRegistry.java
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorRegistryBean.java
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorRegistryService.java
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorTagHandler.java
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/FaceletContentEditor.java
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/PortletContentEditor.java
trunk/core-admin/src/resources/portal-admin-sar/
trunk/core-admin/src/resources/portal-admin-sar/META-INF/
trunk/core-admin/src/resources/portal-admin-sar/META-INF/jboss-service.xml
trunk/core-admin/src/resources/portal-admin-sar/content/
trunk/core-admin/src/resources/portal-admin-sar/content/editor.xhtml
trunk/core-admin/src/resources/portal-admin-war/META-INF/
trunk/core-admin/src/resources/portal-admin-war/META-INF/content.taglib.xml
Modified:
trunk/core-admin/build.xml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jboss-portlet.xml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/index.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/plugins/manager.xhtml
trunk/faces/src/main/org/jboss/portal/faces/el/DelegatingPropertyResolver.java
trunk/faces/src/main/org/jboss/portal/faces/el/PropertyAccessor.java
trunk/faces/src/main/org/jboss/portal/faces/el/TypeDef.java
Log:
started to work on the content editor plugin for the JSF management app : for now the
portlet instance choice for a window is integrated outside of the war file. Need to make
the same for CMS content.
Modified: trunk/core-admin/build.xml
===================================================================
--- trunk/core-admin/build.xml 2007-02-21 20:37:57 UTC (rev 6369)
+++ trunk/core-admin/build.xml 2007-02-21 22:55:25 UTC (rev 6370)
@@ -96,6 +96,7 @@
<path refid="apache.log4j.classpath"/>
<path refid="sun.servlet.classpath"/>
<path refid="facelets.facelets.classpath"/>
+ <path refid="el.el.classpath"/>
<pathelement location="${source.etc}/sun-jsf/jsf-example.jar"/>
</path>
@@ -189,20 +190,22 @@
</fileset>
</jar>
- <!-- portal-admin.war -->
- <copy todir="${build.resources}/portal-admin.war">
- <fileset dir="${build.resources}/portal-admin-war"/>
- <fileset dir="${source.bin}/portal-admin-war"/>
+ <!-- portal-admin.sar -->
+ <copy todir="${build.resources}/portal-admin.sar">
+ <fileset dir="${build.resources}/portal-admin-sar"/>
</copy>
- <copy todir="${build.resources}/portal-admin.war/WEB-INF/lib">
+ <copy todir="${build.resources}/portal-admin.sar/lib">
<fileset dir="${build.lib}"
includes="portal-core-admin-lib.jar"/>
-
<fileset dir="${facelets.facelets.lib}"
includes="jsf-facelets.jar"/>
<fileset dir="${apache.tomahawk.lib}"
includes="tomahawk.jar"/>
<fileset dir="${source.etc}/sun-jsf"
includes="jsf-example.jar"/>
<fileset dir="${apache.lang.lib}"
includes="commons-lang-2.0.jar"/>
<fileset dir="${el.el.lib}"
includes="el-api.jar,el-ri.jar"/>
</copy>
+ <copy
todir="${build.resources}/portal-admin.sar/portal-admin.war">
+ <fileset dir="${build.resources}/portal-admin-war"/>
+ <fileset dir="${source.bin}/portal-admin-war"/>
+ </copy>
</target>
@@ -211,8 +214,8 @@
<target name="output" depends="artifacts">
<!-- Build archives -->
<implode
- dir="${build.resources}/portal-admin.war"
- tofile="${build.lib}/portal-admin.war"/>
+ dir="${build.resources}/portal-admin.sar"
+ tofile="${build.lib}/portal-admin.sar"/>
</target>
<!-- ================================================================== -->
@@ -255,7 +258,7 @@
description="Deploy."
depends="output">
<require file="${jboss.home}/server/${portal.deploy.dir}"/>
- <copy file="${build.lib}/portal-admin.war"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>
+ <copy file="${build.lib}/portal-admin.sar"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>
</target>
<!--
@@ -265,7 +268,7 @@
description="Undeploy."
depends="init">
<require file="${jboss.home}/server/${portal.deploy.dir}"/>
- <delete
file="${jboss.home}/server/${portal.deploy.dir}/portal-admin.war"/>
+ <delete
file="${jboss.home}/server/${portal.deploy.dir}/portal-admin.sar"/>
</target>
</project>
Added:
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/AbstractContentEditor.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/AbstractContentEditor.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/AbstractContentEditor.java 2007-02-21
22:55:25 UTC (rev 6370)
@@ -0,0 +1,74 @@
+/******************************************************************************
+ * 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.portlet.management.content;
+
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+import org.jboss.portal.core.model.content.ContentType;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class AbstractContentEditor extends AbstractJBossService implements ContentEditor
+{
+
+ /** . */
+ private String contentType;
+
+ /** . */
+ private ContentEditorRegistry registry;
+
+ /** . */
+ private ContentType registeredContentType;
+
+ public ContentEditorRegistry getRegistry()
+ {
+ return registry;
+ }
+
+ public void setRegistry(ContentEditorRegistry registry)
+ {
+ this.registry = registry;
+ }
+
+ public String getContentType()
+ {
+ return contentType;
+ }
+
+ public void setContentType(String contentType)
+ {
+ this.contentType = contentType;
+ }
+
+ protected void startService() throws Exception
+ {
+ registeredContentType = ContentType.create(contentType);
+ registry.registerEditor(registeredContentType, this);
+ }
+
+ protected void stopService() throws Exception
+ {
+ registry.unregisterEditor(registeredContentType);
+ }
+}
Added:
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/AbstractFaceletContentEditor.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/AbstractFaceletContentEditor.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/AbstractFaceletContentEditor.java 2007-02-21
22:55:25 UTC (rev 6370)
@@ -0,0 +1,70 @@
+/******************************************************************************
+ * 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.portlet.management.content;
+
+import java.net.URL;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractFaceletContentEditor extends AbstractContentEditor
implements FaceletContentEditor
+{
+
+ /** . */
+ private String faceletPath;
+
+ /** . */
+ private URL faceletURL;
+
+ public String getFaceletPath()
+ {
+ return faceletPath;
+ }
+
+ public void setFaceletPath(String faceletPath)
+ {
+ this.faceletPath = faceletPath;
+ }
+
+ protected void startService() throws Exception
+ {
+ faceletURL =
Thread.currentThread().getContextClassLoader().getResource(faceletPath);
+
+ //
+ super.startService();
+ }
+
+ protected void stopService() throws Exception
+ {
+ super.stopService();
+
+ //
+ faceletURL = null;
+ }
+
+ public URL getFaceletURL()
+ {
+ return faceletURL;
+ }
+}
Added:
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditor.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditor.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditor.java 2007-02-21
22:55:25 UTC (rev 6370)
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * 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.portlet.management.content;
+
+import java.net.URL;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface ContentEditor
+{
+}
Added:
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorRegistry.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorRegistry.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorRegistry.java 2007-02-21
22:55:25 UTC (rev 6370)
@@ -0,0 +1,39 @@
+/******************************************************************************
+ * 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.portlet.management.content;
+
+import org.jboss.portal.core.model.content.ContentType;
+
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface ContentEditorRegistry
+{
+ Set getContentTypes();
+ void registerEditor(ContentType contentType, ContentEditor editor);
+ void unregisterEditor(ContentType contentType);
+ ContentEditor getEditor(ContentType contentType);
+}
Added:
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorRegistryBean.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorRegistryBean.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorRegistryBean.java 2007-02-21
22:55:25 UTC (rev 6370)
@@ -0,0 +1,91 @@
+/******************************************************************************
+ * 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.portlet.management.content;
+
+import org.jboss.portal.faces.el.PropertyAccessor;
+import org.jboss.portal.core.model.content.ContentType;
+
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Iterator;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ContentEditorRegistryBean
+{
+
+ /** . */
+ private ContentEditorRegistry registry;
+
+ /** . */
+ private PropertyAccessor editors;
+
+
+ public ContentEditorRegistryBean()
+ {
+ editors = new PropertyAccessor()
+ {
+ public Class getType(Object propertyName)
+ {
+ ContentEditor editor = getEditor(propertyName);
+ if (editor != null)
+ {
+ return editor.getClass();
+ }
+ return null;
+ }
+ public Object getValue(Object propertyName)
+ {
+ return getEditor(propertyName);
+ }
+ };
+ }
+
+ private ContentEditor getEditor(Object propertyName)
+ {
+ if (propertyName instanceof String)
+ {
+ ContentType ct = ContentType.create((String)propertyName);
+ return registry.getEditor(ct);
+ }
+ return null;
+ }
+
+
+ public ContentEditorRegistry getRegistry()
+ {
+ return registry;
+ }
+
+ public void setRegistry(ContentEditorRegistry registry)
+ {
+ this.registry = registry;
+ }
+
+ public PropertyAccessor getEditors()
+ {
+ return editors;
+ }
+}
Added:
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorRegistryService.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorRegistryService.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorRegistryService.java 2007-02-21
22:55:25 UTC (rev 6370)
@@ -0,0 +1,65 @@
+/******************************************************************************
+ * 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.portlet.management.content;
+
+import org.jboss.portal.core.model.content.ContentType;
+import org.jboss.portal.common.util.CopyOnWriteRegistry;
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ContentEditorRegistryService extends AbstractJBossService implements
ContentEditorRegistry
+{
+
+ /** . */
+ private final CopyOnWriteRegistry registry;
+
+ public ContentEditorRegistryService()
+ {
+ registry = new CopyOnWriteRegistry();
+ }
+
+ public Set getContentTypes()
+ {
+ return registry.getKeys();
+ }
+
+ public void registerEditor(ContentType contentType, ContentEditor editor)
+ {
+ registry.register(contentType, editor);
+ }
+
+ public void unregisterEditor(ContentType contentType)
+ {
+ registry.unregister(contentType);
+ }
+
+ public ContentEditor getEditor(ContentType contentType)
+ {
+ return (ContentEditor)registry.getRegistration(contentType);
+ }
+}
Added:
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorTagHandler.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorTagHandler.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorTagHandler.java 2007-02-21
22:55:25 UTC (rev 6370)
@@ -0,0 +1,104 @@
+/******************************************************************************
+ * 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.portlet.management.content;
+
+import com.sun.facelets.tag.TagHandler;
+import com.sun.facelets.tag.TagConfig;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.FaceletContext;
+import com.sun.facelets.FaceletException;
+import com.sun.facelets.el.VariableMapperWrapper;
+
+import javax.faces.component.UIComponent;
+import javax.faces.FacesException;
+import javax.el.ELException;
+import javax.el.ValueExpression;
+import javax.el.ExpressionFactory;
+import javax.el.VariableMapper;
+import javax.el.ELContext;
+import java.io.IOException;
+import java.net.URL;
+
+import org.jboss.portal.core.model.content.ContentType;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ContentEditorTagHandler extends TagHandler
+{
+
+ /** . */
+ private ContentEditorRegistry registry;
+
+ /** . */
+ private final TagAttribute src;
+
+ /** . */
+ private final TagAttribute contentURI;
+
+ public ContentEditorTagHandler(TagConfig tagConfig)
+ {
+ super(tagConfig);
+
+ //
+ this.src = this.getRequiredAttribute("src");
+ this.contentURI = this.getRequiredAttribute("contentURI");
+ }
+
+ public ContentEditorRegistry getRegistry()
+ {
+ return registry;
+ }
+
+ public void setRegistry(ContentEditorRegistry registry)
+ {
+ this.registry = registry;
+ }
+
+ public void apply(FaceletContext ctx, UIComponent parent) throws IOException,
FacesException, FaceletException, ELException
+ {
+ ExpressionFactory f = ctx.getExpressionFactory();
+ ValueExpression ve = f.createValueExpression(ctx,
"#{applicationScope.ContentEditorRegistry}", ContentEditorRegistry.class);
+ ContentEditorRegistry registry = (ContentEditorRegistry)ve.getValue(ctx);
+ FaceletContentEditor editor =
(FaceletContentEditor)registry.getEditor(ContentType.PORTLET);
+ URL url = editor.getFaceletURL();
+ VariableMapper orig = ctx.getVariableMapper();
+ ctx.setVariableMapper(new VariableMapperWrapper(orig));
+ try
+ {
+ nextHandler.apply(ctx, null);
+
+ //
+ ValueExpression valueVE = contentURI.getValueExpression(ctx, Object.class);
+ ctx.getVariableMapper().setVariable(contentURI.getLocalName(), valueVE);
+
+ //
+ ctx.includeFacelet(parent, url);
+ }
+ finally
+ {
+ ctx.setVariableMapper(orig);
+ }
+ }
+}
Added:
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/FaceletContentEditor.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/FaceletContentEditor.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/FaceletContentEditor.java 2007-02-21
22:55:25 UTC (rev 6370)
@@ -0,0 +1,34 @@
+/******************************************************************************
+ * 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.portlet.management.content;
+
+import java.net.URL;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface FaceletContentEditor extends ContentEditor
+{
+ URL getFaceletURL();
+}
Added:
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/PortletContentEditor.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/PortletContentEditor.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/PortletContentEditor.java 2007-02-21
22:55:25 UTC (rev 6370)
@@ -0,0 +1,69 @@
+/******************************************************************************
+ * 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.portlet.management.content;
+
+import org.jboss.portal.core.model.instance.InstanceContainer;
+import org.jboss.portal.core.model.instance.InstanceDefinition;
+
+import javax.faces.model.SelectItem;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletContentEditor extends AbstractFaceletContentEditor
+{
+
+ /** . */
+ private InstanceContainer instanceContainer;
+
+ public InstanceContainer getInstanceContainer()
+ {
+ return instanceContainer;
+ }
+
+ public void setInstanceContainer(InstanceContainer instanceContainer)
+ {
+ this.instanceContainer = instanceContainer;
+ }
+
+ public List getInstances()
+ {
+ Collection definitions = instanceContainer.getDefinitions();
+ List items = new ArrayList(definitions.size());
+ for (Iterator i = definitions.iterator();i.hasNext();)
+ {
+ InstanceDefinition def = (InstanceDefinition)i.next();
+ SelectItem item = new SelectItem();
+ item.setValue(def.getId());
+ item.setDescription("blah");
+ item.setLabel(def.getId());
+ items.add(item);
+ }
+ return items;
+ }
+}
Added: trunk/core-admin/src/resources/portal-admin-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-sar/META-INF/jboss-service.xml
(rev 0)
+++ trunk/core-admin/src/resources/portal-admin-sar/META-INF/jboss-service.xml 2007-02-21
22:55:25 UTC (rev 6370)
@@ -0,0 +1,52 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<server>
+
+ <!-- -->
+ <mbean
+
code="org.jboss.portal.core.portlet.management.content.ContentEditorRegistryService"
+ name="portal:service=ContentEditorRegistry2"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+
+ <!-- -->
+ <mbean
+
code="org.jboss.portal.core.portlet.management.content.PortletContentEditor"
+ name="portal:service=ContentEditor,type=portlet2"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <attribute name="ContentType">portlet</attribute>
+ <attribute
name="FaceletPath">content/editor.xhtml</attribute>
+ <depends
+ optional-attribute-name="Registry"
+
proxy-type="attribute">portal:service=ContentEditorRegistry2</depends>
+ <depends
+ optional-attribute-name="InstanceContainer"
+ proxy-type="attribute">portal:container=Instance</depends>
+ </mbean>
+
+</server>
Added: trunk/core-admin/src/resources/portal-admin-sar/content/editor.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-sar/content/editor.xhtml
(rev 0)
+++ trunk/core-admin/src/resources/portal-admin-sar/content/editor.xhtml 2007-02-21
22:55:25 UTC (rev 6370)
@@ -0,0 +1,12 @@
+<div
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core">
+
+ <h:selectOneListbox
+ value="#{contentURI}">
+ <f:selectItems value="#{registry.editors.portlet.instances}"/>
+ </h:selectOneListbox>
+
+</div>
\ No newline at end of file
Added: trunk/core-admin/src/resources/portal-admin-war/META-INF/content.taglib.xml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/META-INF/content.taglib.xml
(rev 0)
+++ trunk/core-admin/src/resources/portal-admin-war/META-INF/content.taglib.xml 2007-02-21
22:55:25 UTC (rev 6370)
@@ -0,0 +1,10 @@
+<!DOCTYPE facelet-taglib PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
+ "http://java.sun.com/dtd/facelet-taglib_1_0.dtd">
+<facelet-taglib>
+ <namespace>http://www.julien.com</namespace>
+ <tag>
+ <tag-name>content</tag-name>
+
<handler-class>org.jboss.portal.core.portlet.management.content.ContentEditorTagHandler</handler-class>
+ </tag>
+</facelet-taglib>
\ No newline at end of file
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2007-02-21
20:37:57 UTC (rev 6369)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2007-02-21
22:55:25 UTC (rev 6370)
@@ -180,6 +180,17 @@
</managed-property>
</managed-bean>
+ <!-- The content editor registry bean -->
+ <managed-bean>
+ <managed-bean-name>registry</managed-bean-name>
+
<managed-bean-class>org.jboss.portal.core.portlet.management.content.ContentEditorRegistryBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ <managed-property>
+ <property-name>registry</property-name>
+ <value>#{applicationScope.ContentEditorRegistry}</value>
+ </managed-property>
+ </managed-bean>
+
<navigation-rule>
<navigation-case>
<from-outcome>portalobjects</from-outcome>
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jboss-portlet.xml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jboss-portlet.xml 2007-02-21
20:37:57 UTC (rev 6369)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jboss-portlet.xml 2007-02-21
22:55:25 UTC (rev 6370)
@@ -99,7 +99,7 @@
</service>
<service>
<service-name>ContentEditorRegistry</service-name>
-
<service-class>org.jboss.portal.core.portlet.dashboard.ContentEditorRegistry</service-class>
- <service-ref>:service=ContentEditorRegistry</service-ref>
+
<service-class>org.jboss.portal.core.portlet.management.content.ContentEditorRegistry</service-class>
+ <service-ref>:service=ContentEditorRegistry2</service-ref>
</service>
</portlet-app>
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/index.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/index.xhtml 2007-02-21
20:37:57 UTC (rev 6369)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/index.xhtml 2007-02-21
22:55:25 UTC (rev 6370)
@@ -13,6 +13,7 @@
cellpadding="2"
rowClasses="vertTop"
columnClasses=",,content">
+
<h:panelGroup id="pg1">
<h:form id="foo">
<t:tree2
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/plugins/manager.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/plugins/manager.xhtml 2007-02-21
20:37:57 UTC (rev 6369)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/plugins/manager.xhtml 2007-02-21
22:55:25 UTC (rev 6370)
@@ -3,7 +3,8 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:t="http://myfaces.apache.org/tomahawk">
+
xmlns:t="http://myfaces.apache.org/tomahawk"
+ xmlns:ct="http://www.julien.com">
<br/>
<!-- Context tab -->
<h:panelGroup
@@ -145,15 +146,17 @@
<h:outputText value="#{portalobjectmgr.selectedObject.name}"/>
<f:verbatim><br/><br/></f:verbatim>
<h:outputText style="font-weight:bold;" value="Type: "/>
- <f:verbatim>WINDOW<br/></f:verbatim>
+ <f:verbatim>Window<br/></f:verbatim>
+
<h:form id="window_form">
- <h:selectOneMenu
value="#{portalobjectmgr.selectedObject.instanceRef}">
- <f:selectItems value="#{portalobjectmgr.instanceItems}"/>
- </h:selectOneMenu>
+ <ct:content
+ src="bilto_src"
+ contentURI="#{portalobjectmgr.selectedObject.instanceRef}"/>
<br/>
<h:commandButton value="Change instance"/>
</h:form>
<h:outputLink value="#{portalobjectmgr.previewURL}" title="Preview
link" target="_blank">Preview link</h:outputLink>
+
</h:panelGroup>
<br/>
<h:panelGroup
Modified: trunk/faces/src/main/org/jboss/portal/faces/el/DelegatingPropertyResolver.java
===================================================================
---
trunk/faces/src/main/org/jboss/portal/faces/el/DelegatingPropertyResolver.java 2007-02-21
20:37:57 UTC (rev 6369)
+++
trunk/faces/src/main/org/jboss/portal/faces/el/DelegatingPropertyResolver.java 2007-02-21
22:55:25 UTC (rev 6370)
@@ -80,7 +80,7 @@
TypeDef typeDef = resolveTypeDef(base);
if (typeDef != null)
{
- PropertyDef propDef = typeDef.getAccessor(property);
+ PropertyDef propDef = typeDef.getAccessor(base, property);
if (propDef != null)
{
return propDef.getType();
@@ -104,7 +104,7 @@
TypeDef map = resolveTypeDef(base);
if (map != null)
{
- PropertyDef nav = map.getAccessor(property);
+ PropertyDef nav = map.getAccessor(base, property);
if (nav != null)
{
try
Modified: trunk/faces/src/main/org/jboss/portal/faces/el/PropertyAccessor.java
===================================================================
--- trunk/faces/src/main/org/jboss/portal/faces/el/PropertyAccessor.java 2007-02-21
20:37:57 UTC (rev 6369)
+++ trunk/faces/src/main/org/jboss/portal/faces/el/PropertyAccessor.java 2007-02-21
22:55:25 UTC (rev 6370)
@@ -23,6 +23,8 @@
package org.jboss.portal.faces.el;
/**
+ * Defines an object to access the state and metadata of a property.
+ *
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
*/
Modified: trunk/faces/src/main/org/jboss/portal/faces/el/TypeDef.java
===================================================================
--- trunk/faces/src/main/org/jboss/portal/faces/el/TypeDef.java 2007-02-21 20:37:57 UTC
(rev 6369)
+++ trunk/faces/src/main/org/jboss/portal/faces/el/TypeDef.java 2007-02-21 22:55:25 UTC
(rev 6370)
@@ -60,17 +60,17 @@
accessors = copy;
}
- public PropertyDef getAccessor(Object propertyName)
+ public PropertyDef getAccessor(Object base, Object propertyName)
{
PropertyDef def = (PropertyDef)accessors.get(propertyName);
if (def == null)
{
- def = resolveDef(propertyName);
+ def = resolveDef(base, propertyName);
}
return def;
}
- protected PropertyDef resolveDef(Object propertyName)
+ protected PropertyDef resolveDef(Object base, Object propertyName)
{
return null;
}