From: <ssk...@re...> - 2005-01-24 09:15:03
|
Author: sskracic Date: 2005-01-24 10:04:52 +0100 (Mon, 24 Jan 2005) New Revision: 185 Modified: ccm-cms/trunk/src/com/arsdigita/cms/ui/item/Summary.java Log: Fixing the NPE in the Summary pane. This cures the syndrome only, while the real cause must still be investigated. Modified: ccm-cms/trunk/src/com/arsdigita/cms/ui/item/Summary.java =================================================================== --- ccm-cms/trunk/src/com/arsdigita/cms/ui/item/Summary.java 2005-01-20 09:48:10 UTC (rev 184) +++ ccm-cms/trunk/src/com/arsdigita/cms/ui/item/Summary.java 2005-01-24 09:04:52 UTC (rev 185) @@ -118,7 +118,7 @@ // ITEM Element itemElement = new Element("cms:itemSummary",CMS.CMS_XML_NS); itemElement.addAttribute("name",item.getName()); - + String objectType = item.getObjectType().getName(); String descriptionAttribute = ""; if ( objectType.equals("NewsItem") || objectType.equals("Article") ) { @@ -130,7 +130,7 @@ } else if ( objectType.equals("MultiPartArticle") || objectType.equals("Agenda") || objectType.equals("PressRelease") || objectType.equals("Service") ) { descriptionAttribute = "summary"; } - + if ( !descriptionAttribute.equals("") ) { itemElement.addAttribute("description",(String)DomainServiceInterfaceExposer.get(item,descriptionAttribute)); } @@ -202,7 +202,7 @@ g.addEdge(t, dep, null); buffer.append(dep.getLabel() + ", "); } - + final int len = buffer.length(); if (len >= 2) { buffer.setLength(len - 2); @@ -211,7 +211,7 @@ } deps.close(); } - + List taskList = new ArrayList(); outer: while (g.nodeCount() > 0) { @@ -226,7 +226,7 @@ break; } Iterator tasks = taskList.iterator(); - + while (tasks.hasNext()) { Task task = (Task)tasks.next(); Element taskElement = new Element("cms:task",CMS.CMS_XML_NS); @@ -367,13 +367,13 @@ Iterator i = engine.getEnabledTasks(user, w.getID()).iterator(); if (i.hasNext()) { CMSTask task = (CMSTask) i.next(); - + if ( !task.isLocked() ) { task.lock(user); } } } - + String redirectURL = Web.getConfig().getDispatcherServletPath() + item.getContentSection().getPath() + "/admin/item.jsp?item_id=" + item.getID() + "&set_tab=1"; throw new RedirectSignal(redirectURL,true); } else { @@ -391,6 +391,8 @@ canBeExtended = false; } else if ( !workflow.isFinished() ) { canBeExtended = false; + } else if ( workflow.getWorkflowTemplate() == null ) { + canBeExtended = false; } else { TaskCollection templates = item.getContentSection().getWorkflowTemplates(); Filter f = templates.addInSubqueryFilter @@ -404,7 +406,7 @@ canBeExtended = false; } templates.close(); - + } return canBeExtended; |