UNOMI-117 refactor tags as an open string, removed tags definitions, removed tags hierarchy and associated functions, add previously parent tag to children
Project: http://git-wip-us.apache.org/repos/asf/incubator-unomi/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-unomi/commit/6c5b46ea Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/6c5b46ea Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/6c5b46ea Branch: refs/heads/feature-UNOMI-117 Commit: 6c5b46ead69ab7ea6e5ed580753934ca872daf74 Parents: d871468 Author: dgaillard <dgaill...@jahia.com> Authored: Tue Aug 8 14:39:30 2017 +0200 Committer: dgaillard <dgaill...@jahia.com> Committed: Tue Aug 8 17:53:19 2017 +0200 ---------------------------------------------------------------------- .../java/org/apache/unomi/api/Metadata.java | 10 +- .../java/org/apache/unomi/api/PropertyType.java | 36 +--- api/src/main/java/org/apache/unomi/api/Tag.java | 193 ------------------- .../java/org/apache/unomi/api/ValueType.java | 38 +--- .../unomi/api/services/DefinitionsService.java | 74 +------ .../unomi/api/services/ProfileService.java | 17 +- .../META-INF/cxs/actions/addToLists.json | 1 + .../cxs/actions/sfdcCreateOrUpdateLead.json | 1 + .../cxs/actions/sfdcUpdateProfileFromLead.json | 1 + .../src/test/scala/unomi/AdminScenario.scala | 2 +- .../allEventToProfilePropertiesAction.json | 1 + .../cxs/actions/evaluateProfileAgeAction.json | 1 + .../actions/evaluateProfileSegmentsAction.json | 1 + .../actions/eventToProfilePropertyAction.json | 1 + .../actions/mergeProfilesOnPropertyAction.json | 1 + .../META-INF/cxs/actions/sendEventAction.json | 1 + .../actions/setEventOccurenceCountAction.json | 1 + .../META-INF/cxs/actions/setPropertyAction.json | 1 + .../cxs/conditions/booleanCondition.json | 2 + .../cxs/conditions/eventPropertyCondition.json | 2 + .../cxs/conditions/eventTypeCondition.json | 2 + .../cxs/conditions/formEventCondition.json | 2 + .../geoLocationByPointSessionCondition.json | 2 + .../conditions/geoLocationSessionCondition.json | 2 + .../cxs/conditions/goalMatchCondition.json | 2 + .../cxs/conditions/matchAllCondition.json | 2 + .../cxs/conditions/newVisitorCondition.json | 2 + .../META-INF/cxs/conditions/notCondition.json | 2 + .../cxs/conditions/pastEventCondition.json | 2 + .../conditions/profilePropertyCondition.json | 2 + .../cxs/conditions/profileSegmentCondition.json | 2 + .../profileUpdatedEventCondition.json | 2 + .../conditions/profileUserListCondition.json | 2 + .../conditions/returningVisitorCondition.json | 2 + .../cxs/conditions/scoringCondition.json | 2 + .../sessionCreatedEventCondition.json | 2 + .../conditions/sessionDurationCondition.json | 2 + .../conditions/sessionPropertyCondition.json | 2 + .../sourceEventPropertyCondition.json | 1 + .../cxs/conditions/videoViewEventCondition.json | 2 + .../cxs/conditions/hoverEventCondition.json | 2 + .../META-INF/cxs/actions/sendMailAction.json | 1 + .../requestHeaderToProfilePropertyAction.json | 1 + ...requestParameterToProfilePropertyAction.json | 1 + .../cxs/actions/setRemoteHostInfoAction.json | 1 + .../unomi/rest/DefinitionsServiceEndPoint.java | 97 ++-------- .../apache/unomi/rest/LocalizationHelper.java | 59 +----- .../unomi/rest/ProfileServiceEndPoint.java | 15 +- .../org/apache/unomi/rest/RESTActionType.java | 8 +- .../apache/unomi/rest/RESTConditionType.java | 11 +- .../java/org/apache/unomi/rest/RESTTag.java | 87 --------- .../org/apache/unomi/rest/RESTValueType.java | 8 +- .../training/TrainedNotificationAction.java | 2 +- .../cxs/actions/trainingNotifAction.json | 1 + .../actions/IncrementTweetNumberAction.java | 4 +- .../cxs/actions/incrementTweetNumberAction.json | 1 + .../services/DefinitionsServiceImpl.java | 140 ++------------ .../services/services/GoalsServiceImpl.java | 28 +-- .../services/services/ProfileServiceImpl.java | 27 +-- .../properties/profiles/basic/firstName.json | 6 +- .../cxs/properties/profiles/basic/gender.json | 6 +- .../cxs/properties/profiles/basic/lastName.json | 6 +- .../properties/profiles/basic/nationality.json | 6 +- .../properties/profiles/contact/address.json | 6 +- .../cxs/properties/profiles/contact/city.json | 6 +- .../profiles/contact/countryName.json | 6 +- .../cxs/properties/profiles/contact/email.json | 6 +- .../profiles/contact/phoneNumber.json | 6 +- .../properties/profiles/contact/zipCode.json | 6 +- .../profiles/lead/leadAssignedTo.json | 6 +- .../cxs/properties/profiles/personal/age.json | 6 +- .../properties/profiles/personal/birthDate.json | 6 +- .../cxs/properties/profiles/personal/kids.json | 6 +- .../profiles/personal/maritalStatus.json | 6 +- .../properties/profiles/social/facebookId.json | 6 +- .../properties/profiles/social/googleid.json | 6 +- .../properties/profiles/social/linkedInId.json | 6 +- .../properties/profiles/social/twitterId.json | 6 +- .../properties/profiles/system/firstVisit.json | 6 +- .../properties/profiles/system/lastVisit.json | 6 +- .../properties/profiles/system/nbOfVisits.json | 6 +- .../profiles/system/previousVisit.json | 6 +- .../cxs/properties/profiles/work/company.json | 6 +- .../cxs/properties/profiles/work/income.json | 6 +- .../cxs/properties/profiles/work/jobTitle.json | 6 +- .../sessions/geographic/latitude.json | 6 +- .../sessions/geographic/longitude.json | 6 +- .../geographic/sessionAdminSubDiv1.json | 6 +- .../geographic/sessionAdminSubDiv2.json | 6 +- .../sessions/geographic/sessionCity.json | 6 +- .../sessions/geographic/sessionCountryCode.json | 6 +- .../sessions/geographic/sessionCountryName.json | 6 +- .../sessions/technical/deviceCategory.json | 6 +- .../technical/operatingSystemFamily.json | 6 +- .../sessions/technical/operatingSystemName.json | 6 +- .../sessions/technical/pageReferringURL.json | 6 +- .../sessions/technical/remoteAddr.json | 6 +- .../sessions/technical/remoteHost.json | 6 +- .../sessions/technical/userAgentName.json | 6 +- .../sessions/technical/userAgentVersion.json | 6 +- .../resources/META-INF/cxs/tags/aggregated.json | 4 - .../META-INF/cxs/tags/autocompleted.json | 4 - .../META-INF/cxs/tags/campaign/campaign.json | 4 - .../cxs/tags/campaign/landingCampaign.json | 4 - .../cxs/tags/campaign/parameterCampaign.json | 4 - .../cxs/tags/campaign/referrerCampaign.json | 4 - .../META-INF/cxs/tags/conditions/condition.json | 4 - .../cxs/tags/conditions/eventCondition.json | 4 - .../cxs/tags/conditions/profileCondition.json | 4 - .../cxs/tags/conditions/sessionCondition.json | 4 - .../tags/conditions/sourceEventCondition.json | 4 - .../cxs/tags/conditions/trackedCondition.json | 4 - .../conditions/usableInPastEventCondition.json | 4 - .../META-INF/cxs/tags/demographic.json | 4 - .../main/resources/META-INF/cxs/tags/event.json | 4 - .../resources/META-INF/cxs/tags/geographic.json | 4 - .../META-INF/cxs/tags/goals/downloadGoal.json | 4 - .../META-INF/cxs/tags/goals/formGoal.json | 4 - .../META-INF/cxs/tags/goals/funnelGoal.json | 4 - .../resources/META-INF/cxs/tags/goals/goal.json | 4 - .../cxs/tags/goals/landingPageGoal.json | 4 - .../META-INF/cxs/tags/goals/pageVisitGoal.json | 4 - .../META-INF/cxs/tags/goals/videoGoal.json | 4 - .../resources/META-INF/cxs/tags/logical.json | 4 - .../META-INF/cxs/tags/profileTags.json | 4 - .../profiles/basicProfileProperties.json | 6 - .../profiles/contactProfileProperties.json | 5 - .../profiles/leadProfileProperties.json | 6 - .../profiles/personalProfileProperties.json | 5 - .../properties/profiles/profileProperties.json | 4 - .../profiles/socialProfileProperties.json | 6 - .../profiles/systemProfileProperties.json | 6 - .../profiles/workProfileProperties.json | 5 - .../cxs/tags/properties/properties.json | 4 - .../sessions/geographicSessionProperties.json | 5 - .../properties/sessions/sessionProperties.json | 4 - .../sessions/technicalSessionProperties.json | 5 - .../main/resources/META-INF/cxs/tags/root.json | 4 - .../cxs/tags/rules/formMappingRule.json | 4 - src/site/markdown/versions/1.1/concepts.md | 4 +- src/site/markdown/versions/master/concepts.md | 4 +- 141 files changed, 341 insertions(+), 1000 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/api/src/main/java/org/apache/unomi/api/Metadata.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/unomi/api/Metadata.java b/api/src/main/java/org/apache/unomi/api/Metadata.java index 4c326f4..22216c9 100644 --- a/api/src/main/java/org/apache/unomi/api/Metadata.java +++ b/api/src/main/java/org/apache/unomi/api/Metadata.java @@ -145,9 +145,9 @@ public class Metadata implements Comparable<Metadata> { } /** - * Retrieves a set of {@link Tag} names associated with this Metadata + * Retrieves a set of {@link String} tag names associated with this Metadata * - * @return a set of {@link Tag} names associated with this Metadata + * @return a set of {@link String} tag names associated with this Metadata */ public Set<String> getTags() { return tags; @@ -156,10 +156,10 @@ public class Metadata implements Comparable<Metadata> { /** * Sets the tags. * - * @param tagIDs the tag i ds + * @param tags the tag i ds */ - public void setTags(Set<String> tagIDs) { - this.tags = tagIDs; + public void setTags(Set<String> tags) { + this.tags = tags; } /** http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/api/src/main/java/org/apache/unomi/api/PropertyType.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/unomi/api/PropertyType.java b/api/src/main/java/org/apache/unomi/api/PropertyType.java index 8b9a231..01bc934 100644 --- a/api/src/main/java/org/apache/unomi/api/PropertyType.java +++ b/api/src/main/java/org/apache/unomi/api/PropertyType.java @@ -46,9 +46,7 @@ public class PropertyType extends MetadataItem { private Set<String> automaticMappingsFrom = new HashSet<>(); private Double rank; private String mergeStrategy; - @Deprecated - private Set<Tag> tags = new TreeSet<Tag>(); - private Set<String> tagIds = new LinkedHashSet<String>(); + private Set<String> tags = new LinkedHashSet<>(); private Boolean multivalued; private Boolean protekted; @@ -133,11 +131,8 @@ public class PropertyType extends MetadataItem { * Retrieves the tags used by this PropertyType. * * @return the tags used by this PropertyType - * @deprecated will be removed in next major release as tag become an open string */ - @XmlTransient - @Deprecated - public Set<Tag> getTags() { + public Set<String> getTags() { return tags; } @@ -145,37 +140,12 @@ public class PropertyType extends MetadataItem { * Sets the tags used by this PropertyType. * * @param tags the tags used by this PropertyType - * @deprecated will be removed in next major release as tag become an open string */ - @Deprecated - public void setTags(Set<Tag> tags) { + public void setTags(Set<String> tags) { this.tags = tags; } /** - * Retrieves the identifiers of the tags used by this PropertyType. - * - * @return the identifiers of the tags used by this PropertyType - * @deprecated will be rename to getTags() in next major release as tag become an open string - */ - @XmlElement(name = "tags") - @Deprecated - public Set<String> getTagIds() { - return tagIds; - } - - /** - * Sets the identifiers of the tags used by this PropertyType. - * - * @param tagIds the identifiers of the tags used by this PropertyType - * @deprecated will be rename to setTags(Set<String> tags) in next major release as tag become an open string - */ - @Deprecated - public void setTagIds(Set<String> tagIds) { - this.tagIds = tagIds; - } - - /** * Retrieves the default value defined for property using this PropertyType. * * @return the default value defined for property using this PropertyType http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/api/src/main/java/org/apache/unomi/api/Tag.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/unomi/api/Tag.java b/api/src/main/java/org/apache/unomi/api/Tag.java deleted file mode 100644 index a751336..0000000 --- a/api/src/main/java/org/apache/unomi/api/Tag.java +++ /dev/null @@ -1,193 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.unomi.api; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlTransient; -import java.util.Set; -import java.util.TreeSet; - -/** - * A tag to help categorize entities. A tag can have sub-tags. - * - * @deprecated tags will be an open string in next major release - */ -@Deprecated -public class Tag implements PluginType, Comparable<Tag> { - - private Set<Tag> subTags = new TreeSet<>(); - private String id; - private String nameKey; - private String descriptionKey; - private String parentId; - private double rank = 0.0; - private long pluginId; - private boolean hidden = false; - - /** - * Instantiates a new Tag. - */ - public Tag() { - } - - /** - * Instantiates a new Tag. - * - * @param id the identifier - * @param nameKey the {@link java.util.ResourceBundle} key used to localize this Tag's name - * @param descriptionKey the {@link java.util.ResourceBundle} key used to localize this Tag's description - * @param parentId the identifier of this Tag's parent Tag - */ - public Tag(String id, String nameKey, String descriptionKey, String parentId) { - this.id = id; - this.nameKey = nameKey; - this.descriptionKey = descriptionKey; - this.parentId = parentId; - } - - /** - * Retrieves this Tag's identifier. - * - * @return the id - */ - public String getId() { - return id; - } - - /** - * Retrieves the {@link java.util.ResourceBundle} key used to localize this Tag's name. - * - * @return the {@link java.util.ResourceBundle} key used to localize this Tag's name - */ - public String getNameKey() { - if (nameKey == null) { - nameKey = "tag." + id + ".name"; - } - return nameKey; - } - - /** - * Retrieves the {@link java.util.ResourceBundle} key used to localize this Tag's description. - * - * @return the {@link java.util.ResourceBundle} key used to localize this Tag's name - */ - public String getDescriptionKey() { - if (descriptionKey == null) { - descriptionKey = "tag." + id + ".description"; - } - return descriptionKey; - } - - /** - * Retrieves the identifier of this Tag's parent Tag. - * - * @return the identifier of this Tag's parent Tag - */ - @XmlElement(name = "parent") - public String getParentId() { - return parentId; - } - - /** - * Retrieves the sub tags. - * - * @return the sub tags - */ - public Set<Tag> getSubTags() { - return subTags; - } - - /** - * Sets the sub tags. - * - * @param subTags the sub tags - */ - public void setSubTags(Set<Tag> subTags) { - this.subTags = subTags; - } - - /** - * Retrieves the rank of this PropertyType for ordering purpose. - * - * @return the rank of this PropertyType for ordering purpose - */ - public double getRank() { - return rank; - } - - /** - * Specifies the rank of this PropertyType for ordering purpose. - * - * @param rank the rank of this PropertyType for ordering purpose - */ - public void setRank(double rank) { - this.rank = rank; - } - - /** - * Whether this Tag is considered for internal purposes only and should therefore be hidden to accessing UIs. - * - * @return {@code true} if the Tag needs to be hidden, {@code false} otherwise - */ - public boolean isHidden() { - return hidden; - } - - /** - * Specifies whether this Tag is hidden. - * - * @param hidden {@code true} if the Tag needs to be hidden, {@code false} otherwise - */ - public void setHidden(boolean hidden) { - this.hidden = hidden; - } - - @XmlTransient - public long getPluginId() { - return pluginId; - } - - public void setPluginId(long pluginId) { - this.pluginId = pluginId; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - Tag that = (Tag) o; - - return !(id != null ? !id.equals(that.id) : that.id != null); - - } - - @Override - public int hashCode() { - int result = id != null ? id.hashCode() : 0; - return result; - } - - public int compareTo(Tag otherRank) { - int rankCompare = Double.compare(rank, otherRank.rank); - if (rankCompare != 0) { - return rankCompare; - } - return id.compareTo(otherRank.id); - } -} http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/api/src/main/java/org/apache/unomi/api/ValueType.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/unomi/api/ValueType.java b/api/src/main/java/org/apache/unomi/api/ValueType.java index d56f7aa..d90321d 100644 --- a/api/src/main/java/org/apache/unomi/api/ValueType.java +++ b/api/src/main/java/org/apache/unomi/api/ValueType.java @@ -17,12 +17,10 @@ package org.apache.unomi.api; -import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlTransient; import java.util.LinkedHashSet; import java.util.Set; -import java.util.TreeSet; /** * A value type to be used to constrain property values. @@ -34,9 +32,7 @@ public class ValueType implements PluginType { private String nameKey; private String descriptionKey; private long pluginId; - @Deprecated - private Set<Tag> tags = new TreeSet<>(); - private Set<String> tagIds = new LinkedHashSet<>(); + private Set<String> tags = new LinkedHashSet<>(); /** * Instantiates a new Value type. @@ -126,11 +122,8 @@ public class ValueType implements PluginType { * Retrieves the tags used by this ValueType. * * @return the tags used by this ValueType - * @deprecated will be removed in next major release as tag become an open string */ - @XmlTransient - @Deprecated - public Set<Tag> getTags() { + public Set<String> getTags() { return tags; } @@ -138,36 +131,11 @@ public class ValueType implements PluginType { * Sets the tags used by this ValueType. * * @param tags the tags used by this ValueType - * @deprecated will be removed in next major release as tag become an open string */ - @Deprecated - public void setTags(Set<Tag> tags) { + public void setTags(Set<String> tags) { this.tags = tags; } - /** - * Retrieves the identifiers of the tags used by this ValueType. - * - * @return the identifiers of the tags used by this ValueType - * @deprecated will be rename to getTags() in next major release as tag become an open string - */ - @XmlElement(name = "tags") - @Deprecated - public Set<String> getTagIds() { - return tagIds; - } - - /** - * Sets the identifiers of the tags used by this ValueType. - * - * @param tagIds the identifiers of the tags used by this ValueType - * @deprecated will be rename to setTags(Set<String> tags) in next major release as tag become an open string - */ - @Deprecated - public void setTagIds(Set<String> tagIds) { - this.tagIds = tagIds; - } - @Override public boolean equals(Object o) { if (this == o) return true; http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/api/src/main/java/org/apache/unomi/api/services/DefinitionsService.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/unomi/api/services/DefinitionsService.java b/api/src/main/java/org/apache/unomi/api/services/DefinitionsService.java index ca1f3da..655705a 100644 --- a/api/src/main/java/org/apache/unomi/api/services/DefinitionsService.java +++ b/api/src/main/java/org/apache/unomi/api/services/DefinitionsService.java @@ -19,7 +19,6 @@ package org.apache.unomi.api.services; import org.apache.unomi.api.PluginType; import org.apache.unomi.api.PropertyMergeStrategyType; -import org.apache.unomi.api.Tag; import org.apache.unomi.api.ValueType; import org.apache.unomi.api.actions.ActionType; import org.apache.unomi.api.conditions.Condition; @@ -35,42 +34,6 @@ import java.util.Set; */ public interface DefinitionsService { /** - * Retrieves all known tags. - * - * @return the set of all known tags - * @deprecated will be removed in next major release as tag become an open string - */ - @Deprecated - Set<Tag> getAllTags(); - - /** - * Retrieves the set of all root tags from which all other tags are derived via sub-tags. - * - * @return the set of all root tags - * @deprecated will be removed in next major release as tag become an open string - */ - @Deprecated - Set<Tag> getRootTags(); - - /** - * Retrieves the tag with the specified identifier. - * - * @param tagId the identifier of the tag to retrieve - * @return the tag with the specified identifier - * @deprecated will be removed in next major release as tag become an open string - */ - @Deprecated - Tag getTag(String tagId); - - /** - * Add a new tag to the list of tags - * @param tag the tag to add - * @deprecated will be removed in next major release as tag become an open string - */ - @Deprecated - void addTag(Tag tag); - - /** * Retrieves all condition types. * * @return a Collection of all collection types @@ -81,17 +44,6 @@ public interface DefinitionsService { * Retrieves the set of condition types with the specified tag also retrieving condition types from sub-tags if so specified. * * @param tag the tag marking the condition types we want to retrieve - * @param includeFromSubtags {@code true} if we want to also include condition types marked by sub-tags of the specified tag - * @return the set of condition types with the specified tag (and its sub-tags, if specified) - * @deprecated will be replace by {@link #getConditionTypesByTag(String)} - */ - @Deprecated - Set<ConditionType> getConditionTypesByTag(Tag tag, boolean includeFromSubtags); - - /** - * Retrieves the set of condition types with the specified tag also retrieving condition types from sub-tags if so specified. - * - * @param tag the tag marking the condition types we want to retrieve * @return the set of condition types with the specified tag (and its sub-tags, if specified) */ Set<ConditionType> getConditionTypesByTag(String tag); @@ -129,17 +81,6 @@ public interface DefinitionsService { * Retrieves the set of action types with the specified tag also retrieving action types from sub-tags if so specified. * * @param tag the tag marking the action types we want to retrieve - * @param includeFromSubtags {@code true} if we want to also include action types marked by sub-tags of the specified tag - * @return the set of action types with the specified tag (and its sub-tags, if specified) - * @deprecated will be replace by {@link #getActionTypeByTag(String)} - */ - @Deprecated - Set<ActionType> getActionTypeByTag(Tag tag, boolean includeFromSubtags); - - /** - * Retrieves the set of action types with the specified tag also retrieving action types from sub-tags if so specified. - * - * @param tag the tag marking the action types we want to retrieve * @return the set of action types with the specified tag (and its sub-tags, if specified) */ Set<ActionType> getActionTypeByTag(String tag); @@ -177,17 +118,6 @@ public interface DefinitionsService { * Retrieves the set of value types with the specified tag also retrieving value types from sub-tags if so specified. * * @param tag the tag marking the value types we want to retrieve - * @param includeFromSubtags {@code true} if we want to also include value types marked by sub-tags of the specified tag - * @return the set of value types with the specified tag (and its sub-tags, if specified) - * @deprecated will be replace by {@link #getValueTypeByTag(String)} - */ - @Deprecated - Set<ValueType> getValueTypeByTag(Tag tag, boolean includeFromSubtags); - - /** - * Retrieves the set of value types with the specified tag also retrieving value types from sub-tags if so specified. - * - * @param tag the tag marking the value types we want to retrieve * @return the set of value types with the specified tag (and its sub-tags, if specified) */ Set<ValueType> getValueTypeByTag(String tag); @@ -233,10 +163,10 @@ public interface DefinitionsService { * TODO: purpose and behavior not clear * * @param rootCondition - * @param tagId + * @param tag * @return */ - Condition extractConditionByTag(Condition rootCondition, String tagId); + Condition extractConditionByTag(Condition rootCondition, String tag); /** * Resolves (if possible) the {@link ConditionType}s for the specified condition and its sub-conditions (if any) from the type identifiers existing on the specified condition http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/api/src/main/java/org/apache/unomi/api/services/ProfileService.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/unomi/api/services/ProfileService.java b/api/src/main/java/org/apache/unomi/api/services/ProfileService.java index e7e2369..7b07fcf 100644 --- a/api/src/main/java/org/apache/unomi/api/services/ProfileService.java +++ b/api/src/main/java/org/apache/unomi/api/services/ProfileService.java @@ -260,19 +260,6 @@ public interface ProfileService { * TODO: move to a different class * * @param tag the tag name marking property types we want to retrieve - * @param includeFromSubtags {@code true} if sub-tags of the specified tag should also be considered, {@code false} otherwise - * @return a Set of the property types with the specified tag - * @deprecated will be replace by {@link #getPropertyTypeByTag(String)} in next major release - */ - @Deprecated - Set<PropertyType> getPropertyTypeByTag(String tag, boolean includeFromSubtags); - - /** - * Retrieves all property types with the specified tag also retrieving property types with sub-tags of the specified tag if so specified. - * - * TODO: move to a different class - * - * @param tag the tag name marking property types we want to retrieve * @return a Set of the property types with the specified tag */ Set<PropertyType> getPropertyTypeByTag(String tag); @@ -322,11 +309,11 @@ public interface ProfileService { * * TODO: move to a different class * - * @param tagId the tag we're interested in + * @param tag the tag we're interested in * @param itemType the String representation of the item type we want to retrieve the count of, as defined by its class' {@code ITEM_TYPE} field * @return all property types defined for the specified item type and with the specified tag */ - Set<PropertyType> getExistingProperties(String tagId, String itemType); + Set<PropertyType> getExistingProperties(String tag, String itemType); } http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/extensions/lists-extension/actions/src/main/resources/META-INF/cxs/actions/addToLists.json ---------------------------------------------------------------------- diff --git a/extensions/lists-extension/actions/src/main/resources/META-INF/cxs/actions/addToLists.json b/extensions/lists-extension/actions/src/main/resources/META-INF/cxs/actions/addToLists.json index 7c7e096..ec4a531 100644 --- a/extensions/lists-extension/actions/src/main/resources/META-INF/cxs/actions/addToLists.json +++ b/extensions/lists-extension/actions/src/main/resources/META-INF/cxs/actions/addToLists.json @@ -4,6 +4,7 @@ "name": "addToListsAction", "description": "", "tags": [ + "profileTags", "demographic", "hidden.availableToEndUser" ], http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/extensions/salesforce-connector/actions/src/main/resources/META-INF/cxs/actions/sfdcCreateOrUpdateLead.json ---------------------------------------------------------------------- diff --git a/extensions/salesforce-connector/actions/src/main/resources/META-INF/cxs/actions/sfdcCreateOrUpdateLead.json b/extensions/salesforce-connector/actions/src/main/resources/META-INF/cxs/actions/sfdcCreateOrUpdateLead.json index 55c7da3..f5b9bf5 100644 --- a/extensions/salesforce-connector/actions/src/main/resources/META-INF/cxs/actions/sfdcCreateOrUpdateLead.json +++ b/extensions/salesforce-connector/actions/src/main/resources/META-INF/cxs/actions/sfdcCreateOrUpdateLead.json @@ -4,6 +4,7 @@ "name": "sfdcCreateOrUpdateLeadAction", "description": "", "tags": [ + "profileTags", "demographic", "hidden.availableToEndUser" ], http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/extensions/salesforce-connector/actions/src/main/resources/META-INF/cxs/actions/sfdcUpdateProfileFromLead.json ---------------------------------------------------------------------- diff --git a/extensions/salesforce-connector/actions/src/main/resources/META-INF/cxs/actions/sfdcUpdateProfileFromLead.json b/extensions/salesforce-connector/actions/src/main/resources/META-INF/cxs/actions/sfdcUpdateProfileFromLead.json index 598edb7..f53501f 100644 --- a/extensions/salesforce-connector/actions/src/main/resources/META-INF/cxs/actions/sfdcUpdateProfileFromLead.json +++ b/extensions/salesforce-connector/actions/src/main/resources/META-INF/cxs/actions/sfdcUpdateProfileFromLead.json @@ -4,6 +4,7 @@ "name": "sfdcUpdateProfileFromLeadAction", "description": "", "tags": [ + "profileTags", "demographic", "hidden.availableToEndUser" ], http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/performance-tests/src/test/scala/unomi/AdminScenario.scala ---------------------------------------------------------------------- diff --git a/performance-tests/src/test/scala/unomi/AdminScenario.scala b/performance-tests/src/test/scala/unomi/AdminScenario.scala index f71540c..74be4d0 100644 --- a/performance-tests/src/test/scala/unomi/AdminScenario.scala +++ b/performance-tests/src/test/scala/unomi/AdminScenario.scala @@ -105,7 +105,7 @@ object AdminScenario { .headers(adminHeaders) .check(jsonPath("$..id").find.is("profileTags"))) - .exec(http("Existing profile properties").get("/cxs/profiles/existingProperties?tagId=profileProperties&itemType=profile") + .exec(http("Existing profile properties").get("/cxs/profiles/existingProperties?tag=profileProperties&itemType=profile") .headers(adminHeaders) .check(jsonPath("$..itemId").find.exists)) http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/allEventToProfilePropertiesAction.json ---------------------------------------------------------------------- diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/allEventToProfilePropertiesAction.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/allEventToProfilePropertiesAction.json index adb62e6..869a287 100644 --- a/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/allEventToProfilePropertiesAction.json +++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/allEventToProfilePropertiesAction.json @@ -4,6 +4,7 @@ "name": "allEventToProfilePropertiesAction", "description": "", "tags": [ + "profileTags", "event" ], "readOnly": true http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/evaluateProfileAgeAction.json ---------------------------------------------------------------------- diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/evaluateProfileAgeAction.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/evaluateProfileAgeAction.json index 553f021..0ed9ebd 100644 --- a/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/evaluateProfileAgeAction.json +++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/evaluateProfileAgeAction.json @@ -4,6 +4,7 @@ "name": "evaluateProfileAgeAction", "description": "", "tags": [ + "profileTags", "event" ], "readOnly": true http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/evaluateProfileSegmentsAction.json ---------------------------------------------------------------------- diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/evaluateProfileSegmentsAction.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/evaluateProfileSegmentsAction.json index e5a86e2..188f547 100644 --- a/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/evaluateProfileSegmentsAction.json +++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/evaluateProfileSegmentsAction.json @@ -4,6 +4,7 @@ "name": "evaluateProfileSegmentsAction", "description": "", "tags": [ + "profileTags", "event" ], "readOnly": true http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/eventToProfilePropertyAction.json ---------------------------------------------------------------------- diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/eventToProfilePropertyAction.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/eventToProfilePropertyAction.json index 5539e1d..a3a045d 100644 --- a/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/eventToProfilePropertyAction.json +++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/eventToProfilePropertyAction.json @@ -4,6 +4,7 @@ "name": "eventToProfilePropertyAction", "description": "", "tags": [ + "profileTags", "event" ], "readOnly": true http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/mergeProfilesOnPropertyAction.json ---------------------------------------------------------------------- diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/mergeProfilesOnPropertyAction.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/mergeProfilesOnPropertyAction.json index 62d3719..77d9969 100644 --- a/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/mergeProfilesOnPropertyAction.json +++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/mergeProfilesOnPropertyAction.json @@ -4,6 +4,7 @@ "name": "mergeProfilesOnPropertyAction", "description": "", "tags": [ + "profileTags", "demographic" ], "readOnly": true http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/sendEventAction.json ---------------------------------------------------------------------- diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/sendEventAction.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/sendEventAction.json index ef8535c..d7a8d09 100644 --- a/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/sendEventAction.json +++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/sendEventAction.json @@ -4,6 +4,7 @@ "name": "sendEventAction", "description": "", "tags": [ + "profileTags", "event" ], "readOnly": true http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/setEventOccurenceCountAction.json ---------------------------------------------------------------------- diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/setEventOccurenceCountAction.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/setEventOccurenceCountAction.json index 9a48874..4bd77bb 100644 --- a/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/setEventOccurenceCountAction.json +++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/setEventOccurenceCountAction.json @@ -4,6 +4,7 @@ "name": "setEventOccurenceCountAction", "description": "", "tags": [ + "profileTags", "demographic" ], "readOnly": true http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/setPropertyAction.json ---------------------------------------------------------------------- diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/setPropertyAction.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/setPropertyAction.json index 53c1b64..25cf616 100644 --- a/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/setPropertyAction.json +++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/setPropertyAction.json @@ -4,6 +4,7 @@ "name": "setPropertyAction", "description": "", "tags": [ + "profileTags", "demographic", "hidden.availableToEndUser", "hidden.allowMultipleInstances" http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/booleanCondition.json ---------------------------------------------------------------------- diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/booleanCondition.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/booleanCondition.json index ba3b806..a12a0dd 100644 --- a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/booleanCondition.json +++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/booleanCondition.json @@ -4,7 +4,9 @@ "name": "booleanCondition", "description": "", "tags": [ + "profileTags", "logical", + "condition", "profileCondition", "eventCondition", "sessionCondition", http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/eventPropertyCondition.json ---------------------------------------------------------------------- diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/eventPropertyCondition.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/eventPropertyCondition.json index 6c3ef41..45482cc 100644 --- a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/eventPropertyCondition.json +++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/eventPropertyCondition.json @@ -4,7 +4,9 @@ "name": "eventPropertyCondition", "description": "", "tags": [ + "profileTags", "demographic", + "condition", "eventCondition" ], "readOnly": true http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/eventTypeCondition.json ---------------------------------------------------------------------- diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/eventTypeCondition.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/eventTypeCondition.json index 0715f7a..0a104e4 100644 --- a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/eventTypeCondition.json +++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/eventTypeCondition.json @@ -4,7 +4,9 @@ "name": "eventTypeCondition", "description": "", "tags": [ + "profileTags", "event", + "condition", "eventCondition" ], "readOnly": true http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/formEventCondition.json ---------------------------------------------------------------------- diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/formEventCondition.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/formEventCondition.json index e375267..b1e4fff 100644 --- a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/formEventCondition.json +++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/formEventCondition.json @@ -4,7 +4,9 @@ "name": "formEventCondition", "description": "", "tags": [ + "profileTags", "event", + "condition", "eventCondition", "usableInPastEventCondition", "trackedCondition" http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/geoLocationByPointSessionCondition.json ---------------------------------------------------------------------- diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/geoLocationByPointSessionCondition.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/geoLocationByPointSessionCondition.json index 4c77df3..cdc340d 100644 --- a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/geoLocationByPointSessionCondition.json +++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/geoLocationByPointSessionCondition.json @@ -4,7 +4,9 @@ "name": "geoLocationByPointSessionCondition", "description": "", "tags": [ + "profileTags", "geographic", + "condition", "sessionCondition" ], "readOnly": true http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/geoLocationSessionCondition.json ---------------------------------------------------------------------- diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/geoLocationSessionCondition.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/geoLocationSessionCondition.json index 4468079..c3206ae 100644 --- a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/geoLocationSessionCondition.json +++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/geoLocationSessionCondition.json @@ -4,7 +4,9 @@ "name": "geoLocationSessionCondition", "description": "", "tags": [ + "profileTags", "geographic", + "condition", "sessionCondition" ], "readOnly": true http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/goalMatchCondition.json ---------------------------------------------------------------------- diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/goalMatchCondition.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/goalMatchCondition.json index 417f01d..8d9743b 100644 --- a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/goalMatchCondition.json +++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/goalMatchCondition.json @@ -4,7 +4,9 @@ "name": "goalMatchCondition", "description": "", "tags": [ + "condition", "profileCondition", + "profileTags", "event" ], "readOnly": true http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/matchAllCondition.json ---------------------------------------------------------------------- diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/matchAllCondition.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/matchAllCondition.json index c10446e..b866e48 100644 --- a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/matchAllCondition.json +++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/matchAllCondition.json @@ -4,7 +4,9 @@ "name": "matchAllCondition", "description": "", "tags": [ + "profileTags", "logical", + "condition", "profileCondition", "eventCondition", "sessionCondition", http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/newVisitorCondition.json ---------------------------------------------------------------------- diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/newVisitorCondition.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/newVisitorCondition.json index 6bdb2f6..c90ce4f 100644 --- a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/newVisitorCondition.json +++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/newVisitorCondition.json @@ -4,7 +4,9 @@ "name": "newVisitorCondition", "description": "", "tags": [ + "profileTags", "event", + "condition", "sessionCondition" ], "readOnly": true http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/notCondition.json ---------------------------------------------------------------------- diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/notCondition.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/notCondition.json index 4776d4d..3ab26b3 100644 --- a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/notCondition.json +++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/notCondition.json @@ -4,7 +4,9 @@ "name": "notCondition", "description": "", "tags": [ + "profileTags", "logical", + "condition", "profileCondition", "eventCondition", "sessionCondition", http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/pastEventCondition.json ---------------------------------------------------------------------- diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/pastEventCondition.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/pastEventCondition.json index a0e280e..52c9d5e 100644 --- a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/pastEventCondition.json +++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/pastEventCondition.json @@ -4,7 +4,9 @@ "name": "pastEventCondition", "description": "", "tags": [ + "profileTags", "event", + "condition", "profileCondition" ], "readOnly": true http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/profilePropertyCondition.json ---------------------------------------------------------------------- diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/profilePropertyCondition.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/profilePropertyCondition.json index abaabd5..06ae965 100644 --- a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/profilePropertyCondition.json +++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/profilePropertyCondition.json @@ -4,7 +4,9 @@ "name": "profilePropertyCondition", "description": "", "tags": [ + "profileTags", "demographic", + "condition", "profileCondition" ], "readOnly": true http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/profileSegmentCondition.json ---------------------------------------------------------------------- diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/profileSegmentCondition.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/profileSegmentCondition.json index 40235e0..b1a40e1 100644 --- a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/profileSegmentCondition.json +++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/profileSegmentCondition.json @@ -4,7 +4,9 @@ "name": "profileSegmentCondition", "description": "", "tags": [ + "profileTags", "aggregated", + "condition", "profileCondition" ], "readOnly": true http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/profileUpdatedEventCondition.json ---------------------------------------------------------------------- diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/profileUpdatedEventCondition.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/profileUpdatedEventCondition.json index b2efa0b..7910a13 100644 --- a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/profileUpdatedEventCondition.json +++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/profileUpdatedEventCondition.json @@ -4,7 +4,9 @@ "name": "profileUpdatedEventCondition", "description": "", "tags": [ + "profileTags", "event", + "condition", "eventCondition" ], "readOnly": true http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/profileUserListCondition.json ---------------------------------------------------------------------- diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/profileUserListCondition.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/profileUserListCondition.json index 221f5f9..4891a5a 100644 --- a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/profileUserListCondition.json +++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/profileUserListCondition.json @@ -4,7 +4,9 @@ "name": "profileUserListCondition", "description": "", "tags": [ + "profileTags", "aggregated", + "condition", "profileCondition" ], "readOnly": true http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/returningVisitorCondition.json ---------------------------------------------------------------------- diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/returningVisitorCondition.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/returningVisitorCondition.json index 2ecf315..165ee4a 100644 --- a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/returningVisitorCondition.json +++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/returningVisitorCondition.json @@ -4,7 +4,9 @@ "name": "returningVisitorCondition", "description": "", "tags": [ + "profileTags", "event", + "condition", "sessionCondition" ], "readOnly": true http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/scoringCondition.json ---------------------------------------------------------------------- diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/scoringCondition.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/scoringCondition.json index 6ef37fc..89c176f 100644 --- a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/scoringCondition.json +++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/scoringCondition.json @@ -4,7 +4,9 @@ "name": "scoringCondition", "description": "", "tags": [ + "profileTags", "aggregated", + "condition", "profileCondition" ], "readOnly": true http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/sessionCreatedEventCondition.json ---------------------------------------------------------------------- diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/sessionCreatedEventCondition.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/sessionCreatedEventCondition.json index 25f1818..fb43b88 100644 --- a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/sessionCreatedEventCondition.json +++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/sessionCreatedEventCondition.json @@ -4,7 +4,9 @@ "name": "sessionCreatedEventCondition", "description": "", "tags": [ + "profileTags", "event", + "condition", "eventCondition" ], "readOnly": true http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/sessionDurationCondition.json ---------------------------------------------------------------------- diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/sessionDurationCondition.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/sessionDurationCondition.json index f55b85c..47b214b 100644 --- a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/sessionDurationCondition.json +++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/sessionDurationCondition.json @@ -4,7 +4,9 @@ "name": "sessionDurationCondition", "description": "", "tags": [ + "profileTags", "event", + "condition", "sessionCondition" ], "readOnly": true http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/sessionPropertyCondition.json ---------------------------------------------------------------------- diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/sessionPropertyCondition.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/sessionPropertyCondition.json index 3c3328a..c613839 100644 --- a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/sessionPropertyCondition.json +++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/sessionPropertyCondition.json @@ -4,7 +4,9 @@ "name": "sessionPropertyCondition", "description": "", "tags": [ + "profileTags", "event", + "condition", "sessionCondition" ], "readOnly": true http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/sourceEventPropertyCondition.json ---------------------------------------------------------------------- diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/sourceEventPropertyCondition.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/sourceEventPropertyCondition.json index d977dbc..1aaf934 100644 --- a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/sourceEventPropertyCondition.json +++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/sourceEventPropertyCondition.json @@ -4,6 +4,7 @@ "name": "sourceEventPropertyCondition", "description": "", "tags": [ + "condition", "sourceEventCondition" ], "readOnly": true http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/videoViewEventCondition.json ---------------------------------------------------------------------- diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/videoViewEventCondition.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/videoViewEventCondition.json index cc74144..8efc923 100644 --- a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/videoViewEventCondition.json +++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/videoViewEventCondition.json @@ -4,7 +4,9 @@ "name": "videoViewEventCondition", "description": "", "tags": [ + "profileTags", "event", + "condition", "eventCondition", "usableInPastEventCondition", "trackedCondition" http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/plugins/hover-event/src/main/resources/META-INF/cxs/conditions/hoverEventCondition.json ---------------------------------------------------------------------- diff --git a/plugins/hover-event/src/main/resources/META-INF/cxs/conditions/hoverEventCondition.json b/plugins/hover-event/src/main/resources/META-INF/cxs/conditions/hoverEventCondition.json index 711eb61..a205b9c 100644 --- a/plugins/hover-event/src/main/resources/META-INF/cxs/conditions/hoverEventCondition.json +++ b/plugins/hover-event/src/main/resources/META-INF/cxs/conditions/hoverEventCondition.json @@ -4,7 +4,9 @@ "name": "hoverEventCondition", "description": "", "tags": [ + "profileTags", "event", + "condition", "eventCondition", "usableInPastEventCondition" ], http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/plugins/mail/src/main/resources/META-INF/cxs/actions/sendMailAction.json ---------------------------------------------------------------------- diff --git a/plugins/mail/src/main/resources/META-INF/cxs/actions/sendMailAction.json b/plugins/mail/src/main/resources/META-INF/cxs/actions/sendMailAction.json index ffe346a..fd3c8e9 100644 --- a/plugins/mail/src/main/resources/META-INF/cxs/actions/sendMailAction.json +++ b/plugins/mail/src/main/resources/META-INF/cxs/actions/sendMailAction.json @@ -4,6 +4,7 @@ "name": "sendMailAction", "description": "", "tags": [ + "profileTags", "event", "hidden.availableToEndUser", "hidden.allowMultipleInstances" http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/plugins/request/src/main/resources/META-INF/cxs/actions/requestHeaderToProfilePropertyAction.json ---------------------------------------------------------------------- diff --git a/plugins/request/src/main/resources/META-INF/cxs/actions/requestHeaderToProfilePropertyAction.json b/plugins/request/src/main/resources/META-INF/cxs/actions/requestHeaderToProfilePropertyAction.json index fbe702f..3bd5d81 100644 --- a/plugins/request/src/main/resources/META-INF/cxs/actions/requestHeaderToProfilePropertyAction.json +++ b/plugins/request/src/main/resources/META-INF/cxs/actions/requestHeaderToProfilePropertyAction.json @@ -4,6 +4,7 @@ "name": "requestHeaderToProfilePropertyAction", "description": "", "tags": [ + "profileTags", "event" ], "readOnly": true http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/plugins/request/src/main/resources/META-INF/cxs/actions/requestParameterToProfilePropertyAction.json ---------------------------------------------------------------------- diff --git a/plugins/request/src/main/resources/META-INF/cxs/actions/requestParameterToProfilePropertyAction.json b/plugins/request/src/main/resources/META-INF/cxs/actions/requestParameterToProfilePropertyAction.json index b7eba57..0288056 100644 --- a/plugins/request/src/main/resources/META-INF/cxs/actions/requestParameterToProfilePropertyAction.json +++ b/plugins/request/src/main/resources/META-INF/cxs/actions/requestParameterToProfilePropertyAction.json @@ -4,6 +4,7 @@ "name": "requestParameterToProfilePropertyAction", "description": "", "tags": [ + "profileTags", "event" ], "readOnly": true http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/plugins/request/src/main/resources/META-INF/cxs/actions/setRemoteHostInfoAction.json ---------------------------------------------------------------------- diff --git a/plugins/request/src/main/resources/META-INF/cxs/actions/setRemoteHostInfoAction.json b/plugins/request/src/main/resources/META-INF/cxs/actions/setRemoteHostInfoAction.json index 803b2e5..09935f5 100644 --- a/plugins/request/src/main/resources/META-INF/cxs/actions/setRemoteHostInfoAction.json +++ b/plugins/request/src/main/resources/META-INF/cxs/actions/setRemoteHostInfoAction.json @@ -4,6 +4,7 @@ "name": "setRemoteHostInfoAction", "description": "", "tags": [ + "profileTags", "event" ], "readOnly": true http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/rest/src/main/java/org/apache/unomi/rest/DefinitionsServiceEndPoint.java ---------------------------------------------------------------------- diff --git a/rest/src/main/java/org/apache/unomi/rest/DefinitionsServiceEndPoint.java b/rest/src/main/java/org/apache/unomi/rest/DefinitionsServiceEndPoint.java index 4337ccd..2fd415a 100644 --- a/rest/src/main/java/org/apache/unomi/rest/DefinitionsServiceEndPoint.java +++ b/rest/src/main/java/org/apache/unomi/rest/DefinitionsServiceEndPoint.java @@ -20,7 +20,6 @@ package org.apache.unomi.rest; import org.apache.cxf.rs.security.cors.CrossOriginResourceSharing; import org.apache.unomi.api.PluginType; import org.apache.unomi.api.PropertyMergeStrategyType; -import org.apache.unomi.api.Tag; import org.apache.unomi.api.ValueType; import org.apache.unomi.api.actions.ActionType; import org.apache.unomi.api.conditions.ConditionType; @@ -60,66 +59,6 @@ public class DefinitionsServiceEndPoint { } /** - * Retrieves all known tags localized using the specified language. - * - * @param language the language to use to localize - * @return the set of all known tags - * @deprecated will be removed in next major release as tag become an open string - */ - @GET - @Path("/tags") - @Deprecated - public Collection<RESTTag> getAllTags(@HeaderParam("Accept-Language") String language) { - return localizationHelper.generateTags(definitionsService.getAllTags(), language); - } - - /** - * Retrieves the set of all root tags from which all other tags are derived via sub-tags localized using the specified language. - * - * @param language the language to use to localize. - * @return the set of all root tags - * @deprecated will be removed in next major release as tag become an open string - */ - @GET - @Path("/rootTags") - @Deprecated - public Collection<RESTTag> getRootTags(@HeaderParam("Accept-Language") String language) { - return localizationHelper.generateTags(definitionsService.getRootTags(), language); - } - - /** - * Retrieves the tag with the specified identifier localized using the specified language. - * - * @param language the language to use to localize. - * @param tagId the identifier of the tag to retrieve - * @param filterHidden {@code true} if hidden sub-tags should be filtered out, {@code false} otherwise - * @return the tag with the specified identifier - * @deprecated will be removed in next major release as tag become an open string - */ - @GET - @Path("/tags/{tagId}") - @Deprecated - public RESTTag getTag(@PathParam("tagId") String tagId, @QueryParam("filterHidden") @DefaultValue("false") boolean filterHidden, @HeaderParam("Accept-Language") String language) { - Tag tag = definitionsService.getTag(tagId); - if (tag == null) { - throw new NotFoundException(new NoSuchElementException(tagId)); // return 404 when tag is not found - } - return localizationHelper.generateTag(tag, language, filterHidden); - } - - /** - * Add a new tag to the list of tags - * @param tag the tag to add - * @deprecated will be removed in next major release as tag become an open string - */ - @POST - @Path("/tags") - @Deprecated - public void addTag(Tag tag) { - definitionsService.addTag(tag); - } - - /** * Retrieves all condition types localized using the specified language. * * @param language the language to use to localize. @@ -137,19 +76,15 @@ public class DefinitionsServiceEndPoint { * * @param language the language to use to localize. * @param tags a comma-separated list of tag identifiers - * @param recursive {@code true} if we want to also include condition types marked by sub-tags of the specified tag * @return the set of condition types with the specified tag (and its sub-tags, if specified) */ @GET - @Path("/conditions/tags/{tagId}") - public Collection<RESTConditionType> getConditionTypesByTag(@PathParam("tagId") String tags, @Deprecated @QueryParam("recursive") @DefaultValue("false") boolean recursive, @HeaderParam("Accept-Language") String language) { + @Path("/conditions/tags/{tags}") + public Collection<RESTConditionType> getConditionTypesByTag(@PathParam("tags") String tags, @HeaderParam("Accept-Language") String language) { String[] tagsArray = tags.split(","); Set<ConditionType> results = new LinkedHashSet<>(); - for (String s : tagsArray) { - Tag tag = definitionsService.getTag(s); - if (tag != null) { - results.addAll(definitionsService.getConditionTypesByTag(tag, recursive)); - } + for (String tag : tagsArray) { + results.addAll(definitionsService.getConditionTypesByTag(tag)); } return localizationHelper.generateConditions(results, language); } @@ -208,19 +143,15 @@ public class DefinitionsServiceEndPoint { * * @param language the language to use to localize. * @param tags the tag marking the action types we want to retrieve - * @param recursive {@code true} if we want to also include action types marked by sub-tags of the specified tag * @return the set of action types with the specified tag (and its sub-tags, if specified) */ @GET - @Path("/actions/tags/{tagId}") - public Collection<RESTActionType> getActionTypeByTag(@PathParam("tagId") String tags, @Deprecated @QueryParam("recursive") @DefaultValue("false") boolean recursive, @HeaderParam("Accept-Language") String language) { + @Path("/actions/tags/{tags}") + public Collection<RESTActionType> getActionTypeByTag(@PathParam("tags") String tags, @HeaderParam("Accept-Language") String language) { String[] tagsArray = tags.split(","); Set<ActionType> results = new LinkedHashSet<>(); - for (String s : tagsArray) { - Tag tag = definitionsService.getTag(s); - if (tag != null) { - results.addAll(definitionsService.getActionTypeByTag(tag, recursive)); - } + for (String tag : tagsArray) { + results.addAll(definitionsService.getActionTypeByTag(tag)); } return localizationHelper.generateActions(results, language); } @@ -278,19 +209,15 @@ public class DefinitionsServiceEndPoint { * * @param language the language to use to localize. * @param tags the tag marking the value types we want to retrieve - * @param recursive {@code true} if we want to also include value types marked by sub-tags of the specified tag * @return the set of value types with the specified tag (and its sub-tags, if specified) */ @GET - @Path("/values/tags/{tagId}") - public Collection<RESTValueType> getValueTypeByTag(@PathParam("tagId") String tags, @Deprecated @QueryParam("recursive") @DefaultValue("false") boolean recursive, @HeaderParam("Accept-Language") String language) { + @Path("/values/tags/{tags}") + public Collection<RESTValueType> getValueTypeByTag(@PathParam("tags") String tags, @HeaderParam("Accept-Language") String language) { String[] tagsArray = tags.split(","); Set<ValueType> results = new LinkedHashSet<>(); - for (String s : tagsArray) { - Tag tag = definitionsService.getTag(s); - if (tag != null) { - results.addAll(definitionsService.getValueTypeByTag(tag, recursive)); - } + for (String tag : tagsArray) { + results.addAll(definitionsService.getValueTypeByTag(tag)); } return localizationHelper.generateValueTypes(results, language); } http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/rest/src/main/java/org/apache/unomi/rest/LocalizationHelper.java ---------------------------------------------------------------------- diff --git a/rest/src/main/java/org/apache/unomi/rest/LocalizationHelper.java b/rest/src/main/java/org/apache/unomi/rest/LocalizationHelper.java index 6cb5d89..426c82e 100644 --- a/rest/src/main/java/org/apache/unomi/rest/LocalizationHelper.java +++ b/rest/src/main/java/org/apache/unomi/rest/LocalizationHelper.java @@ -18,7 +18,6 @@ package org.apache.unomi.rest; import org.apache.unomi.api.Parameter; -import org.apache.unomi.api.Tag; import org.apache.unomi.api.ValueType; import org.apache.unomi.api.actions.ActionType; import org.apache.unomi.api.conditions.ConditionType; @@ -173,63 +172,7 @@ public class LocalizationHelper { ResourceBundle bundle = resourceBundleHelper.getResourceBundle(valueType, language); result.setName(resourceBundleHelper.getResourceBundleValue(bundle, valueType.getNameKey())); result.setDescription(resourceBundleHelper.getResourceBundleValue(bundle, valueType.getDescriptionKey())); - result.setTags(generateTags(valueType.getTags(), language)); - return result; - } - - /** - * Same as generateTages(tags, language, false). - */ - public Collection<RESTTag> generateTags(Collection<Tag> tags, String language) { - return generateTags(tags, language, false); - } - - /** - * Creates {@link RESTTag}s, localized using the specified language, based on the specified {@link Tag}s. - * - * @param tags the {@link Tag}s to be localized - * @param language the language to use to localize {@link Tag}s - * @param filterHidden {@code true} to filter out hidden tags, {@code false} otherwise - * @return a collection of {@link RESTTag}s based on the specified {@link Tag}s and localized using the specified language - */ - public Collection<RESTTag> generateTags(Collection<Tag> tags, String language, boolean filterHidden) { - List<RESTTag> result = new ArrayList<RESTTag>(); - for (Tag tag : tags) { - RESTTag subTag = generateTag(tag, language, filterHidden); - if (subTag != null) { - result.add(subTag); - } - } - return result; - } - - /** - * Same as generateTag(tag, language, false). - */ - public RESTTag generateTag(Tag tag, String language) { - return generateTag(tag, language, false); - } - - /** - * Creates a {@link RESTTag}, localized using the specified language, based on the specified {@link Tag}. - * - * @param tag the {@link Tag} to be localized - * @param language the language to use to localize the {@link Tag} - * @param filterHidden {@code true} to filter out hidden sub-tags, {@code false} otherwise - * @return a {@link RESTTag} based on the specified {@link Tag} and localized using the specified language - */ - public RESTTag generateTag(Tag tag, String language, boolean filterHidden) { - if (tag == null || (filterHidden && tag.isHidden())) { - return null; - } - RESTTag result = new RESTTag(); - result.setId(tag.getId()); - ResourceBundle bundle = resourceBundleHelper.getResourceBundle(tag, language); - result.setName(resourceBundleHelper.getResourceBundleValue(bundle, tag.getNameKey())); - result.setDescription(resourceBundleHelper.getResourceBundleValue(bundle, tag.getDescriptionKey())); - result.setParentId(tag.getParentId()); - result.setRank(tag.getRank()); - result.setSubTags(generateTags(tag.getSubTags(), language, filterHidden)); + result.setTags(valueType.getTags()); return result; } http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/rest/src/main/java/org/apache/unomi/rest/ProfileServiceEndPoint.java ---------------------------------------------------------------------- diff --git a/rest/src/main/java/org/apache/unomi/rest/ProfileServiceEndPoint.java b/rest/src/main/java/org/apache/unomi/rest/ProfileServiceEndPoint.java index 1454afe..27a8324 100644 --- a/rest/src/main/java/org/apache/unomi/rest/ProfileServiceEndPoint.java +++ b/rest/src/main/java/org/apache/unomi/rest/ProfileServiceEndPoint.java @@ -443,15 +443,15 @@ public class ProfileServiceEndPoint { * * TODO: move to a different class * - * @param tagId the tag we're interested in + * @param tag the tag we're interested in * @param itemType the String representation of the item type we want to retrieve the count of, as defined by its class' {@code ITEM_TYPE} field * @param language the value of the {@code Accept-Language} header to specify in which locale the properties description should be returned TODO unused * @return all property types defined for the specified item type and with the specified tag */ @GET @Path("/existingProperties") - public Collection<PropertyType> getExistingProperties(@QueryParam("tagId") String tagId, @QueryParam("itemType") String itemType, @HeaderParam("Accept-Language") String language) { - Set<PropertyType> properties = profileService.getExistingProperties(tagId, itemType); + public Collection<PropertyType> getExistingProperties(@QueryParam("tag") String tag, @QueryParam("itemType") String itemType, @HeaderParam("Accept-Language") String language) { + Set<PropertyType> properties = profileService.getExistingProperties(tag, itemType); return properties; } @@ -491,17 +491,16 @@ public class ProfileServiceEndPoint { * TODO: passing a list of tags via a comma-separated list is not very RESTful * * @param tags a comma-separated list of tag identifiers - * @param recursive {@code true} if sub-tags of the specified tag should also be considered, {@code false} otherwise * @param language the value of the {@code Accept-Language} header to specify in which locale the properties description should be returned TODO unused * @return a Set of the property types with the specified tag */ @GET - @Path("/properties/tags/{tagId}") - public Collection<PropertyType> getPropertyTypeByTag(@PathParam("tagId") String tags, @Deprecated @QueryParam("recursive") @DefaultValue("false") boolean recursive, @HeaderParam("Accept-Language") String language) { + @Path("/properties/tags/{tags}") + public Collection<PropertyType> getPropertyTypeByTag(@PathParam("tags") String tags, @HeaderParam("Accept-Language") String language) { String[] tagsArray = tags.split(","); Set<PropertyType> results = new LinkedHashSet<>(); - for (String s : tagsArray) { - results.addAll(profileService.getPropertyTypeByTag(s, recursive)); + for (String tag : tagsArray) { + results.addAll(profileService.getPropertyTypeByTag(tag)); } return results; } http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/rest/src/main/java/org/apache/unomi/rest/RESTActionType.java ---------------------------------------------------------------------- diff --git a/rest/src/main/java/org/apache/unomi/rest/RESTActionType.java b/rest/src/main/java/org/apache/unomi/rest/RESTActionType.java index 5e73a0f..b135adc 100644 --- a/rest/src/main/java/org/apache/unomi/rest/RESTActionType.java +++ b/rest/src/main/java/org/apache/unomi/rest/RESTActionType.java @@ -19,8 +19,8 @@ package org.apache.unomi.rest; import org.apache.unomi.api.actions.ActionType; -import java.util.Collection; import java.util.List; +import java.util.Set; /** * A representation of an {@link ActionType} better suited for definitions. @@ -29,7 +29,7 @@ public class RESTActionType { private String id; private String name; private String description; - private Collection<String> tags; + private Set<String> tags; private List<RESTParameter> parameters; public String getId() { @@ -56,11 +56,11 @@ public class RESTActionType { this.description = description; } - public Collection<String> getTags() { + public Set<String> getTags() { return tags; } - public void setTags(Collection<String> tags) { + public void setTags(Set<String> tags) { this.tags = tags; } http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/rest/src/main/java/org/apache/unomi/rest/RESTConditionType.java ---------------------------------------------------------------------- diff --git a/rest/src/main/java/org/apache/unomi/rest/RESTConditionType.java b/rest/src/main/java/org/apache/unomi/rest/RESTConditionType.java index e37156f..6ffce83 100644 --- a/rest/src/main/java/org/apache/unomi/rest/RESTConditionType.java +++ b/rest/src/main/java/org/apache/unomi/rest/RESTConditionType.java @@ -19,10 +19,7 @@ package org.apache.unomi.rest; import org.apache.unomi.api.conditions.ConditionType; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.TreeSet; +import java.util.*; /** * A representation of a {@link ConditionType} better suited for definitions. @@ -31,7 +28,7 @@ public class RESTConditionType { private String id; private String name; private String description; - private Collection<String> tags = new TreeSet<String>(); + private Set<String> tags = new LinkedHashSet<>(); private List<RESTParameter> parameters = new ArrayList<RESTParameter>(); public RESTConditionType() { @@ -61,11 +58,11 @@ public class RESTConditionType { this.description = description; } - public Collection<String> getTags() { + public Set<String> getTags() { return tags; } - public void setTags(Collection<String> tags) { + public void setTags(Set<String> tags) { this.tags = tags; } http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/rest/src/main/java/org/apache/unomi/rest/RESTTag.java ---------------------------------------------------------------------- diff --git a/rest/src/main/java/org/apache/unomi/rest/RESTTag.java b/rest/src/main/java/org/apache/unomi/rest/RESTTag.java deleted file mode 100644 index da1c394..0000000 --- a/rest/src/main/java/org/apache/unomi/rest/RESTTag.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.unomi.rest; - -import org.apache.unomi.api.Tag; - -import java.util.Collection; -import java.util.TreeSet; - -/** - * A representation of a {@link Tag} better suited for definitions. - * - * @deprecated tags will be an open string in next major release - */ -@Deprecated -public class RESTTag { - private String id; - private String name; - private String description; - private String parentId; - private double rank = 0.0; - private Collection<RESTTag> subTags = new TreeSet<RESTTag>(); - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getParentId() { - return parentId; - } - - public void setParentId(String parentId) { - this.parentId = parentId; - } - - public double getRank() { - return rank; - } - - public void setRank(double rank) { - this.rank = rank; - } - - public Collection<RESTTag> getSubTags() { - return subTags; - } - - public void setSubTags(Collection<RESTTag> subTags) { - this.subTags = subTags; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/rest/src/main/java/org/apache/unomi/rest/RESTValueType.java ---------------------------------------------------------------------- diff --git a/rest/src/main/java/org/apache/unomi/rest/RESTValueType.java b/rest/src/main/java/org/apache/unomi/rest/RESTValueType.java index 95edadf..3891a35 100644 --- a/rest/src/main/java/org/apache/unomi/rest/RESTValueType.java +++ b/rest/src/main/java/org/apache/unomi/rest/RESTValueType.java @@ -19,7 +19,7 @@ package org.apache.unomi.rest; import org.apache.unomi.api.ValueType; -import java.util.Collection; +import java.util.Set; /** * A representation of a {@link ValueType} better suited for definitions. @@ -29,7 +29,7 @@ public class RESTValueType { private String id; private String name; private String description; - private Collection<RESTTag> tags; + private Set<String> tags; public RESTValueType() { } @@ -58,11 +58,11 @@ public class RESTValueType { this.description = description; } - public Collection<RESTTag> getTags() { + public Set<String> getTags() { return tags; } - public void setTags(Collection<RESTTag> tags) { + public void setTags(Set<String> tags) { this.tags = tags; } } http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/samples/trainingplugin/src/main/java/org/apache/unomi/training/TrainedNotificationAction.java ---------------------------------------------------------------------- diff --git a/samples/trainingplugin/src/main/java/org/apache/unomi/training/TrainedNotificationAction.java b/samples/trainingplugin/src/main/java/org/apache/unomi/training/TrainedNotificationAction.java index 7f64cbd..d9493b0 100644 --- a/samples/trainingplugin/src/main/java/org/apache/unomi/training/TrainedNotificationAction.java +++ b/samples/trainingplugin/src/main/java/org/apache/unomi/training/TrainedNotificationAction.java @@ -50,7 +50,7 @@ public class TrainedNotificationAction implements ActionExecutor { // create trained flag property type PropertyType propertyType = new PropertyType(new Metadata(event.getScope(), TRAINED_NB_PROPERTY, TRAINED_NB_PROPERTY, "Am I trained")); propertyType.setValueTypeId("boolean"); - propertyType.setTagIds(Collections.singleton("training")); + propertyType.setTags(Collections.singleton("training")); propertyType.setTarget(TARGET); service.setPropertyType(propertyType); } http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/samples/trainingplugin/src/main/resources/META-INF/cxs/actions/trainingNotifAction.json ---------------------------------------------------------------------- diff --git a/samples/trainingplugin/src/main/resources/META-INF/cxs/actions/trainingNotifAction.json b/samples/trainingplugin/src/main/resources/META-INF/cxs/actions/trainingNotifAction.json index 2ac9763..a14a343 100644 --- a/samples/trainingplugin/src/main/resources/META-INF/cxs/actions/trainingNotifAction.json +++ b/samples/trainingplugin/src/main/resources/META-INF/cxs/actions/trainingNotifAction.json @@ -4,6 +4,7 @@ "name": "Training Action", "description": "", "tags": [ + "profileTags", "event" ], "readOnly": true http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/6c5b46ea/samples/tweet-button-plugin/src/main/java/org/apache/unomi/samples/tweet_button_plugin/actions/IncrementTweetNumberAction.java ---------------------------------------------------------------------- diff --git a/samples/tweet-button-plugin/src/main/java/org/apache/unomi/samples/tweet_button_plugin/actions/IncrementTweetNumberAction.java b/samples/tweet-button-plugin/src/main/java/org/apache/unomi/samples/tweet_button_plugin/actions/IncrementTweetNumberAction.java index c459519..d291f09 100644 --- a/samples/tweet-button-plugin/src/main/java/org/apache/unomi/samples/tweet_button_plugin/actions/IncrementTweetNumberAction.java +++ b/samples/tweet-button-plugin/src/main/java/org/apache/unomi/samples/tweet_button_plugin/actions/IncrementTweetNumberAction.java @@ -45,14 +45,14 @@ public class IncrementTweetNumberAction implements ActionExecutor { // create tweet number property type PropertyType propertyType = new PropertyType(new Metadata(event.getScope(), TWEET_NB_PROPERTY, TWEET_NB_PROPERTY, "Number of times a user tweeted")); propertyType.setValueTypeId("integer"); - propertyType.setTagIds(Collections.singleton("social")); + propertyType.setTags(Collections.singleton("social")); propertyType.setTarget(TARGET); service.setPropertyType(propertyType); // create tweeted from property type propertyType = new PropertyType(new Metadata(event.getScope(), TWEETED_FROM_PROPERTY, TWEETED_FROM_PROPERTY, "The list of pages a user tweeted from")); propertyType.setValueTypeId("string"); - propertyType.setTagIds(Collections.singleton("social")); + propertyType.setTags(Collections.singleton("social")); propertyType.setTarget(TARGET); propertyType.setMultivalued(true); service.setPropertyType(propertyType);