Fetches the current online data for the given item, and adds numerical
labels if necessary.

@param itemIdValue
the id of the document to inspect
544077
protected void addLabelForNumbers(ItemIdValue itemIdValue) {

		String qid = itemIdValue.getId();

		try {
			// Fetch the online version of the item to make sure we edit the
			// current version:
			ItemDocument currentItemDocument = (ItemDocument) dataFetcher
					.getEntityDocument(qid);
			if (currentItemDocument == null) {
				System.out.println("*** " + qid
						+ " could not be fetched. Maybe it has been deleted.");
				return;
			}

			// Check if we still have exactly one numeric value:
			QuantityValue number = currentItemDocument
					.findStatementQuantityValue("P1181");
			if (number == null) {
				System.out.println("*** No unique numeric value for " + qid);
				return;
			}

			// Check if the item is in a known numeric class:
			if (!currentItemDocument.hasStatementValue("P31", numberClasses)) {
				System.out
						.println("*** "
								+ qid
								+ " is not in a known class of integer numbers. Skipping.");
				return;
			}

			// Check if the value is integer and build label string:
			String numberString;
			try {
				BigInteger intValue = number.getNumericValue()
						.toBigIntegerExact();
				numberString = intValue.toString();
			} catch (ArithmeticException e) {
				System.out.println("*** Numeric value for " + qid
						+ " is not an integer: " + number.getNumericValue());
				return;
			}

			// Construct data to write:
			ItemDocumentBuilder itemDocumentBuilder = ItemDocumentBuilder
					.forItemId(itemIdValue).withRevisionId(
							currentItemDocument.getRevisionId());
			ArrayList<String> languages = new ArrayList<>(
					arabicNumeralLanguages.length);
			for (int i = 0; i < arabicNumeralLanguages.length; i++) {
				if (!currentItemDocument.getLabels().containsKey(
						arabicNumeralLanguages[i])) {
					itemDocumentBuilder.withLabel(numberString,
							arabicNumeralLanguages[i]);
					languages.add(arabicNumeralLanguages[i]);
				}
			}

			if (languages.size() == 0) {
				System.out.println("*** Labels already complete for " + qid);
				return;
			}

			logEntityModification(currentItemDocument.getEntityId(),
					numberString, languages);

			dataEditor.editItemDocument(itemDocumentBuilder.build(), false,
					"Set labels to numeric value (Task MB1)");
		} catch (MediaWikiApiErrorException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
1138929
@Override
    public void onListItemSelected(CharSequence value, int number, int requestCode) {
        if (requestCode == REQUEST_LIST_SIMPLE || requestCode == REQUEST_LIST_SINGLE) {
            Toast.makeText(c, "Selected: " + value, Toast.LENGTH_SHORT).show();
        }
    }
705904
function (displayValue, currentlyOpen) {
                var self = this;
                if (currentlyOpen) {
                    var report = new ariaWidgetsControllersReportsDropDownControllerReport(), dataModel = this._dataModel;
                    report.displayDropDown = false;
                    report.value = dataModel.value;
                    report.text = dataModel.text;
                    return report;
                } else {
                    setTimeout(function () {
                        self._resourcesHandler.getAllSuggestions({
                            fn : self._suggestionsCallback,
                            scope : self,
                            args : {
                                nextValue : displayValue,
                                triggerDropDown : !currentlyOpen,
                                keepSelectedValue : true,
                                allSuggestions : true
                            }
                        });
                    }, 1);
                }
            }
914497
String getRangeUri(PropertyIdValue propertyIdValue) {
		String datatype = this.propertyRegister
				.getPropertyType(propertyIdValue);

		if (datatype == null)
			return null;

		switch (datatype) {
		case DatatypeIdValue.DT_MONOLINGUAL_TEXT:
			this.rdfConversionBuffer.addDatatypeProperty(propertyIdValue);
			return Vocabulary.RDF_LANG_STRING;
		case DatatypeIdValue.DT_STRING:
		case DatatypeIdValue.DT_EXTERNAL_ID:
		case DatatypeIdValue.DT_MATH:
			this.rdfConversionBuffer.addDatatypeProperty(propertyIdValue);
			return Vocabulary.XSD_STRING;
		case DatatypeIdValue.DT_COMMONS_MEDIA:
		case DatatypeIdValue.DT_GLOBE_COORDINATES:
		case DatatypeIdValue.DT_ITEM:
		case DatatypeIdValue.DT_PROPERTY:
		case DatatypeIdValue.DT_LEXEME:
		case DatatypeIdValue.DT_FORM:
		case DatatypeIdValue.DT_SENSE:
		case DatatypeIdValue.DT_TIME:
		case DatatypeIdValue.DT_URL:
		case DatatypeIdValue.DT_GEO_SHAPE:
		case DatatypeIdValue.DT_TABULAR_DATA:
		case DatatypeIdValue.DT_QUANTITY:
			this.rdfConversionBuffer.addObjectProperty(propertyIdValue);
			return Vocabulary.OWL_THING;
		default:
			return null;
		}
	}
821876
def get_item_ids_metadata(self):
        """"""
        metadata = dict(self._item_ids_metadata)
        metadata.update({'existing_id_values': self.my_osid_object_form._my_map['itemIds']})
        return Metadata(**metadata)
1249708
function(lastValue) {
      //var currentItem
      if (current === len) {
        cb && cb(lastValue);
        return;
      }
      var item = items[current++];
      setTimeout(function() {
        fn(item, function(val) {
          process(val && lastValue);
        });
      }, 20);
    }
733316
private void displayValue() {

        if (m_currentValue == null) {
            m_picker.displayValue("");
            m_picker.setPreviewVisible(false);
            m_picker.setLocationInfo(Collections.<String, String> emptyMap());
        } else {
            m_picker.displayValue(m_editValue.getAddress());
            Map<String, String> infos = new LinkedHashMap<String, String>();
            if (hasLatLng()) {
                infos.put(Messages.get().key(Messages.GUI_LOCATION_LATITUDE_0), m_editValue.getLatitudeString());
                infos.put(Messages.get().key(Messages.GUI_LOCATION_LONGITUDE_0), m_editValue.getLongitudeString());
                infos.put(Messages.get().key(Messages.GUI_LOCATION_ZOOM_0), String.valueOf(m_editValue.getZoom()));
            }
            if (hasSize()) {
                infos.put(
                    Messages.get().key(Messages.GUI_LOCATION_SIZE_0),
                    m_editValue.getWidth() + " x " + m_editValue.getHeight());
            }
            if (hasType()) {
                infos.put(Messages.get().key(Messages.GUI_LOCATION_TYPE_0), m_editValue.getType());
            }
            if (hasMode()) {
                infos.put(Messages.get().key(Messages.GUI_LOCATION_MODE_0), m_editValue.getMode());
            }
            m_picker.setLocationInfo(infos);
            m_picker.setPreviewVisible(true);
            if (!isApiLoaded()) {

                onApiReady(new Command() {

                    public void execute() {

                        return;
                    }
                });
            }
        }
    }
1340272
public static function update($itemid, $newvalue) {
        require_capability('moodle/tag:manage', context_system::instance());
        $tag = core_tag_tag::get($itemid, '*', MUST_EXIST);
        $newvalue = (int)clean_param($newvalue, PARAM_BOOL);
        $tag->update(array('isstandard' => $newvalue));
        return new self($tag);
    }
522388
public int findItemOnlyIdx(JQMListItem item) {
        if (item == null) return -1;
        List<JQMListItem> items = getItems();
        if (items == null) return -1;
        int i = items.indexOf(item);
        if (i == -1) return -1;
        int j = 0;
        for (JQMListItem k : items) {
            if (k == null) continue;
            if (k == item) return j;
            j++;
        }
        return -1;
    }
328657
protected void fixIntegerPrecisions(ItemIdValue itemIdValue,
			String propertyId) {

		String qid = itemIdValue.getId();

		try {
			// Fetch the online version of the item to make sure we edit the
			// current version:
			ItemDocument currentItemDocument = (ItemDocument) dataFetcher
					.getEntityDocument(qid);
			if (currentItemDocument == null) {
				System.out.println("*** " + qid
						+ " could not be fetched. Maybe it has been deleted.");
				return;
			}

			// Get the current statements for the property we want to fix:
			StatementGroup editPropertyStatements = currentItemDocument
					.findStatementGroup(propertyId);
			if (editPropertyStatements == null) {
				System.out.println("*** " + qid
						+ " no longer has any statements for " + propertyId);
				return;
			}

			PropertyIdValue property = Datamodel
					.makeWikidataPropertyIdValue(propertyId);
			List<Statement> updateStatements = new ArrayList<>();
			for (Statement s : editPropertyStatements) {
				QuantityValue qv = (QuantityValue) s.getValue();
				if (qv != null && isPlusMinusOneValue(qv)) {
					QuantityValue exactValue = Datamodel.makeQuantityValue(
							qv.getNumericValue(), qv.getNumericValue(),
							qv.getNumericValue());
					Statement exactStatement = StatementBuilder
							.forSubjectAndProperty(itemIdValue, property)
							.withValue(exactValue).withId(s.getStatementId())
							.withQualifiers(s.getQualifiers())
							.withReferences(s.getReferences())
							.withRank(s.getRank()).build();
					updateStatements.add(exactStatement);
				}
			}

			if (updateStatements.size() == 0) {
				System.out.println("*** " + qid + " quantity values for "
						+ propertyId + " already fixed");
				return;
			}

			logEntityModification(currentItemDocument.getEntityId(),
					updateStatements, propertyId);

			dataEditor.updateStatements(currentItemDocument, updateStatements,
					Collections.<Statement> emptyList(),
					"Set exact values for [[Property:" + propertyId + "|"
							+ propertyId + "]] integer quantities (Task MB2)");

		} catch (MediaWikiApiErrorException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
1220546
public String setPropertyTypeFromStringValue(
			PropertyIdValue propertyIdValue, StringValue value) {
		String datatype = getPropertyType(propertyIdValue);
		if (datatype == null) {
			logger.warn("Could not fetch datatype of "
					+ propertyIdValue.getIri() + ". Assuming type "
					+ DatatypeIdValue.DT_STRING);
			return DatatypeIdValue.DT_STRING; // default type for StringValue
		} else {
			return datatype;
		}
	}
112455
@Override
    public Identifiable checkId(Identifiable item) {
        if (item.getIdentifier() == -1) {
            item.withIdentifier(nextId(item));
        }
        return item;
    }
758508
public void validateUpdateItem(Long configId, String value) {

        //
        // config
        //
        valideConfigExist(configId);

        //
        // value
        //
        try {

            if (StringUtils.isEmpty(value)) {
                throw new Exception();
            }

        } catch (Exception e) {

            throw new FieldException("value", "conf.item.value.null", e);
        }

    }
1082869
def getItem(self, itemId):
        
        url = "%s/items/%s" % (self.root, itemId)
        return Item(url=url,
                    securityHandler=self._securityHandler,
                    proxy_url=self._proxy_url,
                    proxy_port=self._proxy_port)
1152563
@Override
    public void save(T item) {
        Serializable idValue = getOrGenerateIdValue(item);
        save(idValue, item);
    }
161400
function(key) {
			Y.log("Fetching item at  " + key);
			var item = this._getItem(key);
			return YL.isValue(item) ? this._getValue(item) : null; // required by HTML 5 spec
		}
645104
public String getItemImageUrl(final TreeItemImage item, final String itemId) {

		if (item == null) {
			return null;
		}

		// Check if has image url
		String url = item.getUrl();
		if (!Util.empty(url)) {
			return url;
		}

		// Check if has image
		Image image = item.getImage();
		if (image == null) {
			return null;
		}

		// Check static resource
		if (image instanceof InternalResource) {
			return ((InternalResource) image).getTargetUrl();
		}

		// Build targetted url
		Environment env = getEnvironment();
		Map<String, String> parameters = env.getHiddenParameters();
		parameters.put(Environment.TARGET_ID, getTargetId());

		String cacheKey = item.getImageCacheKey();

		if (Util.empty(cacheKey)) {
			// Add some randomness to the URL to prevent caching
			String random = WebUtilities.generateRandom();
			parameters.put(Environment.UNIQUE_RANDOM_PARAM, random);
		} else {
			// Remove step counter as not required for cached content
			parameters.remove(Environment.STEP_VARIABLE);
			parameters.remove(Environment.SESSION_TOKEN_VARIABLE);
			// Add the cache key
			parameters.put(Environment.CONTENT_CACHE_KEY, cacheKey);
		}

		// Item id
		parameters.put(ITEM_REQUEST_KEY, itemId);

		// The targetable path needs to be configured for the portal environment.
		url = env.getWServletPath();

		// Note the last parameter. In javascript we don't want to encode "&".
		return WebUtilities.getPath(url, parameters, true);
	}