19 package org.turro.alliance.db.entities;
21 import java.util.HashSet;
24 import javax.json.JsonValue;
25 import org.turro.dossier.entity.Dossier;
26 import org.turro.dossier.entity.ProjectGrant;
27 import org.turro.importer.ImporterRegister;
28 import org.turro.json.IJSONizable;
29 import org.turro.plugin.contacts.CompoundId;
30 import org.turro.tags.Tags;
36 public class AxTag implements IJSONizable {
38 private final String tagName, entityRoot, entityId;
39 private final long memberId;
41 public AxTag(
long memberId, String tag, String entityRoot, String entityId) {
42 this.memberId = memberId;
44 this.entityRoot = entityRoot;
45 this.entityId = entityId;
66 public static Set<AxTag>
from(
long memberId,
Dossier dossier) {
67 Set<AxTag> tags =
new HashSet<>();
69 tags.add(
new AxTag(memberId, ti.getTagName(),
"/axproject/", Long.toString(dossier.
getId())));
75 Set<AxTag> tags =
new HashSet<>();
77 tags.add(
new AxTag(memberId, ti.getTagName(),
"/axproject-grant/", Long.toString(projectGrant.
getId())));
82 public static AxTag from(
long memberId, ImporterRegister
register) {
83 return new AxTag(memberId,
register.getString(
"tag"),
register.getString(
"entityRoot"),
register.getString(
"entityId"));
94 public String
toJson(Map<String, Object> properties) {
95 return toJson(
this, properties);
String toJson(Map< String, Object > properties)
static AxTag fromJson(JsonValue value)
static Set< AxTag > from(long memberId, ProjectGrant projectGrant)
AxTag(long memberId, String tag, String entityRoot, String entityId)
static AxTag from(long memberId, ImporterRegister register)
static Set< AxTag > from(long memberId, Dossier dossier)