+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.model.agent.TeamOrPersonBase#getTitleCache()
+ */
+ @Override
+ //@Transient //TODO a.kohlbecker remove??
+ public String getTitleCache() {
+ isGeneratingTitleCache = true;
+ String result = "";
+ if (isProtectedTitleCache()){
+ result = this.titleCache;
+ }else{
+ result = generateTitle();
+ result = replaceEmptyTitleByNomTitle(result);
+ result = getTruncatedCache(result);
+ this.titleCache = result;
+ }
+ isGeneratingTitleCache = false;
+ return result;
+ }
+
+ public boolean isProtectedNomenclaturalTitleCache() {
+ return protectedNomenclaturalTitleCache;
+ }
+
+ public void setProtectedNomenclaturalTitleCache(
+ boolean protectedNomenclaturalTitleCache) {
+ this.protectedNomenclaturalTitleCache = protectedNomenclaturalTitleCache;
+ }
+
+//*********************** CLONE ********************************************************/
+
+ /**
+ * Clones <i>this</i> Team. This is a shortcut that enables to create
+ * a new instance that differs only slightly from <i>this</i> Team.
+ * The corresponding person is cloned.
+ *
+ * @see eu.etaxonomy.cdm.model.media.IdentifiableMediaEntity#clone()
+ * @see java.lang.Object#clone()
+ */
+ @Override
+ public Object clone() {
+ try{
+ Team result = (Team)super.clone();
+ result.teamMembers = new ArrayList<Person>();
+ for (Person teamMember: this.teamMembers){
+ result.addTeamMember(teamMember);
+ }
+ //no changes to protectedNomenclaturalTitleCache
+ return result;
+ } catch (CloneNotSupportedException e){
+ logger.warn("Object does not implement cloneable");
+ e.printStackTrace();
+ return null;
+ }
+
+
+ }
+
+