Author: julien(a)jboss.com
Date: 2007-03-06 17:21:42 -0500 (Tue, 06 Mar 2007)
New Revision: 6566
Removed:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/AbstractContentEditor.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/AbstractFaceletContentEditor.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditor.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditorRegistry.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditorRegistryBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditorRegistryService.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditorTagHandler.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/FaceletContentEditor.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/PortletContentEditor.java
trunk/core-admin/src/resources/portal-admin-sar/content/
trunk/core-admin/src/resources/portal-admin-war/META-INF/
trunk/core-cms/src/main/org/jboss/portal/core/cms/content/CMSFaceletContentEditor.java
trunk/core-cms/src/resources/portal-cms-sar/content/
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditors.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/portlet/PortletContentEditorPortlet.java
trunk/core-admin/src/resources/portal-admin-sar/META-INF/jboss-service.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/jsf/editPageLayout.xhtml
trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
trunk/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml
Log:
remove previous content editor based on facelet
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2007-03-06
21:58:35 UTC (rev 6565)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2007-03-06
22:21:42 UTC (rev 6566)
@@ -33,6 +33,7 @@
import java.util.Map;
import java.util.SortedSet;
import java.util.TreeSet;
+import java.util.LinkedList;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
@@ -141,6 +142,27 @@
// Wired services
+ public List getAvailableContentTypes()
+ {
+ LinkedList types = new LinkedList();
+ for (Iterator i =
ContentEditors.getInstance().getContentTypes().iterator();i.hasNext();)
+ {
+ ContentType contentType = (ContentType)i.next();
+ SelectItem item = new SelectItem();
+ item.setValue(contentType);
+ item.setLabel(contentType.toString());
+ if (contentType.equals(ContentType.PORTLET))
+ {
+ types.addFirst(item);
+ }
+ else
+ {
+ types.addLast(item);
+ }
+ }
+ return types;
+ }
+
public ContentEditors getContentEditors()
{
return ContentEditors.getInstance();
Deleted:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/AbstractContentEditor.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/AbstractContentEditor.java 2007-03-06
21:58:35 UTC (rev 6565)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/AbstractContentEditor.java 2007-03-06
22:21:42 UTC (rev 6566)
@@ -1,74 +0,0 @@
-/******************************************************************************
- * 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.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);
- }
-}
Deleted:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/AbstractFaceletContentEditor.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/AbstractFaceletContentEditor.java 2007-03-06
21:58:35 UTC (rev 6565)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/AbstractFaceletContentEditor.java 2007-03-06
22:21:42 UTC (rev 6566)
@@ -1,70 +0,0 @@
-/******************************************************************************
- * 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.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;
- }
-}
Deleted:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditor.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditor.java 2007-03-06
21:58:35 UTC (rev 6565)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditor.java 2007-03-06
22:21:42 UTC (rev 6566)
@@ -1,31 +0,0 @@
-/******************************************************************************
- * 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.content;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public interface ContentEditor
-{
-}
Deleted:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditorRegistry.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditorRegistry.java 2007-03-06
21:58:35 UTC (rev 6565)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditorRegistry.java 2007-03-06
22:21:42 UTC (rev 6566)
@@ -1,39 +0,0 @@
-/******************************************************************************
- * 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.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);
-}
Deleted:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditorRegistryBean.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditorRegistryBean.java 2007-03-06
21:58:35 UTC (rev 6565)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditorRegistryBean.java 2007-03-06
22:21:42 UTC (rev 6566)
@@ -1,122 +0,0 @@
-/******************************************************************************
- * 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.content;
-
-import org.jboss.portal.faces.el.dynamic.AbstractDynamicBean;
-import org.jboss.portal.faces.el.PropertyValue;
-import org.jboss.portal.core.model.content.ContentType;
-
-import javax.faces.model.SelectItem;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Set;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class ContentEditorRegistryBean
-{
-
- /** . */
- private ContentEditorRegistry registry;
-
- /** . */
- private AbstractDynamicBean editors;
-
- /** . */
- private String selectedType;
-
- public ContentEditorRegistryBean()
- {
- selectedType = "portlet";
- editors = new AbstractDynamicBean()
- {
- public Class getType(Object propertyName)
- {
- ContentEditor editor = getEditor(propertyName);
- if (editor != null)
- {
- return editor.getClass();
- }
- return null;
- }
- public PropertyValue getValue(Object propertyName)
- {
- ContentEditor editor = getEditor(propertyName);
- return editor != null ? new PropertyValue(editor) : null;
- }
- };
- }
-
- private ContentEditor getEditor(Object propertyName)
- {
- if (propertyName instanceof String)
- {
- ContentType ct = ContentType.create((String)propertyName);
- return registry.getEditor(ct);
- }
- return null;
- }
-
- public List getAvailableTypes()
- {
- Set types = registry.getContentTypes();
- List items = new ArrayList(types.size());
- for (Iterator i = types.iterator();i.hasNext();)
- {
- ContentType def = (ContentType)i.next();
- SelectItem item = new SelectItem();
- item.setValue(def.toString());
- item.setLabel(def.toString());
- items.add(item);
- }
- return items;
- }
-
- public String getSelectedType()
- {
- return selectedType;
- }
-
- public void setSelectedType(String selectedType)
- {
- this.selectedType = selectedType;
- }
-
- public ContentEditorRegistry getRegistry()
- {
- return registry;
- }
-
- public void setRegistry(ContentEditorRegistry registry)
- {
- this.registry = registry;
- }
-
- public AbstractDynamicBean getEditors()
- {
- return editors;
- }
-}
Deleted:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditorRegistryService.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditorRegistryService.java 2007-03-06
21:58:35 UTC (rev 6565)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditorRegistryService.java 2007-03-06
22:21:42 UTC (rev 6566)
@@ -1,65 +0,0 @@
-/******************************************************************************
- * 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.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);
- }
-}
Deleted:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditorTagHandler.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditorTagHandler.java 2007-03-06
21:58:35 UTC (rev 6565)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditorTagHandler.java 2007-03-06
22:21:42 UTC (rev 6566)
@@ -1,136 +0,0 @@
-/******************************************************************************
- * 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.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 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 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 contentType;
-
- /** . */
- private final TagAttribute contentURI;
-
- /** . */
- private final TagAttribute submitFunction;
-
- public ContentEditorTagHandler(TagConfig tagConfig)
- {
- super(tagConfig);
-
- //
- this.contentURI = this.getRequiredAttribute("contentURI");
- this.contentType = this.getRequiredAttribute("contentType");
- this.submitFunction = this.getRequiredAttribute("submitFunction");
- }
-
- public static String getContentURI()
- {
- return null;
- }
-
- 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);
-
- // Get content type value
- ValueExpression contentTypeValue = contentType.getValueExpression(ctx,
Object.class);
- ContentType contentType = (ContentType)contentTypeValue.getValue(ctx);
-
- // Get editor
- FaceletContentEditor editor = null;
- if (contentType != null)
- {
- editor = (FaceletContentEditor)registry.getEditor(contentType);
- }
-
- // Only perform inclusion if content type is not null
- if (editor != null)
- {
- // Get editor URL
- URL url = editor.getFaceletURL();
-
- //
- VariableMapper variableMapper = ctx.getVariableMapper();
- ValueExpression previousContentURIVE =
variableMapper.resolveVariable(contentURI.getLocalName());
-
- // Do the include stuff
- try
- {
- nextHandler.apply(ctx, null);
-
- //
- ValueExpression contentURIVE = contentURI.getValueExpression(ctx,
Object.class);
- variableMapper.setVariable(contentURI.getLocalName(), contentURIVE);
-
- //
- ValueExpression submitFunctionVE = submitFunction.getValueExpression(ctx,
Object.class);
- variableMapper.setVariable(submitFunction.getLocalName(), submitFunctionVE);
-
- //
- ctx.includeFacelet(parent, url);
- }
- finally
- {
- variableMapper.setVariable(contentURI.getLocalName(), previousContentURIVE);
- }
- }
- }
-}
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditors.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditors.java 2007-03-06
21:58:35 UTC (rev 6565)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditors.java 2007-03-06
22:21:42 UTC (rev 6566)
@@ -25,6 +25,8 @@
import org.jboss.portal.common.util.CopyOnWriteRegistry;
import org.jboss.portal.core.model.content.ContentType;
+import java.util.Collection;
+
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
@@ -57,4 +59,9 @@
{
return (String)editors.getRegistration(contentType);
}
+
+ public Collection getContentTypes()
+ {
+ return editors.getKeys();
+ }
}
Deleted:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/FaceletContentEditor.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/FaceletContentEditor.java 2007-03-06
21:58:35 UTC (rev 6565)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/FaceletContentEditor.java 2007-03-06
22:21:42 UTC (rev 6566)
@@ -1,34 +0,0 @@
-/******************************************************************************
- * 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.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();
-}
Deleted:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/PortletContentEditor.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/PortletContentEditor.java 2007-03-06
21:58:35 UTC (rev 6565)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/PortletContentEditor.java 2007-03-06
22:21:42 UTC (rev 6566)
@@ -1,138 +0,0 @@
-/******************************************************************************
- * 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.content;
-
-import org.jboss.portal.core.model.instance.InstanceContainer;
-import org.jboss.portal.core.model.instance.InstanceDefinition;
-import org.jboss.portal.core.model.instance.Instance;
-
-import javax.faces.model.SelectItem;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.HashMap;
-
-/**
- * @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 getInstanceItems()
- {
- 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;
- }
-
- public Map getInstanceMap()
- {
- Collection definitions = instanceContainer.getDefinitions();
- Map map = new HashMap(definitions.size());
- for (Iterator i = definitions.iterator();i.hasNext();)
- {
- InstanceDefinition def = (InstanceDefinition)i.next();
- map.put(def.getId(), def);
- }
- return map;
- }
-
- public Instance getSelectedInstance()
- {
- try
- {
-// Class clazz =
Thread.currentThread().getContextClassLoader().loadClass("com.sun.el.ExpressionFactoryImpl");
-// ExpressionFactory factory = (ExpressionFactory)clazz.newInstance();
-// ELContext ctx = ELAdaptor.getELContext(FacesContext.getCurrentInstance());
-//
-// ValueExpression ve =
ctx.getVariableMapper().resolveVariable("contentURI");
-// System.out.println("ve = " + ve);
-// Object o = ve.getValue(ctx);
-// System.out.println("o = " + o);
-// System.out.println("o = " + o);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
-
-// FacesContext ctx = FacesContext.getCurrentInstance();
-// Application app = ctx.getApplication();
-// ValueBinding vb = app.createValueBinding("#{contentURI}");
-// String contentURI = (String)vb.getValue(ctx);
-//// System.out.println("vb.getExpressionString() = " +
vb.getExpressionString());
-//// System.out.println("vb.getExpressionString() = " +
vb.getExpressionString());
-//// System.out.println("vb.getExpressionString() = " +
vb.getExpressionString());
-// System.out.println("contentURI = " + contentURI);
-// System.out.println("contentURI = " + contentURI);
-// System.out.println("contentURI = " + contentURI);
-
-
- return null;
- }
-
-// public List getKeywords()
-// {
-// Collection definitions = instanceContainer.getDefinitions();
-// List items = new ArrayList(definitions.size());
-// for (Iterator i = definitions.iterator();i.hasNext();)
-// {
-// InstanceDefinition def = (InstanceDefinition)i.next();
-// Portlet portlet = def.getPortlet();
-// PortletInfo info = portlet.getInfo();
-// MetaInfo meta = info.getMeta();
-// meta.getMetaValue(MetaInfo.KEYWORDS);
-// SelectItem item = new SelectItem();
-// item.setValue(def.getId());
-// item.setDescription("blah");
-// item.setLabel(def.getId());
-// items.add(item);
-// }
-// return items;
-// }
-}
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/portlet/PortletContentEditorPortlet.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/portlet/PortletContentEditorPortlet.java 2007-03-06
21:58:35 UTC (rev 6565)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/portlet/PortletContentEditorPortlet.java 2007-03-06
22:21:42 UTC (rev 6566)
@@ -28,7 +28,6 @@
import org.jboss.portal.core.admin.ui.content.ContentEditors;
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.info.MetaInfo;
import javax.portlet.GenericPortlet;
@@ -83,6 +82,7 @@
//
PortletURL actionURL = resp.createActionURL();
+ actionURL.setParameter("meta_action", "select");
//
resp.setContentType("text/html");
Modified: 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 2007-03-06
21:58:35 UTC (rev 6565)
+++ trunk/core-admin/src/resources/portal-admin-sar/META-INF/jboss-service.xml 2007-03-06
22:21:42 UTC (rev 6566)
@@ -22,31 +22,4 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<server>
-
- <!-- -->
- <mbean
-
code="org.jboss.portal.core.admin.ui.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.admin.ui.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>
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-03-06
21:58:35 UTC (rev 6565)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2007-03-06
22:21:42 UTC (rev 6566)
@@ -190,17 +190,6 @@
</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.admin.ui.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>objects</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-03-06
21:58:35 UTC (rev 6565)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jboss-portlet.xml 2007-03-06
22:21:42 UTC (rev 6566)
@@ -97,9 +97,4 @@
<service-class>org.jboss.portal.portlet.federation.FederatingPortletInvoker</service-class>
<service-ref>:service=PortletInvoker,type=Federating</service-ref>
</service>
- <service>
- <service-name>ContentEditorRegistry</service-name>
-
<service-class>org.jboss.portal.core.admin.ui.content.ContentEditorRegistry</service-class>
- <service-ref>:service=ContentEditorRegistry2</service-ref>
- </service>
</portlet-app>
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPageLayout.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPageLayout.xhtml 2007-03-06
21:58:35 UTC (rev 6565)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPageLayout.xhtml 2007-03-06
22:21:42 UTC (rev 6566)
@@ -82,7 +82,7 @@
id="instanceId"
value="#{portalobjectmgr.selectedContentType}"
styleClass="portlet-form-field contentType">
- <f:selectItems
value="#{registry.availableTypes}"/>
+ <f:selectItems
value="#{portalobjectmgr.availableContentTypes}"/>
</h:selectOneMenu>
<h:commandButton value="Update"
styleClass="portlet-form-button"/>
<h:message for="instanceId"
errorClass="portlet-msg-error"/>
Deleted:
trunk/core-cms/src/main/org/jboss/portal/core/cms/content/CMSFaceletContentEditor.java
===================================================================
---
trunk/core-cms/src/main/org/jboss/portal/core/cms/content/CMSFaceletContentEditor.java 2007-03-06
21:58:35 UTC (rev 6565)
+++
trunk/core-cms/src/main/org/jboss/portal/core/cms/content/CMSFaceletContentEditor.java 2007-03-06
22:21:42 UTC (rev 6566)
@@ -1,72 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2007, 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.content;
-
-import org.jboss.portal.cms.CMS;
-import org.jboss.portal.cms.Command;
-import org.jboss.portal.cms.model.File;
-import org.jboss.portal.cms.model.Folder;
-import org.jboss.portal.core.admin.ui.content.AbstractFaceletContentEditor;
-
-import javax.faces.model.SelectItem;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class CMSFaceletContentEditor extends AbstractFaceletContentEditor
-{
-
- /** . */
- private CMS cms;
-
- public CMS getCMS()
- {
- return cms;
- }
-
- public void setCMS(CMS cms)
- {
- this.cms = cms;
- }
-
- public List getFiles()
- {
- Command listCMD =
cms.getCommandFactory().createFolderGetListCommand("/default");
- Folder folder = (Folder)cms.execute(listCMD);
- List files = folder.getFiles();
- List items = new ArrayList(files.size());
- for (int i = 0; i < files.size(); i++)
- {
- File file = (File)files.get(i);
- SelectItem item = new SelectItem();
- item.setValue(file.getBasePath());
- item.setDescription("blah");
- item.setLabel(file.getName());
- items.add(item);
- }
- return items;
- }
-}
Modified: trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
===================================================================
---
trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2007-03-06
21:58:35 UTC (rev 6565)
+++
trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2007-03-06
22:21:42 UTC (rev 6566)
@@ -1280,13 +1280,6 @@
this.storePermission("manage", path, manageRoles, manageUsers);
}
- /**
- * @param permission
- * @param action
- * @param criteria
- * @param roles
- * @param users
- */
private void storePermission(String action, String path, String[] roles, String[]
users) throws Exception
{
Permission permission = new Permission("cms", action);
@@ -1378,10 +1371,6 @@
return userPermissions;
}
- /**
- * @param aReq
- * @return
- */
private boolean isPortletAccessible(PortletRequest portletRequest)
{
try
@@ -1416,10 +1405,6 @@
}
}
- /**
- * @param aReq
- * @return
- */
private boolean isSecurityConsoleAccessible(PortletRequest portletRequest)
{
try
Modified: trunk/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml 2007-03-06
21:58:35 UTC (rev 6565)
+++ trunk/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml 2007-03-06
22:21:42 UTC (rev 6566)
@@ -678,22 +678,6 @@
<attribute name="ContentType">cms</attribute>
</mbean>
- <mbean
- code="org.jboss.portal.core.cms.content.CMSFaceletContentEditor"
- name="portal:service=ContentEditor,type=cms2"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <attribute name="ContentType">cms</attribute>
- <attribute
name="FaceletPath">content/editor.xhtml</attribute>
- <depends
- optional-attribute-name="Registry"
-
proxy-type="attribute">portal:service=ContentEditorRegistry2</depends>
- <depends
- optional-attribute-name="CMS"
- proxy-type="attribute">portal:service=CMS</depends>
- </mbean>
-
<!-- Content renderer integration -->
<mbean
code="org.jboss.portal.core.cms.content.CMSContentRenderer"