view src/main/java/de/mpiwg/itgroup/ismi/entry/beans/CurrentTextBean.java @ 109:9adcab5143a3

better comment.
author casties
date Tue, 15 Nov 2016 12:36:06 +0100
parents d172201d24ad
children 22a18bfc66b0
line wrap: on
line source

package de.mpiwg.itgroup.ismi.entry.beans;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.faces.event.ActionEvent;
import javax.faces.event.AjaxBehaviorEvent;
import javax.faces.event.ValueChangeEvent;
import javax.faces.model.SelectItem;

import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.mpi.openmind.repository.bo.Attribute;
import org.mpi.openmind.repository.bo.Entity;
import org.mpi.openmind.repository.bo.Node;
import org.mpi.openmind.repository.bo.Relation;
import org.mpi.openmind.repository.utils.NormalizerUtils;
import org.mpi.openmind.repository.utils.RomanizationLoC;
import org.mpi.openmind.repository.utils.TransliterationUtil;
import org.mpi.openmind.security.bo.User;

import de.mpiwg.itgroup.ismi.auxObjects.ListenerObject;
import de.mpiwg.itgroup.ismi.util.guiComponents.Calendar;
import de.mpiwg.itgroup.ismi.util.guiComponents.Misattribution;
import de.mpiwg.itgroup.ismi.util.guiComponents.MisattributionTable;
import de.mpiwg.itgroup.ismi.util.guiComponents.EntityList;

public class CurrentTextBean extends AbstractISMIBean implements Serializable{
	private static final long serialVersionUID = 1017399812886455381L;

	private static Logger logger = Logger.getLogger(CurrentTextBean.class);

	private String valueShortTitle;
	private Entity shortTitleAlias; // is now an alias of type "prime"
	private String romanizedTitle;
	private String romanizedPrimaAlias;

	private String valueTranslitTitle;
	private Entity translitTitleAlias; // is now an alias of type "prime"

	private ListenerObject authorLo = new ListenerObject(PERSON, "name_translit");
	//private String authorInfo;

	private ListenerObject placeLo = new ListenerObject(PLACE, "name");

	private ListenerObject dedicatedPersonLo = new ListenerObject(PERSON, "name_translit");

	private ListenerObject commentaryLo = new ListenerObject(TEXT, "full_title_translit");

	private ListenerObject translationLo = new ListenerObject(TEXT, "full_title_translit");

	private ListenerObject versionLo = new ListenerObject(TEXT, "full_title_translit");

	private static String PERSON_TYPE_CREATED_BY = "created_by";
	private static String PERSON_TYPE_DEDICATED_TO = "dedicated_to";
	private String personType;

	private Attribute attTitleAlias = new Attribute();
	private Map<Long, Boolean> deletedTitleAliases = new HashMap<Long, Boolean>();
	private String newTitleAlias;

	private Attribute attIncipitAlias = new Attribute();
	private Map<Long, Boolean> deletedIncipitAliases = new HashMap<Long, Boolean>();
	private String newIncipitAlias;

	private Attribute attExplicitAlias = new Attribute();
	private Map<Long, Boolean> deletedExplicitAliases = new HashMap<Long, Boolean>();
	private String newExplicitAlias;
	
	private Long idSubject;
	private Entity subject;

	public static String main_subject = "main_subject";
	public static String sub_subject = "sub_subject";
	public static String type = "type";
	public static String NO_SUBJECT = "NO_SUBJECT";
	
	private boolean searchTextDialogRendered = false;
	private String stringTitle;
	private String stringAuthor;
	private List<SelectItem> textsFound = new ArrayList<SelectItem>();

	private Long idTextSelected;

	private String COMMENTARY_CALLER = "Commentary";
	private String TRANSLATION_CALLER = "Translation";
	private String VERSION_CALLER = "Version";

	private String searchCaller;
	
	private transient Calendar creationDate;
	
