* Returns a ArrayList of Integer-Objects from a content-id.
* @returns ArrayList
*/
- public ArrayList getTopicsOfContent(String contentId) {
+ public ArrayList getTopicsOfContent(String contentId)
+ throws StorageObjectException {
ArrayList returnList = new ArrayList();
if (contentId != null) {
String sql = "select topic_id from " + theTable + " where content_id=" + contentId;
/**
* Set new topics
*/
- public void setTopics(String contentId, String[] topicId) {
+ public void setTopics(String contentId, String[] topicId)
+ throws StorageObjectException {
if (contentId == null){
return;
}
return;
}
//first check which topics this article has
- ArrayList hasTopics = getTopicsOfContent(contentId);
- ArrayList toSet = new ArrayList();
- ArrayList toDelete = new ArrayList();
+ Collection hasTopics = getTopicsOfContent(contentId);
+ Collection toSet = new ArrayList();
+ Collection toDelete = new ArrayList();
if(hasTopics!=null && hasTopics.size()>0){
//now we check if there are new topics and copy them to an array.
}
} else {
//all the topics has to be set, so we copy all to the array
- toSet=(ArrayList)Arrays.asList(topicId);
+ for (int i = 0; i < topicId.length; i++){
+ toSet.add(topicId[i]);
+ }
}
//first delete all row with content_id=contentId
}
}
- public void deleteByContentId(String contentId) {
+ public void deleteByContentId(String contentId)
+ throws StorageObjectException {
if (contentId == null) {
//theLog.printDebugInfo("-- delete topics failed -- no content id");
return;
}
}
- public void deleteByTopicId(String topicId) {
+ public void deleteByTopicId(String topicId)
+ throws StorageObjectException {
if (topicId == null) {
//theLog.printDebugInfo("-- delete topics failed -- no topic id");
return;
}
- public EntityList getContent(EntityTopics topic) {
+ public EntityList getContent(EntityTopics topic)
+ throws StorageObjectException {
EntityList returnList=null;
if (topic != null) {
String id = topic.getId();