[ http://jira.dspace.org/jira/browse/DS-260?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=10446#action_10446 ]
Claudia Jürgen commented on DS-260: ----------------------------------- I wonder whether a template item in general should have an owning collection. It is not a real item. imo templates should be (re)usable for several collections. So rather than per default create a new one while creating a new collection with prefilled metadata, one should have the option to select from the existing templates. This would ease the administrative work. > Template item some times has owningCollection filled and some times not > ----------------------------------------------------------------------- > > Key: DS-260 > URL: http://jira.dspace.org/jira/browse/DS-260 > Project: DSpace 1.x > Issue Type: Bug > Components: DSpace API, JSPUI, XMLUI > Affects Versions: 1.5.0, 1.5.1, 1.5.2 > Reporter: Andrea Bollini > Priority: Critical > > A template item is created by the Collection API > (Collection.createTemplateItem()) without keep the collection id in his > owning collection field/db column... > If you create the template item from the xmlui you will get the same > behaviour (only the api is used) > if you create the template item from the jspui you will get two differents > behavior: > - during the collection creation (the wizard) only the collection api is used > so no collection id is stored in the owning collection field/db column > - from an already created collection (the EditCommunityCollection servlet) > the collection is explicity setted as owining collection of the template item > else if (button.equals("submit_create_template")) > { > // Create a template item > collection.createTemplateItem(); > // Forward to edit page for new template item > Item i = collection.getTemplateItem(); > i.setOwningCollection(collection); > // have to update to avoid ref. integrity error > i.update(); > collection.update(); > context.complete(); > response.sendRedirect(response.encodeRedirectURL(request > .getContextPath() > + "/tools/edit-item?item_id=" + i.getID())); > return; > } > So we could have a db that is not full consistently, we need to choose one of > the two behaviour and uniform him through all the app (a sql script to > update/fix will be required). > Option 1) keep the actual collection api and clean the jspui > EditCommunityCollection servlet > Option 2) add to the current collection api the responsability to set the > owning collection > The option 2 will give us a little performance gain on the "community admin" > check because we will be not longer need to use a different query for > discover template item > see AuthorizeManager.isAdmin(Contex, DSpaceObject) > case Constants.ITEM: > { > Item item = (Item) o; > Collection ownCollection = > item.getOwningCollection(); > if (ownCollection != null) > { > return isAdmin(c,ownCollection); > } > else > { > // is a template item? > TableRow qResult = > DatabaseManager.querySingle(c, > "SELECT collection_id > FROM collection " + > "WHERE template_item_id > = ?",o.getID()); > if (qResult != null) > { > Collection collection = > Collection.find(c,qResult.getIntColumn("collection_id")); > return isAdmin(c,collection); > } > return false; > } > } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.dspace.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Dspace-devel mailing list Dspace-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-devel