	private String textAuthorName;
	private String textAuthorNameTranslit;
	
	private Boolean selectPersonRendered = false;
	private List<SelectItem> personList = new ArrayList<SelectItem>();
	private Long selectedPersonId;
	private boolean restrictedByRole = false;
	
	private EntityList aliasList;
	private EntityList incipitAliasList;
	private EntityList explicitAliasList;

	//private MisattributionDataTable misattDataTable;
	private transient MisattributionTable misattTable;
	
	public CurrentTextBean() {
		this.reset();
	}
	
	@Override
	public void reset(){
		super.reset();
		this.entity = new Entity(Node.TYPE_ABOX, TEXT, false);
		setDefObjectClass(TEXT);
		
		this.aliasList = new EntityList(ALIAS, "alias", getWrapper(), getUserName());
		this.incipitAliasList = new EntityList(ALIAS, "alias", getWrapper(), getUserName());
		this.explicitAliasList = new EntityList(ALIAS, "alias", getWrapper(), getUserName());
		//this.misattDataTable = new MisattributionDataTable(PERSON, "name_translit");
		this.misattTable = new MisattributionTable();
		
		this.selectPersonRendered = false;
		this.selectedPersonId = null;
		this.personList = new ArrayList<SelectItem>();
		this.restrictedByRole = false;
		
		this.textAuthorName = new String();
		this.textAuthorNameTranslit = new String();
		
		this.valueShortTitle = null;
		this.shortTitleAlias = null; // is now an alias of type "prime"

		this.valueTranslitTitle = null;
		this.translitTitleAlias = null; // is now an alias of type "prime"

		//this.authorLo = new ListenerObject();
		this.authorLo.reset();
		//this.authorInfo = null;

		//this.placeLo = new ListenerObject();
		this.placeLo.reset();
		
		this.dedicatedPersonLo.reset();

		this.commentaryLo.reset();

		this.translationLo.reset();

		this.versionLo.reset();

		this.attTitleAlias = new Attribute();
		this.deletedTitleAliases = new HashMap<Long, Boolean>();
		this.newTitleAlias = null;

		this.attIncipitAlias = new Attribute();
		this.deletedIncipitAliases = new HashMap<Long, Boolean>();
		this.newIncipitAlias  = null;

		this.attExplicitAlias = new Attribute();
		this.deletedExplicitAliases = new HashMap<Long, Boolean>();
		this.newExplicitAlias = null;
		
		this.idSubject = null;
		this.subject = null;
		
		this.creationDate = new Calendar();
		

		registerChecker(authorLo, "Creator is not valid!");
		registerChecker(placeLo, "Place is not valid!");
		registerChecker(dedicatedPersonLo, "Place is not valid!");
		registerChecker(commentaryLo, "Commentary is not valid!");
		registerChecker(translationLo, "Translation is not valid!");
		registerChecker(versionLo, "Version is not valid!");
		
		//getPopup().setRendered(false);
	}

	public List<SelectItem> getPersonList() {
		return personList;
	}

	public void setPersonList(List<SelectItem> personList) {
		this.personList = personList;
	}

	public Boolean getSelectPersonRendered() {
		return selectPersonRendered;
	}

	public void setSelectPersonRendered(Boolean selectPersonRendered) {
		this.selectPersonRendered = selectPersonRendered;
	}

