@Override public Map<String, Object> appendToParamsMap(final Map<String, Object> input) { return MapBuilder.newBuilder(input) .add(FIELD_PROJECT, null) .toMap(); // props.put(FIELD_ISSUE_TYPE, null); }
public boolean containsSpecUri(final URI uri) { Assertions.notNull("uri", uri); final List<GenericValue> list = ofBizDelegator.findByLike(TABLE, MapBuilder.<String, Object> newBuilder().add(Columns.GADGET_XML, uri.toASCIIString()).toMap(), Collections.<String> emptyList()); return (list != null) && !list.isEmpty(); } }
public void removeGadgetSpecUri(final ExternalGadgetSpecId id) { Assertions.notNull("id", id); ofBizDelegator.removeByAnd(TABLE, MapBuilder.newBuilder(Columns.ID, Long.parseLong(id.value())).toMap()); }
public Set<Long> removeLabelsForCustomField(final Long customFieldId) { notNull("customFieldId", customFieldId); final Set<Long> issueIdsAffected = new HashSet<Long>(); final List<GenericValue> values = ofBizDelegator.findByAnd(TABLE, MapBuilder.<String, Object>newBuilder().add(CUSTOM_FIELD_ID, customFieldId).toMap()); for (GenericValue value : values) { issueIdsAffected.add(value.getLong(ISSUE_ID)); } ofBizDelegator.removeByAnd(TABLE, MapBuilder.<String, Object>newBuilder().add(CUSTOM_FIELD_ID, customFieldId).toMap()); return issueIdsAffected; }
public void remove(final JiraContextNode context, final String key) { if ((context != null) && (key != null)) { delegator.removeByAnd(ENTITY_TABLE_NAME, transformToFieldsMap(context).add(ENTITY_KEY, key).toMap()); invalidateAll(); } else { log.warn("Context or key was null. Nothing was removed"); } }
@Override @ActionViewData(key = "errors") public Map<String, Object> getWrappedErrorsForView() { return MapBuilder.<String,Object>newBuilder() .add("errors", super.getErrors()) .toMap(); }
@ActionViewDataMappings ({"success","error"}) public Map<String,Object> outputErrorsForSoy() { return MapBuilder.<String,Object>newBuilder() .add("errors", super.getErrors()) .toMap(); }
public void removeLabel(final Long labelId, final Long issueId, final Long customFieldId) { notNull("labelId", labelId); ofBizDelegator.removeByAnd(TABLE, MapBuilder.<String, Object>newBuilder().add(ID, labelId).toMap()); }
private Map<String, String> getParameters(final GenericValue gv) { final PropertySet ps = OFBizPropertyUtils.getPropertySet(gv); @SuppressWarnings("unchecked") final Collection<String> paramKeys = ps.getKeys(PropertySet.STRING); final MapBuilder<String, String> params = MapBuilder.newBuilder(); for (final String key : paramKeys) { params.add(key, ps.getString(key)); } return params.toMap(); }
@Override public Map<String, Object> getAnalytics() { final MapBuilder<String, Object> builder = MapBuilder.newBuilder(); builder.add("users.total", userManager.getTotalUserCount()); builder.add("users.active", licenseCountService.totalBillableUsers()); return builder.toMap(); }
public RememberMeToken save(final RememberMeToken token) { final Timestamp now = new Timestamp(clock.getCurrentDate().getTime()); final Map<String, Object> values = MapBuilder.<String, Object>newBuilder(Columns.TOKEN, token.getRandomString()) .add(Columns.USERKEY, userKeyService.getKeyForUsername(token.getUserName())) .add(Columns.CREATED, now).toMap(); final GenericValue gv = delegator.createValue(TABLE, values); return releaseToken(gv); }
public Set<Label> getLabels(final Long issueId, final Long customFieldId) { notNull("issueId", issueId); final List<GenericValue> labelGvs = ofBizDelegator.findByAnd(TABLE, MapBuilder.<String, Object>newBuilder(). add(ISSUE_ID, issueId). add(CUSTOM_FIELD_ID, customFieldId).toMap()); return getSortedLabelSet(labelGvs); }
private String getCommentHtml(Issue issue, Action action) { final OperationContext context = (OperationContext) action; final MapBuilder<String, Object> displayParams = MapBuilder.newBuilder(); displayParams.add("theme", "aui"); displayParams.add("noHeader", true); final FieldLayout fieldLayout = fieldLayoutManager.getFieldLayout(issue); final FieldLayoutItem commentFieldLayoutItem = fieldLayout.getFieldLayoutItem("comment"); final OrderableField commentField = commentFieldLayoutItem.getOrderableField(); return commentField.getCreateHtml(commentFieldLayoutItem, context, action, issue, displayParams.toMap()); }
public static void dispatchEvent(int type, ApplicationUser user, Map<String,Object> params) { final MapBuilder<String, Object> mapBuilder = MapBuilder.newBuilder(params); mapBuilder.add("baseurl", ComponentAccessor.getApplicationProperties().getString(APKeys.JIRA_BASEURL)); UserEvent event = new UserEvent(mapBuilder.toMap(), user, type); ComponentAccessor.getComponentOfType(EventPublisher.class).publish(event); } }
public String getNewViewHtml(final OrderableField field) { final Map displayParameters = MapBuilder.newBuilder("readonly", Boolean.TRUE).add("nolink", Boolean.TRUE).toMap(); return field.getViewHtml(getBulkEditBean().getTargetFieldLayout().getFieldLayoutItem(field), this, getBulkEditBean().getFirstTargetIssueObject(), displayParameters); }
private Map<String, Object> makeContext(String location, ApplicationUser remoteUser, JiraHelper jiraHelper, ContextLayoutBean layoutBean, I18nHelper i18n) { return MapBuilder.<String, Object>newBuilder("webInterfaceManager", webInterfaceManager) .add("linkManager", simpleLinkManager) .add(JiraWebInterfaceManager.CONTEXT_KEY_LOCATION, location) .add(JiraWebInterfaceManager.CONTEXT_KEY_USER, remoteUser) .add(JiraWebInterfaceManager.CONTEXT_KEY_HELPER, jiraHelper) .add(JiraWebInterfaceManager.CONTEXT_KEY_I18N, i18n) .add("accessKeyHelper", new AccessKeyHelperImpl()) .add("layout", layoutBean).toMap(); }
public void createFieldScreenLayoutItem(FieldScreenLayoutItem fieldScreenLayoutItem) { GenericValue genericValue = ofBizDelegator.createValue(FieldScreenStore.FIELD_SCREEN_LAYOUT_ITEM_ENTITY_NAME, MapBuilder.<String, Object>newBuilder().add("fieldidentifier", fieldScreenLayoutItem.getFieldId()) .add("sequence", (long)fieldScreenLayoutItem.getPosition()) .add("fieldscreentab", fieldScreenLayoutItem.getFieldScreenTab().getId()) .toMap()); fieldScreenLayoutItem.setGenericValue(genericValue); }
public void createFieldScreenTab(FieldScreenTab fieldScreenTab) { GenericValue fieldScreenGV = ofBizDelegator.createValue(FIELD_SCREEN_TAB_ENTITY_NAME, MapBuilder.<String, Object>newBuilder().add("name", fieldScreenTab.getName()).add("sequence", (long)fieldScreenTab.getPosition()) .add("fieldscreen", fieldScreenTab.getFieldScreen().getId()).toMap()); fieldScreenTab.setGenericValue(fieldScreenGV); }
private JiraHelper getJiraHelper() { final MapBuilder<String, Object> context = MapBuilder.newBuilder(); context.add("project", getProject()); if (getProject() != null) { context.add("projectKeyEncoded", encode(getProject().getKey())); } return new JiraHelper(getHttpRequest(), getProject(), context.toMap()); }
@ActionViewData("success") public Map<String, Object> getData() { return MapBuilder.<String, Object>newBuilder() .add("version", buildUtilsInfo.getVersion()) .add("buildNumber", buildUtilsInfo.getApplicationBuildNumber()) .add("commitId", buildUtilsInfo.getCommitId()) .add("buildDate", getDateTimeFormatter().format(buildUtilsInfo.getCurrentBuildDate())) .toMap(); } }