Author: agilliland
Date: Mon May 7 16:23:17 2007
New Revision: 536017
URL: http://svn.apache.org/viewvc?view=rev&rev=536017
Log:
struts2 migration for categories actions.
Added:
roller/trunk/src/org/apache/roller/pojos/WeblogCategoryPathComparator.java
roller/trunk/src/org/apache/roller/ui/authoring/struts2/Categories.java
roller/trunk/src/org/apache/roller/ui/authoring/struts2/CategoryAdd.java
roller/trunk/src/org/apache/roller/ui/authoring/struts2/CategoryBean.java
roller/trunk/src/org/apache/roller/ui/authoring/struts2/CategoryEdit.java
roller/trunk/src/org/apache/roller/ui/authoring/struts2/CategoryRemove.java
roller/trunk/web/WEB-INF/jsps/authoring/struts2/Categories.jsp
roller/trunk/web/WEB-INF/jsps/authoring/struts2/CategoriesSidebar.jsp
roller/trunk/web/WEB-INF/jsps/authoring/struts2/CategoryAdd.jsp
roller/trunk/web/WEB-INF/jsps/authoring/struts2/CategoryEdit.jsp
roller/trunk/web/WEB-INF/jsps/authoring/struts2/CategoryRemove.jsp
Modified:
roller/trunk/src/org/apache/roller/ui/authoring/struts2/editor-menu.xml
roller/trunk/web/WEB-INF/classes/struts.xml
roller/trunk/web/WEB-INF/tiles.xml
Added:
roller/trunk/src/org/apache/roller/pojos/WeblogCategoryPathComparator.java
URL:
http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/pojos/WeblogCategoryPathComparator.java?view=auto&rev=536017
==============================================================================
--- roller/trunk/src/org/apache/roller/pojos/WeblogCategoryPathComparator.java
(added)
+++ roller/trunk/src/org/apache/roller/pojos/WeblogCategoryPathComparator.java
Mon May 7 16:23:17 2007
@@ -0,0 +1,35 @@
+/*
+ * 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.pojos;
+
+import java.util.Comparator;
+
+
+/**
+ * Compare weblog categories by path.
+ */
+public class WeblogCategoryPathComparator implements Comparator {
+
+ public int compare(Object o1, Object o2) {
+ WeblogCategoryData f1 = (WeblogCategoryData)o1;
+ WeblogCategoryData f2 = (WeblogCategoryData)o2;
+ return f1.getPath().compareTo(f2.getPath());
+ }
+
+}
Added: roller/trunk/src/org/apache/roller/ui/authoring/struts2/Categories.java
URL:
http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/authoring/struts2/Categories.java?view=auto&rev=536017
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/authoring/struts2/Categories.java
(added)
+++ roller/trunk/src/org/apache/roller/ui/authoring/struts2/Categories.java Mon
May 7 16:23:17 2007
@@ -0,0 +1,217 @@
+/*
+ * 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.authoring.struts2;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.LinkedList;
+import java.util.Set;
+import java.util.TreeSet;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.roller.RollerException;
+import org.apache.roller.business.RollerFactory;
+import org.apache.roller.business.WeblogManager;
+import org.apache.roller.pojos.PermissionsData;
+import org.apache.roller.pojos.WeblogCategoryData;
+import org.apache.roller.pojos.WeblogCategoryPathComparator;
+import org.apache.roller.ui.core.util.struts2.UIAction;
+
+
+/**
+ * Manage weblog categories.
+ */
+public class Categories extends UIAction {
+
+ private static Log log = LogFactory.getLog(Categories.class);
+
+ // the id of the category we are viewing
+ private String categoryId = null;
+
+ // the category we are viewing
+ private WeblogCategoryData category = null;
+
+ // list of category ids to move
+ private String[] selectedCategories = null;
+
+ // category id of the category to move to
+ private String targetCategoryId = null;
+
+ // all categories from the action weblog
+ private Set allCategories = Collections.EMPTY_SET;
+
+ // path of categories representing selected categories hierarchy
+ private List categoryPath = Collections.EMPTY_LIST;
+
+
+ public Categories() {
+ this.actionName = "categories";
+ this.desiredMenu = "editor";
+ this.pageTitle = "categoriesForm.rootTitle";
+ }
+
+
+ // author perms required
+ public short requiredWeblogPermissions() {
+ return PermissionsData.AUTHOR;
+ }
+
+
+ public void myPrepare() {
+ try {
+ WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
+ if(!StringUtils.isEmpty(getCategoryId()) &&
+ !"/".equals(getCategoryId())) {
+ setCategory(wmgr.getWeblogCategory(getCategoryId()));
+ } else {
+ setCategory(wmgr.getRootWeblogCategory(getActionWeblog()));
+ }
+ } catch (RollerException ex) {
+ log.error("Error looking up category", ex);
+ }
+ }
+
+
+ public String execute() {
+
+ // build list of categories for display
+ TreeSet allCategories = new TreeSet(new
WeblogCategoryPathComparator());
+
+ try {
+ // Build list of all categories, except for current one, sorted by
path.
+ WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
+ List<WeblogCategoryData> cats =
wmgr.getWeblogCategories(getActionWeblog(), true);
+ for(WeblogCategoryData cat : cats) {
+ if (!cat.getId().equals(getCategoryId())) {
+ allCategories.add(cat);
+ }
+ }
+
+ // build category path
+ WeblogCategoryData parent = getCategory().getParent();
+ if(parent != null) {
+ List categoryPath = new LinkedList();
+ categoryPath.add(0, getCategory());
+ while (parent != null) {
+ categoryPath.add(0, parent);
+ parent = parent.getParent();
+ }
+ setCategoryPath(categoryPath);
+ }
+ } catch (RollerException ex) {
+ log.error("Error building categories list", ex);
+ // TODO: i18n
+ addError("Error building categories list");
+ }
+
+ if (allCategories.size() > 0) {
+ setAllCategories(allCategories);
+ }
+
+ return LIST;
+ }
+
+
+ public String move() {
+
+ try {
+ WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
+
+ log.debug("Moving categories to category -
"+getTargetCategoryId());
+
+ // Move subCategories to new category.
+ String[] cats = getSelectedCategories();
+ WeblogCategoryData parent =
wmgr.getWeblogCategory(getTargetCategoryId());
+ if(cats != null) {
+ for (int i = 0; i < cats.length; i++) {
+ WeblogCategoryData cd =
+ wmgr.getWeblogCategory(cats[i]);
+
+ // Don't move category into itself.
+ if (!cd.getId().equals(parent.getId()) &&
+ !parent.descendentOf(cd)) {
+ wmgr.moveWeblogCategory(cd, parent);
+ } else {
+ addMessage("categoriesForm.warn.notMoving",
cd.getName());
+ }
+ }
+
+ // flush changes
+ RollerFactory.getRoller().flush();
+ }
+
+ } catch (RollerException ex) {
+ log.error("Error moving categories", ex);
+ addError("categoriesForm.error.move");
+ }
+
+ return execute();
+ }
+
+
+ public String getCategoryId() {
+ return categoryId;
+ }
+
+ public void setCategoryId(String categoryId) {
+ this.categoryId = categoryId;
+ }
+
+ public WeblogCategoryData getCategory() {
+ return category;
+ }
+
+ public void setCategory(WeblogCategoryData category) {
+ this.category = category;
+ }
+
+ public String[] getSelectedCategories() {
+ return selectedCategories;
+ }
+
+ public void setSelectedCategories(String[] selectedCategories) {
+ this.selectedCategories = selectedCategories;
+ }
+
+ public String getTargetCategoryId() {
+ return targetCategoryId;
+ }
+
+ public void setTargetCategoryId(String targetCategoryId) {
+ this.targetCategoryId = targetCategoryId;
+ }
+
+ public Set getAllCategories() {
+ return allCategories;
+ }
+
+ public void setAllCategories(Set allCategories) {
+ this.allCategories = allCategories;
+ }
+
+ public List getCategoryPath() {
+ return categoryPath;
+ }
+
+ public void setCategoryPath(List categoryPath) {
+ this.categoryPath = categoryPath;
+ }
+
+}
Added: roller/trunk/src/org/apache/roller/ui/authoring/struts2/CategoryAdd.java
URL:
http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/authoring/struts2/CategoryAdd.java?view=auto&rev=536017
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/authoring/struts2/CategoryAdd.java
(added)
+++ roller/trunk/src/org/apache/roller/ui/authoring/struts2/CategoryAdd.java
Mon May 7 16:23:17 2007
@@ -0,0 +1,176 @@
+/*
+ * 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.authoring.struts2;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.roller.RollerException;
+import org.apache.roller.business.BookmarkManager;
+import org.apache.roller.business.RollerFactory;
+import org.apache.roller.business.WeblogManager;
+import org.apache.roller.pojos.WeblogCategoryData;
+import org.apache.roller.pojos.PermissionsData;
+import org.apache.roller.ui.core.util.struts2.UIAction;
+import org.apache.roller.util.cache.CacheManager;
+
+
+/**
+ * Add a new subCategory to an existing Category.
+ */
+public class CategoryAdd extends UIAction {
+
+ private static Log log = LogFactory.getLog(CategoryAdd.class);
+
+ // the id of the Category we are adding the new subCategory into
+ private String categoryId = null;
+
+ // the category we are adding the new subcategory into
+ private WeblogCategoryData category = null;
+
+ // bean for managing form data
+ private CategoryBean bean = new CategoryBean();
+
+
+ public CategoryAdd() {
+ this.actionName = "categoryAdd";
+ this.desiredMenu = "editor";
+ this.pageTitle = "categoryForm.add.title";
+ }
+
+
+ // author perms required
+ public short requiredWeblogPermissions() {
+ return PermissionsData.AUTHOR;
+ }
+
+
+ public void myPrepare() {
+ try {
+ WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
+ if(!StringUtils.isEmpty(getCategoryId())) {
+ setCategory(wmgr.getWeblogCategory(getCategoryId()));
+ }
+ } catch (RollerException ex) {
+ log.error("Error looking up category", ex);
+ }
+ }
+
+
+ /**
+ * Show category form.
+ */
+ public String execute() {
+
+ if(getCategory() == null) {
+ // TODO: i18n
+ addError("Cannot add category to null parent category");
+ return ERROR;
+ }
+
+ return INPUT;
+ }
+
+
+ /**
+ * Save new category.
+ */
+ public String save() {
+
+ if(getCategory() == null) {
+ // TODO: i18n
+ addError("Cannot add category to null parent category");
+ return ERROR;
+ }
+
+ // validation
+ myValidate();
+
+ if(!hasActionErrors()) try {
+
+ WeblogCategoryData newCategory = new WeblogCategoryData(
+ getActionWeblog(),
+ getCategory(),
+ getBean().getName(),
+ getBean().getDescription(),
+ getBean().getImage());
+
+ // add new folder to parent
+ getCategory().addCategory(newCategory);
+
+ // save changes
+ WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
+ wmgr.saveWeblogCategory(newCategory);
+ RollerFactory.getRoller().flush();
+
+ // notify caches
+ CacheManager.invalidate(newCategory);
+
+ // TODO: i18n
+ addMessage("category added");
+
+ return SUCCESS;
+
+ } catch(Exception ex) {
+ log.error("Error saving new category", ex);
+ // TODO: i18n
+ addError("Error saving new category");
+ }
+
+ return INPUT;
+ }
+
+
+ // TODO: validation
+ public void myValidate() {
+
+ // name is required, has max length, no html
+
+ // make sure new name is not a duplicate of an existing folder
+ if(getCategory().hasCategory(getBean().getName())) {
+ addError("categoryForm.error.duplicateName", getBean().getName());
+ }
+ }
+
+
+ public String getCategoryId() {
+ return categoryId;
+ }
+
+ public void setCategoryId(String categoryId) {
+ this.categoryId = categoryId;
+ }
+
+ public WeblogCategoryData getCategory() {
+ return category;
+ }
+
+ public void setCategory(WeblogCategoryData category) {
+ this.category = category;
+ }
+
+ public CategoryBean getBean() {
+ return bean;
+ }
+
+ public void setBean(CategoryBean bean) {
+ this.bean = bean;
+ }
+
+}
Added: roller/trunk/src/org/apache/roller/ui/authoring/struts2/CategoryBean.java
URL:
http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/authoring/struts2/CategoryBean.java?view=auto&rev=536017
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/authoring/struts2/CategoryBean.java
(added)
+++ roller/trunk/src/org/apache/roller/ui/authoring/struts2/CategoryBean.java
Mon May 7 16:23:17 2007
@@ -0,0 +1,87 @@
+/*
+ * 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.authoring.struts2;
+
+import org.apache.roller.RollerException;
+import org.apache.roller.pojos.WeblogCategoryData;
+
+
+/**
+ * Bean for managing category data.
+ */
+public class CategoryBean {
+
+ private String id = null;
+ private String name = null;
+ private String description = null;
+ private String image = null;
+
+
+ public String getId() {
+ return this.id;
+ }
+
+ public void setId( String id ) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return this.name;
+ }
+
+ public void setName( String name ) {
+ this.name = name;
+ }
+
+ public String getDescription() {
+ return this.description;
+ }
+
+ public void setDescription( String description ) {
+ this.description = description;
+ }
+
+ public String getImage() {
+ return image;
+ }
+
+ public void setImage(String image) {
+ this.image = image;
+ }
+
+
+ public void copyTo(WeblogCategoryData dataHolder) throws RollerException {
+
+ if(!dataHolder.getName().equals(this.name)) {
+ dataHolder.updateName(this.name);
+ }
+
+ dataHolder.setDescription(this.description);
+ dataHolder.setImage(this.image);
+ }
+
+
+ public void copyFrom(WeblogCategoryData dataHolder) {
+ this.id = dataHolder.getId();
+ this.name = dataHolder.getName();
+ this.description = dataHolder.getDescription();
+ this.image = dataHolder.getImage();
+ }
+
+}
Added: roller/trunk/src/org/apache/roller/ui/authoring/struts2/CategoryEdit.java
URL:
http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/authoring/struts2/CategoryEdit.java?view=auto&rev=536017
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/authoring/struts2/CategoryEdit.java
(added)
+++ roller/trunk/src/org/apache/roller/ui/authoring/struts2/CategoryEdit.java
Mon May 7 16:23:17 2007
@@ -0,0 +1,159 @@
+/*
+ * 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.authoring.struts2;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.roller.RollerException;
+import org.apache.roller.business.RollerFactory;
+import org.apache.roller.business.WeblogManager;
+import org.apache.roller.pojos.WeblogCategoryData;
+import org.apache.roller.pojos.PermissionsData;
+import org.apache.roller.ui.core.util.struts2.UIAction;
+import org.apache.roller.util.cache.CacheManager;
+
+
+/**
+ * Edit an existing Category.
+ */
+public class CategoryEdit extends UIAction {
+
+ private static Log log = LogFactory.getLog(CategoryEdit.class);
+
+ // the category we are editing
+ private WeblogCategoryData category = null;
+
+ // bean for managing form data
+ private CategoryBean bean = new CategoryBean();
+
+
+ public CategoryEdit() {
+ this.actionName = "categoryEdit";
+ this.desiredMenu = "editor";
+ this.pageTitle = "categoryForm.edit.title";
+ }
+
+
+ // author perms required
+ public short requiredWeblogPermissions() {
+ return PermissionsData.AUTHOR;
+ }
+
+
+ public void myPrepare() {
+ try {
+ WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
+ if(!StringUtils.isEmpty(getBean().getId())) {
+ setCategory(wmgr.getWeblogCategory(getBean().getId()));
+ }
+ } catch (RollerException ex) {
+ log.error("Error looking up category", ex);
+ }
+ }
+
+
+ /**
+ * Show category form.
+ */
+ public String execute() {
+
+ if(getCategory() == null) {
+ // TODO: i18n
+ addError("Cannot edit null category");
+ return ERROR;
+ }
+
+ // make sure bean is properly loaded from pojo data
+ getBean().copyFrom(getCategory());
+
+ return INPUT;
+ }
+
+
+ /**
+ * Save new category.
+ */
+ public String save() {
+
+ if(getCategory() == null) {
+ // TODO: i18n
+ addError("Cannot edit null category");
+ return ERROR;
+ }
+
+ // validation
+ myValidate();
+
+ if(!hasActionErrors()) try {
+
+ // copy updated attributes
+ getBean().copyTo(getCategory());
+
+ // save changes
+ WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
+ wmgr.saveWeblogCategory(getCategory());
+ RollerFactory.getRoller().flush();
+
+ // notify caches
+ CacheManager.invalidate(getCategory());
+
+ // TODO: i18n
+ addMessage("category updated");
+
+ } catch(Exception ex) {
+ log.error("Error saving category", ex);
+ // TODO: i18n
+ addError("Error saving category");
+ }
+
+ return INPUT;
+ }
+
+
+ // TODO: validation
+ public void myValidate() {
+
+ // name is required, has max length, no html
+
+ // make sure new name is not a duplicate of an existing category
+ WeblogCategoryData parent = getCategory().getParent();
+ if(parent != null && parent.hasCategory(getBean().getName())) {
+ addError("categoryForm.error.duplicateName", getBean().getName());
+ }
+ }
+
+
+ public WeblogCategoryData getCategory() {
+ return category;
+ }
+
+ public void setCategory(WeblogCategoryData category) {
+ this.category = category;
+ }
+
+ public CategoryBean getBean() {
+ return bean;
+ }
+
+ public void setBean(CategoryBean bean) {
+ this.bean = bean;
+ }
+
+}
Added:
roller/trunk/src/org/apache/roller/ui/authoring/struts2/CategoryRemove.java
URL:
http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/authoring/struts2/CategoryRemove.java?view=auto&rev=536017
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/authoring/struts2/CategoryRemove.java
(added)
+++ roller/trunk/src/org/apache/roller/ui/authoring/struts2/CategoryRemove.java
Mon May 7 16:23:17 2007
@@ -0,0 +1,180 @@
+/*
+ * 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.authoring.struts2;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.roller.RollerException;
+import org.apache.roller.business.RollerFactory;
+import org.apache.roller.business.WeblogManager;
+import org.apache.roller.pojos.PermissionsData;
+import org.apache.roller.pojos.WeblogCategoryData;
+import org.apache.roller.pojos.WeblogCategoryPathComparator;
+import org.apache.roller.ui.core.util.struts2.UIAction;
+import org.apache.roller.util.cache.CacheManager;
+
+
+/**
+ * Remove a category.
+ */
+public class CategoryRemove extends UIAction {
+
+ private static Log log = LogFactory.getLog(CategoryRemove.class);
+
+ // id of category to remove
+ private String removeId = null;
+
+ // category object that we will remove
+ private WeblogCategoryData category = null;
+
+ // category id of the category to move to
+ private String targetCategoryId = null;
+
+ // all categories from the action weblog
+ private Set allCategories = Collections.EMPTY_SET;
+
+
+ public CategoryRemove() {
+ this.actionName = "categoryRemove";
+ this.desiredMenu = "editor";
+ this.pageTitle = "editPages.title.removeOK";
+ }
+
+
+ public short requiredWeblogPermissions() {
+ return PermissionsData.AUTHOR;
+ }
+
+
+ public void myPrepare() {
+ try {
+ WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
+ if(!StringUtils.isEmpty(getRemoveId())) {
+ setCategory(wmgr.getWeblogCategory(getRemoveId()));
+ }
+ } catch (RollerException ex) {
+ log.error("Error looking up category", ex);
+ }
+ }
+
+
+ /**
+ * Display the remove template confirmation.
+ */
+ public String execute() {
+
+ // build list of categories for display
+ TreeSet allCategories = new TreeSet(new
WeblogCategoryPathComparator());
+
+ try {
+ // Build list of all categories, except for current one, sorted by
path.
+ WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
+ List<WeblogCategoryData> cats =
wmgr.getWeblogCategories(getActionWeblog(), true);
+ for(WeblogCategoryData cat : cats) {
+ if (!cat.getId().equals(getRemoveId())) {
+ allCategories.add(cat);
+ }
+ }
+ } catch (RollerException ex) {
+ log.error("Error building categories list", ex);
+ // TODO: i18n
+ addError("Error building categories list");
+ }
+
+ if (allCategories.size() > 0) {
+ setAllCategories(allCategories);
+ }
+
+ return INPUT;
+ }
+
+
+ /**
+ * Remove a new template.
+ */
+ public String remove() {
+
+ if(getCategory() != null) try {
+ WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
+
+ if(getTargetCategoryId() != null) {
+ WeblogCategoryData target =
wmgr.getWeblogCategory(getTargetCategoryId());
+ wmgr.moveWeblogCategoryContents(getCategory(), target);
+ RollerFactory.getRoller().flush();
+ }
+
+ wmgr.removeWeblogCategory(getCategory());
+ RollerFactory.getRoller().flush();
+
+ // notify cache
+ CacheManager.invalidate(getCategory());
+
+ // set category id to parent for next page
+ setRemoveId(getCategory().getParent().getId());
+
+ return SUCCESS;
+
+ } catch(Exception ex) {
+ log.error("Error removing category - "+getRemoveId(), ex);
+ // TODO: i18n
+ addError("Error removing category");
+ }
+
+ return execute();
+ }
+
+
+ public String getRemoveId() {
+ return removeId;
+ }
+
+ public void setRemoveId(String categoryId) {
+ this.removeId = categoryId;
+ }
+
+ public WeblogCategoryData getCategory() {
+ return category;
+ }
+
+ public void setCategory(WeblogCategoryData category) {
+ this.category = category;
+ }
+
+ public String getTargetCategoryId() {
+ return targetCategoryId;
+ }
+
+ public void setTargetCategoryId(String targetCategoryId) {
+ this.targetCategoryId = targetCategoryId;
+ }
+
+ public Set getAllCategories() {
+ return allCategories;
+ }
+
+ public void setAllCategories(Set allCategories) {
+ this.allCategories = allCategories;
+ }
+
+}
Modified:
roller/trunk/src/org/apache/roller/ui/authoring/struts2/editor-menu.xml
URL:
http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/authoring/struts2/editor-menu.xml?view=diff&rev=536017&r1=536016&r2=536017
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/authoring/struts2/editor-menu.xml
(original)
+++ roller/trunk/src/org/apache/roller/ui/authoring/struts2/editor-menu.xml Mon
May 7 16:23:17 2007
@@ -44,7 +44,7 @@
name="tabbedmenu.weblog.categories"
roles="editor"
perms="author"
- subactions="categoryEdit,categoryDelete" />
+ subactions="categoryAdd,categoryEdit,categoryRemove" />
<menu-item action="bookmarks"
name="tabbedmenu.bookmarks.allFolders"
Modified: roller/trunk/web/WEB-INF/classes/struts.xml
URL:
http://svn.apache.org/viewvc/roller/trunk/web/WEB-INF/classes/struts.xml?view=diff&rev=536017&r1=536016&r2=536017
==============================================================================
--- roller/trunk/web/WEB-INF/classes/struts.xml (original)
+++ roller/trunk/web/WEB-INF/classes/struts.xml Mon May 7 16:23:17 2007
@@ -174,8 +174,27 @@
<result>/roller-ui/authoring/commentManagement.do?method=query</result>
</action>
- <action name="categories">
-
<result>/roller-ui/authoring/categories.do?method=selectCategory</result>
+ <action name="categories!*" method="{1}"
+ class="org.apache.roller.ui.authoring.struts2.Categories">
+ <result name="list" type="tiles">.Categories</result>
+ </action>
+
+ <action name="categoryAdd!*" method="{1}"
+ class="org.apache.roller.ui.authoring.struts2.CategoryAdd">
+ <result name="input" type="tiles">.CategoryAdd</result>
+ <result name="success" type="chain">categories</result>
+ <result name="error" type="chain">categories</result>
+ </action>
+
+ <action name="categoryEdit!*" method="{1}"
+ class="org.apache.roller.ui.authoring.struts2.CategoryEdit">
+ <result name="input" type="tiles">.CategoryEdit</result>
+ </action>
+
+ <action name="categoryRemove!*" method="{1}"
+ class="org.apache.roller.ui.authoring.struts2.CategoryRemove">
+ <result name="input" type="tiles">.CategoryRemove</result>
+ <result name="success" type="chain">categories</result>
</action>
<action name="bookmarks!*" method="{1}"
Added: roller/trunk/web/WEB-INF/jsps/authoring/struts2/Categories.jsp
URL:
http://svn.apache.org/viewvc/roller/trunk/web/WEB-INF/jsps/authoring/struts2/Categories.jsp?view=auto&rev=536017
==============================================================================
--- roller/trunk/web/WEB-INF/jsps/authoring/struts2/Categories.jsp (added)
+++ roller/trunk/web/WEB-INF/jsps/authoring/struts2/Categories.jsp Mon May 7
16:23:17 2007
@@ -0,0 +1,149 @@
+<%--
+ 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.
+--%>
+<%@ include file="/WEB-INF/jsps/taglibs-struts2.jsp" %>
+
+<%-- JavaScript for categories table --%>
+<script type="text/javascript">
+<!--
+function setChecked(val)
+{
+ len = document.categories.elements.length;
+ var i=0;
+ for( i=0 ; i<len ; i++)
+ {
+ document.categories.elements[i].checked=val;
+ }
+}
+function onMove()
+{
+ if ( confirm("<s:text name='categoriesForm.move.confirm' />") )
+ {
+ document.categories.method.value = "moveSelected";
+ document.categories.submit();
+ }
+}
+//-->
+</script>
+
+<s:if test="categoryPath.isEmpty">
+ <p class="subtitle">
+ <s:text name="categoriesForm.subtitle" >
+ <s:param value="weblog" />
+ </s:text>
+ </p>
+ <p class="pagetip">
+ <s:text name="categoriesForm.rootPrompt" />
+ </p>
+</s:if>
+
+<s:else>
+ <p class="subtitle">
+ <s:text name="categoriesForm.path" />: /
+ <s:iterator id="pathItem" value="categoryPath">
+ <s:url id="pathUrl" action="categories">
+ <s:param name="weblog" value="%{actionWeblog.handle}" />
+ <s:param name="categoryId" value="#pathItem.id" />
+ </s:url>
+ <s:a href="%{pathUrl}"><s:property value="#pathItem.name" /></s:a> /
+ </s:iterator>
+ <p>
+ <p><s:text name="categoriesForm.categoryPrompt" /></p>
+</s:else>
+
+
+<%-- Form is a table of categories each with checkbox --%>
+<s:form action="categories!move">
+ <s:hidden name="weblog" />
+ <s:hidden name="categoryId" />
+
+ <%-- Select-all button --%>
+ <input type="button" value="<s:text name='categoriesForm.checkAll' />"
onclick="setChecked(1)" /></input>
+
+ <%-- Select-none button --%>
+ <input type="button" value="<s:text name='categoriesForm.checkNone' />"
onclick="setChecked(0)" /></input>
+
+
+
+ <%-- Move-selected button --%>
+ <s:submit key="categoriesForm.move" onclick="onMove()" />
+
+ <%-- Move-to combo-box --%>
+ <s:select name="targetCategoryId" list="allCategories" listKey="id"
listValue="path" />
+
+ <p />
+
+ <table class="rollertable">
+
+ <tr class="rollertable">
+ <th class="rollertable" width="5%"> </td>
+ <th class="rollertable" width="5%"> </td>
+ <th class="rollertable" width="30%"><s:text
name="categoriesForm.name" /></td>
+ <th class="rollertable" width="45%"><s:text
name="categoriesForm.description" /></td>
+ <th class="rollertable" width="5%"><s:text
name="categoriesForm.edit" /></td>
+ <th class="rollertable" width="5%"><s:text
name="categoriesForm.remove" /></td>
+ </tr>
+
+ <%-- Categories --%>
+ <s:iterator id="category" value="category.weblogCategories"
status="rowstatus">
+ <s:if test="#rowstatus.odd == true">
+ <tr class="rollertable_odd">
+ </s:if>
+ <s:else>
+ <tr class="rollertable_even">
+ </s:else>
+
+ <td class="rollertable">
+ <input type="checkbox" name="selectedCategories"
value="<s:property value="#category.id"/>" />
+ </td>
+
+ <td class="rollertable" align="center"><img src='<s:url
value="/images/folder.png"/>' alt="icon" /></td>
+
+ <td class="rollertable">
+ <s:url id="categoryUrl" action="categories">
+ <s:param name="weblog" value="%{actionWeblog.handle}"
/>
+ <s:param name="categoryId" value="#category.id" />
+ </s:url>
+ <s:a href="%{categoryUrl}"><str:truncateNicely lower="15"
upper="20" ><s:property value="#category.name" /></str:truncateNicely></s:a>
+ </td>
+
+ <td class="rollertable">
+ <str:truncateNicely lower="30" upper="35" ><s:property
value="#category.description" /></str:truncateNicely>
+ </td>
+
+ <td class="rollertable" align="center">
+ <s:url id="editUrl" action="categoryEdit">
+ <s:param name="weblog" value="%{actionWeblog.handle}"
/>
+ <s:param name="bean.id" value="#category.id" />
+ </s:url>
+ <s:a href="%{editUrl}"><img src='<s:url
value="/images/page_white_edit.png"/>' border="0" alt="icon" /></s:a>
+ </td>
+
+ <td class="rollertable" align="center">
+ <s:url id="removeUrl" action="categoryRemove">
+ <s:param name="weblog" value="%{actionWeblog.handle}"
/>
+ <s:param name="removeId" value="#category.id" />
+ </s:url>
+ <s:a href="%{removeUrl}"><img src='<s:url
value="/images/delete.png"/>' border="0" alt="icon" /></s:a>
+ </td>
+
+ </tr>
+ </s:iterator>
+
+ </table>
+
+</s:form>
Added: roller/trunk/web/WEB-INF/jsps/authoring/struts2/CategoriesSidebar.jsp
URL:
http://svn.apache.org/viewvc/roller/trunk/web/WEB-INF/jsps/authoring/struts2/CategoriesSidebar.jsp?view=auto&rev=536017
==============================================================================
--- roller/trunk/web/WEB-INF/jsps/authoring/struts2/CategoriesSidebar.jsp
(added)
+++ roller/trunk/web/WEB-INF/jsps/authoring/struts2/CategoriesSidebar.jsp Mon
May 7 16:23:17 2007
@@ -0,0 +1,43 @@
+<%--
+ 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.
+--%>
+<%@ include file="/WEB-INF/jsps/taglibs-struts2.jsp" %>
+
+<div class="sidebarFade">
+ <div class="menu-tr">
+ <div class="menu-tl">
+
+ <div class="sidebarInner">
+ <h3><s:text name="mainPage.actions" /></h3>
+ <hr size="1" noshade="noshade" />
+
+ <p>
+ <%-- Add Category link --%>
+ <img src='<s:url value="/images/folder_add.png"/>'
border="0"alt="icon" />
+ <s:url id="addCategory" action="categoryAdd">
+ <s:param name="weblog" value="%{actionWeblog.handle}"
/>
+ <s:param name="categoryId" value="%{category.id}" />
+ </s:url>
+ <s:a href="%{addCategory}"><s:text
name="categoriesForm.addCategory" /></s:a>
+ </p>
+
+ <br />
+ </div>
+
+ </div>
+ </div>
+</div>
Added: roller/trunk/web/WEB-INF/jsps/authoring/struts2/CategoryAdd.jsp
URL:
http://svn.apache.org/viewvc/roller/trunk/web/WEB-INF/jsps/authoring/struts2/CategoryAdd.jsp?view=auto&rev=536017
==============================================================================
--- roller/trunk/web/WEB-INF/jsps/authoring/struts2/CategoryAdd.jsp (added)
+++ roller/trunk/web/WEB-INF/jsps/authoring/struts2/CategoryAdd.jsp Mon May 7
16:23:17 2007
@@ -0,0 +1,56 @@
+<%--
+ 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.
+--%>
+<%@ include file="/WEB-INF/jsps/taglibs-struts2.jsp" %>
+
+<p class="subtitle">
+ <s:text name="categoryForm.add.subtitle" />
+</p>
+
+<p>
+ <b><s:text name="categoriesForm.path" /></b>:<s:property
value="category.path" />
+</p>
+
+<s:form action="categoryAdd!save">
+ <s:hidden name="weblog" />
+ <s:hidden name="categoryId" />
+
+ <table>
+
+ <tr>
+ <td><s:text name="categoryForm.name" /></td>
+ <td><s:textfield name="bean.name" size="70" maxlength="255" /></td>
+ </tr>
+
+ <tr>
+ <td><s:text name="categoryForm.description" /></td>
+ <td><s:textarea name="bean.description" rows="5" cols="50" /></td>
+ </tr>
+
+ <tr>
+ <td><s:text name="categoryForm.image" /></td>
+ <td><s:textarea name="bean.image" rows="5" cols="50" /></td>
+ </tr>
+
+ </table>
+
+ <p>
+ <s:submit key="categoryForm.save" />
+ <s:submit key="categoryForm.cancel" action="categories" />
+ </p>
+
+</s:form>
Added: roller/trunk/web/WEB-INF/jsps/authoring/struts2/CategoryEdit.jsp
URL:
http://svn.apache.org/viewvc/roller/trunk/web/WEB-INF/jsps/authoring/struts2/CategoryEdit.jsp?view=auto&rev=536017
==============================================================================
--- roller/trunk/web/WEB-INF/jsps/authoring/struts2/CategoryEdit.jsp (added)
+++ roller/trunk/web/WEB-INF/jsps/authoring/struts2/CategoryEdit.jsp Mon May 7
16:23:17 2007
@@ -0,0 +1,59 @@
+<%--
+ 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.
+--%>
+<%@ include file="/WEB-INF/jsps/taglibs-struts2.jsp" %>
+
+<p class="subtitle">
+ <s:text name="categoryForm.edit.subtitle" />
+</p>
+
+<p>
+ <b><s:text name="categoriesForm.path" /></b>:<s:property
value="category.path" />
+</p>
+
+<s:form action="categoryEdit!save">
+ <s:hidden name="weblog" />
+ <s:hidden name="bean.id" />
+
+ <%-- if we cancel then we need this attribute --%>
+ <s:hidden name="categoryId" value="%{category.parent.id}" />
+
+ <table>
+
+ <tr>
+ <td><s:text name="categoryForm.name" /></td>
+ <td><s:textfield name="bean.name" size="70" maxlength="255" /></td>
+ </tr>
+
+ <tr>
+ <td><s:text name="categoryForm.description" /></td>
+ <td><s:textarea name="bean.description" rows="5" cols="50" /></td>
+ </tr>
+
+ <tr>
+ <td><s:text name="categoryForm.image" /></td>
+ <td><s:textarea name="bean.image" rows="5" cols="50" /></td>
+ </tr>
+
+ </table>
+
+ <p>
+ <s:submit key="categoryForm.save" />
+ <s:submit key="categoryForm.cancel" action="categories" />
+ </p>
+
+</s:form>
Added: roller/trunk/web/WEB-INF/jsps/authoring/struts2/CategoryRemove.jsp
URL:
http://svn.apache.org/viewvc/roller/trunk/web/WEB-INF/jsps/authoring/struts2/CategoryRemove.jsp?view=auto&rev=536017
==============================================================================
--- roller/trunk/web/WEB-INF/jsps/authoring/struts2/CategoryRemove.jsp (added)
+++ roller/trunk/web/WEB-INF/jsps/authoring/struts2/CategoryRemove.jsp Mon May
7 16:23:17 2007
@@ -0,0 +1,53 @@
+<%--
+ 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.
+--%>
+<%@ include file="/WEB-INF/jsps/taglibs-struts2.jsp" %>
+
+<h3>
+ <s:text name="categoryDeleteOK.removeCategory" />
+ [<s:property value="category.name" />]
+</h3>
+
+<s:form action="categoryRemove!remove">
+ <s:hidden name="weblog" />
+ <s:hidden name="removeId" />
+
+ <%-- if we cancel then we need this attribute --%>
+ <s:hidden name="categoryId" value="%{category.parent.id}" />
+
+ <s:if test="category.inUse" >
+ <br />
+ <span class="warning">
+ <s:text name="categoryDeleteOK.warningCatInUse" />
+ </span>
+ <p><s:text name="categoryDeleteOK.youMustMoveEntries" /><p>
+ <s:text name="categoryDeleteOK.moveToWhere" />
+ <s:select name="targetCategoryId" list="allCategories"
listKey="id" listValue="path" />
+ </p>
+ </s:if>
+ <s:else>
+ <p><s:text name="categoryDeleteOK.noEntriesInCat" /></p>
+ </s:else>
+
+ <p>
+ <strong><s:text name="categoryDeleteOK.areYouSure" /></strong>
+ </p>
+
+ <s:submit key="application.yes" />
+ <s:submit key="application.no" action="categories" />
+
+</s:form>
Modified: roller/trunk/web/WEB-INF/tiles.xml
URL:
http://svn.apache.org/viewvc/roller/trunk/web/WEB-INF/tiles.xml?view=diff&rev=536017&r1=536016&r2=536017
==============================================================================
--- roller/trunk/web/WEB-INF/tiles.xml (original)
+++ roller/trunk/web/WEB-INF/tiles.xml Mon May 7 16:23:17 2007
@@ -168,19 +168,24 @@
<put name="styles" value="/WEB-INF/jsps/tiles/struts2/css-sidebar.jsp"
/>
</definition>
- <definition name=".CategoriesForm" extends=".tiles-tabbedpage" >
- <put name="content" value="/WEB-INF/jsps/authoring/CategoriesForm.jsp"
/>
- <put name="sidebar"
value="/WEB-INF/jsps/authoring/CategoriesSidebar.jsp" />
+ <definition name=".Categories" extends=".tiles-tabbedpage" >
+ <put name="content"
value="/WEB-INF/jsps/authoring/struts2/Categories.jsp" />
+ <put name="sidebar"
value="/WEB-INF/jsps/authoring/struts2/CategoriesSidebar.jsp" />
<put name="styles" value="/WEB-INF/jsps/tiles/struts2/css-sidebar.jsp"
/>
</definition>
- <definition name=".CategoryForm" extends=".tiles-tabbedpage" >
- <put name="content" value="/WEB-INF/jsps/authoring/CategoryForm.jsp" />
+ <definition name=".CategoryAdd" extends=".tiles-tabbedpage" >
+ <put name="content"
value="/WEB-INF/jsps/authoring/struts2/CategoryAdd.jsp" />
<put name="styles"
value="/WEB-INF/jsps/tiles/struts2/css-nosidebar.jsp" />
</definition>
- <definition name=".CategoryDeleteOK" extends=".tiles-tabbedpage" >
- <put name="content"
value="/WEB-INF/jsps/authoring/CategoryDeleteOK.jsp" />
+ <definition name=".CategoryEdit" extends=".tiles-tabbedpage" >
+ <put name="content"
value="/WEB-INF/jsps/authoring/struts2/CategoryEdit.jsp" />
+ <put name="styles"
value="/WEB-INF/jsps/tiles/struts2/css-nosidebar.jsp" />
+ </definition>
+
+ <definition name=".CategoryRemove" extends=".tiles-tabbedpage" >
+ <put name="content"
value="/WEB-INF/jsps/authoring/struts2/CategoryRemove.jsp" />
<put name="styles"
value="/WEB-INF/jsps/tiles/struts2/css-nosidebar.jsp" />
</definition>