	/**
	 * Set the entity and process its attributes and relations.
	 * 
	 * Source Relations: 
	 * TEXT is_commentary_on TEXT, 
	 * TEXT is_translation_of TEXT, 
	 * TEXT is_version_of TEXT, 
	 * TEXT was_created_by PERSON,
	 * TEXT was_created_in PLACE,
	 * TEXT was_dedicated_to PERSON,
	 * TEXT has_subject SUBJECT
	 * 
	 * Target Relations:
	 * ALIAS is_alias_title_of TEXT,
	 * ALIAS is_alias_incipit_of TEXT
	 * 
	 * @param text
	 */
	@Override
	public void setEntity(Entity text) {
		this.reset();
		this.entity = text;
		if (this.entity.isPersistent()) {
		    // set id
			setCurrentId(this.entity.getId().toString());

			// load content
			if (text.isLightweight()) {
				this.entity = getWrapper().getEntityContent(this.entity);
				this.entity.setLightweight(false);
			}
			
			// set creation date
			Attribute attCreationDate = this.entity.getAttributeByName("creation_date");
			if(attCreationDate != null && StringUtils.isNotEmpty(attCreationDate.getOwnValue())) {
				this.creationDate = new Calendar(attCreationDate.getOwnValue()); 
			} else {
				this.creationDate = new Calendar();
			}
			
			/*
			 * set attributes
			 */
			this.loadAttributes(this.entity);//, getDefinition(this.entity));
			
			/*
			 * set source relations
			 */
			for (Relation rel : text.getSourceRelations()) {
				Entity target = null;
				String relName = rel.getOwnValue();
                if(relName.equals(has_subject)) {
					this.subject = getTargetRelation(rel);
					this.idSubject = subject.getId();
					
				} else if (relName.equals("is_commentary_on")) {
					target = getTargetRelation(rel);
					this.commentaryLo.setEntityAndAttribute0(target);
					
				} else if (relName.equals("is_translation_of")) {
					target = getTargetRelation(rel);
					this.translationLo.setEntityAndAttribute0(target);
					
				} else if (relName.equals("is_version_of")) {
					target = getTargetRelation(rel);
					this.versionLo.setEntityAndAttribute0(target);
					
				} else if (relName.equals("was_created_by")) {
					target = getTargetRelation(rel);
					this.authorLo.setEntityAndAttribute0(target);
					
					if (this.authorLo.attribute != null) {
						this.textAuthorNameTranslit = this.authorLo.attribute.getValue();
					}
					
				} else if (relName.equals("was_dedicated_to")) {
					target = getTargetRelation(rel);
					this.dedicatedPersonLo.setEntityAndAttribute0(target); 
						
				} else if (relName.equals("was_created_in")) {
					target = getTargetRelation(rel);
					this.placeLo.setEntityAndAttribute0(target);					
					
				} else if (relName.equals("has_author_misattribution")) {
					target = getTargetRelation(rel);
					this.misattTable.load(target);
				}
			}
			
			/*
			 * set target relations
			 */
			for (Relation rel : text.getTargetRelations()) {
				String relName = rel.getOwnValue();
                if (relName.equals("is_alias_title_of")) {
					Entity alias = getWrapper().getEntityByIdWithContent(rel.getSourceId());
					this.aliasList.add(alias);
					
				} else if (relName.equals("is_alias_incipit_of")) {
					Entity alias = getWrapper().getEntityByIdWithContent(rel.getSourceId());
					this.incipitAliasList.add(alias);
					
				} else if (relName.equals("is_alias_explicit_of")) {
					Entity alias = getWrapper().getEntityByIdWithContent(rel.getSourceId());
					this.explicitAliasList.add(alias);
					
				} else if (relName.equals("is_prime_alias_title_of")) {
					Entity alias = getWrapper().getEntityByIdWithContent(rel.getSourceId());
					this.shortTitleAlias = alias;
					this.valueShortTitle = alias.getAttributeByName("alias").getValue();
				}
			}
			
			/*
			 * set references
			 */
			this.loadEndNoteRefs();
			this.displayUrl = generateDisplayUrl(authorLo.entity, text, null, getAppBean().getRoot());
		}
	}

	public String translitTitleAction() {
		String pn = getAttributes().get("full_title");

		String translit = TransliterationUtil.getTransliteration(pn);
		getAttributes().put("full_title_translit", translit);

		return "translit";

	}

