Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/item In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17236/src/org/cobricks/item Modified Files: ItemManagerDB.java Item.java ItemManagerImpl.java ItemManager.java ItemServlet.java ItemPresenter.java ItemAttrs.java Log Message: Index: ItemManagerDB.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/item/ItemManagerDB.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ItemManagerDB.java 2 Mar 2004 17:58:10 -0000 1.6 --- ItemManagerDB.java 6 Mar 2004 21:35:04 -0000 1.7 *************** *** 14,17 **** --- 14,18 ---- */ import org.cobricks.core.db.DBAccess; + import org.cobricks.core.CobricksException; import org.cobricks.item.xmldb.XMLDBAccess; *************** *** 146,154 **** * @param newItem The new item (the one which has changed) * @param itemclass The item class which correspond to this item */ protected final void updateAttributeXMLDB(String name, Item oldItem, Item newItem, OntologyClass itemclass) throws XMLDBException { ! String xpath = "/item[globalid='" + newItem.getGlobalId() + "']"; //ItemAttrs.buildXPathForAttribute(name, oldItem.getGlobalId()); --- 147,157 ---- * @param newItem The new item (the one which has changed) * @param itemclass The item class which correspond to this item + * @throws XMLDBException Is thrown in case there were major problems + * while updating (so that the calling method can try a failsafe update). */ protected final void updateAttributeXMLDB(String name, Item oldItem, Item newItem, OntologyClass itemclass) throws XMLDBException { ! String xpath = "/item[itemid='" + newItem.getLocalId() + "']"; //ItemAttrs.buildXPathForAttribute(name, oldItem.getGlobalId()); *************** *** 167,172 **** */ protected final void storeItemXMLDB(Item item) { ! this.xmlDBAccess.insertDocument(item.getItemAsXML(false, false), ! String.valueOf(item.getLocalId())); } /** --- 170,186 ---- */ protected final void storeItemXMLDB(Item item) { ! try { ! this.xmlDBAccess.insertDocument(item.getItemAsXML(false, false), ! String.valueOf(item.getLocalId())); ! } catch (CobricksException e) { ! if (e.getExceptionId().equals("3001")) { ! logger.warn("Offline-Exception"); ! //TBD: Offline Error handling? ! } ! //TBD ! } catch (XMLDBException e) { ! logger.warn("Error during storing", e); ! } ! } /** *************** *** 305,310 **** protected final void performSafeUpdateXMLDB(Item item) { logger.info("Performing safe update for item: " + item.getLocalId()); ! this.xmlDBAccess.updateWholeDocument(item.getItemAsXML(false, false), ! String.valueOf(item.getLocalId())); } --- 319,331 ---- protected final void performSafeUpdateXMLDB(Item item) { logger.info("Performing safe update for item: " + item.getLocalId()); ! try { ! this.xmlDBAccess.updateWholeDocument(item.getItemAsXML(false, false), ! String.valueOf(item.getLocalId())); ! } catch (XMLDBException e) { ! logger.warn("Fatal problem while trying safe update", e); ! } catch (CobricksException e) { ! logger.warn("Can't update - db offline"); ! } ! } Index: Item.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/item/Item.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Item.java 2 Mar 2004 17:57:41 -0000 1.6 --- Item.java 6 Mar 2004 21:35:04 -0000 1.7 *************** *** 60,64 **** this.xmlEncoding = itemManager.getXMLEncoding(); ! HashMap attrs = itemManager.extractFromXML(xml); if (attrs == null) { --- 60,64 ---- this.xmlEncoding = itemManager.getXMLEncoding(); ! Map attrs = itemManager.extractFromXML(xml); if (attrs == null) { *************** *** 274,284 **** attrs.remove("globalid"); } - if ((attrs.get("itemclass") != null) && - (attrs.get("itemclass") instanceof String)) { - this.itemclass = (String) attrs.get("itemclass"); - attrs.remove("itemclass"); } ! */ this.attrs = attrs; } --- 274,284 ---- attrs.remove("globalid"); } + */ + if ((attrs.get("itemclass") != null) + && (attrs.get("itemclass") instanceof String)) { + this.itemclass = (String) attrs.remove("itemclass"); } ! this.attrs = attrs; } Index: ItemManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/item/ItemManagerImpl.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ItemManagerImpl.java 2 Mar 2004 17:58:26 -0000 1.6 --- ItemManagerImpl.java 6 Mar 2004 21:35:04 -0000 1.7 *************** *** 2,6 **** package org.cobricks.item; ! import org.apache.log4j.*; import org.cobricks.category.Category; --- 2,6 ---- package org.cobricks.item; ! import org.apache.log4j.Logger; import org.cobricks.category.Category; *************** *** 30,44 **** import org.xml.sax.SAXException; ! import java.io.*; ! ! import java.lang.reflect.Constructor; ! ! import java.net.URI; import java.sql.Timestamp; - import java.text.DateFormat; ! import java.util.*; import javax.xml.parsers.DocumentBuilder; --- 30,49 ---- import org.xml.sax.SAXException; ! import java.io.File; ! import java.io.BufferedInputStream; ! import java.io.ByteArrayInputStream; import java.sql.Timestamp; import java.text.DateFormat; ! import java.util.Map; ! import java.util.Set; ! import java.util.ArrayList; ! import java.util.HashMap; ! import java.util.HashSet; ! import java.util.Iterator; ! import java.util.List; ! import java.util.LinkedList; ! import java.util.Properties; import javax.xml.parsers.DocumentBuilder; *************** *** 57,61 **** --- 62,72 ---- public class ItemManagerImpl extends ComponentManagerAdaptor implements ItemManager { + /** + * Standard logger. + */ private static Logger logger = Logger.getLogger(ItemManagerImpl.class); + /** + * All tables in the relational data base. + */ private static final String[] DB_REL_ALL_TABLES = { *************** *** 63,69 **** "item_attrsitem", "item_attrsuser", "item_title", "item_content", }; ! static String COMP_NAME = "Cobricks-2 Item Manager"; ! static String COMP_VERSION = "V0.1 (Jul. 2003)"; ! private static int DEFAULT_CACHE_SIZE = 50; /** --- 74,89 ---- "item_attrsitem", "item_attrsuser", "item_title", "item_content", }; ! /** ! * Component name ! */ ! private static final String COMP_NAME = "Cobricks-2 Item Manager"; ! /** ! * Component version ! */ ! private static final String COMP_VERSION = "V0.1 (Jul. 2003)"; ! /** ! * The default value for the item cache - used in case no property is found ! */ ! private static final int DEFAULT_CACHE_SIZE = 50; /** *************** *** 73,87 **** /** * What attributes are used for permission checking? Maybe this will be ! * defined in the ontology? * TBD */ ! private static final String [] PERMISSION_ATTRIBUTES = {"creator","category"}; ! ! protected String defaultLanguage = "en"; private Ontology ontology; private CoreManager coreManager; ! Map itemObjects = null; private ItemCache itemCache; ! //private XMLDBAccess xmlDBAccess; private ItemManagerDB itemManagerDB; /** --- 93,122 ---- /** * What attributes are used for permission checking? Maybe this will be ! * defined in the ontology? * TBD */ ! private static final String [] PERMISSION_ATTRIBUTES = {"creator", ! "category"}; ! /** ! * Default language entry. Used for item attributes that are multi language ! */ ! private String defaultLanguage = "en"; ! /** ! * Ontology information about items ! */ private Ontology ontology; + /** + * Reference to the core manager. + */ private CoreManager coreManager; ! //Map itemObjects = null; ! /** ! * Itemcache is a map - based cache structure ! */ private ItemCache itemCache; ! ! /** ! * All database handling is done via the item manager db - adapter. ! */ private ItemManagerDB itemManagerDB; /** *************** *** 90,102 **** */ private String javaEncoding = "UTF-8"; ! /** * This has to be equivalent with the java setting. (Sometimes java encoding * names differ from xml encoding names). */ - private String xmlEncoding = "UTF-8"; - //private org.cobricks.item.xmldb.XMLDBAccess xmlDB; /** --- 125,135 ---- */ private String javaEncoding = "UTF-8"; ! /** * This has to be equivalent with the java setting. (Sometimes java encoding * names differ from xml encoding names). */ private String xmlEncoding = "UTF-8"; /** *************** *** 106,127 **** super(); } ! ! public String getComponentName() { return COMP_NAME; } ! public String getComponentVersion() { return COMP_VERSION; } ! public String getDefaultLanguage() { return defaultLanguage; } /** ! * */ ! public void init(String componentId, String managerId, ! Properties properties, CoreManager coreManager, DBAccess dbAccess) throws Exception { super.init(componentId, managerId, properties, coreManager, dbAccess); --- 139,171 ---- super(); } ! /** ! * @see org.cobricks.core.ComponentManagerInterface#getComponentName() ! */ ! public final String getComponentName() { return COMP_NAME; } + /** + * @see org.cobricks.core.ComponentManagerInterface#getComponentVersion() + */ ! public final String getComponentVersion() { return COMP_VERSION; } ! /** ! * @see org.cobricks.item.ItemManager#getDefaultLanguage() ! */ ! ! public final String getDefaultLanguage() { return defaultLanguage; } /** ! * @see org.cobricks.core.ComponentManagerInterface#init(java.lang.String, java.lang.String, java.util.Properties, org.cobricks.core.CoreManager, org.cobricks.core.db.DBAccess) */ ! public final void init(String componentId, String managerId, ! Properties properties, ! CoreManager coreManager, ! DBAccess dbAccess) throws Exception { super.init(componentId, managerId, properties, coreManager, dbAccess); *************** *** 186,190 **** + componentId + File.separator + "dbxml" + File.separator + "item.xml"); ! /*xmlDBAccess = new XMLDBAccess(properties); xmlDBAccess.init("item", (String) --- 230,234 ---- + componentId + File.separator + "dbxml" + File.separator + "item.xml"); ! /*xmlDBAccess = new XMLDBAccess(properties); xmlDBAccess.init("item", (String) *************** *** 193,205 **** + "item.xml"); */ Thread init = new Thread((Runnable) xmlDBAccess , "init"); - init.start(); ! this.itemManagerDB = new ItemManagerDB(this, coreManager.getDBAccess(), xmlDBAccess); ! if (properties.getProperty("item.java.file.encoding") != null){ this.javaEncoding = properties.getProperty("item.java.file.encoding"); } ! if (properties.getProperty("item.xml.encoding")!= null){ this.xmlEncoding = properties.getProperty("item.xml.encoding"); } --- 237,248 ---- + "item.xml"); */ Thread init = new Thread((Runnable) xmlDBAccess , "init"); init.start(); ! this.itemManagerDB = new ItemManagerDB(this, coreManager.getDBAccess(), xmlDBAccess); ! if (properties.getProperty("item.java.file.encoding") != null) { this.javaEncoding = properties.getProperty("item.java.file.encoding"); } ! if (properties.getProperty("item.xml.encoding")!= null) { this.xmlEncoding = properties.getProperty("item.xml.encoding"); } *************** *** 207,227 **** } ! public Ontology getOntology() { return ontology; } private Item getItemFromCache(int itemLocalId) { logger.info("getItemFrom Cache(int)"); - return itemCache.getItem(itemLocalId); } private Item getItemFromCache(String itemGlobalId) { logger.info("getItemFrom Cache (String based)"); return itemCache.getItem(itemGlobalId); } ! public Item getItem(int itemLocalId) { Item res = this.getItemFromCache(itemLocalId); --- 250,284 ---- } ! protected final Ontology getOntology() { return ontology; } + /** + * This method retries an item out of the local cache. + * @param itemLocalId Needed to find the item. + * @return The item in case it is in the cache, null otherwise + */ private Item getItemFromCache(int itemLocalId) { logger.info("getItemFrom Cache(int)"); return itemCache.getItem(itemLocalId); } + /** + * This method retries an item out of the local cache. + * @param itemGlobalId Needed to find the item. + * @return The item in case it is in the cache, null otherwise + */ private Item getItemFromCache(String itemGlobalId) { + //TBD get out of cache with global id - still needed? logger.info("getItemFrom Cache (String based)"); return itemCache.getItem(itemGlobalId); } + ! /** ! * @see org.cobricks.item.ItemManager#getItem(int) ! */ ! public final Item getItem(int itemLocalId) { Item res = this.getItemFromCache(itemLocalId); *************** *** 237,241 **** } ! public Item getItem(String itemid) { Item res = this.getItemFromCache(itemid); --- 294,301 ---- } ! /** ! * @see org.cobricks.item.ItemManager#getItem(java.lang.String) ! */ ! public final Item getItem(String itemid) { Item res = this.getItemFromCache(itemid); *************** *** 262,271 **** --- 322,344 ---- } + /** + * @see org.cobricks.item.ItemManager#addItemAnnotation(org.cobricks.item. + * Item, + * org.cobricks.item.ItemAnnotation) + */ public void addItemAnnotation(Item item, ItemAnnotation iann) { } + /** + * @see org.cobricks.item.ItemManager#addItemAttachment(org.cobricks.item. + * Item, + * org.cobricks.item.ItemAttachment) + */ public void addItemAttachment(Item item, ItemAttachment ia) { } + /** + * @see org.cobricks.item.ItemManager#createItem(java.util.Map) + */ public final Item createItem(Map attrs) { //I. Handle the two item ids *************** *** 350,354 **** public Item createItemFromXML(String xml) { ! HashMap attrs = this.extractFromXML(xml); return this.createItem(attrs); --- 423,427 ---- public Item createItemFromXML(String xml) { ! Map attrs = this.extractFromXML(xml); return this.createItem(attrs); *************** *** 1214,1218 **** * @return HashMap filled with extracted Objects from xml */ ! public HashMap extractFromXML(String xml) { logger.debug("extractFromXML"); --- 1287,1291 ---- * @return HashMap filled with extracted Objects from xml */ ! public Map extractFromXML(String xml) { logger.debug("extractFromXML"); Index: ItemManager.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/item/ItemManager.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ItemManager.java 29 Feb 2004 12:03:26 -0000 1.2 --- ItemManager.java 6 Mar 2004 21:35:04 -0000 1.3 *************** *** 1,30 **** ! /** ! * ! * @author mic...@ac... ! * @version $ $ ! * ! * Copyright (c) 2003 Michael Koch, mic...@ac... ! */ package org.cobricks.item; ! import java.util.*; import org.cobricks.core.ComponentManagerInterface; - import org.cobricks.core.util.LogUtil; - import org.cobricks.core.Ontology; - ! public interface ItemManager extends ComponentManagerInterface ! { ! public String getDefaultLanguage(); ! ! public Item getItem(int itemid); ! public Item createItem(Map attrs) ;// minimum: typeid, title_de, publisherid ! public Item createItem(Map attrs, String userid); // check access rights ! public Item getItem(String globalid); public Item getItem(String globalid, String userid); // check access rights public List searchItems(String xpath); //List of Items --- 1,73 ---- ! package org.cobricks.item; ! import java.util.Map; ! import java.util.List; import org.cobricks.core.ComponentManagerInterface; ! //import org.cobricks.core.Ontology; ! /** ! * ! * @author mic...@ac..., ma...@in... ! * @version $ $ ! * ! * Copyright (c) 2003 Michael Koch, mic...@ac... ! */ ! public interface ItemManager extends ComponentManagerInterface { ! /** ! * This method returns the default language; the default language is used in all ! * mutli language attributes if no language is specified. ! * @return An ISO 639-1 language identifier (two letters) of the default language ! * used. ! */ ! String getDefaultLanguage(); ! /** ! * This method is used to get an item out of the backend structure. ! * In case caching is activated, at first a lookup in the cache is performed. ! * If this succeeds, the item will be returned out of the cache. If it fails, ! * the item will be retrieved out of the persistent structure (data base). ! * @param itemid The local id of the item to get. ! * @return An instance of item in case it was found, the null pointer other ! * wise. ! */ + Item getItem(int itemid); + /** + * This method creates a new item object: At first the data is inserted into + * the persistent storage and then instantiated and (if activated) inserted + * into the cache and then returned. + * <i> Important: Because no user is supplied, anonymous will be used </i> + * In case some of the submitted attributes are not valid (according to the + * item ontology) this method tries at first to correct the attributes and if + * this fails, the still invalid attributes are discarded. + * If required attributes are missing, the item won't be created. + * @param attrs Map containing all attributes. All attributes must have the + * correct Java type (according to the item ontology). + * There are some attributes that get a special handling: The ids are + * discarded in the create method (reason: they have to be assigned by the + * system). Second, an attribute named itemclass is necessary to assign the + * correct item ontology class. If none is submitted, the default will be + * used: "item". + * Multi language attributes: The attribute name has to be aname_lang (lang + * as two letters, e.g. en). If the default language attribute value is set + * the _lang can be omitted. + * @return The item which was stored in the database, null if an error + * occurred. + */ + Item createItem(Map attrs); // minimum: typeid, title_de, publisherid + /** + * The same as getItem(int), but with additional user information - access + * right checking with given user id. + * @see ItemManager#getItem(int) + * @param attrs The attributes for the new item + * @param userid Needed to check access rights. + * @return newly instantiated item or null if an error occurs. + */ + Item createItem(Map attrs, String userid); // check access rights ! Item getItem(String globalid); public Item getItem(String globalid, String userid); // check access rights public List searchItems(String xpath); //List of Items *************** *** 52,57 **** public int getLocalIdForGlobalId(String globalid); // get HashMap of Objects from xml-input ! public HashMap extractFromXML(String xml); ! public Ontology getOntology(); /** --- 95,100 ---- public int getLocalIdForGlobalId(String globalid); // get HashMap of Objects from xml-input ! public Map extractFromXML(String xml); ! //public Ontology getOntology(); /** Index: ItemServlet.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/item/ItemServlet.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ItemServlet.java 2 Mar 2004 17:59:05 -0000 1.3 --- ItemServlet.java 6 Mar 2004 21:35:04 -0000 1.4 *************** *** 1,12 **** ! /** ! * ! * @author mic...@co... ! * @version $ $ ! * ! * Copyright (c) 2003 Michael Koch, mic...@co... ! */ package org.cobricks.item; ! import org.apache.log4j.*; import org.cobricks.core.ComponentDirectory; --- 1,6 ---- ! package org.cobricks.item; ! import org.apache.log4j.Logger; import org.cobricks.core.ComponentDirectory; *************** *** 16,45 **** import org.cobricks.portal.PortalUser; ! import java.io.*; ! ! import java.net.URL; ! ! import java.util.*; ! import javax.servlet.*; ! import javax.servlet.http.*; public class ItemServlet extends PortalServletAdaptor { ! static Logger logger = Logger.getLogger(ItemServlet.class); ! protected ItemManager itemManager; /** ! * */ ! public void performLogin(HttpServletRequest request, ! HttpServletResponse response, PrintWriter out, PortalUser user) { logger.info(">>>>>>>>perfomLogin()!!!!!"); } /** ! * */ ! public void init(ServletConfig config) throws ServletException { super.init(config); --- 10,72 ---- import org.cobricks.portal.PortalUser; ! import java.io.PrintWriter; ! import java.util.HashMap; ! import java.util.HashSet; ! import java.util.Iterator; ! import java.util.Map; ! import java.util.Set; + import javax.servlet.ServletConfig; + import javax.servlet.ServletException; + import javax.servlet.http.HttpServletRequest; + import javax.servlet.http.HttpServletResponse; + /** + * + * @author mic...@co..., ma...@in... + * @version $ $ + * + * Copyright (c) 2003 Michael Koch, mic...@co... + */ public class ItemServlet extends PortalServletAdaptor { ! /** ! * This array contains all regex which are not used (directly) for building ! * the ItemAttrsMap ! */ ! private static final String [] FILTERED_ATTRIBUTE_NAMES = { ! "cmd.*", "_.*", ".*_lang", "DD.MM.YY HH:MM", "itemid", "globalid" }; ! /** ! * standard logger ! */ ! private static Logger logger = Logger.getLogger(ItemServlet.class); ! /** ! * the item manager is needed for doing actions in the back end structure ! */ ! private ItemManager itemManager; /** ! * Performs a login TBD ! * @param request TBD ! * @param response TBD ! * @param out TBD ! * @param user TBD */ ! ! public final void performLogin(HttpServletRequest request, ! HttpServletResponse response, ! PrintWriter out, ! PortalUser user) { logger.info(">>>>>>>>perfomLogin()!!!!!"); } /** ! * Initializes the presenter: adding targets, initializing item manager ! * @param config Needed to run init method in PortalServletAdaptor ! * @throws ServletException Is thrown in case init method of ! * PortalServerletAdaptor throws this exception */ ! public final void init(ServletConfig config) throws ServletException { ! super.init(config); *************** *** 57,60 **** --- 84,102 ---- } } + /** + * This method performs item creation out of the request parameter. The + * request parameter must have a special format: + * if a custom itemclass is desired there must be a parameter itemclass + * with a correct item class name. + * All cmd.* are ignored. + * Multi-language attributes: parameter name1 = attribute name + * parameter value1 = attribute value; parameter name2 = attribute name + + * "_lang"; parameter value2=language + * @param prequest Portalrequest to gather the data to create a new item + * @param out Is not used. + * @return "error": In case there are errors, also a context object named + * errors is set (a Set of InputErrors). "success" If everything is o.k., + * a context object named "createdItem" is set (Item object). + */ public final String performCreateItem(PortalRequest prequest, *************** *** 66,69 **** --- 108,112 ---- prequest.setContextObject("errors", attrs.get("errors")); out.write(attrs.get("errors").toString()); + // Set the itemclass in the velocity context, //because the select itemclass is an extra form and is overwritten *************** *** 90,93 **** --- 133,137 ---- } } + /** * This method performs a standard update. It does <b>no</b> handling of *************** *** 95,98 **** --- 139,149 ---- * task, this handling is completely done by the front end structure (item * presenter / templates). It only detects changes of item classes. + * The request parameter must have a special format: + * If a custom itemclass is desired there must be a parameter itemclass + * with a correct item class name. + * All cmd.* are ignored. + * Multi-language attributes: parameter name1 = attribute name + * parameter value1 = attribute value; parameter name2 = attribute name + + * "_lang"; parameter value2=language * @param prequest The portal request this call comes from. * @param out Not needed. *************** *** 100,119 **** * there were illegal attributes, success if everything was o.k. */ - public final String performUpdate(PortalRequest prequest, PrintWriter out) { //Object itemObject = prequest.getVelocityContext().get("item"); String itemid = prequest.getRequestParameter("itemid"); Item item = null; try { item = itemManager.getItem(Integer.parseInt(itemid)); } catch (Exception e) { - //TBD out.write("Fatal: Could'nt find item to update."); ! return null; } - if (item !=null) { //This object must not be null /invalid - //Item item = (Item) itemObject; ! if (item.getItemClass().equals(prequest.getRequestParameter( "itemclass"))) { // There was no change in the item class, go ahead with updating --- 151,180 ---- * there were illegal attributes, success if everything was o.k. */ public final String performUpdate(PortalRequest prequest, PrintWriter out) { //Object itemObject = prequest.getVelocityContext().get("item"); String itemid = prequest.getRequestParameter("itemid"); Item item = null; + try { item = itemManager.getItem(Integer.parseInt(itemid)); } catch (Exception e) { out.write("Fatal: Could'nt find item to update."); ! Set errors = new HashSet(); ! errors.add(new InputError("INTERNAL_PRESENTER_ERROR")); ! prequest.setContextObject("errors", errors); ! return "error"; } ! if (item != null) { //This object must not be null /invalid ! logger.debug("old:" + item.getItemClass() + "new:" + ! prequest.getRequestParameter("itemclass")); ! String previousItemClassName = ! prequest.getRequestParameter("_previousitemclass"); ! if (previousItemClassName == null ! || previousItemClassName.length() == 0) { ! previousItemClassName = item.getItemClass(); ! } ! //Item item = (Item) itemObject; ! if (previousItemClassName.equals(prequest.getRequestParameter( "itemclass"))) { // There was no change in the item class, go ahead with updating *************** *** 129,132 **** --- 190,195 ---- } else { item.setFromMap(changedAttrs); + item.setItemClass( + prequest.getRequestParameter("itemclassname")); itemManager.updateItem(item); *************** *** 134,139 **** --- 197,204 ---- } } else { // There was a change in itemclass --> this has to be managed + //by the item presenter / frontend before. prequest.setContextObject("oldItemClass", item.getItemClass()); + return "changedItemClass"; } *************** *** 142,145 **... [truncated message content] |