public void removeItemTagByTagId(String tagId) { final Set itemTagSet = getItemTagSet(); if ( itemTagSet == null || itemTagSet.isEmpty() ) { return; } itemTagSet.removeIf(itemTag -> tagId.equals(((ItemTagIfc)itemTag).getTagId())); this.itemTagSet = getItemTagSet(); }
public void addItemTag(String tagId, String tagLabel, String tagCollectionId, String tagCollectionName) { if (getItemTagSet() == null) { setItemTagSet(new HashSet()); } getItemTagSet().add(new ItemTag(this.data, tagId, tagLabel, tagCollectionId, tagCollectionName)); this.itemTextSet = getItemTagSet(); }
public void removeItemTagByTagId(String tagId) { final Set itemTagSet = getItemTagSet(); if ( itemTagSet == null || itemTagSet.isEmpty() ) { return; } itemTagSet.removeIf(itemTag -> tagId.equals(((ItemTagIfc)itemTag).getTagId())); this.itemTagSet = getItemTagSet(); }
public void addItemTag(String tagId, String tagLabel, String tagCollectionId, String tagCollectionName) { if (getItemTagSet() == null) { setItemTagSet(new HashSet()); } getItemTagSet().add(new ItemTag(this.data, tagId, tagLabel, tagCollectionId, tagCollectionName)); this.itemTextSet = getItemTagSet(); }
public List<String> tags(ItemFacade item){ List<String> tags = new ArrayList<>(); Set itemTagSet = item.getItemTagSet(); Iterator iterator = itemTagSet.iterator(); while(iterator.hasNext()){ ItemTag tag = (ItemTag)iterator.next(); if (!(tags.contains(tag.getTagLabel()))){ tags.add(tag.getTagLabel()+ "(" + tag.getTagCollectionName() + ")"); } } return tags; }
public List<String> tags(ItemFacade item){ List<String> tags = new ArrayList<>(); Set itemTagSet = item.getItemTagSet(); Iterator iterator = itemTagSet.iterator(); while(iterator.hasNext()){ ItemTag tag = (ItemTag)iterator.next(); if (!(tags.contains(tag.getTagLabel()))){ tags.add(tag.getTagLabel()+ "(" + tag.getTagCollectionName() + ")"); } } return tags; }
Set<ItemTagIfc> itemTagIfcSet = itemOrigin.getItemTagSet(); Map itemsToUpdate = itemService.getItemsByHash(itemOrigin.getHash()); Iterator itemsIterator = itemsToUpdate.values().iterator(); itemTagIfcSetOriginal.addAll(itemHashed.getItemTagSet()); Iterator originIterator = itemTagIfcSetOriginal.iterator(); while (originIterator.hasNext()) {
Set<ItemTagIfc> itemTagIfcSet = itemOrigin.getItemTagSet(); Map itemsToUpdate = itemService.getItemsByHash(itemOrigin.getHash()); Iterator itemsIterator = itemsToUpdate.values().iterator(); itemTagIfcSetOriginal.addAll(itemHashed.getItemTagSet()); Iterator originIterator = itemTagIfcSetOriginal.iterator(); while (originIterator.hasNext()) {
/** * This is a very important constructor. Please make sure that you have * set all the properties (declared above as private) of ItemFacade using * the "data" supplied. "data" is a org.osid.assessment.Item properties * and I use it to store info about an item. * @param data */ public ItemFacade(ItemDataIfc data){ this.data = data; ItemImpl itemImpl = new ItemImpl(); // place holder item = (Item)itemImpl; try { item.updateData(this.data); } catch (AssessmentException ex) { throw new DataFacadeException(ex.getMessage()); } this.id = getId(); this.description = getDescription(); this.itemType = getItemType(); this.itemTextSet = getItemTextSet(); this.itemMetaDataSet = getItemMetaDataSet(); this.itemTagSet = getItemTagSet(); this.itemFeedbackSet = getItemFeedbackSet(); this.hasRationale= data.getHasRationale();//rshastri :SAK-1824 this.itemAttachmentSet = getItemAttachmentSet(); this.answerOptionsRichCount = getAnswerOptionsRichCount(); this.answerOptionsSimpleOrRich = getAnswerOptionsSimpleOrRich(); }
/** * This is a very important constructor. Please make sure that you have * set all the properties (declared above as private) of ItemFacade using * the "data" supplied. "data" is a org.osid.assessment.Item properties * and I use it to store info about an item. * @param data */ public ItemFacade(ItemDataIfc data){ this.data = data; ItemImpl itemImpl = new ItemImpl(); // place holder item = (Item)itemImpl; try { item.updateData(this.data); } catch (AssessmentException ex) { throw new DataFacadeException(ex.getMessage()); } this.id = getId(); this.description = getDescription(); this.itemType = getItemType(); this.itemTextSet = getItemTextSet(); this.itemMetaDataSet = getItemMetaDataSet(); this.itemTagSet = getItemTagSet(); this.itemFeedbackSet = getItemFeedbackSet(); this.hasRationale= data.getHasRationale();//rshastri :SAK-1824 this.itemAttachmentSet = getItemAttachmentSet(); this.answerOptionsRichCount = getAnswerOptionsRichCount(); this.answerOptionsSimpleOrRich = getAnswerOptionsSimpleOrRich(); }