	public void showSearchTextCommentaryDialog(ActionEvent event) {
		this.setSearchTextDialogRendered(true);
		this.searchCaller = COMMENTARY_CALLER;
	}

	public void showSearchTextTranslationDialog(ActionEvent event) {
		this.setSearchTextDialogRendered(true);
		this.searchCaller = TRANSLATION_CALLER;
	}

	public void showSearchTextVersionDialog(ActionEvent event) {
		this.setSearchTextDialogRendered(true);
		this.searchCaller = VERSION_CALLER;
	}

	public void closeSearchTextDialog(ActionEvent event) {
		this.setSearchTextDialogRendered(false);
	}

	public void resetSearchText(ActionEvent event) {
		this.textsFound = new ArrayList<SelectItem>();
		this.stringAuthor = "";
		this.stringTitle = "";
	}

	public void takeVersion(ActionEvent event) {
		if(this.idTextSelected != null){
			Entity ent = getWrapper().getEntityById(idTextSelected);
			if(ent != null){
				if (VERSION_CALLER.equals(this.searchCaller)) {
					this.versionLo.setEntityAndAttribute0(ent);
					
				} else if (COMMENTARY_CALLER.equals(this.searchCaller)) {
					this.commentaryLo.setEntityAndAttribute0(ent);
					
				} else if (TRANSLATION_CALLER.equals(this.searchCaller)) {
					this.translationLo.setEntityAndAttribute0(ent);
				}
				this.searchTextDialogRendered = false;
			}
		}
	}

	public String getStringTitle() {
		return stringTitle;
	}

	public void setStringTitle(String stringTitle) {
		this.stringTitle = stringTitle;
	}

	public String getStringAuthor() {
		return stringAuthor;
	}

	public void setStringAuthor(String stringAuthor) {
		this.stringAuthor = stringAuthor;
	}

	public void searchText(ActionEvent event) {
		this.textsFound = new ArrayList<SelectItem>();
		
		if(StringUtils.isNotEmpty(stringTitle)){
			if (StringUtils.isNotEmpty(this.stringAuthor)) {
				String termAuthor = NormalizerUtils.normalize(stringAuthor);
				for(Entity title : getWrapper().getEntitiesByAtt(TEXT, "full_title_translit", stringTitle, -1, true)){
					for(Entity author : 
						getWrapper().getTargetsForSourceRelation(title, "was_created_by", PERSON, -1)){
						String authorOW = (StringUtils.isNotEmpty(author.getNormalizedOwnValue())) ? author.getNormalizedOwnValue() : "";
						if(authorOW.contains(termAuthor)){
							this.textsFound.add(
									new SelectItem(title.getId(), "Title [" + title.getId() + "]: " + title.getOwnValue()
											+ " - Author: " + author.getOwnValue()));
						}
					}
				}
			}else{
				for(Entity title : getWrapper().getEntitiesByAtt(TEXT, "full_title_translit", stringTitle, -1, true)){
					this.textsFound.add(
							new SelectItem(title.getId(), "Title: " + title.getOwnValue()));
				}
			}
		}else if (StringUtils.isNotEmpty(this.stringAuthor)) {
			String termAuthor = NormalizerUtils.normalize(stringAuthor);
			for(Entity author : getCache().getPersonListByRole("Author")){
				String authorOW = (StringUtils.isNotEmpty(author.getNormalizedOwnValue())) ? author.getNormalizedOwnValue() : "";
				if(authorOW.contains(termAuthor)){
					for(Entity title : 
						getWrapper().getSourcesForTargetRelation(author, "was_created_by", TEXT, -1)){
						this.textsFound.add(
								new SelectItem(title.getId(), "Author[" + author.getId() + "]: " + author.getOwnValue()
								+ " - Title: " + title.getOwnValue()));
					}	
				}
			}	
		}
	}
	
