public List<TaggableItem> getItems( TaggableActivity activity, String userId, TaggingProvider provider, boolean getMyItemsOnly, String taggedItem) { List<TaggableItem> items = new ArrayList<TaggableItem>(); // Return custom list of items to rating providers. This // list should match that seen in the evaluation item list (?) if (ratingProviderIds.contains(provider.getId())) { WizardPageDefinition def = (WizardPageDefinition) activity.getObject(); for (Iterator<WizardPage> i = def.getPages().iterator(); i.hasNext(); ) { // Make sure this page is evaluatable by the current // user WizardPage page = i.next(); if (page != null && (page.getStatus().equals(MatrixFunctionConstants.PENDING_STATUS) || page.getStatus().equals(MatrixFunctionConstants.COMPLETE_STATUS)) && (page.getOwner().getId().getValue().equals(userId) || (!getMyItemsOnly && canEvaluate(page)))) { items.add(getItem(page)); // There is only one submitted page per definition, so break // here break; } } } else { // Notify other tagging providers that they aren't accepted here yet logger.warn(this + ".getItems() 2: Provider with id " + provider.getId() + " not allowed!"); } return items; }
public List<TaggableItem> getItems( TaggableActivity activity, TaggingProvider provider, boolean getMyItemsOnly, String taggedItem) { List<TaggableItem> items = new ArrayList<TaggableItem>(); // Only return items to a specified rating provider if (ratingProviderIds.contains(provider.getId())) { WizardPageDefinition def = (WizardPageDefinition) activity.getObject(); for (Iterator<WizardPage> i = def.getPages().iterator(); i.hasNext(); ) { // Make sure this page is evaluatable by the current // user WizardPage page = i.next(); if (page != null && (page.getStatus().equals(MatrixFunctionConstants.PENDING_STATUS) || page.getStatus().equals(MatrixFunctionConstants.COMPLETE_STATUS)) && (!getMyItemsOnly && canEvaluate(page))) { items.add(getItem(page)); } } } else { // Notify other tagging providers that they aren't accepted here yet logger.warn(this + ".getItems(): Provider with id " + provider.getId() + " not allowed!"); } return items; }
public TaggableItem getItem( String itemRef, TaggingProvider provider, boolean getMyItemOnly, String taggedItem) { TaggableItem item = null; if (checkReference(itemRef)) { // Only return item to a specified rating (evalutation) provider if (ratingProviderIds.contains(provider.getId())) { WizardReference reference = WizardReference.getReference(itemRef); if (reference != null) { WizardPage page = matrixManager.getWizardPage(idManager.getId(reference.getId())); if (page != null && (page.getStatus().equals(MatrixFunctionConstants.PENDING_STATUS) || page.getStatus().equals(MatrixFunctionConstants.COMPLETE_STATUS)) && (page.getOwner() .getId() .getValue() .equals(sessionManager.getCurrentSessionUserId()) || (!getMyItemOnly && canEvaluate(page)))) { item = getItem(page); } } } else { // Notify other tagging providers that they aren't accepted here // yet logger.warn(this + ".getItem(): Provider with id " + provider.getId() + " not allowed!"); } } return item; }
protected List<TaggingHelperInfo> getHelperInfo(TaggableItem item) { List<TaggingHelperInfo> infoList = new ArrayList<TaggingHelperInfo>(); if (getTaggingManager().isTaggable()) { for (TaggingProvider provider : getTaggingManager().getProviders()) { // Only get helpers for accepted rating providers if (ratingProviderIds.contains(provider.getId())) { TaggingHelperInfo info = provider.getItemHelperInfo(item.getReference()); if (info != null) { infoList.add(info); } } } } return infoList; }