roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r424444 - in /incubator/roller/branches/roller_3.0: metadata/xdoclet/ src/org/apache/roller/ui/core/tags/ src/org/apache/roller/ui/core/tags/menu/ web/WEB-INF/ web/WEB-INF/jsps/authoring/
Date Fri, 21 Jul 2006 20:21:25 GMT
Author: snoopdave
Date: Fri Jul 21 13:21:24 2006
New Revision: 424444

URL: http://svn.apache.org/viewvc?rev=424444&view=rev
Log:
Two fixes: 1) always allow weblog remove and 2) all weblog authoring pages appear with tabbed
menu structure

Modified:
    incubator/roller/branches/roller_3.0/metadata/xdoclet/global-forwards.xml
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/VelocityTag.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/menu/Menu.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/menu/MenuImpl.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/menu/MenuItem.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/menu/MenuItemImpl.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/menu/MenuModel.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/menu/MenuTag.java
    incubator/roller/branches/roller_3.0/web/WEB-INF/editor-menu.xml
    incubator/roller/branches/roller_3.0/web/WEB-INF/jsps/authoring/CategoryDeleteOK.jsp
    incubator/roller/branches/roller_3.0/web/WEB-INF/jsps/authoring/WebsiteRemove.jsp
    incubator/roller/branches/roller_3.0/web/WEB-INF/tiles-defs.xml

Modified: incubator/roller/branches/roller_3.0/metadata/xdoclet/global-forwards.xml
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/metadata/xdoclet/global-forwards.xml?rev=424444&r1=424443&r2=424444&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/metadata/xdoclet/global-forwards.xml (original)
+++ incubator/roller/branches/roller_3.0/metadata/xdoclet/global-forwards.xml Fri Jul 21 13:21:24
2006
@@ -28,6 +28,8 @@
 <forward name="commentManagement"      path="/roller-ui/authoring/commentManagement.do?method=query"/>
 <forward name="commentQuery"           path="/roller-ui/authoring/commentQuery.do?method=query"/>
 <forward name="categories"             path="/roller-ui/authoring/categories.do?method=selectCategory"/>