	public void restrictedByRoleChange(ValueChangeEvent event) {
		if (event.getNewValue().equals(event.getOldValue()))
			return;
		Boolean val = (Boolean) event.getNewValue();
		this.setRestrictedByRole(val);
		this.updatePersonList();
	}

	public void listenerRomanizeTitleTranslit(AjaxBehaviorEvent event){
		if(getAttributes().get("full_title_translit") != null)
			this.romanizedTitle = RomanizationLoC.convert(getAttributes().get("full_title_translit"));
	}
	
	public void listenerRomanizePrimaAlias(AjaxBehaviorEvent event){
		if(valueShortTitle != null){
			this.romanizedPrimaAlias = RomanizationLoC.convert(valueShortTitle);
		}
	}
	
	public void listenerShowAllAuthors(ActionEvent event) {
		this.setPersonType(PERSON_TYPE_CREATED_BY);
		this.updatePersonList();
	}
	
	public void listenerShowAllDedicatedToPersons(ActionEvent event) {
		this.setPersonType(PERSON_TYPE_DEDICATED_TO);
		this.updatePersonList();
	}
	
	private void updatePersonList(){
		if (!restrictedByRole)
			this.personList = getCache().getAllPersons();
		else {
			this.personList = getCache().getPersonsByRole("Author");
		}
		this.selectPersonRendered = true;
	}
	
	public void listenerPersonCancel(ActionEvent event) {
		this.selectPersonRendered = false;
	}

	public void listenerSelectPerson(ActionEvent event){
		if(this.selectedPersonId != null){
			Entity selectedPerson = getWrapper().getEntityById(selectedPersonId);
			if(selectedPerson != null){
				if(this.personType.equals(PERSON_TYPE_CREATED_BY)){
					this.authorLo.setEntityAndAttribute0(selectedPerson);
					this.authorLo.entityInfo = "ID = " + authorLo.getEntity().getId();
					
					Attribute attArabicName = getTargetAttribute(selectedPerson, "name");
					if(attArabicName != null){
						this.authorLo.entityInfo += ", Arabic Name = " + attArabicName.getOwnValue();
						this.textAuthorName = attArabicName.getValue();
					}
					
					if(this.authorLo.attribute != null){
						this.textAuthorNameTranslit = this.authorLo.attribute.getValue();
					}
				}else if(this.personType.equals(PERSON_TYPE_DEDICATED_TO)){
					this.dedicatedPersonLo.setEntityAndAttribute0(selectedPerson);
				}
			}
		}
		this.setSelectPersonRendered(false);
	}
	
	/**
	 * Check mandatory parts.
	 * 
	 * In this case the author has to be set.
	 * 
	 * @return
	 */
	public boolean mandatoryEntriesOK(){
		boolean ok = true;
		if(this.authorLo.entity == null || !this.authorLo.entity.isPersistent()){
			addGeneralMsg("<Created by> is a mandatory entry. If you do not know the author of this text, you should select the person <ANONYMOUS>.");
			ok = false;
		}
		return ok;
	}

