# HG changeset patch # User casties # Date 1448894289 -3600 # Node ID 4ec8d4cfad26d5295e4cfa7b18fe3693aa41eda6 # Parent 403afc3d94eb3d5e605f48f923272e11c534def1 remove old PubMan/escidoc code. diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/java/de/mpiwg/itgroup/ismi/admin/AdminBean.java --- a/src/main/java/de/mpiwg/itgroup/ismi/admin/AdminBean.java Mon Nov 30 15:37:10 2015 +0100 +++ b/src/main/java/de/mpiwg/itgroup/ismi/admin/AdminBean.java Mon Nov 30 15:38:09 2015 +0100 @@ -8,8 +8,6 @@ import org.apache.commons.lang.StringUtils; import org.mpi.openmind.security.bo.User; -import org.mpiwg.itgroup.escidoc.bo.ESciDocItem; - import de.mpiwg.itgroup.ismi.entry.beans.AbstractISMIBean; @@ -40,20 +38,6 @@ private String password2; private boolean changePassword; - private boolean showESciDocPanelControl = false; - - public void listenerOpenESciDocPanelControl(ActionEvent event){ - this.showESciDocPanelControl = true; - } - - public void listenerCloseESciDocPanelControl(ActionEvent event){ - this.showESciDocPanelControl = false; - } - - public boolean isShowESciDocPanelControl() { - return showESciDocPanelControl & getSessionBean().isAdmin(); - } - public void reset(){ this.user = null; this.password1 = new String(); diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/java/de/mpiwg/itgroup/ismi/defs/AbstractDefinitionForm.java --- a/src/main/java/de/mpiwg/itgroup/ismi/defs/AbstractDefinitionForm.java Mon Nov 30 15:37:10 2015 +0100 +++ b/src/main/java/de/mpiwg/itgroup/ismi/defs/AbstractDefinitionForm.java Mon Nov 30 15:38:09 2015 +0100 @@ -41,7 +41,6 @@ contentTypeList.add(new SelectItem("", "-- select one --")); contentTypeList.add(new SelectItem("arabic")); contentTypeList.add(new SelectItem("date")); - contentTypeList.add(new SelectItem("escidoc-objid")); contentTypeList.add(new SelectItem("link")); contentTypeList.add(new SelectItem("json")); contentTypeList.add(new SelectItem("text")); diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/java/de/mpiwg/itgroup/ismi/entry/beans/AbstractISMIBean.java --- a/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/AbstractISMIBean.java Mon Nov 30 15:37:10 2015 +0100 +++ b/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/AbstractISMIBean.java Mon Nov 30 15:38:09 2015 +0100 @@ -8,7 +8,6 @@ import java.util.Map; import javax.faces.context.FacesContext; -import javax.faces.event.ActionEvent; import javax.faces.event.ValueChangeEvent; import javax.faces.model.SelectItem; @@ -21,10 +20,6 @@ import org.mpi.openmind.repository.bo.Relation; import org.mpi.openmind.security.SecurityService; import org.mpi.openmind.security.bo.User; -import org.mpiwg.itgroup.escidoc.bo.ESciDocItem; -import org.mpiwg.itgroup.escidoc.bo.Publication; -import org.mpiwg.itgroup.escidoc.utils.ESciDocItemDataTable; -import org.mpiwg.itgroup.escidoc.utils.SelectedESciDocItems; import de.mpiwg.itgroup.ismi.auxObjects.ListenerObject; import de.mpiwg.itgroup.ismi.entry.dataBeans.SimpleSearchCache; @@ -258,95 +253,6 @@ return rs; } - //******************************** - //**** PUBLICATIONS ESciDOC ****** - //******************************** - - private ESciDocItemDataTable refDataTable = new ESciDocItemDataTable(this); - protected SelectedESciDocItems selectedItems = new SelectedESciDocItems(); - - public ESciDocItemDataTable getRefDataTable() { - return refDataTable; - } - - public void setRefDataTable(ESciDocItemDataTable refDataTable) { - this.refDataTable = refDataTable; - } - - public void listenerRemoveReference(ActionEvent event){ - List pubIdList = new ArrayList(); - for(String pubId : this.selectedItems.getMap().keySet()){ - if(this.selectedItems.getMap().get(pubId)){ - pubIdList.add(pubId); - } - } - for(String pubId : pubIdList){ - this.selectedItems.removeById(pubId); - } - } - - public void loadReferences(Entity currentEntity){ - this.loadReferences(currentEntity, new ArrayList()); - } - - public void loadReferences(Entity currentEntity, List idsNoFound){ - this.selectedItems.setList(new ArrayList()); - boolean escidocRespondOK = true; - try{ - - for (Relation rel : currentEntity.getTargetRelations()) { - if (rel.getOwnValue().equals(rel_is_reference_of)) { - Entity source = getWrapper().getEntityByIdWithContent(rel.getSourceId()); - ESciDocItem item = getAppBean().getRefCache().getItem(source.getOwnValue()); - if(item == null){ - item = new ESciDocItem(source.getOwnValue()); - item.setErrorLoading(ESciDocItem.ESCIDOC_ERROR_ID_NO_FOUND); - idsNoFound.add(source.getOwnValue()); - } - - /*Publication pub = ESciDocHandler.getPublicationById(source.getOwnValue()); - if(pub == null){ - pub = new Publication(source.getOwnValue()); - pub.setErrorLoading(Publication.ESCIDOC_ERROR_ID_NO_FOUND); - idsNoFound.add(source.getOwnValue()); - } - */ - Attribute att = source.getAttributeByName("additional_information"); - if(att != null){ - item.getPublication().setAdditionalInformation(att.getOwnValue()); - } - item.getPublication().setEntity(source); - this.selectedItems.addESciDocItem(item); - } - } - }catch (Exception e) { - escidocRespondOK = false; - } - this.reportEscidocError(escidocRespondOK, idsNoFound); - } - - - - protected void reportEscidocError(boolean escidocRespondOK, List idsNoFound){ - if(!escidocRespondOK){ - addGeneralMsg("The references could not be loaded. The server did not respond."); - addGeneralMsg("Exception connecting to http://escidoc.mpiwg-berlin.mpg.de:8080 "); - } - - if(!idsNoFound.isEmpty()){ - addGeneralMsg("The following references were not found in Pubman server:"); - StringBuilder sb = new StringBuilder(); - int count = 0; - for(String id : idsNoFound){ - if(count > 0){ - sb.append(", "); - } - sb.append(id); - } - addGeneralMsg(sb.toString()); - } - - } protected void prepareEndNoteRefs2Save() throws Exception{ //REFERENCE -> is_reference_of -> WITNESS @@ -362,32 +268,6 @@ } } - protected Entity prepareESciDocRefs2Save(Entity currentEntity) throws Exception{ - //REFERENCE -> is_reference_of -> WITNESS - currentEntity.removeAllTargetRelationsByName(rel_is_reference_of); - for(ESciDocItem item : this.selectedItems.getList()){ - Publication pub = item.getPublication(); - if(pub.getEntity() == null){ - Entity pubEntity = new Entity(Node.TYPE_ABOX, REFERENCE, false); - pubEntity.setOwnValue(pub.getObjid()); - pubEntity.addAttribute(new Attribute("id", "escidoc-objid", pub.getObjid())); - if(StringUtils.isNotEmpty(pub.getAdditionalInformation())){ - pubEntity.addAttribute(new Attribute("additional_information", "text", pub.getAdditionalInformation())); - } - pubEntity = getWrapper().saveEntity(pubEntity, getUserName()); - pub.setEntity(pubEntity); - }else{ - if(pub.getEntity().getAttributeByName("additional_information") != null){ - pub.getEntity().getAttributeByName("additional_information").setOwnValue(pub.getAdditionalInformation()); - }else{ - pub.getEntity().addAttribute(new Attribute("additional_information", "text", pub.getAdditionalInformation())); - } - pub.setEntity(getWrapper().saveEntity(pub.getEntity(), getUserName())); - } - Relation rel = new Relation(pub.getEntity(), currentEntity, rel_is_reference_of); - } - return currentEntity; - } public static de.mpiwg.itgroup.ismi.util.guiComponents.Calendar updateCalendar(Attribute att){ de.mpiwg.itgroup.ismi.util.guiComponents.Calendar calendar = null; @@ -421,7 +301,6 @@ this.setCurrentId(""); this.setCurrentIdMsg(""); this.setAttributes(new HashMap()); - this.selectedItems = new SelectedESciDocItems(); this.displayUrl = null; this.endNoteRefTable = new ReferenceTable(); } @@ -1136,14 +1015,6 @@ this.currentIdMsg = currentIdMsg; } - public SelectedESciDocItems getSelectedItems() { - return selectedItems; - } - - public void setSelectedItems(SelectedESciDocItems selectedItems) { - this.selectedItems = selectedItems; - } - public String getDefObjectClass() { return defObjectClass; } diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/java/de/mpiwg/itgroup/ismi/entry/beans/ApplicationBean.java --- a/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/ApplicationBean.java Mon Nov 30 15:37:10 2015 +0100 +++ b/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/ApplicationBean.java Mon Nov 30 15:38:09 2015 +0100 @@ -17,7 +17,6 @@ import org.mpi.openmind.repository.services.ServiceRegistry; import org.mpi.openmind.search.SearchService; import org.mpi.openmind.security.SecurityService; -import org.mpiwg.itgroup.escidoc.ESciDocCache; import de.mpiwg.itgroup.ismi.entry.dataBeans.SimpleSearchCache; import de.mpiwg.itgroup.ismi.publicView.PublicCodexList; @@ -56,8 +55,6 @@ private PublicCodexList publicCodexList; - public ESciDocCache refCache = new ESciDocCache(); - public static String generateExportURL(String urlRoot, List list, String mode){ StringBuilder sb = new StringBuilder(urlRoot); @@ -201,10 +198,6 @@ this.suggestedSubjects = suggestedSubjects; } - public void listenerSynchronizeESciDocCacheWithServer(){ - this.refCache.synchronizeWithServer(); - } - static{ dateTypes.add(new SelectItem(FORMATED_DATE)); @@ -534,10 +527,6 @@ this.dirty = true; } - public ESciDocCache getRefCache() { - return refCache; - } - public String getJSConfirmationSave(){ return "if(!confirm('Do you really want to save the changes?')){ return false; };"; } diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/java/de/mpiwg/itgroup/ismi/entry/beans/CurrentTextBean.java --- a/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/CurrentTextBean.java Mon Nov 30 15:37:10 2015 +0100 +++ b/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/CurrentTextBean.java Mon Nov 30 15:38:09 2015 +0100 @@ -22,17 +22,11 @@ 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.entry.utils.PrivacityUtils; import de.mpiwg.itgroup.ismi.util.guiComponents.Calendar; import de.mpiwg.itgroup.ismi.util.guiComponents.EndNoteMisattribution; import de.mpiwg.itgroup.ismi.util.guiComponents.EndNoteMisattributionTable; import de.mpiwg.itgroup.ismi.util.guiComponents.EntityList; -import de.mpiwg.itgroup.ismi.util.guiComponents.TargetMisattribution; -import de.mpiwg.itgroup.ismi.util.guiComponents.MisattributionDataTable; public class CurrentTextBean extends AbstractISMIBean implements Serializable{ private static final long serialVersionUID = 1017399812886455381L; diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/java/de/mpiwg/itgroup/ismi/entry/beans/SessionBean.java --- a/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/SessionBean.java Mon Nov 30 15:37:10 2015 +0100 +++ b/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/SessionBean.java Mon Nov 30 15:38:09 2015 +0100 @@ -12,13 +12,10 @@ import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; -import org.mpi.openmind.cache.WrapperService; import org.mpi.openmind.repository.bo.Attribute; import org.mpi.openmind.repository.bo.Entity; import org.mpi.openmind.security.SecurityService; import org.mpi.openmind.security.bo.User; -import org.mpiwg.itgroup.escidoc.utils.ESciDocItemDataTable; -import org.mpiwg.itgroup.escidoc.web.ESciDocItemForm; import org.mpiwg.itgroup.geonames.GeonameForm; import org.richfaces.event.ItemChangeEvent; @@ -32,7 +29,6 @@ import de.mpiwg.itgroup.ismi.merge.GeneralMerge; import de.mpiwg.itgroup.ismi.publicView.DynamicPageEditor; import de.mpiwg.itgroup.ismi.publicView.PublicCodexBean; -import de.mpiwg.itgroup.ismi.publicView.PublicCodexList; import de.mpiwg.itgroup.ismi.publicView.PublicCodexView; import de.mpiwg.itgroup.ismi.publicView.pages.DynamicPage; import de.mpiwg.itgroup.ismi.search.beans.AdvancedSearchBean; @@ -58,10 +54,6 @@ private DisplayAuthorBean displayAuthor = new DisplayAuthorBean(); private DisplayTitleBean displayTitle = new DisplayTitleBean(); - private ESciDocItemForm eSciDocForm = new ESciDocItemForm(); - - private ESciDocItemDataTable refDataTable = new ESciDocItemDataTable(null); - private DynamicPageEditor pageEditor = null; @@ -180,10 +172,6 @@ return null; } - public void listenerOpenESciDocForm(ActionEvent event){ - this.refDataTable.open(); - } - //************************************ //************************************ //************************************ @@ -1048,22 +1036,6 @@ this.entDetailsForm = entDetailsForm; } - public ESciDocItemForm geteSciDocForm() { - return eSciDocForm; - } - - public void seteSciDocForm(ESciDocItemForm eSciDocForm) { - this.eSciDocForm = eSciDocForm; - } - - public ESciDocItemDataTable getRefDataTable() { - return refDataTable; - } - - public void setRefDataTable(ESciDocItemDataTable refDataTable) { - this.refDataTable = refDataTable; - } - public GeonameForm getGeoForm() { return geoForm; } diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/java/de/mpiwg/itgroup/ismi/event/beans/AbstractEvent.java --- a/src/main/java/de/mpiwg/itgroup/ismi/event/beans/AbstractEvent.java Mon Nov 30 15:37:10 2015 +0100 +++ b/src/main/java/de/mpiwg/itgroup/ismi/event/beans/AbstractEvent.java Mon Nov 30 15:38:09 2015 +0100 @@ -4,7 +4,6 @@ import java.util.ArrayList; import java.util.List; -import javax.faces.event.ActionEvent; import javax.faces.event.AjaxBehaviorEvent; import javax.faces.event.ValueChangeEvent; import javax.faces.model.SelectItem; diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/java/de/mpiwg/itgroup/ismi/search/beans/DisplayBean.java --- a/src/main/java/de/mpiwg/itgroup/ismi/search/beans/DisplayBean.java Mon Nov 30 15:37:10 2015 +0100 +++ b/src/main/java/de/mpiwg/itgroup/ismi/search/beans/DisplayBean.java Mon Nov 30 15:38:09 2015 +0100 @@ -4,21 +4,14 @@ import java.util.List; import javax.faces.event.ActionEvent; -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.mpiwg.itgroup.escidoc.ESciDocHandler; -import org.mpiwg.itgroup.escidoc.bo.Publication; import de.mpiwg.itgroup.ismi.auxObjects.SelectItem0; import de.mpiwg.itgroup.ismi.entry.beans.AbstractISMIBean; -import de.mpiwg.itgroup.ismi.entry.beans.ApplicationBean; import de.mpiwg.itgroup.ismi.entry.utils.PrivacityUtils; -import de.mpiwg.itgroup.ismi.util.guiComponents.HtmlOption; import de.mpiwg.itgroup.ismi.utils.templates.TitleTemplate; import de.mpiwg.itgroup.ismi.utils.templates.WitnessTemplate; diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/java/de/mpiwg/itgroup/ismi/util/guiComponents/MisattributionDataTable.java --- a/src/main/java/de/mpiwg/itgroup/ismi/util/guiComponents/MisattributionDataTable.java Mon Nov 30 15:37:10 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,164 +0,0 @@ -package de.mpiwg.itgroup.ismi.util.guiComponents; - -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.ValueChangeEvent; - -import org.mpi.openmind.repository.bo.Entity; -import org.mpiwg.itgroup.escidoc.bo.ESciDocItem; -import org.mpiwg.itgroup.escidoc.utils.ESciDocItemDataTable; - -import de.mpiwg.itgroup.ismi.auxObjects.ListenerObject; -import de.mpiwg.itgroup.ismi.entry.beans.AbstractISMIBean; - -/** - * TEXT misattributed_to PERSON - * @author jurzua - * - */ -public class MisattributionDataTable extends AbstractISMIBean{ - - private List misattList = new ArrayList(); - private Map selectionList = new HashMap(); - - private ListenerObject lo = new ListenerObject(); - private String attName; - private String objectClass; - - private TargetMisattribution currentMisatt; - private ESciDocItemDataTable refDataTable; - - public MisattributionDataTable(String oc, String attName){ - this.attName = attName; - this.objectClass = oc; - this.refDataTable = new ESciDocItemDataTable(this); - } - - public void setESciDocItem(ESciDocItem item){ - if(this.currentMisatt != null){ - this.currentMisatt.setItem(item); - } - } - - public void listenerCloseRefDialog(ActionEvent event){ - this.currentMisatt = null; - this.refDataTable.listenerClose(event); - } - - public void listenerOpenRefDialog(ActionEvent event){ - this.currentMisatt = (TargetMisattribution)getRequestBean("misatt"); - this.refDataTable.listenerOpen(event); - } - - - public void listenerAdd(ActionEvent event){ - this.add(this.lo.entity); - } - - public void listenerRemoveSelection(ActionEvent event){ - for(Entity remove : getSelectedEntities()){ - this.remove(remove.getId()); - } - } - - public void listenerChanged(ValueChangeEvent event) { - this.lo = changeListener(event, lo, this.objectClass, this.attName); - if(lo.entity != null && lo.entity.isPersistent()){ - lo.statusImage.setStatus(StatusImage.STATUS_OK); - }else{ - lo.statusImage.setStatus(StatusImage.STATUS_UNSET); - } - } - - private List getSelectedEntities(){ - List list = new ArrayList(); - for(TargetMisattribution misatt : this.misattList){ - Entity e = misatt.getPerson(); - if(selectionList.get(e.getId())){ - list.add(e); - } - } - return list; - } - - public void add(Entity e){ - if(e != null && e.isPersistent()){ - if(!selectionList.containsKey(e.getId())){ - this.misattList.add(new TargetMisattribution(e, null, null, getAppBean())); - this.selectionList.put(e.getId(), false); - //TODO sort - //Collections.sort(this.misattList); - } - } - } - - public void add(Entity person, String refId, String notes){ - this.misattList.add(new TargetMisattribution(person, refId, notes, getAppBean())); - this.selectionList.put(person.getId(), false); - } - - public void remove(Long id){ - this.selectionList.remove(id); - TargetMisattribution toDelete = null; - for(TargetMisattribution misatt : this.misattList){ - Entity ent = misatt.getPerson(); - if(ent.getId().intValue() == id){ - toDelete = misatt; - break; - } - } - this.misattList.remove(toDelete); - } - - - public List getMisattList() { - return misattList; - } - - public void setMisattList(List misattList) { - this.misattList = misattList; - } - - public Map getSelectionList() { - return selectionList; - } - public void setSelectionList(Map selectionList) { - this.selectionList = selectionList; - } - public ListenerObject getLo() { - return lo; - } - public void setLo(ListenerObject lo) { - this.lo = lo; - } - public String getAttName() { - return attName; - } - public void setAttName(String attName) { - this.attName = attName; - } - public String getObjectClass() { - return objectClass; - } - public void setObjectClass(String objectClass) { - this.objectClass = objectClass; - } - public TargetMisattribution getCurrentMisatt() { - return currentMisatt; - } - public void setCurrentMisatt(TargetMisattribution currentMisatt) { - this.currentMisatt = currentMisatt; - } - - public ESciDocItemDataTable getRefDataTable() { - return refDataTable; - } - - public void setRefDataTable(ESciDocItemDataTable refDataTable) { - this.refDataTable = refDataTable; - } -} diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/java/de/mpiwg/itgroup/ismi/util/guiComponents/Reference.java --- a/src/main/java/de/mpiwg/itgroup/ismi/util/guiComponents/Reference.java Mon Nov 30 15:37:10 2015 +0100 +++ b/src/main/java/de/mpiwg/itgroup/ismi/util/guiComponents/Reference.java Mon Nov 30 15:38:09 2015 +0100 @@ -17,7 +17,6 @@ */ private static final long serialVersionUID = 8933033295341938974L; public static String ADD_INFORMATION = "additional_information"; - public static String ESCIDOC_ID = "id"; public static String ENDNOTE_ID = "endnote-id"; public static String ENDNOTE_CONTENT = "endnote-content"; @@ -28,7 +27,6 @@ private String endNoteId; private String endNoteContent; private String addInformation; - private String escidocId; //private int mode = CREATION; @Override @@ -43,8 +41,7 @@ Reference other = (Reference)o; if(StringUtils.equals(endNoteId, other.endNoteId) && StringUtils.equals(endNoteContent, other.endNoteContent) && - StringUtils.equals(addInformation, other.addInformation) && - StringUtils.equals(escidocId, other.escidocId)){ + StringUtils.equals(addInformation, other.addInformation)) { //@TODO compare entities return true; } @@ -64,9 +61,6 @@ if(ent.containsAttribute(ADD_INFORMATION)){ this.addInformation = ent.getAttributeByName(ADD_INFORMATION).getValue(); } - if(ent.containsAttribute(ESCIDOC_ID)){ - this.escidocId = ent.getAttributeByName(ESCIDOC_ID).getValue(); - } if(ent.containsAttribute(ENDNOTE_ID)){ this.endNoteId = ent.getAttributeByName(ENDNOTE_ID).getValue(); } @@ -82,8 +76,7 @@ if(ent == null && StringUtils.isEmpty(endNoteId) && StringUtils.isEmpty(endNoteContent) && - StringUtils.isEmpty(addInformation) && - StringUtils.isEmpty(escidocId)){ + StringUtils.isEmpty(addInformation)) { return true; } return false; @@ -97,9 +90,6 @@ if(!ent.containsAttribute(ADD_INFORMATION)){ ent.addAttribute(new Attribute(ADD_INFORMATION, "text", this.addInformation)); } - if(!ent.containsAttribute(ESCIDOC_ID)){ - ent.addAttribute(new Attribute(ESCIDOC_ID, "text", this.escidocId)); - } if(!ent.containsAttribute(ENDNOTE_ID)){ ent.addAttribute(new Attribute(ENDNOTE_ID, "text", this.endNoteId)); } @@ -111,9 +101,6 @@ if(StringUtils.isNotEmpty(addInformation)){ ent.getAttributeByName(ADD_INFORMATION).setValue(addInformation); } - if(StringUtils.isNotEmpty(escidocId)){ - ent.getAttributeByName(ESCIDOC_ID).setValue(escidocId); - } if(StringUtils.isNotEmpty(endNoteId)){ ent.getAttributeByName(ENDNOTE_ID).setValue(endNoteId); } @@ -148,14 +135,6 @@ this.addInformation = addInformation; } - public String getEscidocId() { - return escidocId; - } - - public void setEscidocId(String escidocId) { - this.escidocId = escidocId; - } - @Override public String toString(){ StringBuilder sb = new StringBuilder(); @@ -170,9 +149,6 @@ if(StringUtils.isNotEmpty(endNoteContent)){ sb.append(endNoteContent + "\n"); } - if(StringUtils.isNotEmpty(escidocId)){ - sb.append(escidocId); - } return sb.toString(); } diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/java/de/mpiwg/itgroup/ismi/util/guiComponents/TargetMisattribution.java --- a/src/main/java/de/mpiwg/itgroup/ismi/util/guiComponents/TargetMisattribution.java Mon Nov 30 15:37:10 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -package de.mpiwg.itgroup.ismi.util.guiComponents; - -import org.mpi.openmind.repository.bo.Entity; -import org.mpiwg.itgroup.escidoc.bo.ESciDocItem; - -import de.mpiwg.itgroup.ismi.entry.beans.ApplicationBean; - -public class TargetMisattribution{ - private Entity person; - //private Publication pub; - private ESciDocItem item; - - public TargetMisattribution(Entity person, String refId, String notes, ApplicationBean appBean){ - this.person = person; - - this.item = appBean.getRefCache().getItem(refId); - if(this.item == null){ - this.item = new ESciDocItem(refId); - this.item.setErrorLoading(ESciDocItem.ESCIDOC_ERROR_ID_NO_FOUND); - } - this.item.getPublication().setAdditionalInformation(notes); - - /* - try{ - this.pub = ESciDocHandler.getPublicationById(refId); - }catch (Exception e) { - System.err.println("The references could not be loaded. The server did not respond."); - } - - if(this.pub == null){ - this.pub = new Publication(refId); - this.pub.setErrorLoading(Publication.ESCIDOC_ERROR_ID_NO_FOUND); - } - this.pub.setAdditionalInformation(notes); - */ - } - - public Entity getPerson() { - return person; - } - public void setPerson(Entity person) { - this.person = person; - } - - public ESciDocItem getItem() { - return item; - } - - public void setItem(ESciDocItem item) { - this.item = item; - } -} \ No newline at end of file diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/java/de/mpiwg/itgroup/ismi/utils/templates/AbstractTemplate.java --- a/src/main/java/de/mpiwg/itgroup/ismi/utils/templates/AbstractTemplate.java Mon Nov 30 15:37:10 2015 +0100 +++ b/src/main/java/de/mpiwg/itgroup/ismi/utils/templates/AbstractTemplate.java Mon Nov 30 15:38:09 2015 +0100 @@ -4,13 +4,7 @@ import java.util.ArrayList; import java.util.List; -import org.apache.commons.lang.StringUtils; -import org.mpi.openmind.repository.bo.Attribute; import org.mpi.openmind.repository.bo.Entity; -import org.mpiwg.itgroup.escidoc.ESciDocHandler; -import org.mpiwg.itgroup.escidoc.bo.Publication; - -import de.mpiwg.itgroup.ismi.util.guiComponents.Reference; public abstract class AbstractTemplate implements Serializable{ @@ -34,38 +28,18 @@ private static final long serialVersionUID = -8257628538319156038L; - private String escidocLabel; private String additionalInf; private String endnoteId; private String endnoteContent; public ReferenceTemplate(Entity ent){ - Attribute att = ent.getAttributeByName(Reference.ESCIDOC_ID); - try { - if(att != null && StringUtils.isNotEmpty(att.getValue())){ - Publication pub = ESciDocHandler.getPublicationById(att.getValue()); - if(pub != null){ - this.escidocLabel = pub.getHTMLLabel(); - } - } - } catch (Exception e) { - e.printStackTrace(); - } - - this.additionalInf = (ent.getAttributeByName("additional_information") != null) ? ent.getAttributeByName("additional_information").getValue() : null; this.endnoteId = (ent.getAttributeByName("endnote-id") != null) ? ent.getAttributeByName("endnote-id").getValue() : null; this.endnoteContent = (ent.getAttributeByName("endnote-content") != null) ? ent.getAttributeByName("endnote-content").getValue() : null; } - public String getEscidocLabel() { - return escidocLabel; - } - public void setEscidocLabel(String escidocLabel) { - this.escidocLabel = escidocLabel; - } public String getAdditionalInf() { return additionalInf; } diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/java/de/mpiwg/itgroup/ismi/utils/templates/AuthorTemplate.java --- a/src/main/java/de/mpiwg/itgroup/ismi/utils/templates/AuthorTemplate.java Mon Nov 30 15:37:10 2015 +0100 +++ b/src/main/java/de/mpiwg/itgroup/ismi/utils/templates/AuthorTemplate.java Mon Nov 30 15:38:09 2015 +0100 @@ -12,9 +12,6 @@ import org.mpi.openmind.repository.bo.Attribute; import org.mpi.openmind.repository.bo.Entity; import org.mpi.openmind.repository.bo.Relation; -import org.mpi.openmind.search.AbstractSearchService; -import org.mpiwg.itgroup.escidoc.ESciDocHandler; -import org.mpiwg.itgroup.escidoc.bo.Publication; import de.mpiwg.itgroup.ismi.entry.beans.AbstractISMIBean; import de.mpiwg.itgroup.ismi.util.guiComponents.Calendar; diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/java/org/mpiwg/itgroup/escidoc/AbstractClient.java --- a/src/main/java/org/mpiwg/itgroup/escidoc/AbstractClient.java Mon Nov 30 15:37:10 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,376 +0,0 @@ -package org.mpiwg.itgroup.escidoc; - -import java.io.IOException; -import java.io.InputStream; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.lang.StringUtils; -import org.apache.http.HttpEntity; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpDelete; -import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.client.methods.HttpPut; -import org.apache.http.client.methods.HttpRequestBase; -import org.apache.http.client.params.ClientPNames; -import org.apache.http.client.params.CookiePolicy; -import org.apache.http.entity.InputStreamEntity; -import org.apache.http.impl.client.DefaultHttpClient; -import org.jdom.Attribute; -import org.jdom.Document; -import org.jdom.Element; -import org.jdom.JDOMException; -import org.jdom.input.SAXBuilder; -import org.jdom.xpath.XPath; -import org.mpiwg.itgroup.escidoc.bo.Creator; -import org.mpiwg.itgroup.escidoc.bo.ESciDocConstants; -import org.mpiwg.itgroup.escidoc.bo.ESciDocItem; -import org.mpiwg.itgroup.escidoc.bo.Publication; -import org.mpiwg.itgroup.escidoc.bo.Publishing; - -public class AbstractClient extends ESciDocConstants implements Serializable{ - - private static final long serialVersionUID = 8133780898394554218L; - - private String user; - private String password; - public String eScidocUrl; - private HttpClient httpclient = null; - - public AbstractClient(String eScidocServer, int eScidocPort, String user, - String password) { - this.user = user; - this.password = password; - this.eScidocUrl = "http://" + eScidocServer + ":" - + String.valueOf(eScidocPort); - } - - public HttpClient login() throws IOException { - httpclient = new DefaultHttpClient(); - - httpclient.getParams().setParameter(ClientPNames.COOKIE_POLICY, - CookiePolicy.BROWSER_COMPATIBILITY); - - HttpPost httppost = new HttpPost(eScidocUrl + "/aa/login?target=/"); - - HttpResponse response = httpclient.execute(httppost); - // HttpEntity entity = httppost.getRes - - System.out.println("----------------------------------------"); - System.out.println(response.getStatusLine()); - - HttpEntity entity = response.getEntity(); - if (entity != null) { - entity.consumeContent(); - } - - HttpGet httpget = new HttpGet(eScidocUrl - + "/aa/j_spring_security_check?j_username=" + user - + "&j_password=" + password); - - response = httpclient.execute(httpget); - // entity = response.getEntity(); - - System.out.println("----------------------------------------"); - System.out.println(response.getStatusLine()); - - entity = response.getEntity(); - if (entity != null) { - entity.consumeContent(); - } - - // entity.consumeContent(); - return httpclient; - } - - public HttpClient getHttpClient() throws IOException { - //if (httpclient == null) { - //how can be detected that the timeout of the session??? - this.login(); - //} - return httpclient; - } - - public ESciDocItem eScidocPut(String command, InputStream body) - throws IOException, JDOMException, ESciDocException, Exception { - //create PUT /ir/item return item - //update PUT /ir/item/ return item - System.out.println("PUT " + eScidocUrl + command); - HttpPut httpput = new HttpPut(eScidocUrl + command); - return getItemFromDoc(eScidocRequestBase(httpput, command, body)); - } - - public String eScidocPost(String command, InputStream body) - throws IOException, JDOMException, ESciDocException, Exception { - ///ir/item//submit last-modification-date - ///ir/item//release last-modification-date within XML (result.xsd) - System.out.println("----------------------"); - System.out.println("POST " + eScidocUrl + command); - HttpPost httppost = new HttpPost(eScidocUrl + command); - - return getLastModificationDate(eScidocRequestBase(httppost, command, body)); - } - - public void eScidocDelete(String command, InputStream body) - throws IOException, JDOMException, ESciDocException, Exception { - //DELETE /ir/item/ - System.out.println("----------------------"); - System.out.println("DELETE " + eScidocUrl + command); - HttpDelete httppost = new HttpDelete(eScidocUrl + command); - - eScidocRequestBase(httppost, command, body); - return; - } - - public ESciDocItem eScidocGet(String command) throws IOException, - JDOMException, ESciDocException, Exception { - System.out.println("GET " + eScidocUrl + command); - HttpGet httpget = new HttpGet(eScidocUrl + command); - Document doc = eScidocRequestBase(httpget, command, null); - //System.out.println(new XMLOutputter().outputString(doc)); - return getItemFromDoc(doc); - } - - private Document eScidocRequestBase(HttpRequestBase httpBase, String command, - InputStream body) throws Exception { - - if (HttpEntityEnclosingRequestBase.class.isInstance(httpBase)) { - if (body != null) { - HttpEntity entity = new InputStreamEntity(body, -1); - ((HttpEntityEnclosingRequestBase) httpBase).setEntity(entity); - } - } - - HttpResponse status = getHttpClient().execute(httpBase); - - InputStream in = status.getEntity().getContent(); - Document doc = new SAXBuilder().build(in); - - //System.out.println("Resonse output for " + command + ":"); - //System.out.println(new XMLOutputter().outputString(doc)); - - // the response can be an exception for the cases UPDATE and GET - // The response can be a Item for GET - - isReponseException(doc); - - return doc; - } - - public static ESciDocItem getItemFromDoc(Document doc) throws Exception { - List list = getItemsFromDoc(doc); - if (!list.isEmpty()) - return list.get(0); - return null; - } - - public static List getItemsFromDoc(Document doc) - throws Exception { - List list = new ArrayList(); - - XPath xp = XPath.newInstance(".//escidocItem:item"); - xp.addNamespace("escidocItem", "http://www.escidoc.de/schemas/item/0.9"); - - List inputList = xp.selectNodes(doc); - for (Object obj : inputList) { - if (obj instanceof Element) { - Element eItem = (Element) obj; - - - - ESciDocItem escidocItem = new ESciDocItem(); - // FIXME: sometimes this is not the last version, therefore.... - escidocItem.setLastModificationDate(eItem.getAttributeValue("last-modification-date")); - addVersionToItem(eItem, escidocItem); - addPublicStatusItem(eItem, escidocItem); - addLatestVersionToItem(eItem, escidocItem); - addLatestRelease(eItem, escidocItem); - - escidocItem.setPublication(getPubFromXMLElement(eItem)); - Attribute objIdAtt = eItem.getAttribute("objid"); - String objId = (objIdAtt != null) ? objIdAtt.getValue() : null; - - if(StringUtils.isEmpty(objId)){ - //xlink:href="/ir/item/escidoc:127561" - objIdAtt = eItem.getAttribute("href", NS_XLINK); - objId = (objIdAtt != null) ? objIdAtt.getValue() : ""; - objId = objId.replace("/ir/item/", ""); - } - escidocItem.getPublication().setObjid(objId); - - list.add(escidocItem); - } else { - System.out.println(obj); - } - } - - return list; - } - - public static void addPublicStatusItem(Element eItem, ESciDocItem item){ - Element props = eItem.getChild("properties", NS_ESCIDOC_ITEM); - Element publicStatus = props.getChild("public-status", NS_PROP); - - item.setPublicStatus((publicStatus != null) ? publicStatus.getValue() : null); - } - - public static void addVersionToItem(Element eItem, ESciDocItem item){ - Element props = eItem.getChild("properties", NS_ESCIDOC_ITEM); - Element version = props.getChild("version", NS_PROP); - - if(version != null){ - String value = (version.getChild("number", NS_VERSION) != null) ? version.getChild("number", NS_VERSION).getValue() : null; - item.setVersionNumber(value); - - value = (version.getChild("date", NS_VERSION) != null) ? version.getChild("date", NS_VERSION).getValue() : null; - item.setVersionDate(value); - - value = (version.getChild("status", NS_VERSION) != null) ? version.getChild("status", NS_VERSION).getValue() : null; - item.setVersionStatus(value); - } - } - - public static void addLatestVersionToItem(Element eItem, ESciDocItem item){ - Element props = eItem.getChild("properties", NS_ESCIDOC_ITEM); - Element latestVersion = props.getChild("latest-version", NS_PROP); - - //Attribute hrefAtt = latestVersion.getAttribute("href", NS_XLINK); - //putting into item - item.setLatestVersionNumber(latestVersion.getChild("number", NS_VERSION).getValue()); - item.setLatestVersionDate(latestVersion.getChild("date", NS_VERSION).getValue()); - //item.setLatestVersionHref(hrefAtt.getValue()); - } - - - - private static void addLatestRelease(Element eItem, ESciDocItem item){ - Element props = eItem.getChild("properties", NS_ESCIDOC_ITEM); - Element latestRelease = props.getChild("latest-release", NS_PROP); - - if(latestRelease != null){ - //Attribute hrefAtt = latestRelease.getAttribute("href", NS_XLINK); - - //putting into item - item.setLatestReleaseNumber(latestRelease.getChild("number", NS_RELEASE).getValue()); - item.setLatestReleaseDate(latestRelease.getChild("date", NS_RELEASE).getValue()); - //item.setLatestReleasePid(latestRelease.getChild("pid", NS_RELEASE).getValue()); - //item.setLatestReleaseHref(hrefAtt.getValue()); - } - } - - private void isReponseException(Document doc) - throws JDOMException, IOException, ESciDocException { - - XPath xp = XPath.newInstance(".//exception"); - xp.addNamespace("escidocItem", "http://www.escidoc.de/schemas/item/0.9"); - - List inputList = xp.selectNodes(doc); - if (!inputList.isEmpty()) { - throw new ESciDocException((Element) inputList.get(0)); - } - } - - private String getLastModificationDate(Document doc) throws JDOMException{ - - if(doc.getRootElement().getName().equals("result")){ - Attribute lastModif = doc.getRootElement().getAttribute("last-modification-date"); - if(lastModif != null){ - return lastModif.getValue(); - } - } - return null; - } - - protected static Publication getPubFromXMLElement(Element item) { - - Publication reference = new Publication(getObjId(item.getAttribute( - "href", NS_XLINK))); - - Element md_records = item.getChild("md-records", NS_ESCIDOC_MD_RECORDS); - Element md_record = md_records.getChild("md-record", NS_ESCIDOC_MD_RECORDS); - Element publication = md_record.getChild("publication", NS_PUBLICATION); - - List creatorList = publication.getChildren("creator", NS_ETERMS); - Element title = publication.getChild("title", NS_DC); - List alternativeList = publication.getChildren("alternative", NS_DCTERMS); - Element publishing_info = publication.getChild("publishing-info", NS_ETERMS); - Element issued = publication.getChild("issued", NS_DCTERMS); - Element totalNumberOfPages = publication.getChild("total-number-of-pages", NS_ETERMS); - - // - Element subject = publication.getChild("subject", NS_DCTERMS); - - // Filling the reference - - for (Object object : creatorList) { - if (object instanceof Element) { - Element creator = (Element) object; - Element person = creator.getChild("person", NS_PERSON); - - if (person != null) { - Element complete_name = person.getChild("complete-name", - NS_ETERMS); - Element family_name = person.getChild("family-name", - NS_ETERMS); - Element given_name = person.getChild("given-name", - NS_ETERMS); - Element organization = person.getChild("organization", - NS_ORGANIZATION); - - reference.addCreator(new Creator( - (complete_name != null) ? complete_name.getText() - : "", (family_name != null) ? family_name - .getText() : "", - (given_name != null) ? given_name.getText() : "")); - } - } - } - - reference.setTitle((title != null) ? title.getText() : ""); - - for (Object object : alternativeList) { - if (object instanceof Element) { - Element alternative = (Element) object; - reference.addAlternative(alternative.getText()); - } - } - - if (publishing_info != null) { - Element publisher = publishing_info.getChild("publisher", NS_DC); - Element place = publishing_info.getChild("place", NS_ETERMS); - Element edition = publishing_info.getChild("edition", NS_ETERMS); - - reference.setPublishing(new Publishing( - (publisher != null) ? publisher.getText() : "", - (place != null) ? place.getText() : "", - (edition != null) ? edition.getText() : "")); - } - - reference.setIssued - ((issued != null) ? issued.getText() : ""); - reference.setNumberOfPages - ((totalNumberOfPages != null) ? totalNumberOfPages.getText() : ""); - reference.setSubject - ((subject != null) ? subject.getText() : ""); - - return reference; - } - - private static String getObjId(Attribute att) { - // new Attribute("href", "/ir/item/"+ publication.getObjid() - // +"/md-records", NS_XLINK) - if (att != null) { - String objId = att.getValue().replace("/ir/item/", ""); - String[] array = objId.split(":"); - if (array.length == 3) { - return array[0] + ":" + array[1]; - } - return objId; - } - return null; - } -} diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/java/org/mpiwg/itgroup/escidoc/AbstractESciDocCache.java --- a/src/main/java/org/mpiwg/itgroup/escidoc/AbstractESciDocCache.java Mon Nov 30 15:37:10 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,107 +0,0 @@ -package org.mpiwg.itgroup.escidoc; - -import java.io.Serializable; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.mpiwg.itgroup.escidoc.bo.ESciDocItem; - -public class AbstractESciDocCache implements Serializable{ - - private static final long serialVersionUID = 2093872792493279298L; - - private static Integer SERVER_STATUS_OK = 0; - private static Integer SERVER_STATUS_DOWN = 1; - - public static int SORT_NONE = -1; - public static int SORT_DEFAULT = 0; - public static int SORT_TITLE = 1; - public static int SORT_CREATOR = 2; - - - private int serverStatus = SERVER_STATUS_OK; - private Long lastSynchronizationTimeExec; - private Date lastSynchronization; - private int lastSynchronizationMaxRecords; - private final static DateFormat dateformater = new SimpleDateFormat("yyyy.MM.dd-HH:mm"); - - protected ESciDocClient client = new ESciDocClient("escidoc.mpiwg-berlin.mpg.de", 8080, "jurzua", "221082"); - - private Map itemMap; - private Integer maxRecords = 50; - - public Map getItemMap(){ - if(itemMap == null || SERVER_STATUS_DOWN.equals(serverStatus)){ - this.synchronizeWithServer(); - } - return itemMap; - } - - public int getItemsSize(){ - return this.getItemMap().size(); - } - - public void synchronizeWithServer(){ - - System.out.println("synchronizeWithServer Pubman"); - - long start = System.currentTimeMillis(); - this.itemMap = new HashMap(); - this.lastSynchronizationMaxRecords = this.maxRecords; - try { - //List list = new ArrayList(); //ESciDocClient.getAllItems(); - - List list = new ArrayList(); //ESciDocClient.getAllItems(this.maxRecords); - for(ESciDocItem item : list){ - this.itemMap.put(item.getPublication().getObjid(), item); - } - this.serverStatus = SERVER_STATUS_OK; - } catch (Exception e) { - e.printStackTrace(); - this.serverStatus = SERVER_STATUS_DOWN; - } finally{ - this.lastSynchronization = new Date(); - } - this.lastSynchronizationTimeExec = System.currentTimeMillis() - start; - } - - public String getServerStatus(){ - if(SERVER_STATUS_OK.equals(serverStatus)){ - return new String("OK"); - }else{ - return new String("Server did not respond."); - } - } - - public String getLastSynchronization() { - return dateformater.format(lastSynchronization); - } - - public boolean isServerStatusOK(){ - if(SERVER_STATUS_OK.equals(SERVER_STATUS_OK)) - return true; - return false; - } - - public Long getLastSynchronizationTimeExec() { - return lastSynchronizationTimeExec; - } - - public Integer getMaxRecords() { - return maxRecords; - } - - public void setMaxRecords(Integer maxRecords) { - this.maxRecords = maxRecords; - } - - public int getLastSynchronizationMaxRecords() { - return lastSynchronizationMaxRecords; - } - -} diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/java/org/mpiwg/itgroup/escidoc/BootcampClient.java --- a/src/main/java/org/mpiwg/itgroup/escidoc/BootcampClient.java Mon Nov 30 15:37:10 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -package org.mpiwg.itgroup.escidoc; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; - -import org.apache.http.HttpEntity; -import org.apache.http.HttpResponse; -import org.apache.http.client.ClientProtocolException; -import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.client.methods.HttpPut; -import org.apache.http.entity.InputStreamEntity; -import org.apache.http.impl.client.DefaultHttpClient; -import org.json.JSONException; -import org.json.JSONObject; - -public class BootcampClient { - - public static String url = "http://localhost:8080/"; - - - public static void testPost() throws JSONException, ClientProtocolException, IOException{ - HttpPost httpBase = new HttpPost("http://localhost:8080/"); - - JSONObject json = new JSONObject(); - json.put("name", "Jorge hahaha"); - json.put("text", "jhakjhskhjdsahjdsahjkdsa"); - - - - InputStream body = new ByteArrayInputStream(json.toString().getBytes()); - if (HttpEntityEnclosingRequestBase.class.isInstance(httpBase)) { - if (body != null) { - HttpEntity entity = new InputStreamEntity(body, -1); - ((HttpEntityEnclosingRequestBase) httpBase).setEntity(entity); - } - } - - HttpResponse status = (new DefaultHttpClient()).execute(httpBase); - } - - /** - * @param args - */ - public static void main(String[] args) { - try { - System.out.println("TESTING BEGINING*******"); - testPost(); - System.out.println("TESTING END************"); - } catch (Exception e) { - e.printStackTrace(); - } - - } - -} diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/java/org/mpiwg/itgroup/escidoc/ESciDocCache.java --- a/src/main/java/org/mpiwg/itgroup/escidoc/ESciDocCache.java Mon Nov 30 15:37:10 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,160 +0,0 @@ -package org.mpiwg.itgroup.escidoc; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import javax.faces.event.ActionEvent; - -import org.apache.commons.lang.StringUtils; -import org.apache.log4j.Logger; -import org.jdom.JDOMException; -import org.mpi.openmind.repository.utils.NormalizerUtils; -import org.mpiwg.itgroup.escidoc.bo.Creator; -import org.mpiwg.itgroup.escidoc.bo.ESciDocItem; -import org.mpiwg.itgroup.escidoc.bo.utils.SortItemByCreator; -import org.mpiwg.itgroup.escidoc.bo.utils.SortItemByTitle; - -public class ESciDocCache extends AbstractESciDocCache{ - - private static final long serialVersionUID = 2087364857910704625L; - - private static Logger logger = Logger.getLogger(ESciDocCache.class); - - public ESciDocCache(){ - this.synchronizeWithServer(); - } - - public ESciDocItem getItemFromServer(String id) throws IOException, JDOMException, ESciDocException, Exception{ - System.out.println("ESciDocCache.getItemFromServer " + id); - return this.client.getItemX(id); - } - - public ESciDocItem getItem(String id){ - System.out.println("ESciDocCache.getItem " + id); - return this.getItemMap().get(id); - } - - public void deleteItem(ESciDocItem item, String userName) throws Exception{ - logger.info("Deleting " + item.getObjId()); - - /* - if(item.getVersionStatus().equals("released")){ - //only doing a change, the update of the item will change its status to pending, - //otherwise I do not see a way to move from released to pending (in-revision would also work). - item.getPublication().setTitle(item.getPublication().getTitle() + "."); - item = this.client.updateItem(item); - item.setLastModificationDate(this.client.submitItem(item, userName)); - item.setLastModificationDate(this.client.reviseItem(item, userName)); - - }*/ - - if(item.getPublicStatus().equals("pending") || item.getPublicStatus().equals("in-revision")){ - this.client.deleteItem(item.getObjId()); - }else{ - this.client.withdrawItem(item, userName); - } - - - this.getItemMap().remove(item.getObjId()); - } - - public ESciDocItem saveItem(ESciDocItem item, String userName) throws Exception{ - - logger.info("Saving " + item.getObjId()); - - if(item != null && StringUtils.isNotEmpty(item.getObjId())){ - - item = this.client.updateItem(item); - - - }else if(StringUtils.isEmpty(item.getObjId())){ - - item = this.client.createItem(item); - - } - - if(item.getVersionStatus().equals("pending")){ - //Submitting - item.setLastModificationDate(this.client.submitItem(item, userName)); - item.setLastModificationDate(this.client.releaseItem(item, userName)); - } - - if(item.getVersionStatus().equals("submitted")){ - //Releasing - item.setLastModificationDate(this.client.releaseItem(item, userName)); - } - - this.getItemMap().put(item.getObjId(), item); - - return item; - } - - - public List getAllItems(Integer sortBy){ - List list = new ArrayList(getItemMap().values()); - sort(sortBy, list); - return list; - } - - public static void sort(Integer sortBy, List list){ - if(sortBy == null || sortBy.equals(SORT_NONE)){ - return; - }else if(sortBy.equals(SORT_DEFAULT)){ - Collections.sort(list); - }else if(sortBy.equals(SORT_TITLE)){ - Collections.sort(list, new SortItemByTitle()); - }else if(sortBy.equals(SORT_CREATOR)){ - Collections.sort(list, new SortItemByCreator()); - } - } - - public void listenerSynchronizeWithServer(ActionEvent event){ - this.synchronizeWithServer(); - } - - public List searchItem(String term, Integer sortBy){ - List rs = new ArrayList(); - - if(StringUtils.isNotEmpty(term)){ - term = NormalizerUtils.normalize(term); - - for(ESciDocItem item : getItemMap().values()){ - if(itemContainsTerm(item, term)){ - rs.add(item); - } - } - sort(sortBy, rs); - } - return rs; - } - - private boolean itemContainsTerm(ESciDocItem item, String term){ - - if(item.getObjId().contains(term)) - return true; - - String secondTerm = item.getPublication().getNorTitle(); - if(secondTerm.contains(term)) - return true; - - secondTerm = item.getPublication().getNorSubject(); - if(secondTerm.contains(term)) - return true; - - for(String secondTerm0 : item.getPublication().getNorAlternativeList()){ - if(secondTerm0.contains(term)) - return true; - } - - for(Creator creator : item.getPublication().getCreatorList()){ - if(creator.containsTerm(term)) - return true; - } - - return false; - } - - -} diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/java/org/mpiwg/itgroup/escidoc/ESciDocClient.java --- a/src/main/java/org/mpiwg/itgroup/escidoc/ESciDocClient.java Mon Nov 30 15:37:10 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,227 +0,0 @@ -package org.mpiwg.itgroup.escidoc; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.io.Serializable; -import java.io.UnsupportedEncodingException; -import java.net.HttpURLConnection; -import java.net.URI; -import java.net.URL; -import java.net.URLEncoder; -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.lang.StringUtils; -import org.apache.http.HttpEntity; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.client.params.ClientPNames; -import org.apache.http.client.params.CookiePolicy; -import org.apache.http.impl.client.DefaultHttpClient; -import org.jdom.Attribute; -import org.jdom.Document; -import org.jdom.Element; -import org.jdom.JDOMException; -import org.jdom.input.SAXBuilder; -import org.jdom.output.XMLOutputter; -import org.jdom.xpath.XPath; -import org.mpiwg.itgroup.escidoc.bo.Creator; -import org.mpiwg.itgroup.escidoc.bo.ESciDocConstants; -import org.mpiwg.itgroup.escidoc.bo.ESciDocItem; -import org.mpiwg.itgroup.escidoc.bo.Publication; -import org.mpiwg.itgroup.escidoc.bo.Publishing; - -public class ESciDocClient extends AbstractClient implements Serializable{ - - private static final long serialVersionUID = 4982908578268938883L; - public static String GET_ITEM = "http://escidoc.mpiwg-berlin.mpg.de:8080/ir/item/"; - public static String GET_CONTEXT = "http://escidoc.mpiwg-berlin.mpg.de:8080/ir/context/"; - public static String PUT_ITEM = GET_ITEM; - public static String CREATE_ITEM = GET_ITEM; - - public static String ISMI_CONTEXT_ID = "escidoc:79281"; - private static String ENCODING = "UTF-8"; - - public static String host = - "http://escidoc.mpiwg-berlin.mpg.de:8080/srw/search/escidoc_all?operation=searchRetrieve&maximumRecords=MAX_RECORDS&query="; - - public static String queryGetAll = - "escidoc.content-model.objid=escidoc:persistent4 and escidoc.context.objid=" - + ISMI_CONTEXT_ID; - - public static String queryGetObjectById = "escidoc.content-model.objid=escidoc:persistent4 and escidoc.context.objid=" - + ISMI_CONTEXT_ID + " and escidoc.objid="; - - public static String queryByTitle = "escidoc.content-model.objid=escidoc:persistent4 and escidoc.context.objid=" - + ISMI_CONTEXT_ID + " and escidoc.any-title:="; - - static { - try { - // PUT_ITEM = URLEncoder.encode(PUT_ITEM, ENCODING); - queryGetAll = URLEncoder.encode(queryGetAll, ENCODING); - queryGetObjectById = URLEncoder - .encode(queryGetObjectById, ENCODING); - queryByTitle = URLEncoder.encode(queryByTitle, ENCODING); - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } - } - - public ESciDocClient(String eScidocServer, int eScidocPort, String user, - String password) { - super(eScidocServer, eScidocPort, user, password); - } - - public void deleteItem(String objId) throws Exception { - eScidocDelete("/ir/item/" + objId, null); - return; - } - - - - public ESciDocItem updateItem(ESciDocItem item) throws Exception { - String body = new XMLOutputter().outputString(item.toXMLESciDoc(UPDATE)); - byte[] data = body.getBytes("UTF-8"); - return this.eScidocPut("/ir/item/" + item.getObjId(), new ByteArrayInputStream(data)); - } - - public ESciDocItem createItem(ESciDocItem item) throws Exception { - if(item.getObjId() != null){ - throw new Exception("Trying to create a item that has already an object id."); - } - String body = new XMLOutputter().outputString(item.toXMLESciDoc(CREATE)); - //System.out.println("----------------- INPUT for CREATE"); - //System.out.println(body); - //System.out.println("-----------------"); - byte[] data = body.getBytes("UTF-8"); - return this.eScidocPut("/ir/item", new ByteArrayInputStream(data)); - } - - /** - * - * @param item - * @param comment - * @return the modification date of this action that should be updated in the cache - * @throws Exception - */ - public String releaseItem(ESciDocItem item, String comment) throws Exception { - return this.executeAction(item, comment, "release"); - } - - /** - * - * @param item - * @param comment - * @return the modification date of this action that should be updated in the cache - * @throws Exception - */ - public String submitItem(ESciDocItem item, String comment) throws Exception { - return this.executeAction(item, comment, "submit"); - } - - public String reviseItem(ESciDocItem item, String comment) throws Exception { - return this.executeAction(item, comment, "revise"); - } - - public String withdrawItem(ESciDocItem item, String comment) throws Exception { - return this.executeAction(item, comment, "withdraw"); - } - - private String executeAction(ESciDocItem item, String comment, String action) throws Exception{ - Element param = new Element("param"); - param.setAttribute(new Attribute("last-modification-date", item.getLastModificationDate())); - Document doc = new Document(param); - - Element eComment = new Element("comment"); - if(StringUtils.isNotEmpty(comment)){ - eComment.addContent(comment); - } - param.addContent(eComment); - - String body = new XMLOutputter().outputString(doc); - byte[] data = body.getBytes("UTF-8"); - return this.eScidocPost("/ir/item/" + item.getObjId() + "/" + action, new ByteArrayInputStream(data)); - } - - public static List getAllItems(Integer maxRecords) throws Exception { - String host0 = host.replace("MAX_RECORDS", maxRecords.toString()); - System.out.println("getAllPublications=" + host0 + queryGetAll); - URI uri = new URI(host0 + queryGetAll); - URL url = uri.toURL(); - InputStream in = url.openStream(); - Document doc = new SAXBuilder().build(in); - return getItemsFromDoc(doc); - } - - public ESciDocItem getItemX(String objId) throws IOException, JDOMException, ESciDocException, Exception{ - return eScidocGet("/ir/item/" + objId); - - } - - public static ESciDocItem getItem(String escidocId) throws Exception { - return getItemFromDoc(getItem0(escidocId)); - } - - private static Document getItem0(String escidocId) throws Exception { - URL url = new URL(GET_ITEM + escidocId); - System.out.println("getItem0= " + GET_ITEM + escidocId); - - HttpURLConnection httpCon = (HttpURLConnection) url.openConnection(); - httpCon.setRequestMethod("GET"); - - InputStreamReader in = new InputStreamReader(httpCon.getInputStream(), ENCODING); - - Document doc = new SAXBuilder().build(in); - return doc; - } - - public static void testGet() { - try { - ESciDocItem item = getItem("escidoc:127561"); - System.out.println(new XMLOutputter().outputString(item - .toXMLESciDoc(null))); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public static void testGetAndSave() { - try { - - //ESciDocItem item = getItem("escidoc:127561"); - - //System.out.println(new XMLOutputter().outputString(item.toXMLESciDoc(UPDATE))); - - ESciDocClient client = new ESciDocClient("escidoc.mpiwg-berlin.mpg.de", 8080, "jurzua", "221082"); - - ESciDocItem item = client.getItemX("escidoc:127561"); - - System.out.println(item.getLastModificationDate()); - - //item.getPublication().setTitle(item.getPublication().getTitle() + " test"); - //item.getPublication().setTitle(item.getPublication().getTitle().replace(" test", "")); - - //client.updateItem(item); - //client.submitItem(item, "test"); - //item = client.getItemX("escidoc:127561"); - client.releaseItem(item, "test"); - - - - //System.out.println(new XMLOutputter().outputString(item0 - // .toElementXMLESciDoc(UPDATE))); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public static void main(String[] args) throws IOException { - ESciDocClient.testGetAndSave(); - } - -} diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/java/org/mpiwg/itgroup/escidoc/ESciDocException.java --- a/src/main/java/org/mpiwg/itgroup/escidoc/ESciDocException.java Mon Nov 30 15:37:10 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -package org.mpiwg.itgroup.escidoc; - -import org.jdom.Element; -import org.jdom.output.XMLOutputter; - -public class ESciDocException extends Exception{ - private static final long serialVersionUID = 798105291785018910L; - - private String message; - private String title; - private String stackTrace; - private String cls; - private boolean internalException = false; - - public ESciDocException(Element input){ - try{ - Element etitle = input.getChild("title"); - Element emessage = input.getChild("message"); - Element eclass = input.getChild("class"); - Element estackTrace = input.getChild("stack-trace"); - - this.title = (etitle != null) ? etitle.getValue() : null; - this.message = (emessage != null) ? emessage.getValue() : null; - this.cls = (eclass != null) ? eclass.getValue() : null; - this.stackTrace = (estackTrace != null) ? estackTrace.getValue() : null; - }catch (Exception e) { - this.stackTrace = new XMLOutputter().outputString(input); - this.internalException = true; - } - } - - @Override - public void printStackTrace() { - printStackTrace(System.err); - if(!internalException){ - String tmp = "Exception comming from sSciDoc Server: \n"; - tmp += title + "\n"; - tmp += message + "\n"; - tmp += cls + "\n"; - System.err.println(tmp + stackTrace); - }else{ - System.err.println(stackTrace); - } - } - - @Override - public String getMessage() { - return message; - } - - public String getTitle(){ - return title; - } - - public String getCls(){ - return cls; - } - -} diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/java/org/mpiwg/itgroup/escidoc/ESciDocHandler.java --- a/src/main/java/org/mpiwg/itgroup/escidoc/ESciDocHandler.java Mon Nov 30 15:37:10 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,204 +0,0 @@ -package org.mpiwg.itgroup.escidoc; - -import java.io.InputStream; -import java.io.UnsupportedEncodingException; -import java.net.URI; -import java.net.URL; -import java.net.URLEncoder; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.apache.commons.lang.StringUtils; -import org.jdom.Document; -import org.jdom.Element; -import org.jdom.Namespace; -import org.jdom.input.SAXBuilder; -import org.jdom.output.Format; -import org.jdom.output.XMLOutputter; -import org.jdom.xpath.XPath; -import org.mpiwg.itgroup.escidoc.bo.Creator; -import org.mpiwg.itgroup.escidoc.bo.Publication; -import org.mpiwg.itgroup.escidoc.bo.Publishing; -import org.mpiwg.itgroup.escidoc.bo.utils.SortPublicationByTitle; - -public class ESciDocHandler { - - public static String ISMI_CONTEXT_ID = "escidoc:79281"; - private static String ENCODING = "UTF-8"; - public static String host = "http://escidoc.mpiwg-berlin.mpg.de:8080/srw/search/escidoc_all?operation=searchRetrieve&maximumRecords=5000&query="; - public static String queryGetAll = "escidoc.content-model.objid=escidoc:persistent4 and escidoc.context.objid=" + ISMI_CONTEXT_ID; - - public static String queryGetObjectById = "escidoc.content-model.objid=escidoc:persistent4 and escidoc.context.objid=" + ISMI_CONTEXT_ID + " and escidoc.objid="; - - public static String queryByTitle = "escidoc.content-model.objid=escidoc:persistent4 and escidoc.context.objid=" + ISMI_CONTEXT_ID + " and escidoc.any-title:="; - - static{ - try { - queryGetAll = URLEncoder.encode(queryGetAll, ENCODING); - queryGetObjectById = URLEncoder.encode(queryGetObjectById, ENCODING); - queryByTitle = URLEncoder.encode(queryByTitle, ENCODING); - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } - } - - public static List getAllPublications() throws Exception{ - List list = null; - System.out.println("getAllPublications=" + host + queryGetAll); - URI uri = new URI(host + queryGetAll); - URL url = uri.toURL(); - - InputStream in = url.openStream(); - list = getPublicationsFromStream(new SAXBuilder().build(in)); - - Collections.sort(list, new SortPublicationByTitle()); - return list; - } - - public static List searchPublicationByTitle(String title) throws Exception{ - List list = new ArrayList(); - URI uri = new URI(host + queryGetAll); - URL url = uri.toURL(); - InputStream in = url.openStream(); - List pubList = getPublicationsFromStream(new SAXBuilder().build(in)); - - title = title.toLowerCase(); - - for(Publication pub : pubList){ - if(StringUtils.isNotEmpty(pub.getTitle())){ - String pubTitle = pub.getTitle().toLowerCase(); - if(pubTitle.contains(title)){ - list.add(pub); - } - } - } - return list; - } - - public static List searchPublicationByAuthor(String author) throws Exception{ - List list = new ArrayList(); - - URI uri = new URI(host + queryGetAll); - URL url = uri.toURL(); - InputStream in = url.openStream(); - List pubList = getPublicationsFromStream(new SAXBuilder().build(in)); - - //TODO - /* - author = author.toLowerCase(); - - for(Publication pub : pubList){ - if(pub.getCreator() != null && StringUtils.isNotEmpty(pub.getCreator().getCompleteName())){ - String pubAuthor = pub.getCreator().getCompleteName().toLowerCase(); - if(pubAuthor.contains(author)){ - list.add(pub); - } - } - } */ - return list; - } - - public static Publication getPublicationById(String objectId) throws Exception{ - List list = null; - String urlString = host + queryGetObjectById + objectId; - System.out.println(urlString); - URI uri = new URI(urlString); - URL url = uri.toURL(); - InputStream in = url.openStream(); - list = getPublicationsFromStream(new SAXBuilder().build(in)); - if(list.size() > 0){ - return list.get(0); - } - return null; - } - - private static List getPublicationsFromStream(Document doc) throws Exception { - - List list = new ArrayList(); - - XPath xp = XPath.newInstance(".//escidocItem:item"); - xp.addNamespace("escidocItem", "http://www.escidoc.de/schemas/item/0.9"); - - List inputList = xp.selectNodes(doc); - //System.out.println("inputList.size: " + inputList.size()); - for(Object obj : inputList){ - if(obj instanceof Element){ - Element item = (Element)obj; - Publication reference = new Publication(item.getAttributeValue("objid")); - //System.out.println(reference.getObjid()); - - Element md_records = item.getChild("md-records", Namespace.getNamespace("escidocMetadataRecords", "http://www.escidoc.de/schemas/metadatarecords/0.5")); - Element md_record = md_records.getChild("md-record", Namespace.getNamespace("escidocMetadataRecords", "http://www.escidoc.de/schemas/metadatarecords/0.5")); - Element publication = md_record.getChild("publication", Namespace.getNamespace("publication", "http://purl.org/escidoc/metadata/profiles/0.1/publication")); - - - - - Element title = publication.getChild("title", Namespace.getNamespace("dc", "http://purl.org/dc/elements/1.1/")); - Element publishing_info = publication.getChild("publishing-info", Namespace.getNamespace("eterms", "http://purl.org/escidoc/metadata/terms/0.1/")); - Element issued = publication.getChild("issued", Namespace.getNamespace("dcterms", "http://purl.org/dc/terms/")); - if(issued != null){ - reference.setIssued(issued.getText()); - } - Element subject = publication.getChild("subject", Namespace.getNamespace("dcterms", "http://purl.org/dc/terms/")); - - List creatorList = publication.getChildren("creator", Namespace.getNamespace("eterms", "http://purl.org/escidoc/metadata/terms/0.1/")); - for(Object object : creatorList){ - if(object instanceof Element){ - Element creator = (Element)object; - Element person = creator.getChild("person", Namespace.getNamespace("person", "http://purl.org/escidoc/metadata/profiles/0.1/person")); - - if(person != null){ - Element complete_name = person.getChild("complete-name", Namespace.getNamespace("eterms", "http://purl.org/escidoc/metadata/terms/0.1/")); - Element family_name = person.getChild("family-name", Namespace.getNamespace("eterms", "http://purl.org/escidoc/metadata/terms/0.1/")); - Element given_name = person.getChild("given-name", Namespace.getNamespace("eterms", "http://purl.org/escidoc/metadata/terms/0.1/")); - Element organization = person.getChild("organization", Namespace.getNamespace("organization", "http://purl.org/escidoc/metadata/profiles/0.1/organization")); - - reference.addCreator(new Creator( - (complete_name != null) ? complete_name.getText() : "", - (family_name != null) ? family_name.getText() : "", - (given_name != null) ? given_name.getText() : "")); - } - } - } - - - if(publishing_info != null){ - Element publisher = publishing_info.getChild("publisher", Namespace.getNamespace("dc", "http://purl.org/dc/elements/1.1/")); - Element place = publishing_info.getChild("place", Namespace.getNamespace("eterms", "http://purl.org/escidoc/metadata/terms/0.1/")); - Element edition = publishing_info.getChild("edition", Namespace.getNamespace("eterms", "http://purl.org/escidoc/metadata/terms/0.1/")); - - reference.setPublishing( - new Publishing( - (publisher != null) ? publisher.getText() : "", - (place != null) ? place.getText() : "", - (edition != null) ? edition.getText() : "")); - } - - reference.setSubject((subject != null) ? subject.getText() : ""); - reference.setTitle((title != null) ? title.getText() : ""); - //System.out.println(reference.toString()); - list.add(reference); - - }else{ - System.out.println(obj); - } - } - - return list; - } - - public static void main(String[] args) { - try { - //ESciDocHandler.getAllPublications(); - - Publication pub = ESciDocHandler.getPublicationById("escidoc:127561"); - XMLOutputter outputter1 = new XMLOutputter(Format.getPrettyFormat()); - outputter1.output(pub.toXMLESciDoc(null), System.out); - - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/java/org/mpiwg/itgroup/escidoc/Test.java --- a/src/main/java/org/mpiwg/itgroup/escidoc/Test.java Mon Nov 30 15:37:10 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,131 +0,0 @@ -package org.mpiwg.itgroup.escidoc; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; - -import org.apache.http.HttpEntity; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.client.methods.HttpPut; -import org.apache.http.client.methods.HttpRequestBase; -import org.apache.http.client.params.ClientPNames; -import org.apache.http.client.params.CookiePolicy; -import org.apache.http.entity.InputStreamEntity; -import org.apache.http.impl.client.DefaultHttpClient; -import org.jdom.Document; -import org.jdom.output.XMLOutputter; -import org.mpiwg.itgroup.escidoc.bo.ESciDocItem; - -public class Test { - - //private String eScidocServer; - //private int eScidocPort; - private String user; - private String password; - public String eScidocUrl; - private HttpClient httpclient = null; - - public Test(String eScidocServer, int eScidocPort, String user, - String password) { - // this.eScidocServer=eScidocServer; - // this.eScidocPort=eScidocPort; - this.user = user; - this.password = password; - this.eScidocUrl = "http://" + eScidocServer + ":" + String.valueOf(eScidocPort); - } - - public HttpClient login() throws IOException { - httpclient = new DefaultHttpClient(); - - httpclient.getParams().setParameter(ClientPNames.COOKIE_POLICY, - CookiePolicy.BROWSER_COMPATIBILITY); - - HttpPost httppost = new HttpPost(eScidocUrl + "/aa/login?target=/"); - - HttpResponse response = httpclient.execute(httppost); - // HttpEntity entity = httppost.getRes - - System.out.println("----------------------------------------"); - System.out.println(response.getStatusLine()); - - HttpEntity entity = response.getEntity(); - if (entity != null) { - entity.consumeContent(); - } - - HttpGet httpget = new HttpGet(eScidocUrl - + "/aa/j_spring_security_check?j_username=" + user - + "&j_password=" + password); - - response = httpclient.execute(httpget); - // entity = response.getEntity(); - - System.out.println("----------------------------------------"); - System.out.println(response.getStatusLine()); - - entity = response.getEntity(); - if (entity != null) { - entity.consumeContent(); - } - - // entity.consumeContent(); - return httpclient; - } - - public HttpResponse eScidocPut(String command, InputStream body) - throws IOException { - HttpPut httpput = new HttpPut(eScidocUrl + command); - return eScidocRequestBase(httpput, command, body); - } - - private HttpResponse eScidocRequestBase(HttpRequestBase httpBase, String command, InputStream body) throws IOException { - if (httpclient == null) - login(); - - if (HttpEntityEnclosingRequestBase.class.isInstance(httpBase)) { - if (body != null) { - HttpEntity entity = new InputStreamEntity(body, -1); - ((HttpEntityEnclosingRequestBase) httpBase).setEntity(entity); - } - } - - HttpResponse status = httpclient.execute(httpBase); - return status; - } - - public static Document testGetAndSave(){ - try { - ESciDocItem item = ESciDocClient.getItem("escidoc:127561"); - //System.out.println(new XMLOutputter().outputString(item.toXMLESciDoc(null))); - - return item.toXMLESciDoc(ESciDocClient.UPDATE); - - } catch (Exception e) { - e.printStackTrace(); - } - return null; - } - - - - public static void main(String[] args) throws IOException { - /* - Document doc = Test.testGetAndSave(); - - String body = new XMLOutputter().outputString(doc); - byte[] data = body.getBytes("UTF-8"); - - Test test = new Test("escidoc-test.mpiwg-berlin.mpg.de", 8080, "jurzua", "221082"); - test.eScidocPut("/ir/item/escidoc:127561", new ByteArrayInputStream(data)); - */ - - String s = new String("CODEX:distinguishing_features&CODEX¬es_on_ownership&CODEX:notes"); - String[] array = s.split("&"); - System.out.println(array.length); - } - -} diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/java/org/mpiwg/itgroup/escidoc/bo/Creator.java --- a/src/main/java/org/mpiwg/itgroup/escidoc/bo/Creator.java Mon Nov 30 15:37:10 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,148 +0,0 @@ -package org.mpiwg.itgroup.escidoc.bo; - -import java.io.Serializable; - -import org.apache.commons.lang.StringUtils; -import org.jdom.Element; -import org.jdom.output.Format; -import org.jdom.output.XMLOutputter; -import org.mpi.openmind.repository.utils.NormalizerUtils; - -public class Creator extends ESciDocConstants implements Serializable{ - private static final long serialVersionUID = 1L; - - - //completeName familyName givenName - - private String completeName; - private String familyName; - private String givenName; - - private String norCompleteName; - private String norFamilyName; - private String norGivenName; - - public Creator(String completeName, String familyName, String givenName){ - this.setCompleteName(completeName); - this.setFamilyName(familyName); - this.setGivenName(givenName); - } - - public String getCompleteName() { - return completeName; - } - public void setCompleteName(String completeName) { - this.completeName = completeName; - if(StringUtils.isEmpty(completeName)){ - this.norCompleteName = new String(); - }else{ - this.norCompleteName = NormalizerUtils.normalize(completeName); - } - - } - public String getFamilyName() { - return familyName; - } - public void setFamilyName(String familyName) { - this.familyName = familyName; - if(StringUtils.isEmpty(familyName)){ - this.norFamilyName = new String(); - }else{ - this.norFamilyName = NormalizerUtils.normalize(familyName); - } - } - public String getGivenName() { - return givenName; - } - public void setGivenName(String givenName) { - this.givenName = givenName; - if(StringUtils.isEmpty(givenName)){ - this.norGivenName = new String(); - }else{ - this.norGivenName = NormalizerUtils.normalize(givenName); - } - } - - public String getNorCompleteName() { - return norCompleteName; - } - - public String getNorFamilyName() { - return norFamilyName; - } - - public String getNorGivenName() { - return norGivenName; - } - - /** - * term must be normalized before calling this method - * @param term - * @return - */ - public boolean containsTerm(String term){ - String secondTerm = this.getNorCompleteName(); - - if(secondTerm.contains(term)) - return true; - - secondTerm = this.getNorFamilyName(); - if(secondTerm.contains(term)) - return true; - - secondTerm = this.getNorGivenName(); - if(secondTerm.contains(term)) - return true; - - return false; - - } - - @Override - public Element toElementXMLESciDoc(Integer mode){ - Element root = new Element("person", NS_PERSON); - - Element completeName = new Element("complete-name", NS_ETERMS); - Element familyName = new Element("family-name", NS_ETERMS); - Element givenName = new Element("given-name", NS_ETERMS); - - completeName.addContent(this.completeName); - familyName.addContent(this.familyName); - givenName.addContent(this.givenName); - - root.addContent(completeName); - root.addContent(familyName); - root.addContent(givenName); - - Element organization = new Element("organization", NS_ORGANIZATION); - - Element orgTitle = new Element("title", NS_DC); - orgTitle.addContent("Max Planck Society"); - Element orgIdentifier = new Element("identifier", NS_DC); - - organization.addContent(orgTitle); - organization.addContent(orgIdentifier); - - root.addContent(organization); - - return root; - } - - public static void main(String[] args){ - try{ - Creator c = new Creator("Jorge Urzua", "Urzua", "Jorge"); - XMLOutputter outputter1 = new XMLOutputter(Format.getPrettyFormat()); - outputter1.output(c.toXMLESciDoc(null), System.out); - }catch (Exception e) { - e.printStackTrace(); - } - } - - - @Override - public String toString(){ - - return "Creator [completeName="+ completeName +", familyName="+ familyName +", givenName=" + givenName + "]"; - } - -} diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/java/org/mpiwg/itgroup/escidoc/bo/ESciDocConstants.java --- a/src/main/java/org/mpiwg/itgroup/escidoc/bo/ESciDocConstants.java Mon Nov 30 15:37:10 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -package org.mpiwg.itgroup.escidoc.bo; - -import java.io.Serializable; - -import org.jdom.Document; -import org.jdom.Element; -import org.jdom.Namespace; - -public class ESciDocConstants implements Serializable{ - - - - /** - * - */ - private static final long serialVersionUID = 7156928908863818464L; - public static Integer DEBUG = -1; - public static Integer CREATE = 0; - public static Integer UPDATE = 1; - - - public static Namespace NS_PERSON = Namespace.getNamespace("person", "http://purl.org/escidoc/metadata/profiles/0.1/person"); - public static Namespace NS_ORGANIZATION = Namespace.getNamespace("organization", "http://purl.org/escidoc/metadata/profiles/0.1/organization"); - - public static Namespace NS_DC = Namespace.getNamespace("dc", "http://purl.org/dc/elements/1.1/"); - public static Namespace NS_ETERMS = Namespace.getNamespace("eterms", "http://purl.org/escidoc/metadata/terms/0.1/"); - - public static Namespace NS_DCTERMS = Namespace.getNamespace("dcterms", "http://purl.org/dc/terms/"); - - //xmlns:publication="http://purl.org/escidoc/metadata/profiles/0.1/publication" - public static Namespace NS_PUBLICATION = Namespace.getNamespace("publication", "http://purl.org/escidoc/metadata/profiles/0.1/publication"); - - //xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - public static Namespace NS_XSI = Namespace.getNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance"); - - //xsi:type="dcterms:W3CDTF" - //public static Namespace NS_XSI = Namespace.getNamespace("xsi", "dcterms:W3CDTF"); - - //xmlns:relations="http://www.escidoc.de/schemas/relations/0.3" - public static Namespace NS_RELATIONS = Namespace.getNamespace("relations", "http://www.escidoc.de/schemas/relations/0.3"); - - // xmlns:escidocMetadataRecords="http://www.escidoc.de/schemas/metadatarecords/0.5" - public static Namespace NS_ESCIDOC_MD_RECORDS = Namespace.getNamespace("escidocMetadataRecords", "http://www.escidoc.de/schemas/metadatarecords/0.5"); - - // xmlns:escidocContentStreams="http://www.escidoc.de/schemas/contentstreams/0.7" - public static Namespace NS_ESCIDOC_CONTENT_STREAMS = Namespace.getNamespace("escidocContentStreams", "http://www.escidoc.de/schemas/contentstreams/0.7"); - - // xmlns:escidocComponents="http://www.escidoc.de/schemas/components/0.9" - public static Namespace NS_ESCIDOC_COMPONENTS = Namespace.getNamespace("escidocComponents", "http://www.escidoc.de/schemas/components/0.9"); - - // xmlns:version="http://escidoc.de/core/01/properties/version/" - public static Namespace NS_VERSION = Namespace.getNamespace("version", "http://escidoc.de/core/01/properties/version/"); - - // xmlns:release="http://escidoc.de/core/01/properties/release/" - public static Namespace NS_RELEASE = Namespace.getNamespace("release", "http://escidoc.de/core/01/properties/release/"); - - // xmlns:escidocItem="http://www.escidoc.de/schemas/item/0.9" - public static Namespace NS_ESCIDOC_ITEM = Namespace.getNamespace("escidocItem", "http://www.escidoc.de/schemas/item/0.9"); - - // xmlns:prop="http://escidoc.de/core/01/properties/" - public static Namespace NS_PROP = Namespace.getNamespace("prop", "http://escidoc.de/core/01/properties/"); - - // xmlns:srel="http://escidoc.de/core/01/structural-relations/" - public static Namespace NS_SREL = Namespace.getNamespace("srel", "http://escidoc.de/core/01/structural-relations/"); - - // xmlns:xlink="http://www.w3.org/1999/xlink" - public static Namespace NS_XLINK = Namespace.getNamespace("xlink", "http://www.w3.org/1999/xlink"); - - // xml:base="http://escidoc.mpiwg-berlin.mpg.de:8080" - //public static Namespace NS_BASE = Namespace.getNamespace("base", "http://escidoc.mpiwg-berlin.mpg.de:8080"); - - // xlink:type="simple" - //public static Namespace NS_ = Namespace.getNamespace("", ""); - - // xlink:title="Max Planck Society" - //public static Namespace NS_ = Namespace.getNamespace("", ""); - - // xlink:href="/ir/item/escidoc:127561" - //public static Namespace NS_ = Namespace.getNamespace("", ""); - - public Element toElementXMLESciDoc(Integer mode){ - return null; - } - - public Document toXMLESciDoc(Integer mode){ - Document doc = new Document(); - - doc.setRootElement(this.toElementXMLESciDoc(mode)); - - return doc; - } - -} diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/java/org/mpiwg/itgroup/escidoc/bo/ESciDocItem.java --- a/src/main/java/org/mpiwg/itgroup/escidoc/bo/ESciDocItem.java Mon Nov 30 15:37:10 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,366 +0,0 @@ -package org.mpiwg.itgroup.escidoc.bo; - -import org.apache.commons.lang.StringUtils; -import org.jdom.Attribute; -import org.jdom.Element; -import org.jdom.output.Format; -import org.jdom.output.XMLOutputter; - -public class ESciDocItem extends ESciDocConstants implements Cloneable, Comparable{ - - public static int ESCIDOC_ERROR_ID_NO_FOUND = 0; - public static int ESCIDOC_ERROR_SERVER_NO_RESPONDED = 1; - - private Integer errorLoading; - - private Publication publication = null; - - private String lastModificationDate; - - //Properties TODO: this should be configurable - private static String CONTEXT_ID = "escidoc:79281"; - private static String CONTENT_MODEL = "escidoc:persistent4"; - - private String publicStatus; - - //item/properties/latest-version - //private String latestVersionHref; - private String latestVersionNumber; - private String latestVersionDate; - - //item/properties/latest-release - private String latestReleaseNumber; - private String latestReleaseDate; - //private String latestReleasePid; - - //item/properties/version - private String versionNumber; - private String versionDate; - private String versionStatus; - - - public ESciDocItem(String id){ - publication = new Publication(id); - } - - public ESciDocItem(){ - publication = new Publication(null); - } - - @Override - public Object clone() { - try { - return super.clone(); - } catch (CloneNotSupportedException e) { - e.printStackTrace(); - } - return null; - } - - @Override - public Element toElementXMLESciDoc(Integer mode){ - Element root = new Element("item", NS_ESCIDOC_ITEM); - - root.addNamespaceDeclaration(NS_RELATIONS); - root.addNamespaceDeclaration(NS_ESCIDOC_MD_RECORDS); - root.addNamespaceDeclaration(NS_ESCIDOC_CONTENT_STREAMS); - root.addNamespaceDeclaration(NS_ESCIDOC_COMPONENTS); - root.addNamespaceDeclaration(NS_VERSION); - root.addNamespaceDeclaration(NS_RELEASE); - root.addNamespaceDeclaration(NS_PROP); - root.addNamespaceDeclaration(NS_SREL); - root.addNamespaceDeclaration(NS_XLINK); - //root.addNamespaceDeclaration(NS_BASE); - - if(UPDATE.equals(mode)){ - // discarded for UPDATE and CREATE - root.setAttribute(new Attribute("type", "simple", NS_XLINK)); - root.setAttribute(new Attribute("title", "Max Planck Society", NS_XLINK)); - root.setAttribute(new Attribute("href", "/ir/item/" + publication.getObjid(), NS_XLINK)); - - root.setAttribute(new Attribute("last-modification-date", this.lastModificationDate)); - } - - // CREATE=required, UPDATE=optional - //if(CREATE.equals(mode)) - root.addContent(getESciDocItemProperties(mode)); - - root.addContent(getESciDocMDRecords(mode)); - - //item/components UPDATE, CREATE = required - Element components = new Element("components", NS_ESCIDOC_COMPONENTS); - if(mode == null){ - components.setAttribute(new Attribute("type", "simple", NS_XLINK)); - components.setAttribute(new Attribute("title", "Components of Item " + publication.getObjid(), NS_XLINK)); - components.setAttribute(new Attribute("href", "/ir/item/"+ publication.getObjid() +"/components", NS_XLINK)); - } - - root.addContent(components); - - if(UPDATE.equals(mode)){ - //item/relations UPDATE, CREATE = optional - Element relations = new Element("relations", NS_RELATIONS); - relations.setAttribute(new Attribute("type", "simple", NS_XLINK)); - relations.setAttribute(new Attribute("title", "Relations of Item", NS_XLINK)); - relations.setAttribute(new Attribute("href", "/ir/item/"+this.publication.getObjid()+"/relations", NS_XLINK)); - - //item/resources UPDATE, CREATE = discarded - Element resources = new Element("resources", NS_ESCIDOC_ITEM); - resources.setAttribute(new Attribute("type", "simple", NS_XLINK)); - resources.setAttribute(new Attribute("title", "Resources", NS_XLINK)); - resources.setAttribute(new Attribute("href", "/ir/item/"+this.publication.getObjid()+"/resources", NS_XLINK)); - } - - return root; - } - - private Element getESciDocItemProperties(Integer mode){ - - Element root = new Element("properties", NS_ESCIDOC_ITEM); - - //CREATE, UPDATE discard = xlink:type, xlink:title, xlink:href, xml:base - //UPDATE requests = last-modification-date - - //item/properties - if(UPDATE.equals(mode)){ - root.setAttribute(new Attribute("type", "simple", NS_XLINK)); - root.setAttribute(new Attribute("title", "Properties", NS_XLINK)); - root.setAttribute(new Attribute("href", "/ir/item/" + this.publication.getObjid() + "/properties", NS_XLINK)); - } - - - //item/properties/context - Element context = new Element("context", NS_SREL); - context.setAttribute(new Attribute("type", "simple", NS_XLINK)); - context.setAttribute(new Attribute("title", "ISMI", NS_XLINK)); - context.setAttribute(new Attribute("href", "/ir/context/" + CONTEXT_ID, NS_XLINK)); - root.addContent(context); - - //item/properties/content-model - Element contentModel = new Element("content-model", NS_SREL); - if(UPDATE.equals(mode)){ - contentModel.setAttribute(new Attribute("type", "simple", NS_XLINK)); - contentModel.setAttribute(new Attribute("title", "ct", NS_XLINK)); - } - contentModel.setAttribute(new Attribute("href", "/cmm/content-model/" + CONTENT_MODEL, NS_XLINK)); - root.addContent(contentModel); - - - //item/properties/latest-version - if(mode == null){ - Element latestVersion = new Element("latest-version", NS_PROP); - //latestVersion.setAttribute(new Attribute("href", this.latestVersionHref, NS_XLINK)); - - Element eVersionNumber = new Element("number", NS_VERSION); - Element eVersionDate = new Element("date", NS_VERSION); - - eVersionNumber.addContent(this.latestVersionNumber); - eVersionDate.addContent(this.latestVersionDate); - - latestVersion.addContent(eVersionNumber); - latestVersion.addContent(eVersionDate); - - root.addContent(latestVersion); - } - - //item/properties/latest-release - if(mode == null){ - Element latestRelease = new Element("latest-release", NS_PROP); - //latestRelease.setAttribute(new Attribute("href", this.latestReleaseHref, NS_XLINK)); - - Element eReleaseNumber = new Element("number", NS_RELEASE); - Element eReleaseDate = new Element("date", NS_RELEASE); - //Element eReleasePid = new Element("pid", NS_RELEASE); - - eReleaseNumber.addContent(this.latestReleaseNumber); - eReleaseDate.addContent(this.latestReleaseDate); - //eReleasePid.addContent(this.latestReleasePid); - - latestRelease.addContent(eReleaseNumber); - latestRelease.addContent(eReleaseDate); - //latestRelease.addContent(eReleasePid); - - root.addContent(latestRelease); - } - - return root; - } - - private Element getESciDocMDRecords(Integer mode){ - Element root = new Element("md-records", NS_ESCIDOC_MD_RECORDS); - - if(UPDATE.equals(mode)){ - root.setAttribute(new Attribute("type", "simple", NS_XLINK)); - root.setAttribute(new Attribute("title", "Metadata Records of Item " + publication.getObjid(), NS_XLINK)); - root.setAttribute(new Attribute("href", "/ir/item/"+ publication.getObjid() +"/md-records", NS_XLINK)); - } - if(UPDATE.equals(mode)){ - //TODO last-modification-date - } - - Element record = new Element("md-record", NS_ESCIDOC_MD_RECORDS); - record.setAttribute(new Attribute("name", "escidoc")); - - if(UPDATE.equals(mode)){ - record.setAttribute(new Attribute("type", "simple", NS_XLINK)); - record.setAttribute(new Attribute("title", "escidoc", NS_XLINK)); - record.setAttribute(new Attribute("href", "/ir/item/"+ this.publication.getObjid() +"/md-records/md-record/escidoc", NS_XLINK)); - } - - record.addContent(this.publication.toElementXMLESciDoc(mode)); - - root.addContent(record); - - return root; - } - - public Publication getPublication() { - return publication; - } - - public void setPublication(Publication publication) { - this.publication = publication; - } - - public String getLastModificationDate() { - return lastModificationDate; - } - - public void setLastModificationDate(String lastModificationDate) { - this.lastModificationDate = lastModificationDate; - } - - public Integer getErrorLoading() { - return errorLoading; - } - - public void setErrorLoading(Integer errorLoading) { - this.errorLoading = errorLoading; - } - - public String getObjId(){ - if(publication != null) - return this.publication.getObjid(); - return null; - } - - public String getLatestVersionNumber() { - return latestVersionNumber; - } - - public void setLatestVersionNumber(String latestVersionNumber) { - this.latestVersionNumber = latestVersionNumber; - } - - public String getLatestVersionDate() { - return latestVersionDate; - } - - public void setLatestVersionDate(String latestVersionDate) { - this.latestVersionDate = latestVersionDate; - } - - public String getLatestReleaseNumber() { - return latestReleaseNumber; - } - - public void setLatestReleaseNumber(String latestReleaseNumber) { - this.latestReleaseNumber = latestReleaseNumber; - } - - public String getLatestReleaseDate() { - return latestReleaseDate; - } - - public void setLatestReleaseDate(String latestReleaseDate) { - this.latestReleaseDate = latestReleaseDate; - } - - @Override - public int compareTo(ESciDocItem arg0) { - if(this.publication != null && arg0.publication != null){ - if(StringUtils.isNotEmpty(this.publication.getObjid()) && StringUtils.isNotEmpty(arg0.publication.getObjid())){ - return this.getPublication().getObjid().compareTo(arg0.publication.getObjid()); - }else if(StringUtils.isNotEmpty(this.publication.getObjid())){ - return -1; - }else if(StringUtils.isNotEmpty(arg0.publication.getObjid())){ - return 1; - } - } - return 0; - } - - public static void main(String[] args){ - try{ - - Publication pub = new Publication(null); - - Publishing publishing = new Publishing("Jorge Urzua", "Chile", "JIJI"); - pub.setPublishing(publishing); - - Creator creator0 = new Creator("Jorge Urzua", "Urzua", "Jorge"); - Creator creator1 = new Creator("Valeria Mouzas", "Mouzas", "Valeria"); - pub.getCreatorList().add(creator0); - pub.getCreatorList().add(creator1); - - pub.setIssued("1982"); - pub.getAlternativeList().add("alternative01"); - pub.getAlternativeList().add("alternative02"); - pub.getAlternativeList().add("alternative03"); - - pub.setTitle("Por Dios..."); - - XMLOutputter outputter1 = new XMLOutputter(Format.getPrettyFormat()); - outputter1.output(pub.toXMLESciDoc(CREATE), System.out); - - }catch (Exception e) { - e.printStackTrace(); - } - } - - public String getVersionNumber() { - return versionNumber; - } - - public void setVersionNumber(String versionNumber) { - this.versionNumber = versionNumber; - } - - public String getVersionDate() { - return versionDate; - } - - public void setVersionDate(String versionDate) { - this.versionDate = versionDate; - } - - public String getVersionStatus() { - return versionStatus; - } - - public void setVersionStatus(String versionStatus) { - this.versionStatus = versionStatus; - } - - public String getPublicStatus() { - return publicStatus; - } - - public void setPublicStatus(String publicStatus) { - this.publicStatus = publicStatus; - } - - public String getInfo(){ - StringBuilder sb = new StringBuilder(); - - sb.append("publicStatus=" + this.publicStatus); - sb.append(", versionNumber=" + this.versionNumber); - sb.append(", versionStatus=" + this.versionStatus); - sb.append(", versionDate=" + this.versionDate); - sb.append(", releaseNumber=" + this.latestReleaseNumber); - sb.append(", releaseDate=" + this.latestReleaseDate); - - return sb.toString(); - - } -} diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/java/org/mpiwg/itgroup/escidoc/bo/Publication.java --- a/src/main/java/org/mpiwg/itgroup/escidoc/bo/Publication.java Mon Nov 30 15:37:10 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,311 +0,0 @@ -package org.mpiwg.itgroup.escidoc.bo; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.lang.StringUtils; -import org.jdom.Attribute; -import org.jdom.Document; -import org.jdom.Element; -import org.jdom.output.Format; -import org.jdom.output.XMLOutputter; -import org.mpi.openmind.repository.bo.Entity; -import org.mpi.openmind.repository.utils.NormalizerUtils; - -public class Publication extends ESciDocConstants implements Comparable, Serializable, Cloneable{ - - private static final long serialVersionUID = 1L; - private String objid; - private List creatorList = new ArrayList(); - private String title; - private List alternativeList = new ArrayList(); - - private Publishing publishing = new Publishing(null, null, null); - private String subject; - private String issued; - private String numberOfPages; - - - private String norTitle; - private List norAlternativeList = new ArrayList(); - private String norSubject; - - - - private String additionalInformation; - private Entity entity; - - private static String HTML_LABEL = "" + - "" + - "[ID]AUTHORDATE TITLEPUBLISHER" + - ""; - - @Override - public Object clone() { - try { - return super.clone(); - } catch (CloneNotSupportedException e) { - e.printStackTrace(); - } - return null; - } - - - public String getHTMLLabel(){ - - String html = HTML_LABEL.replace("TITLE", (StringUtils.isNotEmpty(this.title) ? this.title : "")); - String creators = this.getCreatorsAsString(); - html = html.replace("AUTHOR", (creators != null) ? " " + creators + "." : ""); - html = html.replace("PUBLISHER", (publishing != null) ? " " + publishing.getPublisher() + "." : ""); - html = html.replace("DATE", (StringUtils.isNotEmpty(this.issued)? " (" + issued + ")." : "")); - html = html.replace("ID", (StringUtils.isNotEmpty(this.objid)? this.objid : "NO ID")); - return html; - } - - public String getCreatorsAsString(){ - StringBuilder sb = new StringBuilder(); - for(Creator c : creatorList){ - if(StringUtils.isNotEmpty(sb.toString())){ - sb.append(", "); - } - sb.append(c.getFamilyName() + " " + c.getGivenName()); - } - return sb.toString(); - } - - public void addCreator(Creator creator){ - this.creatorList.add(creator); - } - - public Publication(String objid){ - this.objid = objid; - } - - public List getCreatorList() { - return creatorList; - } - - public void setCreatorList(List creatorList) { - this.creatorList = creatorList; - } - - - public String getObjid() { - return objid; - } - - public void setObjid(String objid) { - this.objid = objid; - } - - public String getTitle() { - return title; - } - - public String getNorTitle(){ - return norTitle; - } - - public List getNorAlternativeList() { - - return norAlternativeList; - } - - - public String getNorSubject() { - return norSubject; - } - - - public void setTitle(String title) { - this.title = title; - if(StringUtils.isEmpty(title)){ - this.norTitle = new String(); - }else{ - this.norTitle = NormalizerUtils.normalize(title); - } - } - - public Publishing getPublishing() { - return publishing; - } - - public void setPublishing(Publishing publishing) { - this.publishing = publishing; - } - - public String getSubject() { - return subject; - } - - public void setSubject(String subject) { - this.subject = subject; - if(StringUtils.isEmpty(subject)){ - this.norSubject = new String(); - }else{ - this.norSubject = NormalizerUtils.normalize(subject); - } - } - - public String getAdditionalInformation() { - return additionalInformation; - } - - public void setAdditionalInformation(String additionalInformation) { - this.additionalInformation = additionalInformation; - } - - public Entity getEntity() { - return entity; - } - - public void setEntity(Entity entity) { - this.entity = entity; - } - - public String getIssued() { - return issued; - } - - public void setIssued(String issued) { - this.issued = issued; - } - - public List getAlternativeList() { - return alternativeList; - } - - - public void setAlternativeList(List alternativeList) { - this.alternativeList = alternativeList; - for(String term : alternativeList){ - this.norAlternativeList.add(NormalizerUtils.normalize(term)); - } - } - - public void addAlternative(String alternative){ - this.alternativeList.add(alternative); - this.norAlternativeList.add(NormalizerUtils.normalize(alternative)); - } - - public String getNumberOfPages() { - return numberOfPages; - } - - - public void setNumberOfPages(String numberOfPages) { - this.numberOfPages = numberOfPages; - } - - @Override - public Element toElementXMLESciDoc(Integer mode){ - Element root = new Element("publication", NS_PUBLICATION); - root.setAttribute(new Attribute("type", "http://purl.org/eprint/type/Book")); - - Element creator = new Element("creator", NS_ETERMS); - creator.setAttribute(new Attribute("role", "http://www.loc.gov/loc.terms/relators/AUT")); - for(Creator person : this.creatorList){ - creator.addContent(person.toElementXMLESciDoc(mode)); - } - root.addContent(creator); - - Element title = new Element("title", NS_DC); - title.addContent(this.title); - root.addContent(title); - - for(String s : this.alternativeList){ - Element alternative = new Element("alternative", NS_DCTERMS); - alternative.addContent(s); - root.addContent(alternative); - } - - root.addContent(this.publishing.toElementXMLESciDoc(mode)); - - - // - Element issued = new Element("issued", NS_DCTERMS); - issued.addNamespaceDeclaration(NS_XSI); - issued.setAttribute(new Attribute("type", "dcterms:W3CDTF", NS_XSI)); - issued.addContent(this.issued); - root.addContent(issued); - - - Element numberOfPages = new Element("total-number-of-pages", NS_ETERMS); - numberOfPages.addContent(this.numberOfPages); - root.addContent(numberOfPages); - - Element subject = new Element("subject", NS_DCTERMS); - subject.addContent(this.subject); - root.addContent(subject); - - return root; - } - - - @Override - public boolean equals(Object object) { - // TODO: Warning - this method won't work in the case the id fields are not set - if (!(object instanceof Publication)) { - return false; - } - Publication other = (Publication) object; - - if(this.objid != null && other.getObjid() != null && this.objid == other.objid) - return true; - - return false; - } - - - - @Override - public String toString(){ - return "Publication [objid="+objid+ - ", title="+ title + - ", subject="+ subject + - ", " + creatorList + - ", " + publishing + "]"; - } - - @Override - public int compareTo(Publication arg0) { - if(StringUtils.isNotEmpty(this.objid) && StringUtils.isNotEmpty(arg0.objid)){ - return this.objid.compareTo(arg0.objid); - }else if(StringUtils.isNotEmpty(this.objid)){ - return -1; - }else if(StringUtils.isNotEmpty(arg0.objid)){ - return 1; - } - return 0; - } - - public static void main(String[] args){ - try{ - - Publication pub = new Publication(null); - - Publishing publishing = new Publishing("Jorge Urzua", "Chile", "JIJI"); - pub.setPublishing(publishing); - - Creator creator0 = new Creator("Jorge Urzua", "Urzua", "Jorge"); - Creator creator1 = new Creator("Valeria Mouzas", "Mouzas", "Valeria"); - pub.getCreatorList().add(creator0); - pub.getCreatorList().add(creator1); - - pub.setIssued("1982"); - pub.getAlternativeList().add("alternative01"); - pub.getAlternativeList().add("alternative02"); - pub.getAlternativeList().add("alternative03"); - - pub.setTitle("Por Dios..."); - - XMLOutputter outputter1 = new XMLOutputter(Format.getPrettyFormat()); - outputter1.output(pub.toXMLESciDoc(null), System.out); - - }catch (Exception e) { - e.printStackTrace(); - } - } -} diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/java/org/mpiwg/itgroup/escidoc/bo/Publishing.java --- a/src/main/java/org/mpiwg/itgroup/escidoc/bo/Publishing.java Mon Nov 30 15:37:10 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,75 +0,0 @@ -package org.mpiwg.itgroup.escidoc.bo; - -import java.io.Serializable; - -import org.jdom.Document; -import org.jdom.Element; -import org.jdom.output.Format; -import org.jdom.output.XMLOutputter; - -public class Publishing extends ESciDocConstants implements Serializable{ - private static final long serialVersionUID = 1L; - - private String publisher; - private String place; - private String edition; - - public Publishing(String publisher, String place, String edition){ - this.publisher = publisher; - this.place = place; - this.edition = edition; - } - - public String getPublisher() { - return publisher; - } - public void setPublisher(String publisher) { - this.publisher = publisher; - } - public String getPlace() { - return place; - } - public void setPlace(String place) { - this.place = place; - } - public String getEdition() { - return edition; - } - public void setEdition(String edition) { - this.edition = edition; - } - - @Override - public Element toElementXMLESciDoc(Integer mode){ - Element root = new Element("publishing-info", NS_ETERMS); - Element publisher = new Element("publisher", NS_DC); - Element place = new Element("place", NS_ETERMS); - Element edition = new Element("edition", NS_ETERMS); - - publisher.addContent(this.publisher); - place.addContent(this.place); - edition.addContent(this.edition); - - root.addContent(publisher); - root.addContent(place); - root.addContent(edition); - - return root; - } - - @Override - public String toString(){ - return "Publishing [publisher="+ publisher +", place="+ place +", edition="+ edition +"]"; - } - - public static void main(String[] args){ - try{ - Publishing c = new Publishing("Jorge Urzua", "Chile", "JIJI"); - XMLOutputter outputter1 = new XMLOutputter(Format.getPrettyFormat()); - outputter1.output(c.toXMLESciDoc(null), System.out); - }catch (Exception e) { - e.printStackTrace(); - } - } - -} diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/java/org/mpiwg/itgroup/escidoc/bo/utils/SortItemByCreator.java --- a/src/main/java/org/mpiwg/itgroup/escidoc/bo/utils/SortItemByCreator.java Mon Nov 30 15:37:10 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -package org.mpiwg.itgroup.escidoc.bo.utils; - -import java.util.Comparator; - -import org.apache.commons.lang.StringUtils; -import org.mpiwg.itgroup.escidoc.bo.ESciDocItem; -import org.mpiwg.itgroup.escidoc.bo.Publication; - -public class SortItemByCreator implements Comparator { - - - public int compare(ESciDocItem e1, ESciDocItem e2) { - Publication p1 = e1.getPublication(); - Publication p2 = e2.getPublication(); - - if(p1 != null && p2 != null){ - String c1 = replace(p1.getCreatorsAsString()); - String c2 = replace(p2.getCreatorsAsString()); - - if(StringUtils.isNotEmpty(c1) && StringUtils.isNotEmpty(c2)){ - return c1.compareTo(c2); - }else if(StringUtils.isNotEmpty(c1)){ - return -1; - }else if(StringUtils.isNotEmpty(c2)){ - return 1; - } - } - return 0; - } - - public static String replace(String s){ - if(StringUtils.isNotEmpty(s)){ - s = s.replace("(", ""); - s = s.replace(")", ""); - } - return s; - } -} diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/java/org/mpiwg/itgroup/escidoc/bo/utils/SortItemByTitle.java --- a/src/main/java/org/mpiwg/itgroup/escidoc/bo/utils/SortItemByTitle.java Mon Nov 30 15:37:10 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -package org.mpiwg.itgroup.escidoc.bo.utils; - -import java.util.Comparator; - -import org.apache.commons.lang.StringUtils; -import org.mpiwg.itgroup.escidoc.bo.ESciDocItem; -import org.mpiwg.itgroup.escidoc.bo.Publication; - -public class SortItemByTitle implements Comparator{ - - public int compare(ESciDocItem e1, ESciDocItem e2) { - Publication p1 = e1.getPublication(); - Publication p2 = e2.getPublication(); - - if(p1 != null && p2 != null){ - - String t1 = replace(p1.getNorTitle()); - String t2 = replace(p2.getNorTitle()); - - if (StringUtils.isNotEmpty(t1) && StringUtils.isNotEmpty(t2)) { - return t1.compareTo(t2); - } else if (StringUtils.isNotEmpty(t1)) { - return -1; - } else if (StringUtils.isNotEmpty(t2)) { - return 1; - } - } - System.out.println("equals titles"); - return 0; - } - - public static String replace(String s){ - if(StringUtils.isNotEmpty(s)){ - s = s.replace("(", ""); - s = s.replace(")", ""); - } - return s; - } - -} diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/java/org/mpiwg/itgroup/escidoc/bo/utils/SortPublicationByCreator.java --- a/src/main/java/org/mpiwg/itgroup/escidoc/bo/utils/SortPublicationByCreator.java Mon Nov 30 15:37:10 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -package org.mpiwg.itgroup.escidoc.bo.utils; - -import java.util.Comparator; - -import org.apache.commons.lang.StringUtils; -import org.mpiwg.itgroup.escidoc.bo.Publication; - -public class SortPublicationByCreator implements Comparator { - - - public int compare(Publication e1, Publication e2) { - String creators1 = e1.getCreatorsAsString(); - String creators2 = e2.getCreatorsAsString(); - - if(StringUtils.isNotEmpty(creators1) && StringUtils.isNotEmpty(creators2)){ - return creators1.compareTo(creators2); - }else if(StringUtils.isNotEmpty(creators1)){ - return -1; - }else if(StringUtils.isNotEmpty(creators2)){ - return 1; - } - return 0; - } - -} \ No newline at end of file diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/java/org/mpiwg/itgroup/escidoc/bo/utils/SortPublicationByTitle.java --- a/src/main/java/org/mpiwg/itgroup/escidoc/bo/utils/SortPublicationByTitle.java Mon Nov 30 15:37:10 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -package org.mpiwg.itgroup.escidoc.bo.utils; - -import java.util.Comparator; - -import org.apache.commons.lang.StringUtils; -import org.mpiwg.itgroup.escidoc.bo.Publication; - -public class SortPublicationByTitle implements Comparator { - - public int compare(Publication e1, Publication e2) { - if (StringUtils.isNotEmpty(e1.getTitle()) && StringUtils.isNotEmpty(e2.getTitle())) { - return e1.getTitle().compareTo(e2.getTitle()); - } else if (StringUtils.isNotEmpty(e1.getTitle())) { - return -1; - } else if (StringUtils.isNotEmpty(e2.getTitle())) { - return 1; - } else { - return 0; - } - } - -} diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/java/org/mpiwg/itgroup/escidoc/utils/ESciDocItemDataTable.java --- a/src/main/java/org/mpiwg/itgroup/escidoc/utils/ESciDocItemDataTable.java Mon Nov 30 15:37:10 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,163 +0,0 @@ -package org.mpiwg.itgroup.escidoc.utils; - -import java.util.ArrayList; -import java.util.List; - -import javax.faces.event.ActionEvent; -import javax.faces.event.ValueChangeEvent; -import javax.faces.model.SelectItem; - -import org.mpiwg.itgroup.escidoc.ESciDocCache; -import org.mpiwg.itgroup.escidoc.bo.ESciDocItem; - -import de.mpiwg.itgroup.ismi.entry.beans.AbstractBean; -import de.mpiwg.itgroup.ismi.entry.beans.AbstractISMIBean; -import de.mpiwg.itgroup.ismi.util.guiComponents.MisattributionDataTable; - -public class ESciDocItemDataTable extends AbstractBean{ - - private List items = new ArrayList(); - private String term; - - private boolean showDialog = false; - private AbstractISMIBean entityForm; - private MisattributionDataTable misattDataTable; - - private int sortBy = ESciDocCache.SORT_DEFAULT; - - private static List sortAlternatives; - - static{ - sortAlternatives = new ArrayList(); - sortAlternatives.add(new SelectItem(ESciDocCache.SORT_DEFAULT, "Id")); - sortAlternatives.add(new SelectItem(ESciDocCache.SORT_TITLE, "Title")); - sortAlternatives.add(new SelectItem(ESciDocCache.SORT_CREATOR, "Authors")); - } - - public ESciDocItemDataTable(AbstractISMIBean entityForm){ - this.entityForm = entityForm; - this.reset(); - } - - public ESciDocItemDataTable(MisattributionDataTable misattDataTable){ - this.misattDataTable = misattDataTable; - this.reset(); - } - - public void listenerSort(ValueChangeEvent event){ - if(event.getNewValue() != null) - ESciDocCache.sort(new Integer(event.getNewValue().toString()), items); - } - - public void listenerSelectRefItem(ActionEvent event){ - ESciDocItem item = (ESciDocItem)getRequestBean("refItem"); - if(item != null){ - if(entityForm != null){ - SelectedESciDocItems selectedPubs = this.entityForm.getSelectedItems(); - if(selectedPubs != null){ - if(!selectedPubs.addESciDocItem((ESciDocItem)item.clone())){ - getSessionBean().addGeneralMsg("The reference was already selected."); - } - } - }else if(misattDataTable != null){ - misattDataTable.setESciDocItem(item); - } - this.showDialog = false; - } - } - - public void listenerEditItem(ActionEvent event){ - ESciDocItem item = (ESciDocItem)getRequestBean("refItem"); - getSessionBean().geteSciDocForm().setItem(item); - this.term = null; - this.items = null; - this.showDialog = false; - } - - public void listenerCreateReference(){ - getSessionBean().geteSciDocForm().createItem(); - this.close(); - } - - public void listenerReset(ActionEvent event){ - this.reset(); - } - - public void listenerFilter(ActionEvent event){ - this.filter(); - } - - public void listenerOpen(ActionEvent event){ - this.open(); - } - - public void open(){ - this.reset(); - this.showDialog = true; - } - - public void listenerClose(ActionEvent event){ - this.close(); - } - - public void close(){ - this.term = null; - this.items = null; - this.showDialog = false; - } - - public void reset(){ - /* - this.term = null; - List list = this.getAppBean().getRefCache().getAllItems(sortBy); - if(list != null){ - this.items = new ArrayList(list); - }else{ - this.items = new ArrayList(); - }*/ - } - - public void filter(){ - this.items = this.getAppBean().getRefCache().searchItem(term, sortBy); - } - public int getItemsSize(){ - if(items == null) - return 0; - return items.size(); - } - - public List getItems() { - return items; - } - - public void setItems(List items) { - this.items = items; - } - - public String getTerm() { - return term; - } - - public void setTerm(String term) { - this.term = term; - } - - public boolean isShowDialog() { - return showDialog; - } - - public void setShowDialog(boolean showDialog) { - this.showDialog = showDialog; - } - public int getSortBy() { - return sortBy; - } - - public void setSortBy(int sortBy) { - this.sortBy = sortBy; - } - - public List getSortAlternatives() { - return sortAlternatives; - } -} diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/java/org/mpiwg/itgroup/escidoc/utils/SelectedESciDocItems.java --- a/src/main/java/org/mpiwg/itgroup/escidoc/utils/SelectedESciDocItems.java Mon Nov 30 15:37:10 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -package org.mpiwg.itgroup.escidoc.utils; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.mpiwg.itgroup.escidoc.bo.ESciDocItem; - - -public class SelectedESciDocItems implements Serializable{ - - private static final long serialVersionUID = -756497439159524677L; - private transient List list = new ArrayList(); - private Map map = new HashMap(); - - public boolean addESciDocItem(ESciDocItem pub) { - if (!map.containsKey(pub.getPublication().getObjid())) { - this.list.add(pub); - this.map.put(pub.getPublication().getObjid(), false); - return true; - } - return false; - } - - public void removeById(String id) { - ESciDocItem pp = null; - for (ESciDocItem pub : this.list) { - if (id.equals(pub.getPublication().getObjid())) { - pp = pub; - break; - } - } - this.list.remove(pp); - this.map.remove(id); - } - - public List getList() { - return list; - } - - public void setList(List list) { - this.list = list; - } - - public Map getMap() { - return map; - } - - public void setMap(Map map) { - this.map = map; - } - -} diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/java/org/mpiwg/itgroup/escidoc/web/ESciDocItemForm.java --- a/src/main/java/org/mpiwg/itgroup/escidoc/web/ESciDocItemForm.java Mon Nov 30 15:37:10 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,199 +0,0 @@ -package org.mpiwg.itgroup.escidoc.web; - -import java.util.ArrayList; -import java.util.List; - -import javax.faces.event.ActionEvent; -import javax.faces.model.SelectItem; - -import org.apache.commons.lang.StringUtils; -import org.mpiwg.itgroup.escidoc.bo.Creator; -import org.mpiwg.itgroup.escidoc.bo.ESciDocItem; - -import de.mpiwg.itgroup.ismi.entry.beans.AbstractBean; -import de.mpiwg.itgroup.ismi.utils.SelectableObject; - -public class ESciDocItemForm extends AbstractBean { - - private ESciDocItem item; - private String itemId; - - private List creatorList = new ArrayList(); - private List alternativeNameList = new ArrayList(); - - - private boolean visible; - - public ESciDocItemForm(){ - this.reset(); - } - - private void reset(){ - this.item = new ESciDocItem(); - this.itemId = null; - this.creatorList = new ArrayList(); - this.alternativeNameList = new ArrayList(); - } - - public void listenerCleanForm(ActionEvent event){ - this.reset(); - } - - public void listenerDelete(ActionEvent event){ - try { - - getAppBean().getRefCache().deleteItem(item, getSessionBean().getUsername()); - - addGeneralMsg("The publication has been deleted successfully."); - this.visible = false; - this.item = null; - } catch (Exception e) { - addErrorMsg(e.getMessage()); - e.printStackTrace(); - } - } - - public void listenerSave(ActionEvent event){ - - List alternativeNames = new ArrayList(); - for(SelectableObject so : this.alternativeNameList){ - alternativeNames.add((String)so.getObj()); - } - List creators = new ArrayList(); - for(SelectableObject so : this.creatorList){ - creators.add((Creator)so.getObj()); - } - this.item.getPublication().setAlternativeList(alternativeNames); - this.item.getPublication().setCreatorList(creators); - try { - - this.item = getAppBean().getRefCache().saveItem(item, getSessionBean().getUsername()); - - this.setItem(getAppBean().getRefCache().getItem(item.getObjId())); - addGeneralMsg("The publication has been saved successfully."); - } catch (Exception e) { - addErrorMsg(e.getMessage()); - e.printStackTrace(); - } - } - - public String getButtonSaveLabel(){ - if(StringUtils.isEmpty(item.getObjId())){ - return "Create"; - } - return "Save"; - } - - public boolean isDisplayDeleteBtn(){ - if(item == null || StringUtils.isEmpty(item.getObjId())){ - return false; - } - return true; - } - - public void listenerReloadItem(ActionEvent event){ - if(StringUtils.isNotEmpty(itemId)){ - this.item = getAppBean().getRefCache().getItem(itemId); - - if(item == null){ - addGeneralMsg("No item found " + itemId); - }else{ - this.item = (ESciDocItem)this.item.clone(); - } - }else{ - addGeneralMsg("Item id can not be empty"); - } - } - - public void listenerAddAlternativeName(ActionEvent event){ - this.alternativeNameList.add(new SelectableObject(new String("..."))); - } - - public void listenerRemoveAlternativeName(ActionEvent event){ - List toDelete = new ArrayList(); - for(SelectableObject so : this.alternativeNameList){ - if(so.isSelected()){ - toDelete.add(so); - } - } - for(SelectableObject so : toDelete){ - this.alternativeNameList.remove(so); - } - } - - public void listenerAddCreator(ActionEvent event){ - this.creatorList.add(new SelectableObject(new Creator("completeName", "familyName", "givenName"))); - } - - public void listenerRemoveCreator(ActionEvent event){ - List toDelete = new ArrayList(); - for(SelectableObject so : this.creatorList){ - if(so.isSelected()){ - toDelete.add(so); - } - } - for(SelectableObject so : toDelete){ - this.creatorList.remove(so); - } - } - - public void listenerClose(ActionEvent event){ - this.visible = false; - this.item = null; - } - - public ESciDocItem getItem() { - return item; - } - - public void createItem(){ - this.reset(); - this.visible = true; - } - - public void setItem(ESciDocItem item) { - this.reset(); - try { - - this.item = getAppBean().getRefCache().getItemFromServer(item.getObjId()); - this.visible = true; - - for(String s : this.item.getPublication().getAlternativeList()){ - this.alternativeNameList.add(new SelectableObject(s)); - } - - for(Creator creator : this.item.getPublication().getCreatorList()){ - this.creatorList.add(new SelectableObject(creator)); - } - - } catch (Exception e) { - e.printStackTrace(); - addGeneralMsg(e.getMessage()); - } - } - - public boolean isVisible() { - return visible; - } - - public void setVisible(boolean visible) { - this.visible = visible; - } - - public List getCreatorList() { - return creatorList; - } - - public void setCreatorList(List creatorList) { - this.creatorList = creatorList; - } - - public List getAlternativeNameList() { - return alternativeNameList; - } - - public void setAlternativeNameList(List alternativeNameList) { - this.alternativeNameList = alternativeNameList; - } - -} diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/webapp/admin/admin.xhtml --- a/src/main/webapp/admin/admin.xhtml Mon Nov 30 15:37:10 2015 +0100 +++ b/src/main/webapp/admin/admin.xhtml Mon Nov 30 15:38:09 2015 +0100 @@ -26,8 +26,6 @@ actionListener="#{adminBean.actionCreateUser}" /> - - - -
-
- - - -
-
-
-
ESciDoc Panel Control
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
-
diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/webapp/entry/components/misattribution.xhtml --- a/src/main/webapp/entry/components/misattribution.xhtml Mon Nov 30 15:37:10 2015 +0100 +++ b/src/main/webapp/entry/components/misattribution.xhtml Mon Nov 30 15:38:09 2015 +0100 @@ -39,10 +39,6 @@ - - - - - - - - - - diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/webapp/resources/components/ismi/refWidget.xhtml --- a/src/main/webapp/resources/components/ismi/refWidget.xhtml Mon Nov 30 15:37:10 2015 +0100 +++ b/src/main/webapp/resources/components/ismi/refWidget.xhtml Mon Nov 30 15:38:09 2015 +0100 @@ -46,13 +46,6 @@ - - - - - - - @@ -113,9 +106,6 @@ - - - - - - - - - - @@ -270,13 +263,6 @@ - - - - - - - @@ -448,13 +434,6 @@ - - - - - - - diff -r 403afc3d94eb -r 4ec8d4cfad26 src/main/webapp/search/displayTitle.xhtml --- a/src/main/webapp/search/displayTitle.xhtml Mon Nov 30 15:37:10 2015 +0100 +++ b/src/main/webapp/search/displayTitle.xhtml Mon Nov 30 15:38:09 2015 +0100 @@ -131,13 +131,6 @@ - - - - - - - @@ -299,13 +292,6 @@ - - - - - - -