Commit e4a9ea51 authored by Peter Harrison's avatar Peter Harrison Committed by GitHub

Merge pull request #53 from cheetah100/development

Pulling latest changes into Master
parents ec60a707 d003ce0d
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<groupId>nz.net.gravity</groupId> <groupId>nz.net.gravity</groupId>
<artifactId>gravity</artifactId> <artifactId>gravity</artifactId>
<packaging>war</packaging> <packaging>war</packaging>
<version>3.0.1-SNAPSHOT</version> <version>3.0.2-SNAPSHOT</version>
<name>Gravity Workflow Automation</name> <name>Gravity Workflow Automation</name>
<properties> <properties>
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
<java.version>1.6</java.version> <java.version>1.6</java.version>
<junit.version>4.8.2</junit.version> <junit.version>4.8.2</junit.version>
<jackson.version>1.9.10</jackson.version> <jackson.version>1.9.10</jackson.version>
<camel.version>2.17.2</camel.version>
</properties> </properties>
<licenses> <licenses>
...@@ -60,17 +61,17 @@ ...@@ -60,17 +61,17 @@
<dependency> <dependency>
<groupId>javax.validation</groupId> <groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId> <artifactId>validation-api</artifactId>
<version>1.0.0.GA</version> <version>1.1.0.Final</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.hibernate</groupId> <groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId> <artifactId>hibernate-validator</artifactId>
<version>4.0.0.GA</version> <version>5.2.4.Final</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<!-- Spring Dependencies --> <!-- Spring Dependencies -->
<dependency> <dependency>
...@@ -343,7 +344,6 @@ ...@@ -343,7 +344,6 @@
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.freemarker</groupId> <groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId> <artifactId>freemarker</artifactId>
...@@ -398,6 +398,20 @@ ...@@ -398,6 +398,20 @@
<artifactId>sjsxp</artifactId> <artifactId>sjsxp</artifactId>
<version>1.0.1</version> <version>1.0.1</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/org.apache.camel/camel-core -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>${camel.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.camel/camel-spring -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring</artifactId>
<version>${camel.version}</version>
</dependency>
</dependencies> </dependencies>
......
/** /**
* GRAVITY WORKFLOW AUTOMATION * GRAVITY WORKFLOW AUTOMATION
* (C) Copyright 2015 Orcon Limited * (C) Copyright 2015 Orcon Limited
* (C) Copyright 2016 Peter Harrison
* *
* This file is part of Gravity Workflow Automation. * This file is part of Gravity Workflow Automation.
* *
...@@ -57,7 +58,7 @@ public class CacheManager implements MessageListener, CacheInvalidationInterface ...@@ -57,7 +58,7 @@ public class CacheManager implements MessageListener, CacheInvalidationInterface
CacheInvalidationInstruction instruction = (CacheInvalidationInstruction) objectMessage.getObject(); CacheInvalidationInstruction instruction = (CacheInvalidationInstruction) objectMessage.getObject();
if( logger.isDebugEnabled()){ if( logger.isDebugEnabled()){
logger.debug( "Cache Invalidation Instruction: " logger.debug( "Cache Invalidation Instruction Received: "
+ instruction.getCacheType() + " " + instruction.getId()); + instruction.getCacheType() + " " + instruction.getId());
} }
...@@ -78,6 +79,9 @@ public class CacheManager implements MessageListener, CacheInvalidationInterface ...@@ -78,6 +79,9 @@ public class CacheManager implements MessageListener, CacheInvalidationInterface
CacheInvalidationInstruction instruction = CacheInvalidationInstruction instruction =
new CacheInvalidationInstruction(type,id); new CacheInvalidationInstruction(type,id);
this.jmsTemplate.convertAndSend(instruction); this.jmsTemplate.convertAndSend(instruction);
if( logger.isDebugEnabled()){
logger.debug("Invalidation Message Sent to Queue: " + type + " - " + id);
}
} }
public void setTimerManager(TimerManager timerManager) { public void setTimerManager(TimerManager timerManager) {
......
...@@ -47,6 +47,7 @@ import nz.net.orcon.kanban.tools.IdentifierTools; ...@@ -47,6 +47,7 @@ import nz.net.orcon.kanban.tools.IdentifierTools;
import nz.net.orcon.kanban.tools.ListTools; import nz.net.orcon.kanban.tools.ListTools;
import nz.net.orcon.kanban.tools.OcmMapperFactory; import nz.net.orcon.kanban.tools.OcmMapperFactory;
import org.apache.commons.lang3.StringUtils;
import org.apache.jackrabbit.ocm.manager.ObjectContentManager; import org.apache.jackrabbit.ocm.manager.ObjectContentManager;
import org.apache.jackrabbit.ocm.query.Query; import org.apache.jackrabbit.ocm.query.Query;
import org.apache.jackrabbit.ocm.query.QueryManager; import org.apache.jackrabbit.ocm.query.QueryManager;
...@@ -62,8 +63,6 @@ import org.springframework.web.bind.annotation.RequestMethod; ...@@ -62,8 +63,6 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import com.amazonaws.util.StringUtils;
/** /**
* *
*/ */
...@@ -284,15 +283,12 @@ public class BoardController { ...@@ -284,15 +283,12 @@ public class BoardController {
@RequestMapping(value = "/{boardId}", method=RequestMethod.DELETE) @RequestMapping(value = "/{boardId}", method=RequestMethod.DELETE)
public @ResponseBody void deleteBoard(@PathVariable String boardId) throws Exception { public @ResponseBody void deleteBoard(@PathVariable String boardId) throws Exception {
throw new Exception("Method Unavailable!"); if( StringUtils.isEmpty(boardId)){
/*
if( StringUtils.isBlank(boardId)){
return; return;
} }
ObjectContentManager ocm = ocmFactory.getOcm(); ObjectContentManager ocm = ocmFactory.getOcm();
Node node = ocm.getSession().getNode(String.format(boardUri, boardId)); Node node = ocm.getSession().getNode(String.format(URI.BOARD_URI, boardId));
if(node==null){ if(node==null){
ocm.logout(); ocm.logout();
...@@ -302,8 +298,7 @@ public class BoardController { ...@@ -302,8 +298,7 @@ public class BoardController {
node.remove(); node.remove();
ocm.save(); ocm.save();
ocm.logout(); ocm.logout();
this.cacheInvalidationManager.invalidate(CacheType.BOARD, boardId); this.cacheInvalidationManager.invalidate(BOARD, boardId);
*/
} }
...@@ -409,11 +404,11 @@ public class BoardController { ...@@ -409,11 +404,11 @@ public class BoardController {
detailFilter = "(jcr:contains(@detail,'${detail}'))".replaceAll("\\$\\{detail\\}", detail); detailFilter = "(jcr:contains(@detail,'${detail}'))".replaceAll("\\$\\{detail\\}", detail);
} }
if( !StringUtils.isNullOrEmpty(categoryFilter) && !StringUtils.isNullOrEmpty(detailFilter)){ if( !StringUtils.isEmpty(categoryFilter) && !StringUtils.isEmpty(detailFilter)){
qmFilter.addJCRExpression( categoryFilter + " or " + detailFilter); qmFilter.addJCRExpression( categoryFilter + " or " + detailFilter);
} else if ( !StringUtils.isNullOrEmpty(categoryFilter) && StringUtils.isNullOrEmpty(detailFilter)) { } else if ( !StringUtils.isEmpty(categoryFilter) && StringUtils.isEmpty(detailFilter)) {
qmFilter.addJCRExpression( categoryFilter ); qmFilter.addJCRExpression( categoryFilter );
} else if (StringUtils.isNullOrEmpty(categoryFilter) && !StringUtils.isNullOrEmpty(detailFilter)) { } else if (StringUtils.isEmpty(categoryFilter) && !StringUtils.isEmpty(detailFilter)) {
qmFilter.addJCRExpression( detailFilter ); qmFilter.addJCRExpression( detailFilter );
} }
...@@ -468,8 +463,8 @@ public class BoardController { ...@@ -468,8 +463,8 @@ public class BoardController {
detailFilter = "(jcr:contains(@detail,'${detail}'))".replaceAll("\\$\\{detail\\}", detail); detailFilter = "(jcr:contains(@detail,'${detail}'))".replaceAll("\\$\\{detail\\}", detail);
} }
boolean categoryPresent = !StringUtils.isNullOrEmpty(categoryFilter); boolean categoryPresent = !StringUtils.isEmpty(categoryFilter);
boolean detailPresent = !StringUtils.isNullOrEmpty(detailFilter); boolean detailPresent = !StringUtils.isEmpty(detailFilter);
if(categoryPresent && detailPresent){ if(categoryPresent && detailPresent){
qmFilter.addJCRExpression( categoryFilter + " or " + detailFilter); qmFilter.addJCRExpression( categoryFilter + " or " + detailFilter);
......
...@@ -26,9 +26,15 @@ import java.util.HashMap; ...@@ -26,9 +26,15 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
abstract public class CacheImpl<T> implements Cache<T> { abstract public class CacheImpl<T> implements Cache<T> {
private static final Logger logger = LoggerFactory.getLogger(CacheImpl.class);
private static String DEFAULT_LIST_NAME = "default";
private Map<String, T> cacheMap = new ConcurrentHashMap<String,T>(); private Map<String, T> cacheMap = new ConcurrentHashMap<String,T>();
...@@ -44,7 +50,18 @@ abstract public class CacheImpl<T> implements Cache<T> { ...@@ -44,7 +50,18 @@ abstract public class CacheImpl<T> implements Cache<T> {
for( int a=0; a<itemIds.length-1; a++){ for( int a=0; a<itemIds.length-1; a++){
listId[a] = itemIds[a]; listId[a] = itemIds[a];
} }
this.cacheList.remove(getCacheId(listId)); String cacheListId = getCacheId(listId);
this.cacheList.remove(cacheListId);
if(logger.isDebugEnabled()){
logger.debug("Clearing List: " + cacheListId);
}
} else if(itemIds.length==1){
this.cacheList.remove(DEFAULT_LIST_NAME);
if(logger.isDebugEnabled()){
logger.debug("Clearing Root List: " + itemIds[0]);
}
} }
} }
...@@ -68,7 +85,7 @@ abstract public class CacheImpl<T> implements Cache<T> { ...@@ -68,7 +85,7 @@ abstract public class CacheImpl<T> implements Cache<T> {
} }
public Map<String,String> list(String... prefixs) throws Exception{ public Map<String,String> list(String... prefixs) throws Exception{
String cacheId = "default"; String cacheId = DEFAULT_LIST_NAME;
if(prefixs.length>0){ if(prefixs.length>0){
cacheId = this.getCacheId(prefixs); cacheId = this.getCacheId(prefixs);
} }
...@@ -83,20 +100,6 @@ abstract public class CacheImpl<T> implements Cache<T> { ...@@ -83,20 +100,6 @@ abstract public class CacheImpl<T> implements Cache<T> {
} }
return new HashMap<String,String>(this.cacheList.get(cacheId)); return new HashMap<String,String>(this.cacheList.get(cacheId));
/*
if( this.cacheList == null){
if( prefixs.length>0){
cacheId = this.getCacheId(prefixs);
Map<String,String> list = this.getListFromStore(prefixs);
this.cacheList.put(cacheId, list);
} else {
Map<String,String> list = this.getListFromStore("");
this.cacheList.put(cacheId, list);
}
}
return new HashMap<String,String>(this.cacheList.get(cacheId));
*/
} }
@Override @Override
......
...@@ -22,7 +22,9 @@ ...@@ -22,7 +22,9 @@
package nz.net.orcon.kanban.controllers; package nz.net.orcon.kanban.controllers;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
...@@ -30,7 +32,9 @@ import javax.annotation.Resource; ...@@ -30,7 +32,9 @@ import javax.annotation.Resource;
import javax.jcr.Node; import javax.jcr.Node;
import nz.net.orcon.kanban.automation.CacheInvalidationInterface; import nz.net.orcon.kanban.automation.CacheInvalidationInterface;
import nz.net.orcon.kanban.model.Card;
import nz.net.orcon.kanban.model.ListResource; import nz.net.orcon.kanban.model.ListResource;
import nz.net.orcon.kanban.model.ListResourceType;
import nz.net.orcon.kanban.model.Option; import nz.net.orcon.kanban.model.Option;
import nz.net.orcon.kanban.tools.IdentifierTools; import nz.net.orcon.kanban.tools.IdentifierTools;
import nz.net.orcon.kanban.tools.ListTools; import nz.net.orcon.kanban.tools.ListTools;
...@@ -68,6 +72,12 @@ public class ListController { ...@@ -68,6 +72,12 @@ public class ListController {
@Autowired @Autowired
ListTools listTools; ListTools listTools;
@Autowired
PhaseController phaseController;
@Autowired
CardController cardController;
@PreAuthorize("hasPermission(#boardId, 'BOARD', 'ADMIN')") @PreAuthorize("hasPermission(#boardId, 'BOARD', 'ADMIN')")
@RequestMapping(value = "", method=RequestMethod.POST) @RequestMapping(value = "", method=RequestMethod.POST)
...@@ -90,13 +100,50 @@ public class ListController { ...@@ -90,13 +100,50 @@ public class ListController {
return list; return list;
} }
/**
* Get List.
* There are two sources for a list:
* - A List within the Board itself, used for small lists.
* - A List generated out of another Board.
*
* @param boardId
* @param listId
* @return
* @throws Exception
*/
@PreAuthorize("hasPermission(#boardId, 'BOARD', 'READ,WRITE,ADMIN')") @PreAuthorize("hasPermission(#boardId, 'BOARD', 'READ,WRITE,ADMIN')")
@RequestMapping(value = "/{listId}", method=RequestMethod.GET) @RequestMapping(value = "/{listId}", method=RequestMethod.GET)
public @ResponseBody ListResource getList( public @ResponseBody ListResource getList(
@PathVariable String boardId, @PathVariable String boardId,
@PathVariable String listId) throws Exception { @PathVariable String listId) throws Exception {
return listCache.getItem(boardId, IdentifierTools.getIdFromName(listId)); String lid = IdentifierTools.getIdFromName(listId);
ListResource item = listCache.getItem(boardId, lid);
if( item.getListResourceType()==null || item.getListResourceType().equals(ListResourceType.INTERNAL)){
return item;
} else {
Map<String, String> cardList = cardController.getCardList(item.getBoard(), item.getPhase(), item.getFilter());
List<String> newList = new ArrayList<String>();
newList.addAll(cardList.keySet());
List<Card> cards = phaseController.getCards(item.getBoard(), item.getPhase(), item.getView(), newList);
Map<String,Option> optionList = new HashMap<String,Option>();
for( Card card : cards){
Option option = new Option();
option.setId(item.getBoard() + "-" + card.getId().toString());
option.setName( (String)card.getFields().get(item.getNameField()));
Map<String,String> newAttrs = new HashMap<String,String>();
Map<String, Object> fields = card.getFields();
for( Entry<String,Object> attr : fields.entrySet()){
newAttrs.put(attr.getKey(), attr.getValue().toString());
}
option.setAttributes(newAttrs);
optionList.put(option.getId(), option);
}
item.setItems(optionList);
return item;
}
} }
public String getValue( public String getValue(
......
...@@ -62,9 +62,11 @@ public class TeamCache extends CacheImpl<Team> { ...@@ -62,9 +62,11 @@ public class TeamCache extends CacheImpl<Team> {
@Override @Override
protected Map<String, String> getListFromStore(String... prefixs) throws Exception { protected Map<String, String> getListFromStore(String... prefixs) throws Exception {
String pre = Integer.toString(prefixs.length) + " - "; StringBuffer pre = new StringBuffer();
pre.append(Integer.toString(prefixs.length) + " - ");
for( int x=0; x < prefixs.length; x++){ for( int x=0; x < prefixs.length; x++){
pre = pre + prefixs[x] + ", "; pre.append(prefixs[x]);
pre.append(", ");
} }
logger.info("Prefixs: " + pre); logger.info("Prefixs: " + pre);
......
...@@ -95,7 +95,7 @@ public class TeamController { ...@@ -95,7 +95,7 @@ public class TeamController {
return team; return team;
} }
@PreAuthorize("hasPermission(#teamId, 'TEAM', 'READ,WRITE,ADMIN')") //@PreAuthorize("hasPermission(#teamId, 'TEAM', 'READ,WRITE,ADMIN')")
@RequestMapping(value = "/{teamId}", method=RequestMethod.GET) @RequestMapping(value = "/{teamId}", method=RequestMethod.GET)
public @ResponseBody Team getTeam(@PathVariable String teamId) throws Exception { public @ResponseBody Team getTeam(@PathVariable String teamId) throws Exception {
return teamCache.getItem(teamId); return teamCache.getItem(teamId);
......
...@@ -39,6 +39,7 @@ import org.apache.jackrabbit.ocm.manager.ObjectContentManager; ...@@ -39,6 +39,7 @@ import org.apache.jackrabbit.ocm.manager.ObjectContentManager;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
...@@ -62,6 +63,7 @@ public class UserController { ...@@ -62,6 +63,7 @@ public class UserController {
@Resource(name="ocmFactory") @Resource(name="ocmFactory")
OcmMapperFactory ocmFactory; OcmMapperFactory ocmFactory;
@PreAuthorize("hasPermission('admin', 'TEAM', 'ADMIN')")
@RequestMapping(value = "", method=RequestMethod.POST) @RequestMapping(value = "", method=RequestMethod.POST)
public @ResponseBody User createUser(@RequestBody User user) throws Exception { public @ResponseBody User createUser(@RequestBody User user) throws Exception {
if( user.getPath()!=null ){ if( user.getPath()!=null ){
...@@ -115,6 +117,7 @@ public class UserController { ...@@ -115,6 +117,7 @@ public class UserController {
return taskList; return taskList;
} }
@PreAuthorize("hasPermission('admin', 'TEAM', 'ADMIN')")
@RequestMapping(value = "/{userId}", method=RequestMethod.DELETE) @RequestMapping(value = "/{userId}", method=RequestMethod.DELETE)
public @ResponseBody void deleteUser(@PathVariable String userId) throws Exception { public @ResponseBody void deleteUser(@PathVariable String userId) throws Exception {
Session session = ocmFactory.getOcm().getSession(); Session session = ocmFactory.getOcm().getSession();
......
/** /**
* GRAVITY WORKFLOW AUTOMATION * GRAVITY WORKFLOW AUTOMATION
* (C) Copyright 2015 Orcon Limited * (C) Copyright 2015 Orcon Limited
* (C) Copyright 2016 Peter Harrison
* *
* This file is part of Gravity Workflow Automation. * This file is part of Gravity Workflow Automation.
* *
...@@ -24,17 +25,78 @@ package nz.net.orcon.kanban.model; ...@@ -24,17 +25,78 @@ package nz.net.orcon.kanban.model;
import java.io.Serializable; import java.io.Serializable;
import java.util.Map; import java.util.Map;
import org.apache.jackrabbit.ocm.manager.enumconverter.EnumTypeConverter;
import org.apache.jackrabbit.ocm.mapper.impl.annotation.Collection; import org.apache.jackrabbit.ocm.mapper.impl.annotation.Collection;
import org.apache.jackrabbit.ocm.mapper.impl.annotation.Node; import org.apache.jackrabbit.ocm.mapper.impl.annotation.Node;
import org.apache.jackrabbit.ocm.mapper.impl.annotation.Field;
@Node @Node
public class ListResource extends AbstractNamedModelClass implements Serializable{ public class ListResource extends AbstractNamedModelClass implements Serializable{
private static final long serialVersionUID = -1199910314402814094L; private static final long serialVersionUID = -1199910314402814094L;
@Field(converter=EnumTypeConverter.class)
private ListResourceType listResourceType;
@Field
private String board;
@Field
private String phase;
@Field
private String view;
@Field
private String filter;
@Field
private String nameField;
@Collection(jcrMandatory=false) @Collection(jcrMandatory=false)
private Map<String, Option> items; private Map<String, Option> items;
public ListResourceType getListResourceType() {
return listResourceType;
}
public void setListResourceType(ListResourceType listResourceType) {
this.listResourceType = listResourceType;
}
public String getBoard() {
return board;
}
public void setBoard(String board) {
this.board = board;
}
public String getPhase() {
return phase;
}
public void setPhase(String phase) {
this.phase = phase;
}
public String getView() {
return view;
}
public void setView(String view) {
this.view = view;
}
public String getFilter() {
return filter;
}
public void setFilter(String filter) {
this.filter = filter;
}
public void setItems(Map<String, Option> items) { public void setItems(Map<String, Option> items) {
this.items = items; this.items = items;
} }
...@@ -43,4 +105,12 @@ public class ListResource extends AbstractNamedModelClass implements Serializabl ...@@ -43,4 +105,12 @@ public class ListResource extends AbstractNamedModelClass implements Serializabl
return items; return items;
} }
public String getNameField() {
return nameField;
}
public void setNameField(String nameField) {
this.nameField = nameField;
}
} }
/**
* GRAVITY WORKFLOW AUTOMATION
* (C) Copyright 2016 Peter Harrison
*
* This file is part of Gravity Workflow Automation.
*
* Gravity Workflow Automation is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* Gravity Workflow Automation is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Gravity Workflow Automation.
* If not, see <http://www.gnu.org/licenses/>.
*/
package nz.net.orcon.kanban.model;
public enum ListResourceType {
INTERNAL,
BOARD;
}
...@@ -66,9 +66,8 @@ public class TemplateGroup extends AbstractNamedModelClass implements Serializab ...@@ -66,9 +66,8 @@ public class TemplateGroup extends AbstractNamedModelClass implements Serializab
sorted.put(entry.getValue().getIndex(), entry.getValue()); sorted.put(entry.getValue().getIndex(), entry.getValue());
} }
this.fields = new LinkedHashMap<String,TemplateField>(); this.fields = new LinkedHashMap<String,TemplateField>();
for( Integer key: sorted.keySet()){ for( Entry<Integer,TemplateField> entry: sorted.entrySet()){
TemplateField field = sorted.get(key); this.fields.put(entry.getValue().getId(), entry.getValue());
this.fields.put(field.getId(), field);
} }
} }
......
...@@ -174,16 +174,16 @@ public class CardConverter implements Converter{ ...@@ -174,16 +174,16 @@ public class CardConverter implements Converter{
} }
card.setFields(map); card.setFields(map);
if("tasks".equalsIgnoreCase(reader.getNodeName())){ if("tasks".equalsIgnoreCase(reader.getNodeName())){
card.setTasks(new Long(reader.getValue())); card.setTasks(Long.valueOf(reader.getValue()));
} }
if("history".equalsIgnoreCase(reader.getNodeName())){ if("history".equalsIgnoreCase(reader.getNodeName())){
card.setHistory(new Long(reader.getValue())); card.setHistory(Long.valueOf(reader.getValue()));
} }
if("comments".equalsIgnoreCase(reader.getNodeName())){ if("comments".equalsIgnoreCase(reader.getNodeName())){
card.setComments(new Long(reader.getValue())); card.setComments(Long.valueOf(reader.getValue()));
}