+<forward name="categoryEdit"           path="/roller-ui/authoring/categoryEdit.do"/>
+<forward name="categoryDelete"         path="/roller-ui/authoring/categoryDelete.do"/>
 <forward name="bookmarks"              path="/roller-ui/authoring/bookmarks.do?method=selectFolder"/>
 <forward name="folderEdit"             path="/roller-ui/authoring/folderEdit.do"/>
 <forward name="importBookmarks"        path="/roller-ui/authoring/importBookmarks.do"/>

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/VelocityTag.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/VelocityTag.java?rev=424444&r1=424443&r2=424444&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/VelocityTag.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/VelocityTag.java
Fri Jul 21 13:21:24 2006
@@ -37,8 +37,8 @@
  */
 public abstract class VelocityTag extends HybridTag // TagSupport 
 {
-    private static Log mLogger = 
-        LogFactory.getFactory().getInstance(VelocityTag.class);
+    private static Log mLogger =
+            LogFactory.getFactory().getInstance(VelocityTag.class);
 /*
     private String              title;
     private String              subtitle;

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/menu/Menu.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/menu/Menu.java?rev=424444&r1=424443&r2=424444&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/menu/Menu.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/menu/Menu.java
Fri Jul 21 13:21:24 2006
@@ -1,54 +1,55 @@
 /*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-*  contributor license agreements.  The ASF licenses this file to You
-* under the Apache License, Version 2.0 (the "License"); you may not
-* use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.  For additional information regarding
-* copyright in this work, please see the NOTICE file in the top level
-* directory of this distribution.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
 
 package org.apache.roller.ui.core.tags.menu;
+
 import javax.servlet.http.HttpServletRequest;
 
 import org.apache.roller.RollerException;
 
-/** An individual menu which contains MenuItems */ 
-public interface Menu 
-{
-	/** Name of Menu */
-	public String getName();
-
-	/** Collection of MenuItem objects contained in this menu */
-	public java.util.Vector getMenuItems();
-
-	/** Determine if this menu is selected based on request */
-	public boolean isSelected( HttpServletRequest req ) throws RollerException;
-
-	/** Get currently selected menu item in this menu */
-	public MenuItem getSelectedMenuItem( HttpServletRequest req ) throws RollerException;
-
-    /** Url to be displayed in menu */ 
+/** An individual menu which contains MenuItems */
+public interface Menu {
+    
+    /** Name of Menu */
+    public String getName();
+    
+    /** Collection of MenuItem objects contained in this menu */
+    public java.util.Vector getMenuItems();
+    
+    /** Determine if this menu is selected based on request */
+    public boolean isSelected( HttpServletRequest req ) throws RollerException;
+    
+    /** Get currently selected menu item in this menu */
+    public MenuItem getSelectedMenuItem( HttpServletRequest req ) throws RollerException;
+    
+    /** Url to be displayed in menu */
     public String getUrl( javax.servlet.jsp.PageContext pctx );
     
-    /** Is user principal permitted to use this menu? */ 
+    /** Is user principal permitted to use this menu? */
     public boolean isPermitted( HttpServletRequest req ) throws RollerException;
     
-    /** Set roles allowed to use this menu (comma separated list). */ 
+    /** Set roles allowed to use this menu (comma separated list). */
     public void setRoles( String roles );
-
-    /** Name of true/false configuration property that enables this menu */ 
+    
+    /** Name of true/false configuration property that enables this menu */
     public void setEnabledProperty( String enabledProperty );
-
-    /** Name of true/false configuration property that disables this menu */ 
+    
+    /** Name of true/false configuration property that disables this menu */
     public void setDisabledProperty( String disabledProperty );
 }
 

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/menu/MenuImpl.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/menu/MenuImpl.java?rev=424444&r1=424443&r2=424444&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/menu/MenuImpl.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/menu/MenuImpl.java
Fri Jul 21 13:21:24 2006
@@ -1,20 +1,20 @@
 /*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-*  contributor license agreements.  The ASF licenses this file to You
-* under the Apache License, Version 2.0 (the "License"); you may not
-* use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.  For additional information regarding
-* copyright in this work, please see the NOTICE file in the top level
-* directory of this distribution.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
 
 package org.apache.roller.ui.core.tags.menu;
 
@@ -39,130 +39,111 @@
 /////////////////////////////////////////////////////////////////////////
 
 /** MenuImpl model has collection of menus */
-public class MenuImpl extends BaseRollerMenu implements Menu 
-{
-	private String mMenuId = null;
-
+public class MenuImpl extends BaseRollerMenu implements Menu {
+    private String mMenuId = null;
+    
     /** Vector of MenuItemImpl objects */
-	Vector mMenuItems = new Vector();
-	
-	/** Is this the default menu? */
-	boolean mDefault = false;
-	
-	public MenuImpl() {}
-
-	/** Construct with name */
-	public MenuImpl(String n) { super(n, null); }
-	
-	/** Add MenuItemImpl to MenuImpl */
-	public void addItem( MenuItemImpl item ) { mMenuItems.addElement(item); };
-	
-	/** Parent menu's ID */ 
-	public void setMenuId( String v ) { mMenuId = v; }
-
-	/** Parent menu's ID */
-	public String getMenuId() { return mMenuId; }
-
-	/** Collection of MenuItemImpl objects */
-	public Vector getMenuItems() { return mMenuItems; }
-
-	/** Get currently selected menu item in this menu 
-	 * @throws RollerException*/
-	public MenuItem getSelectedMenuItem( HttpServletRequest req ) throws RollerException
-	{
-		return getSelectedMenuItem( req, true ) ;
-	}
-
-	/** 
-     * Get currently selected menu item in this menu 
-	 * @throws RollerException
+    Vector mMenuItems = new Vector();
+    
+    /** Is this the default menu? */
+    boolean mDefault = false;
+    
+    public MenuImpl() {}
+    
+    /** Construct with name */
+    public MenuImpl(String n) { super(n, null); }
+    
+    /** Add MenuItemImpl to MenuImpl */
+    public void addItem( MenuItemImpl item ) { mMenuItems.addElement(item); };
+    
+    /** Parent menu's ID */
+    public void setMenuId( String v ) { mMenuId = v; }
+    
+    /** Parent menu's ID */
+    public String getMenuId() { return mMenuId; }
+    
+    /** Collection of MenuItemImpl objects */
+    public Vector getMenuItems() { return mMenuItems; }
+    
+    /** Get currently selected menu item in this menu
+     * @throws RollerException*/
+    public MenuItem getSelectedMenuItem( HttpServletRequest req ) throws RollerException
{
+        return getSelectedMenuItem( req, true ) ;
+    }
+    
+    /**
+     * Get currently selected menu item in this menu
+     * @throws RollerException
      */
-	public MenuItem getSelectedMenuItem( HttpServletRequest req, 
-			boolean returnDefault ) throws RollerException
-	{
-		MenuItemImpl def = null;
-		MenuItemImpl selected = null;
-		for ( int i=0; i<mMenuItems.size(); i++ ) 
-		{
-			MenuItemImpl item = (MenuItemImpl)mMenuItems.elementAt(i);
-			if ( item.isSelected( req ) )
-			{
-				selected = item;
-				break;
-			}
-		    // Set first permitted and enabled menu item in each menu as default
-			if ( item.isPermitted(req) && def == null)
-			{
-				def = item;
-			}
-		}
-		if ( selected != null )
-		{
-			return selected;
-		}
-		else if ( returnDefault )
-		{
-			return def;
-		}
-		else 
-		{
-			return null;
-		}
-	}
+    public MenuItem getSelectedMenuItem( HttpServletRequest req,
+            boolean returnDefault ) throws RollerException {
+        MenuItemImpl def = null;
+        MenuItemImpl selected = null;
+        for ( int i=0; i<mMenuItems.size(); i++ ) {
+            MenuItemImpl item = (MenuItemImpl)mMenuItems.elementAt(i);
+            if ( item.isSelected( req ) ) {
+                selected = item;
+                break;
+            }
+            // Set first permitted and enabled menu item in each menu as default
+            if ( item.isPermitted(req) && def == null) {
+                def = item;
+            }
+        }
+        if ( selected != null ) {
+            return selected;
+        } else if ( returnDefault ) {
+            return def;
+        } else {
+            return null;
+        }
+    }
     
-	/** 
+    /**
      * Get default menu item (first one that is permitted)
-	 * @throws RollerException
+     * @throws RollerException
      */
-	public MenuItem getDefaultMenuItem( HttpServletRequest req ) 
-        throws RollerException
-	{
-		MenuItemImpl def = null;
-		MenuItemImpl selected = null;
-		for ( int i=0; i<mMenuItems.size(); i++ ) 
-		{
-		    // Set first permitted and enabled menu item in each menu as default
-			MenuItemImpl item = (MenuItemImpl)mMenuItems.elementAt(i);
-			if (item.isPermitted(req) && def == null)
-			{
-				def = item;
-			}
-		}
-		return def;
-	}
-
-	/** 
-     * Is this menu selected? 
-	 * @throws RollerException
-     */ 
-	public boolean isSelected( HttpServletRequest req ) throws RollerException
-	{
+    public MenuItem getDefaultMenuItem( HttpServletRequest req )
+    throws RollerException {
+        MenuItemImpl def = null;
+        MenuItemImpl selected = null;
+        for ( int i=0; i<mMenuItems.size(); i++ ) {
+            // Set first permitted and enabled menu item in each menu as default
+            MenuItemImpl item = (MenuItemImpl)mMenuItems.elementAt(i);
+            if (item.isPermitted(req) && def == null) {
+                def = item;
+            }
+        }
+        return def;
+    }
+    
+    /**
+     * Is this menu selected?
+     * @throws RollerException
+     */
+    public boolean isSelected( HttpServletRequest req ) throws RollerException {
         boolean selected = false;
         HttpSession ses = req.getSession(false);
         
         // try to get state from request param then attribute
         String menuKey = req.getParameter(RollerMenuModel.MENU_KEY );
-        if (null == menuKey) 
-        {
+        if (null == menuKey) {
             menuKey = (String)req.getAttribute(RollerMenuModel.MENU_KEY);
         }
-        if (menuKey != null && menuKey.equals(mName)) 
-        {
+        if (menuKey != null && menuKey.equals(mName)) {
             selected = true;
         }
         // next, if submenu is selected, then we're selected
-        else if (getSelectedMenuItem(req, false) != null)
-		{
+        else if (getSelectedMenuItem(req, false) != null) {
             selected = true;
-		}
+        }
         // next, try to use Struts forward to determine state
-        else if (mForward != null)
-        {
-            ServletContext ctx = RollerContext.getServletContext();     
-			ModuleConfig mConfig = RequestUtils.getModuleConfig(req, ctx);
+        else if (mForward != null) {
+            ServletContext ctx = RollerContext.getServletContext();
+            ModuleConfig mConfig = RequestUtils.getModuleConfig(req, ctx);
             ActionMapping amapping = (ActionMapping)req.getAttribute(Globals.MAPPING_KEY);
             List fconfigs = new ArrayList();
-			fconfigs.add(mConfig.findForwardConfig(mForward));
+            fconfigs.add(mConfig.findForwardConfig(mForward));
             if (mSubforwards != null) {
                 String[] subforwards = mSubforwards.split(",");
                 for (int i=0; i<subforwards.length; i++) {
@@ -174,53 +155,42 @@
                 String fwdPath = fconfig.getPath();
                 int end = fwdPath.indexOf(".do");
                 fwdPath = (end == -1) ? fwdPath : fwdPath.substring(0, end);
-                if  (fwdPath.equals(amapping.getPath()))
-                {
+                if  (fwdPath.equals(amapping.getPath())) {
                     selected = true;
                     break;
-                } 
+                }
             }
         }
-		return selected;
-	}
-
-	/** Name of Struts forward menu item should link to */
-	public String getUrl(PageContext pctx) 
-	{
-		String url = null;
-		try 
-		{
+        return selected;
+    }
+    
+    /** Name of Struts forward menu item should link to */
+    public String getUrl(PageContext pctx) {
+        String url = null;
+        try {
             // If no forward specified, use default submenu URL
-            if (mForward == null && mMenuItems != null && mMenuItems.size()
> 0)
-            {
+            if (mForward == null && mMenuItems != null && mMenuItems.size()
> 0) {
                 HttpServletRequest req = (HttpServletRequest)pctx.getRequest();
-                String surl = getDefaultMenuItem( req ).getUrl( pctx ); 
-                StringBuffer sb = new StringBuffer( surl ); 
-                if ( surl.indexOf("?") == -1 )
-                {
-                    sb.append( "?" ); 
-                }
-                else
-                {
-                    sb.append( "&amp;" ); 
+                String surl = getDefaultMenuItem( req ).getUrl( pctx );
+                StringBuffer sb = new StringBuffer( surl );
+                if ( surl.indexOf("?") == -1 ) {
+                    sb.append( "?" );
+                } else {
+                    sb.append( "&amp;" );
                 }
                 sb.append( RollerMenuModel.MENU_KEY );
-                sb.append( "=" ); 
-                sb.append( getName() );	
+                sb.append( "=" );
+                sb.append( getName() );
                 url = sb.toString();
-            }
-            else
-            {
+            } else {
                 return super.getUrl(pctx);
             }
-		}
-		catch (Exception e)
-		{
-			pctx.getServletContext().log(
-				"ERROR in menu creating URL",e);
-		}
-		return url;
-	}
-
+        } catch (Exception e) {
+            pctx.getServletContext().log(
+                    "ERROR in menu creating URL",e);
+        }
+        return url;
+    }
+    
 }
 

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/menu/MenuItem.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/menu/MenuItem.java?rev=424444&r1=424443&r2=424444&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/menu/MenuItem.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/menu/MenuItem.java
Fri Jul 21 13:21:24 2006
@@ -1,41 +1,39 @@
 /*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-*  contributor license agreements.  The ASF licenses this file to You
-* under the Apache License, Version 2.0 (the "License"); you may not
-* use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.  For additional information regarding
-* copyright in this work, please see the NOTICE file in the top level
-* directory of this distribution.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
 
 package org.apache.roller.ui.core.tags.menu;
+
 import java.util.Vector;
 import javax.servlet.http.HttpServletRequest;
 
-/** An individual menu item, contained in a Menu */ 
-public interface MenuItem 
-{
-	/** Name of menu */
-	public String getName();
-
-	/** Url to be displayed in menu */ 
-	public String getUrl( javax.servlet.jsp.PageContext pctx );
-
-	/** Determine if this menu item is selected */
-	public boolean isSelected( HttpServletRequest req );
+/** An individual menu item, contained in a Menu */
+public interface MenuItem {
+    
+    /** Name of menu */
+    public String getName();
     
-    /** Name of true/false configuration property that enables this menu */ 
+    /** Url to be displayed in menu */
+    public String getUrl( javax.servlet.jsp.PageContext pctx );
+    
+    /** Determine if this menu item is selected */
+    public boolean isSelected( HttpServletRequest req );
+    
+    /** Name of true/false configuration property that enables this menu */
     public void setEnabledProperty( String enabledProperty );
-
-    /** Collection of MenuItemImpl objects */
-	//public Vector getMenuItems();
 }
 

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/menu/MenuItemImpl.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/menu/MenuItemImpl.java?rev=424444&r1=424443&r2=424444&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/menu/MenuItemImpl.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/menu/MenuItemImpl.java
Fri Jul 21 13:21:24 2006
@@ -1,20 +1,20 @@
 /*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-*  contributor license agreements.  The ASF licenses this file to You
-* under the Apache License, Version 2.0 (the "License"); you may not
-* use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.  For additional information regarding
-* copyright in this work, please see the NOTICE file in the top level
-* directory of this distribution.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
 
 package org.apache.roller.ui.core.tags.menu;
 
@@ -25,6 +25,8 @@
 import javax.servlet.ServletContext;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpSession;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.struts.Globals;
 import org.apache.struts.action.ActionMapping;
 
@@ -36,63 +38,62 @@
 
 /////////////////////////////////////////////////////////////////////////
 
-/** 
- * MenuImpls has collection of menu items. Multiple menus can be used 
+/**
+ * MenuImpls has collection of menu items. Multiple menus can be used
  * in one session, but they must have unique names.
- */ 
-public class MenuItemImpl extends BaseRollerMenu implements MenuItem
-{
-	private String mMenuId = null;
+ */
+public class MenuItemImpl extends BaseRollerMenu implements MenuItem {
+    private String mMenuId = null;
+    private static Log log = LogFactory.getFactory().getInstance(MenuItemImpl.class);
     
     //private Vector mMenuItems = new Vector();
-		
-	/** Is this the default menu? */
-	boolean mDefault = false;
-
-	//---------------------------------------------------
-
-	public MenuItemImpl() {}
-
-	/** Construct with name and Struts forward */
-	public MenuItemImpl(String n, String f) 
-    { 
-        super(n, f); 
+    
+    /** Is this the default menu? */
+    boolean mDefault = false;
+    
+    //---------------------------------------------------
+    
+    public MenuItemImpl() {}
+    
+    /** Construct with name and Struts forward */
+    public MenuItemImpl(String n, String f) {
+        super(n, f);
     }
-
-	/** Parent menu's ID */ 
-	public void setMenuId( String v ) { mMenuId = v; }
-
-	/** Parent menu's ID */
-	public String getMenuId() { return mMenuId; }
-
-	/** Given a request, tells if menu item is selected */ 
-	public boolean isSelected( HttpServletRequest req )
-	{
-		boolean selected = false;
+    
+    /** Parent menu's ID */
+    public void setMenuId( String v ) { mMenuId = v; }
+    
+    /** Parent menu's ID */
+    public String getMenuId() { return mMenuId; }
+    
+    /** Given a request, tells if menu item is selected */
+    public boolean isSelected( HttpServletRequest req ) {
+        boolean selected = false;
         HttpSession ses = req.getSession(false);
         
         // first look for menu state in request params, then attributes
         String itemKey = req.getParameter(RollerMenuModel.MENU_ITEM_KEY );
-        if (null == itemKey) 
-        {
+        if (null == itemKey) {
             itemKey = (String)req.getAttribute(RollerMenuModel.MENU_ITEM_KEY);
         }
         
         ActionMapping amapping = (ActionMapping)req.getAttribute(Globals.MAPPING_KEY);
-        if (itemKey != null && itemKey.equals(mName)) 
-        {
+        if (itemKey != null && itemKey.equals(mName)) {
             selected = true;
-        }
-		else if (mForward != null && amapping != null) 
-		{
-            ServletContext ctx = RollerContext.getServletContext();     
-			ModuleConfig mConfig = RequestUtils.getModuleConfig(req, ctx);
+        } else if (mForward != null && amapping != null) {
+            ServletContext ctx = RollerContext.getServletContext();
+            ModuleConfig mConfig = RequestUtils.getModuleConfig(req, ctx);
             List fconfigs = new ArrayList();
-			fconfigs.add(mConfig.findForwardConfig(mForward));
+            fconfigs.add(mConfig.findForwardConfig(mForward));
             if (mSubforwards != null) {
                 String[] subforwards = mSubforwards.split(",");
                 for (int i=0; i<subforwards.length; i++) {
-                    fconfigs.add(mConfig.findForwardConfig(subforwards[i]));
+                    ForwardConfig fconfig = mConfig.findForwardConfig(subforwards[i]);
+                    if (fconfig != null) {
+                        fconfigs.add(fconfig);
+                    } else {
+                        log.error("ERROR: subforward specified in XML menu file not found:
" + subforwards[i]);
+                    }
                 }
             }
             for (Iterator iter = fconfigs.iterator(); iter.hasNext();) {
@@ -100,33 +101,31 @@
                 String fwdPath = fconfig.getPath();
                 int end = fwdPath.indexOf(".do");
                 fwdPath = (end == -1) ? fwdPath : fwdPath.substring(0, end);
-                if  (fwdPath.equals(amapping.getPath()))
-                {
+                if  (fwdPath.equals(amapping.getPath())) {
                     selected = true;
                     break;
-                } 
+                }
             }
-		}
+        }
         
         // still not found, look for menu state in session attributes
-		if (ses != null && selected)
-		{
-			ses.setAttribute(mMenuId+"_"+RollerMenuModel.MENU_ITEM_KEY, mName);
-		}
-		return selected;
-	}
+        if (ses != null && selected) {
+            ses.setAttribute(mMenuId+"_"+RollerMenuModel.MENU_ITEM_KEY, mName);
+        }
+        return selected;
+    }
     
     /*
-    public Vector getMenuItems() 
+    public Vector getMenuItems()
     {
         return mMenuItems;
     }
-
+     
     public addMenuItem(MenuItem item)
     {
         mMenuItems.add(item);
     }
-    */
+     */
 }
 
 
@@ -134,7 +133,7 @@
 //// get menu key from request param or from cookie
 //String menuKeyName = mMenuId+"rmk";
 //String menuKey = req.getParameter("rmk");
-//if (menuKey == null) 
+//if (menuKey == null)
 //{
 //  Cookie menuCookie = RequestUtil.getCookie(req, menuKeyName);
 //  if (menuCookie != null)
@@ -149,7 +148,7 @@
 //// get menu item key from request param or from cookie
 //String itemKeyName = mMenuId+"rmik";
 //String itemKey = req.getParameter("rmik");
-//if (itemKey == null) 
+//if (itemKey == null)
 //{
 //  Cookie itemCookie = RequestUtil.getCookie(req, itemKeyName);
 //  if (itemCookie != null)
@@ -160,5 +159,5 @@
 //}
 //// save menu item key in cookie
 //RequestUtil.setCookie(res, itemKeyName, itemKey, req.getContextPath());
-        
+
 

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/menu/MenuModel.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/menu/MenuModel.java?rev=424444&r1=424443&r2=424444&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/menu/MenuModel.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/menu/MenuModel.java
Fri Jul 21 13:21:24 2006
@@ -1,20 +1,20 @@
 /*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-*  contributor license agreements.  The ASF licenses this file to You
-* under the Apache License, Version 2.0 (the "License"); you may not
-* use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.  For additional information regarding
-* copyright in this work, please see the NOTICE file in the top level
-* directory of this distribution.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
 
 package org.apache.roller.ui.core.tags.menu;
 import javax.servlet.http.HttpServletRequest;
@@ -22,16 +22,15 @@
 import org.apache.roller.RollerException;
 
 
-/** Menu model contains Menus */ 
-public interface MenuModel 
-{
-	/** Collection of Menu objects contained in this menu model */
-	public java.util.Vector getMenus();
-
-	/** Return menu selected by current request or first menu.
-	 *  If request does not indicate a menu then first menu is returned.
-	 * @throws RollerException
-	 */
-	public Menu getSelectedMenu( HttpServletRequest req ) throws RollerException;
+/** Menu model contains Menus */
+public interface MenuModel {
+    /** Collection of Menu objects contained in this menu model */
+    public java.util.Vector getMenus();
+    
+    /** Return menu selected by current request or first menu.
+     *  If request does not indicate a menu then first menu is returned.
+     * @throws RollerException
+     */
+    public Menu getSelectedMenu( HttpServletRequest req ) throws RollerException;
 }
 

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/menu/MenuTag.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/menu/MenuTag.java?rev=424444&r1=424443&r2=424444&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/menu/MenuTag.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/menu/MenuTag.java
Fri Jul 21 13:21:24 2006
@@ -69,7 +69,7 @@
     }
     
     
-    /** 
+    /**
      * Unique ID for this menu within the user's session.
      *
      * @jsp.attribute
@@ -79,7 +79,7 @@
     public void setId( String v ) { mMenuId= v; }
     
     
-    /** 
+    /**
      * Name of the view to be used to render the menu.
      * The view is a Velocity template and it must be in the classpath.
      * Values: tabbed, vertical, horizontal.
@@ -91,7 +91,7 @@
     public void setView( String v ) { mView = v; }
     
     
-    /** 
+    /**
      * Name of the model to be used.
      * Must correspond to name of XML file in WEB-INF directory.
      *

Modified: incubator/roller/branches/roller_3.0/web/WEB-INF/editor-menu.xml
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/web/WEB-INF/editor-menu.xml?rev=424444&r1=424443&r2=424444&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/web/WEB-INF/editor-menu.xml (original)
+++ incubator/roller/branches/roller_3.0/web/WEB-INF/editor-menu.xml Fri Jul 21 13:21:24 2006
@@ -30,7 +30,8 @@
         <menu-item forward="commentManagement" name="tabbedmenu.admin.commentManagement"

                                           perms="admin" 
                                           subforwards="commentQuery" />
-        <menu-item forward="categories"   name="tabbedmenu.weblog.categories" />
+        <menu-item forward="categories"   name="tabbedmenu.weblog.categories" 
+                                          subforwards="categoryEdit,categoryDelete" />
         <menu-item forward="bookmarks"    name="tabbedmenu.bookmarks.allFolders" 
                                           subforwards="importBookmarks" />
         <menu-item forward="uploadFiles"  name="tabbedmenu.website.files" />
@@ -43,10 +44,12 @@
         <menu-item forward="editTheme"         name="tabbedmenu.website.themes" 
                                                perms="admin" />
         <menu-item forward="editPages"         name="tabbedmenu.website.pages" 
-                                               perms="admin" />
+                                               perms="admin" 
+                                               subforwards="page,removePage" />
         <menu-item forward="memberPermissions" enabledProperty="groupblogging.enabled"
                                                name="tabbedmenu.website.members" 
-                                               perms="admin" />
+                                               perms="admin" 
+                                               subforwards="inviteMember" />
         <menu-item forward="pingSetup"         name="tabbedmenu.weblog.pingSetup" 
                                                disabledProperty="pings.disablePingUsage"

                                                perms="admin" />

Modified: incubator/roller/branches/roller_3.0/web/WEB-INF/jsps/authoring/CategoryDeleteOK.jsp
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/web/WEB-INF/jsps/authoring/CategoryDeleteOK.jsp?rev=424444&r1=424443&r2=424444&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/web/WEB-INF/jsps/authoring/CategoryDeleteOK.jsp (original)
+++ incubator/roller/branches/roller_3.0/web/WEB-INF/jsps/authoring/CategoryDeleteOK.jsp Fri
Jul 21 13:21:24 2006
@@ -46,6 +46,7 @@
 	<html:hidden property="confirmDelete" />
 
 	<c:if test="${categoryDeleteForm.inUse}" >
+                <br />
 		<span class="warning">
 		    <fmt:message key="categoryDeleteOK.warningCatInUse" />
 		</span>

Modified: incubator/roller/branches/roller_3.0/web/WEB-INF/jsps/authoring/WebsiteRemove.jsp
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/web/WEB-INF/jsps/authoring/WebsiteRemove.jsp?rev=424444&r1=424443&r2=424444&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/web/WEB-INF/jsps/authoring/WebsiteRemove.jsp (original)
+++ incubator/roller/branches/roller_3.0/web/WEB-INF/jsps/authoring/WebsiteRemove.jsp Fri
Jul 21 13:21:24 2006
@@ -26,6 +26,7 @@
     <fmt:param value="${website.name}" />
 </fmt:message>
 <br/>
+<br/>
 <span class="warning">
     <fmt:message key="websiteSettings.removeWebsiteWarning" />
 </span>

Modified: incubator/roller/branches/roller_3.0/web/WEB-INF/tiles-defs.xml
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/web/WEB-INF/tiles-defs.xml?rev=424444&r1=424443&r2=424444&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/web/WEB-INF/tiles-defs.xml (original)
+++ incubator/roller/branches/roller_3.0/web/WEB-INF/tiles-defs.xml Fri Jul 21 13:21:24 2006
@@ -142,23 +142,31 @@
     <put name="content" value="/WEB-INF/jsps/authoring/UploadFile.jsp" />
 </definition>
 
-<definition name=".WeblogEntryRemove" extends=".tiles-simplepage" >
+<!-- subpages -->
+
+<definition name=".WeblogEntryRemove" extends=".tiles-editorpage" >
     <put name="content" value="/WEB-INF/jsps/authoring/WeblogEntryRemove.jsp" />
+    <put name="styles" value="/WEB-INF/jsps/tiles/css-nosidebar.jsp" />
 </definition>
-<definition name=".CategoryForm" extends=".tiles-simplepage" >
+<definition name=".CategoryForm" extends=".tiles-editorpage" >
     <put name="content" value="/WEB-INF/jsps/authoring/CategoryForm.jsp" />
+    <put name="styles" value="/WEB-INF/jsps/tiles/css-nosidebar.jsp" />
 </definition>
-<definition name=".CategoryDeleteOK" extends=".tiles-simplepage" >
+<definition name=".CategoryDeleteOK" extends=".tiles-editorpage" >
     <put name="content" value="/WEB-INF/jsps/authoring/CategoryDeleteOK.jsp" />
+    <put name="styles" value="/WEB-INF/jsps/tiles/css-nosidebar.jsp" />
 </definition>
-<definition name=".BookmarkForm" extends=".tiles-simplepage" >
+<definition name=".BookmarkForm" extends=".tiles-editorpage" >
     <put name="content" value="/WEB-INF/jsps/authoring/BookmarkForm.jsp" />
+    <put name="styles" value="/WEB-INF/jsps/tiles/css-nosidebar.jsp" />
 </definition>
-<definition name=".FolderForm" extends=".tiles-simplepage" >
+<definition name=".FolderForm" extends=".tiles-editorpage" >
     <put name="content" value="/WEB-INF/jsps/authoring/FolderForm.jsp" />
+    <put name="styles" value="/WEB-INF/jsps/tiles/css-nosidebar.jsp" />
 </definition>
 <definition name=".import" extends=".tiles-editorpage" >
     <put name="content" value="/WEB-INF/jsps/authoring/import.jsp" />
+    <put name="styles" value="/WEB-INF/jsps/tiles/css-nosidebar.jsp" />
 </definition>
 
 <!-- weblog admin pages (and associates) -->
@@ -197,26 +205,35 @@
     <put name="content" value="/WEB-INF/jsps/authoring/Maintenance.jsp" />
 </definition>
 
-<definition name=".WebsiteRemove" extends=".tiles-simplepage" >
+<!-- subpages -->
+
+<definition name=".WebsiteRemove" extends=".tiles-editorpage" >
     <put name="content" value="/WEB-INF/jsps/authoring/WebsiteRemove.jsp" />
+    <put name="styles" value="/WEB-INF/jsps/tiles/css-nosidebar.jsp" />
 </definition>
-<definition name=".CustomPingTargetDeleteOK" extends=".tiles-simplepage" >
-    <put name="content" value="/WEB-INF/jsps/authoring/CustomPingTargetDeleteOK.jsp" />
-</definition>
-<definition name=".CustomPingTargetEdit" extends=".tiles-simplepage" >
-    <put name="content" value="/WEB-INF/jsps/authoring/CustomPingTargetEdit.jsp" />
-</definition>
-<definition name=".InviteMember" extends=".tiles-simplepage" >
+<definition name=".InviteMember" extends=".tiles-editorpage" >
     <put name="content" value="/WEB-INF/jsps/authoring/InviteMember.jsp" />
+    <put name="styles" value="/WEB-INF/jsps/tiles/css-nosidebar.jsp" />
 </definition>
-<definition name=".InviteMemberDone" extends=".tiles-simplepage" >
+<definition name=".InviteMemberDone" extends=".tiles-editorpage" >
     <put name="content" value="/WEB-INF/jsps/authoring/InviteMemberDone.jsp" />
+    <put name="styles" value="/WEB-INF/jsps/tiles/css-nosidebar.jsp" />
+</definition>
+<definition name=".CustomPingTargetDeleteOK" extends=".tiles-editorpage" >
+    <put name="content" value="/WEB-INF/jsps/authoring/CustomPingTargetDeleteOK.jsp" />
+    <put name="styles" value="/WEB-INF/jsps/tiles/css-nosidebar.jsp" />
+</definition>
+<definition name=".CustomPingTargetEdit" extends=".tiles-editorpage" >
+    <put name="content" value="/WEB-INF/jsps/authoring/CustomPingTargetEdit.jsp" />
+    <put name="styles" value="/WEB-INF/jsps/tiles/css-nosidebar.jsp" />
 </definition>
-<definition name=".edit-page" extends=".tiles-simplepage"  >
+<definition name=".edit-page" extends=".tiles-editorpage"  >
     <put name="content" value="/WEB-INF/jsps/authoring/edit-page.jsp" />
+    <put name="styles" value="/WEB-INF/jsps/tiles/css-nosidebar.jsp" />
 </definition>
-<definition name=".remove-page" extends=".tiles-simplepage"  >
+<definition name=".remove-page" extends=".tiles-editorpage"  >
     <put name="content" value="/WEB-INF/jsps/authoring/remove-page.jsp" />
+    <put name="styles" value="/WEB-INF/jsps/tiles/css-nosidebar.jsp" />
 </definition>
 
 



Mime
View raw message