@Override public String apply(final IssueConstant input) { return input.getId(); } };
@Override public String apply(final IssueConstant input) { return input.getId(); } });
@Override public String apply(final IssueConstant input) { return input != null ? input.getId() : "-1"; } });
@Override public Long apply(final IssueConstant input) { return Long.valueOf(input.getId()); } };
@Override public boolean apply(final T constant) { return !id.equals(constant.getId()); } }));
private static List<String> getConstantIds(Collection<? extends IssueConstant> issueConstants) { List<String> ids = new ArrayList<String>(issueConstants.size()); for (IssueConstant issueConstant : issueConstants) { ids.add(issueConstant.getId()); } return ids; }
public String getDescKey(IssueConstant issueConstant) { String fieldName = TRANSLATION_PREFIX + getIssueConstantName() + "." + issueConstant.getId() + ".desc"; return fieldName; }
public String getNameKey(IssueConstant issueConstant) { String fieldName = TRANSLATION_PREFIX + getIssueConstantName() + "." + issueConstant.getId() + ".name"; return fieldName; }
public List<String> getIdsFromName(String name) { IssueConstant constant = constantsManager.getConstantByNameIgnoreCase(constantName, name); if (constant != null) { return Lists.newArrayList(constant.getId()); } return Collections.emptyList(); }
public String getIndexedValue(final T indexedObject) { notNull("indexedObject", indexedObject); return indexedObject.getId(); }
protected Map handleWord(String word, QuickSearchResult searchResult) { IssueConstant typeByName = getTypeByName(word); if (typeByName == null && (word.endsWith("S") || word.endsWith("s"))) { typeByName = getTypeByName(word.substring(0, word.length() - 1)); } return typeByName != null ? FieldMap.build(DocumentConstants.ISSUE_TYPE, typeByName.getId()) : null; } }
protected Map handleWord(String word, QuickSearchResult searchResult) { if (UNRESOLVED.equalsIgnoreCase(word)) return UNRESOLVED_RESULT; IssueConstant resolutionByName = getResolutionsByName(word); return resolutionByName != null ? EasyMap.build("resolution", resolutionByName.getId()) : null; } }
protected Map handleWord(String word, QuickSearchResult searchResult) { IssueConstant statusByName = getStatusByName(word); return statusByName != null ? EasyMap.build("status", statusByName.getId()) : null; }
protected Map handleWord(String word, QuickSearchResult searchResult) { IssueConstant priorityByName = getPriorityByName(word); return priorityByName != null ? EasyMap.build("priority", priorityByName.getId()) : null; }
public boolean isDefault(IssueConstant constant) { String constantId = getApplicationProperties().getString(getDefaultPropertyName()); return (constantId != null && constant.getId().equals(constantId)); }
public AbstractRemoteConstant(IssueConstant gv) { super(gv.getId(), gv.getName()); this.description = gv.getDescription(); this.icon = gv.getIconUrl(); if (TextUtils.stringSet(icon) && !this.icon.startsWith("http://")) { this.icon = ComponentAccessor.getApplicationProperties().getString(APKeys.JIRA_BASEURL) + icon; } }
public void deleteIssueConstantTranslation(IssueConstant issueConstant, String issueConstantPrefix, Locale locale) { PropertySet ps = ((IssueConstantImpl) issueConstant).getPropertySet(); String issueConstantLocaleKey = issueConstantPrefix + issueConstant.getId() + "." + locale; if (ps.exists(issueConstantLocaleKey)) ps.remove(issueConstantLocaleKey); // Can't inject this due to circular dependency ComponentAccessor.getConstantsManager().invalidate(issueConstant); }
private String getTranslationFromDatabase(IssueConstant issueConstant, String locale, boolean name) { PropertySet ps = ((IssueConstantImpl) issueConstant).getPropertySet(); String translationPrefix = getTranslationPrefix(issueConstant); String translationString = ps.getString(translationPrefix + issueConstant.getId() + "." + locale); if (TextUtils.stringSet(translationString)) { return name ? getTranslatedNameFromString(translationString) : getTranslatedDescriptionFromString(translationString); } return null; }
public void setIssueConstantTranslation(IssueConstant issueConstant, String issueConstantPrefix, Locale locale, String translatedName, String translatedDesc) { PropertySet ps = ((IssueConstantImpl) issueConstant).getPropertySet(); String issueConstantLocaleKey = issueConstantPrefix + issueConstant.getId() + "." + locale; // Set property if (TextUtils.stringSet(translatedName) && TextUtils.stringSet(translatedDesc)) ps.setString(issueConstantLocaleKey, translatedName + "\n" + translatedDesc); // Can't inject this due to circular dependency ComponentAccessor.getConstantsManager().invalidate(issueConstant); }
public boolean hasLocaleTranslation(IssueConstant issueConstant, String locale) { PropertySet ps = ((IssueConstantImpl) issueConstant).getPropertySet(); String issueConstantType = ((IssueConstantImpl) issueConstant).getGenericValue().getEntityName(); String translationPrefix = getTranslationPrefix(issueConstantType); String translationString = ps.getString(translationPrefix + issueConstant.getId() + "." + locale); return TextUtils.stringSet(translationString); }