	/* (non-Javadoc)
	 * @see de.mpiwg.itgroup.ismi.entry.beans.AbstractISMIBean#save()
	 */
	@Override
	public String save() {
		super.save();
		try {
			
		    /*
		     * check input
		     */
			if (!mandatoryEntriesOK()) {
				addGeneralMsg("The entity could not be saved.");
				return PAGE_EDITOR;
			}			
			CheckResults cr = getCheckResults();
			if (cr.hasErrors) {
				getSessionBean().setErrorMessages(cr);
				getSessionBean().setDisplayError(true);
				return PAGE_EDITOR;
			}

			User user = getSessionUser();
			
			// add creation date
			getAttributes().put("creation_date", this.creationDate.toJSONString());
			
			// update all attributes
			this.entity = updateEntityAttributes(this.entity);
			
			/*
			 * set relations
			 */
			this.entity.replaceSourceRelation(commentaryLo.entity, TEXT, "is_commentary_on");
			
			this.entity.replaceSourceRelation(translationLo.entity, TEXT, "is_translation_of");
			
			this.entity.replaceSourceRelation(versionLo.entity, TEXT, "is_version_of");
			
			this.entity.replaceSourceRelation(authorLo.entity, PERSON, "was_created_by");
			
			this.entity.replaceSourceRelation(dedicatedPersonLo.entity, PERSON, "was_dedicated_to");
			
			this.entity.replaceSourceRelation(placeLo.entity, PLACE, "was_created_in");
			
			this.entity.removeAllSourceRelations(has_subject, SUBJECT);
			if (getIdSubject() != null) {
				this.subject = getWrapper().getEntityByIdWithContent(getIdSubject());
				this.entity.replaceSourceRelation(subject, SUBJECT, has_subject);
			}
			
			/*
			 * set short title (is_prime_alias_title_of)
			 */
			if (!StringUtils.isEmpty(valueShortTitle)) {
				this.entity.removeAllTargetRelations("is_prime_alias_title_of", ALIAS);
			
				if (this.shortTitleAlias == null) {
					//1)create  alias, 2) update value of alias3) save alias, and 4) add to this text.
					shortTitleAlias = new Entity(Node.TYPE_ABOX, ALIAS, false);
					shortTitleAlias.addAttribute(new Attribute("alias", "text", this.valueShortTitle));
					getWrapper().saveEntity(shortTitleAlias, getUserName());					
				} else {
					//1) update value, 2) re-save alias
					this.shortTitleAlias.getAttributeByName("alias").setOwnValue(this.valueShortTitle);
					this.shortTitleAlias.removeAllSourceRelations("is_prime_alias_title_of", TEXT);
					getWrapper().saveEntity(shortTitleAlias, getUserName());
				}
				new Relation(shortTitleAlias, this.entity, "is_prime_alias_title_of");
			}
			
			/*
			 * set alias title (ALIAS -> is_alias_title_of -> TEXT)
			 */
			this.entity.removeAllTargetRelationsByName("is_alias_title_of");
			for(Entity alias : this.aliasList.getEntities()){
				Entity alias0 = getWrapper().getEntityByIdWithContent(alias.getId());
				new Relation(alias0, this.entity, "is_alias_title_of");
			}
			
			/*
			 * set alias incipit
			 */
			this.entity.removeAllTargetRelationsByName("is_alias_incipit_of");
			for(Entity alias : this.incipitAliasList.getEntities()){
				Entity alias0 = getWrapper().getEntityByIdWithContent(alias.getId());
				new Relation(alias0, this.entity, "is_alias_incipit_of");
			}
			
			/*
			 * save alias explicit
			 */
			this.entity.removeAllTargetRelationsByName("is_alias_explicit_of");
			for(Entity alias : this.explicitAliasList.getEntities()){
				Entity alias0 = getWrapper().getEntityByIdWithContent(alias.getId());
				new Relation(alias0, this.entity, "is_alias_explicit_of");
			}
			
			// set references
			this.prepareEndNoteRefs2Save();
			
			/*
			 * set misattribution
			 */
			this.entity.removeAllSourceRelations(Misattribution.HAS_AUTHOR_MISATT, Misattribution.MISATT);
			
			/*
			 * save entity
			 */
			this.entity = getWrapper().saveEntity(this.entity, user.getEmail());
			this.getAppBean().setAllTextsAsDirty();
			getAppBean().getSimpleSearchCache().setMapDirty(true);
			
			/*
			 * save misattributions
			 */
			this.entity = this.misattTable.saveMisattributions(this.entity);
			
			// re-set entity
			this.setEntity(this.entity);
			
			// update related own values
			this.updateRelatedOW(this.entity, getSessionUser().getEmail());

			logger.info("Entity saved - Time = " + (System.currentTimeMillis() - start) + ", " + entity);
			
			// print success
			this.printSuccessSavingEntity();

		} catch (Exception e) {
			logger.error(e.getMessage(), e);
			this.printInternalError(e);
		}
		
		// end saving
		saveEnd();
		// stay on edit page
		return PAGE_EDITOR;
	}

