Examples of TagChanges


Examples of org.platformlayer.core.model.TagChanges

            item.secret = existing.secret;
            item.setKey(existing.getKey());

            newItem = repository.updateManagedItem(project, item);

            TagChanges tagChanges = new TagChanges();
            for (Tag tag : item.getTags()) {
              if (newItem.getTags().hasTag(tag)) {
                continue;
              }

              boolean uniqueTagKey = false;
              if (tag.getKey().equals(Tag.PARENT.getKey())) {
                uniqueTagKey = true;
              }

              tagChanges.addTags.add(tag);

              if (uniqueTagKey) {
                for (Tag oldTag : newItem.getTags().findTags(tag.getKey())) {
                  tagChanges.removeTags.add(oldTag);
                }
              }
            }

            if (!tagChanges.isEmpty()) {
              repository.changeTags(modelClass, project, newItem.getKey().getItemId(), tagChanges, null);
            }
          }
        } catch (RepositoryException e) {
          throw new OpsException("Error writing object to database", e);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.