Author: bpoussin Date: 2010-12-03 17:12:58 +0100 (Fri, 03 Dec 2010) New Revision: 559 Url: http://nuiton.org/repositories/revision/wikitty/559 Log: add new method to addLabel Modified: trunk/wikitty-api/src/main/java/org/nuiton/wikitty/addons/WikittyLabelUtil.java Modified: trunk/wikitty-api/src/main/java/org/nuiton/wikitty/addons/WikittyLabelUtil.java =================================================================== --- trunk/wikitty-api/src/main/java/org/nuiton/wikitty/addons/WikittyLabelUtil.java 2010-12-03 15:52:10 UTC (rev 558) +++ trunk/wikitty-api/src/main/java/org/nuiton/wikitty/addons/WikittyLabelUtil.java 2010-12-03 16:12:58 UTC (rev 559) @@ -34,6 +34,8 @@ import org.nuiton.wikitty.entities.WikittyLabelHelper; import org.nuiton.wikitty.entities.WikittyLabelImpl; import org.nuiton.wikitty.WikittyProxy; +import org.nuiton.wikitty.entities.BusinessEntity; +import org.nuiton.wikitty.entities.BusinessEntityImpl; import org.nuiton.wikitty.search.Search; /** @@ -51,8 +53,35 @@ static private Log log = LogFactory.getLog(WikittyLabelUtil.class); /** - * Add new lable to the wikitty object. + * Add label on this wikitty. You must store your wikitty after + * @param wikitty + * @param label + */ + static public void addLabel(Wikitty wikitty, String label) { + if (!WikittyLabelHelper.hasExtension(wikitty)) { + WikittyLabelHelper.addExtension(wikitty); + } + WikittyLabelHelper.addLabels(wikitty, label); + } + /** + * Add label on this entity. You must store your entiry after * + * @param entity + * @param label + */ + static public void addLabel(BusinessEntityImpl entity, String label) { + Wikitty w = entity.getWikitty(); + addLabel(w, label); + } + + /** + * Add new lable to the wikitty object. You must only used this method, if + * you don't have the Wikitty Object because this method restore and save + * version in WikittyService. If you have Wikitty present in your space, your + * wikitty become obsolete and you lose your change :( + * + * If you have wikitty or business entity you must used {@link #} + * * @param proxy * @param wikittyId object'id * @param label label to add
participants (1)
-
bpoussin@users.nuiton.org