	public EntityList getIncipitAliasList() {
		return incipitAliasList;
	}

	public void setIncipitAliasList(EntityList incipitAliasList) {
		this.incipitAliasList = incipitAliasList;
	}

	public Attribute getAttTitleAlias() {
		return attTitleAlias;
	}

	public void setAttTitleAlias(Attribute attTitleAlias) {
		this.attTitleAlias = attTitleAlias;
	}

	public Attribute getAttIncipitAlias() {
		return attIncipitAlias;
	}

	public void setAttIncipitAlias(Attribute attIncipitAlias) {
		this.attIncipitAlias = attIncipitAlias;
	}

	public Attribute getAttExplicitAlias() {
		return attExplicitAlias;
	}

	public void setAttExplicitAlias(Attribute attExplicitAlias) {
		this.attExplicitAlias = attExplicitAlias;
	}

	public String getValueShortTitle() {
		return valueShortTitle;
	}

	public void setValueShortTitle(String valueShortTitle) {
		this.valueShortTitle = valueShortTitle;
	}

	public Entity getShortTitleAlias() {
		return shortTitleAlias;
	}

	public void setShortTitleAlias(Entity shortTitleAlias) {
		this.shortTitleAlias = shortTitleAlias;
	}

	public String getValueTranslitTitle() {
		return valueTranslitTitle;
	}

	public void setValueTranslitTitle(String valueTranslitTitle) {
		this.valueTranslitTitle = valueTranslitTitle;
	}

	public Entity getTranslitTitleAlias() {
		return translitTitleAlias;
	}

	public void setTranslitTitleAlias(Entity translitTitleAlias) {
		this.translitTitleAlias = translitTitleAlias;
	}

	public void setNewTitleAlias(String newAlias) {
		this.newTitleAlias = newAlias;
	}

	public String getNewTitleAlias() {
		return newTitleAlias;
	}

	public Map<Long, Boolean> getDeletedIncipitAliases() {
		return deletedIncipitAliases;
	}

	public void setDeletedIncipitAliases(
			Map<Long, Boolean> deletedIncipitAliases) {
		this.deletedIncipitAliases = deletedIncipitAliases;
	}

	public Map<Long, Boolean> getDeletedExplicitAliases() {
		return deletedExplicitAliases;
	}

	public void setDeletedExplicitAliases(
			Map<Long, Boolean> deletedExplicitAliases) {
		this.deletedExplicitAliases = deletedExplicitAliases;
	}

	public String getNewIncipitAlias() {
		return newIncipitAlias;
	}

	public void setNewIncipitAlias(String newIncipitAlias) {
		this.newIncipitAlias = newIncipitAlias;
	}

	public String getNewExplicitAlias() {
		return newExplicitAlias;
	}

	public void setNewExplicitAlias(String newExplicitAlias) {
		this.newExplicitAlias = newExplicitAlias;
	}

	public Map<Long, Boolean> getDeletedTitleAliases() {
		return deletedTitleAliases;
	}

	public void setDeletedTitleAliases(Map<Long, Boolean> deletedTitleAliases) {
		this.deletedTitleAliases = deletedTitleAliases;
	}

	public boolean isSearchTextDialogRendered() {
		return searchTextDialogRendered;
	}

	public void setSearchTextDialogRendered(boolean searchTextDialogRendered) {
		this.searchTextDialogRendered = searchTextDialogRendered;
	}

	public void setTextsFound(List<SelectItem> textsFound) {
		this.textsFound = textsFound;
	}

	public List<SelectItem> getTextsFound() {
		return textsFound;
	}

	public Long getIdTextSelected() {
		return idTextSelected;
	}

	public void setIdTextSelected(Long idTextSelected) {
		this.idTextSelected = idTextSelected;
	}

	public String getSearchCaller() {
		return searchCaller;
	}

	public void setSearchCaller(String searchCaller) {
		this.searchCaller = searchCaller;
	}
	public ListenerObject getAuthorLo() {
		return authorLo;
	}

	public void setAuthorLo(ListenerObject authorLo) {
		this.authorLo = authorLo;
	}

	public ListenerObject getPlaceLo() {
		return placeLo;
	}

	public void setPlaceLo(ListenerObject placeLo) {
		this.placeLo = placeLo;
	}

	public ListenerObject getDedicatedPersonLo() {
		return dedicatedPersonLo;
	}

	public void setDedicatedPersonLo(ListenerObject dedicatedPersonLo) {
		this.dedicatedPersonLo = dedicatedPersonLo;
	}

	public ListenerObject getCommentaryLo() {
		return commentaryLo;
	}

	public void setCommentaryLo(ListenerObject commentaryLo) {
		this.commentaryLo = commentaryLo;
	}

	public ListenerObject getTranslationLo() {
		return translationLo;
	}

	public void setTranslationLo(ListenerObject translationLo) {
		this.translationLo = translationLo;
	}

	public ListenerObject getVersionLo() {
		return versionLo;
	}

	public void setVersionLo(ListenerObject versionLo) {
		this.versionLo = versionLo;
	}

	public Long getIdSubject() {
		return idSubject;
	}

	public void setIdSubject(Long idSubject) {
		this.idSubject = idSubject;
	}

	public Entity getSubject() {
		return subject;
	}

	public void setSubject(Entity subject) {
		this.subject = subject;
	}

	public String getTextAuthorName() {
		return textAuthorName;
	}

	public Calendar getCreationDate() {
		return creationDate;
	}

	public void setCreationDate(Calendar creationDate) {
		this.creationDate = creationDate;
	}

	public void setTextAuthorName(String textAuthorName) {
		this.textAuthorName = textAuthorName;
	}

	public String getTextAuthorNameTranslit() {
		return textAuthorNameTranslit;
	}

	public void setTextAuthorNameTranslit(String textAuthorNameTranslit) {
		this.textAuthorNameTranslit = textAuthorNameTranslit;
	}

	public boolean isRestrictedByRole() {
		return restrictedByRole;
	}

	public void setRestrictedByRole(boolean restrictedByRole) {
		this.restrictedByRole = restrictedByRole;
	}
	
	
	public String getPersonType() {
		return personType;
	}

	public void setPersonType(String personType) {
		this.personType = personType;
	}

	public EntityList getAliasList() {
		return aliasList;
	}

	public void setAliasList(EntityList aliasList) {
		this.aliasList = aliasList;
	}

	public EntityList getExplicitAliasList() {
		return explicitAliasList;
	}

	public void setExplicitAliasList(EntityList explicitAliasList) {
		this.explicitAliasList = explicitAliasList;
	}

	public Long getSelectedPersonId() {
		return selectedPersonId;
	}

	public void setSelectedPersonId(Long selectedPersonId) {
		this.selectedPersonId = selectedPersonId;
	}

	public MisattributionTable getMisattTable() {
		return misattTable;
	}

	public void setMisattTable(MisattributionTable misattTable) {
		this.misattTable = misattTable;
	}

	public String getRomanizedTitle() {
		return romanizedTitle;
	}

	public void setRomanizedTitle(String romanizedTitle) {
		this.romanizedTitle = romanizedTitle;
	}

	public String getRomanizedPrimaAlias() {
		return romanizedPrimaAlias;
	}

	public void setRomanizedPrimaAlias(String romanizedPrimaAlias) {
		this.romanizedPrimaAlias = romanizedPrimaAlias;
	}
}