NIHVIVO-2317 NIHVIVO-2318 removing vitro namespace properties from editing and various Java classes and interfaces
This commit is contained in:
parent
9c469cef6b
commit
6e4fcedb6c
87 changed files with 178 additions and 3918 deletions
Binary file not shown.
Binary file not shown.
BIN
webapp/lib/arq-2.8.7-tests.jar
Normal file
BIN
webapp/lib/arq-2.8.7-tests.jar
Normal file
Binary file not shown.
BIN
webapp/lib/arq-2.8.7.jar
Normal file
BIN
webapp/lib/arq-2.8.7.jar
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
webapp/lib/mysql-connector-java-5.1.16-bin.jar
Normal file
BIN
webapp/lib/mysql-connector-java-5.1.16-bin.jar
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -52,24 +52,15 @@ public class PropertyRestrictionPolicyHelper {
|
||||||
private static final Collection<String> PERMITTED_EXCEPTIONS = Arrays
|
private static final Collection<String> PERMITTED_EXCEPTIONS = Arrays
|
||||||
.asList(new String[] {
|
.asList(new String[] {
|
||||||
VitroVocabulary.MONIKER,
|
VitroVocabulary.MONIKER,
|
||||||
VitroVocabulary.BLURB,
|
|
||||||
VitroVocabulary.DESCRIPTION,
|
|
||||||
VitroVocabulary.MODTIME,
|
VitroVocabulary.MODTIME,
|
||||||
VitroVocabulary.TIMEKEY,
|
|
||||||
|
|
||||||
VitroVocabulary.CITATION,
|
|
||||||
VitroVocabulary.IND_MAIN_IMAGE,
|
VitroVocabulary.IND_MAIN_IMAGE,
|
||||||
|
|
||||||
VitroVocabulary.LINK,
|
VitroVocabulary.LINK,
|
||||||
VitroVocabulary.PRIMARY_LINK,
|
VitroVocabulary.PRIMARY_LINK,
|
||||||
VitroVocabulary.ADDITIONAL_LINK,
|
VitroVocabulary.ADDITIONAL_LINK,
|
||||||
VitroVocabulary.LINK_ANCHOR,
|
VitroVocabulary.LINK_ANCHOR,
|
||||||
VitroVocabulary.LINK_URL,
|
VitroVocabulary.LINK_URL });
|
||||||
|
|
||||||
VitroVocabulary.KEYWORD_INDIVIDUALRELATION,
|
|
||||||
VitroVocabulary.KEYWORD_INDIVIDUALRELATION_INVOLVESKEYWORD,
|
|
||||||
VitroVocabulary.KEYWORD_INDIVIDUALRELATION_INVOLVESINDIVIDUAL,
|
|
||||||
VitroVocabulary.KEYWORD_INDIVIDUALRELATION_MODE });
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The bean is attached to the ServletContext using this attribute name.
|
* The bean is attached to the ServletContext using this attribute name.
|
||||||
|
|
|
@ -36,17 +36,5 @@ public interface DataPropertyStatement {
|
||||||
|
|
||||||
public void setLanguage(String language);
|
public void setLanguage(String language);
|
||||||
|
|
||||||
public Date getSunrise();
|
|
||||||
|
|
||||||
public void setSunrise(Date sunrise);
|
|
||||||
|
|
||||||
public Date getSunset();
|
|
||||||
|
|
||||||
public void setSunset(Date sunset);
|
|
||||||
/*
|
|
||||||
public String getQualifier();
|
|
||||||
|
|
||||||
public void setQualifier(String qualifier);
|
|
||||||
*/
|
|
||||||
public String getString();
|
public String getString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ import java.util.Date;
|
||||||
* a class representing an particular instance of a data property
|
* a class representing an particular instance of a data property
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class DataPropertyStatementImpl implements VitroTimeWindowedResource, DataPropertyStatement
|
public class DataPropertyStatementImpl implements DataPropertyStatement
|
||||||
{
|
{
|
||||||
private Individual individual = null;
|
private Individual individual = null;
|
||||||
private String individualURI = null;
|
private String individualURI = null;
|
||||||
|
@ -17,10 +17,6 @@ public class DataPropertyStatementImpl implements VitroTimeWindowedResource, Dat
|
||||||
private String datatypeURI = null;
|
private String datatypeURI = null;
|
||||||
private String language = null;
|
private String language = null;
|
||||||
|
|
||||||
private Date sunrise = null;
|
|
||||||
private Date sunset = null;
|
|
||||||
//private String qualifier = null;
|
|
||||||
|
|
||||||
public DataPropertyStatementImpl(){
|
public DataPropertyStatementImpl(){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,30 +80,6 @@ public class DataPropertyStatementImpl implements VitroTimeWindowedResource, Dat
|
||||||
this.language = language;
|
this.language = language;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Date getSunrise() {
|
|
||||||
return sunrise;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSunrise(Date sunrise) {
|
|
||||||
this.sunrise = sunrise;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getSunset() {
|
|
||||||
return sunset;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSunset(Date sunset) {
|
|
||||||
this.sunset = sunset;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
public String getQualifier() {
|
|
||||||
return qualifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setQualifier(String qualifier) {
|
|
||||||
this.qualifier = qualifier;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
public String getString(){
|
public String getString(){
|
||||||
String out = "instance of dataprop: " + datapropURI;
|
String out = "instance of dataprop: " + datapropURI;
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ import edu.cornell.mannlib.vitro.webapp.search.beans.ProhibitedFromSearch;
|
||||||
* Date: Oct 18, 2007
|
* Date: Oct 18, 2007
|
||||||
* Time: 3:08:33 PM
|
* Time: 3:08:33 PM
|
||||||
*/
|
*/
|
||||||
public interface Individual extends ResourceBean, VitroTimeWindowedResource, Comparable<Individual> {
|
public interface Individual extends ResourceBean, Comparable<Individual> {
|
||||||
String getName();
|
String getName();
|
||||||
void setName(String in);
|
void setName(String in);
|
||||||
|
|
||||||
|
@ -31,15 +31,6 @@ public interface Individual extends ResourceBean, VitroTimeWindowedResource, Com
|
||||||
String getVClassURI();
|
String getVClassURI();
|
||||||
void setVClassURI(String in);
|
void setVClassURI(String in);
|
||||||
|
|
||||||
//Date getSunrise();
|
|
||||||
void setSunrise(Date in);
|
|
||||||
|
|
||||||
//Date getSunset();
|
|
||||||
void setSunset(Date in);
|
|
||||||
|
|
||||||
Date getTimekey();
|
|
||||||
void setTimekey(Date in);
|
|
||||||
|
|
||||||
Timestamp getModTime();
|
Timestamp getModTime();
|
||||||
void setModTime(Timestamp in);
|
void setModTime(Timestamp in);
|
||||||
|
|
||||||
|
@ -92,24 +83,6 @@ public interface Individual extends ResourceBean, VitroTimeWindowedResource, Com
|
||||||
List<DataPropertyStatement> getExternalIds();
|
List<DataPropertyStatement> getExternalIds();
|
||||||
void setExternalIds(List<DataPropertyStatement> externalIds);
|
void setExternalIds(List<DataPropertyStatement> externalIds);
|
||||||
|
|
||||||
String getMoniker();
|
|
||||||
void setMoniker(String in);
|
|
||||||
|
|
||||||
String getDescription();
|
|
||||||
void setDescription(String in);
|
|
||||||
|
|
||||||
String getAnchor();
|
|
||||||
void setAnchor(String in);
|
|
||||||
|
|
||||||
String getBlurb();
|
|
||||||
void setBlurb(String in);
|
|
||||||
|
|
||||||
int getStatusId();
|
|
||||||
void setStatusId(int in);
|
|
||||||
|
|
||||||
String getStatus();
|
|
||||||
void setStatus(String s);
|
|
||||||
|
|
||||||
void setMainImageUri(String mainImageUri);
|
void setMainImageUri(String mainImageUri);
|
||||||
String getMainImageUri();
|
String getMainImageUri();
|
||||||
|
|
||||||
|
@ -117,22 +90,6 @@ public interface Individual extends ResourceBean, VitroTimeWindowedResource, Com
|
||||||
String getThumbUrl();
|
String getThumbUrl();
|
||||||
boolean hasThumb();
|
boolean hasThumb();
|
||||||
|
|
||||||
String getUrl();
|
|
||||||
void setUrl(String url);
|
|
||||||
|
|
||||||
List<Link> getLinksList();
|
|
||||||
void setLinksList(List<Link> linksList);
|
|
||||||
|
|
||||||
Link getPrimaryLink();
|
|
||||||
void setPrimaryLink(Link link);
|
|
||||||
|
|
||||||
List<String> getKeywords();
|
|
||||||
void setKeywords(List<String> keywords);
|
|
||||||
String getKeywordString();
|
|
||||||
|
|
||||||
List<Keyword> getKeywordObjects();
|
|
||||||
void setKeywordObjects(List<Keyword> keywords);
|
|
||||||
|
|
||||||
void sortForDisplay();
|
void sortForDisplay();
|
||||||
|
|
||||||
JSONObject toJSON() throws JSONException;
|
JSONObject toJSON() throws JSONException;
|
||||||
|
|
|
@ -2,17 +2,25 @@
|
||||||
|
|
||||||
package edu.cornell.mannlib.vitro.webapp.beans;
|
package edu.cornell.mannlib.vitro.webapp.beans;
|
||||||
|
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
import java.sql.Timestamp;
|
||||||
|
import java.text.Collator;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.TreeSet;
|
||||||
|
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.filestorage.model.ImageInfo;
|
import edu.cornell.mannlib.vitro.webapp.filestorage.model.ImageInfo;
|
||||||
import edu.cornell.mannlib.vitro.webapp.search.beans.ProhibitedFromSearch;
|
import edu.cornell.mannlib.vitro.webapp.search.beans.ProhibitedFromSearch;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
|
||||||
import java.sql.Timestamp;
|
|
||||||
import java.text.Collator;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a single entity record.
|
* Represents a single entity record.
|
||||||
*/
|
*/
|
||||||
|
@ -31,9 +39,6 @@ public class IndividualImpl extends BaseResourceBean implements Individual, Comp
|
||||||
protected VClass vClass = null;
|
protected VClass vClass = null;
|
||||||
protected List<VClass> directVClasses = null;
|
protected List<VClass> directVClasses = null;
|
||||||
protected List<VClass> allVClasses = null;
|
protected List<VClass> allVClasses = null;
|
||||||
protected Date sunrise = null;
|
|
||||||
protected Date sunset = null;
|
|
||||||
protected Date timekey = null;
|
|
||||||
protected Timestamp modTime = null;
|
protected Timestamp modTime = null;
|
||||||
protected List <ObjectProperty>propertyList = null;
|
protected List <ObjectProperty>propertyList = null;
|
||||||
protected List<ObjectProperty> populatedObjectPropertyList = null;
|
protected List<ObjectProperty> populatedObjectPropertyList = null;
|
||||||
|
@ -46,19 +51,8 @@ public class IndividualImpl extends BaseResourceBean implements Individual, Comp
|
||||||
protected List <ObjectPropertyStatement>rangeEnts2Ents = null;
|
protected List <ObjectPropertyStatement>rangeEnts2Ents = null;
|
||||||
protected List <DataPropertyStatement>externalIds = null;
|
protected List <DataPropertyStatement>externalIds = null;
|
||||||
|
|
||||||
protected String moniker = null;
|
|
||||||
protected String url = null;
|
|
||||||
protected String description = null;
|
|
||||||
protected String anchor = null;
|
|
||||||
protected String blurb = null;
|
|
||||||
protected String mainImageUri = NOT_INITIALIZED;
|
protected String mainImageUri = NOT_INITIALIZED;
|
||||||
protected ImageInfo imageInfo = null;
|
protected ImageInfo imageInfo = null;
|
||||||
protected int statusId = 0;
|
|
||||||
protected String status = null;
|
|
||||||
protected List <Link>linksList = null;
|
|
||||||
protected Link primaryLink = null;
|
|
||||||
protected List<String> keywords=null;
|
|
||||||
protected List<Keyword> keywordObjects=null;
|
|
||||||
protected Float searchBoost;
|
protected Float searchBoost;
|
||||||
|
|
||||||
/** indicates if sortForDisplay has been called */
|
/** indicates if sortForDisplay has been called */
|
||||||
|
@ -87,22 +81,9 @@ public class IndividualImpl extends BaseResourceBean implements Individual, Comp
|
||||||
public String getRdfsLabel(){ return rdfsLabel; }
|
public String getRdfsLabel(){ return rdfsLabel; }
|
||||||
public void setRdfsLabel(String s){ rdfsLabel = s; }
|
public void setRdfsLabel(String s){ rdfsLabel = s; }
|
||||||
|
|
||||||
// private String modTime = null;
|
|
||||||
// public String getModtime(){return modTime;}
|
|
||||||
// public void setModtime(String in){modTime=in;}
|
|
||||||
|
|
||||||
public String getVClassURI(){return vClassURI;}
|
public String getVClassURI(){return vClassURI;}
|
||||||
public void setVClassURI(String in){vClassURI=in;}
|
public void setVClassURI(String in){vClassURI=in;}
|
||||||
|
|
||||||
public Date getSunrise(){return sunrise;}
|
|
||||||
public void setSunrise(Date in){sunrise=in;}
|
|
||||||
|
|
||||||
public Date getSunset(){return sunset;}
|
|
||||||
public void setSunset(Date in){sunset=in;}
|
|
||||||
|
|
||||||
public Date getTimekey(){return timekey;}
|
|
||||||
public void setTimekey(Date in){timekey=in;}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the last time this object was changed in the model.
|
* Returns the last time this object was changed in the model.
|
||||||
* Notice Java API craziness: Timestamp is a subclass of Date
|
* Notice Java API craziness: Timestamp is a subclass of Date
|
||||||
|
@ -272,26 +253,6 @@ public class IndividualImpl extends BaseResourceBean implements Individual, Comp
|
||||||
this.externalIds = externalIds;
|
this.externalIds = externalIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getMoniker(){return moniker;}
|
|
||||||
public void setMoniker(String in){moniker=in;}
|
|
||||||
|
|
||||||
public String getDescription(){return description;}
|
|
||||||
public void setDescription(String in){description=in;}
|
|
||||||
|
|
||||||
public String getAnchor(){return anchor;}
|
|
||||||
public void setAnchor(String in){anchor=in;}
|
|
||||||
|
|
||||||
public String getBlurb(){return blurb;}
|
|
||||||
public void setBlurb(String in){blurb=in;}
|
|
||||||
|
|
||||||
public int getStatusId(){return statusId;}
|
|
||||||
public void setStatusId(int in){statusId=in;}
|
|
||||||
|
|
||||||
public String getStatus() {return status;}
|
|
||||||
public void setStatus(String s) {status=s; }
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getMainImageUri() {
|
public String getMainImageUri() {
|
||||||
return (mainImageUri == NOT_INITIALIZED) ? null : mainImageUri;
|
return (mainImageUri == NOT_INITIALIZED) ? null : mainImageUri;
|
||||||
|
@ -313,61 +274,6 @@ public class IndividualImpl extends BaseResourceBean implements Individual, Comp
|
||||||
return "thumbUrl";
|
return "thumbUrl";
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUrl() {
|
|
||||||
return url;
|
|
||||||
}
|
|
||||||
public void setUrl(String url) {
|
|
||||||
this.url = url;
|
|
||||||
}
|
|
||||||
public List<Link> getLinksList() {
|
|
||||||
return linksList;
|
|
||||||
}
|
|
||||||
public void setLinksList(List <Link>linksList) {
|
|
||||||
this.linksList = linksList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Link getPrimaryLink() {
|
|
||||||
return primaryLink;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPrimaryLink(Link link) {
|
|
||||||
primaryLink = link;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> getKeywords() { return keywords; }
|
|
||||||
public void setKeywords(List<String> keywords) {this.keywords = keywords;}
|
|
||||||
public String getKeywordString(){
|
|
||||||
String rv = "";
|
|
||||||
List keywords=getKeywords();
|
|
||||||
if (getKeywords()!=null){
|
|
||||||
Iterator<String> it1 = getKeywords().iterator();
|
|
||||||
TreeSet<String> keywordSet = new TreeSet<String>(new Comparator<String>() {
|
|
||||||
public int compare( String first, String second ) {
|
|
||||||
if (first==null) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
if (second==null) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
Collator collator = Collator.getInstance();
|
|
||||||
return collator.compare(first,second);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
while( it1.hasNext() ){
|
|
||||||
keywordSet.add(it1.next());
|
|
||||||
}
|
|
||||||
Iterator<String> it2 = keywordSet.iterator();
|
|
||||||
while (it2.hasNext()) {
|
|
||||||
rv+= it2.next();
|
|
||||||
if( it2.hasNext())
|
|
||||||
rv+=", ";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return rv;
|
|
||||||
}
|
|
||||||
public List<Keyword> getKeywordObjects() { return keywordObjects; }
|
|
||||||
public void setKeywordObjects(List<Keyword> keywords) {this.keywordObjects = keywords;}
|
|
||||||
|
|
||||||
public Float getSearchBoost() { return searchBoost; }
|
public Float getSearchBoost() { return searchBoost; }
|
||||||
public void setSearchBoost(Float boost) { searchBoost = boost; }
|
public void setSearchBoost(Float boost) { searchBoost = boost; }
|
||||||
|
|
||||||
|
@ -421,8 +327,6 @@ public class IndividualImpl extends BaseResourceBean implements Individual, Comp
|
||||||
|
|
||||||
if( "name".equalsIgnoreCase(fieldName) )
|
if( "name".equalsIgnoreCase(fieldName) )
|
||||||
return getName();
|
return getName();
|
||||||
if( "timekey".equalsIgnoreCase(fieldName) )
|
|
||||||
return getTimekey();
|
|
||||||
|
|
||||||
//not one of the more common ones, try reflection
|
//not one of the more common ones, try reflection
|
||||||
|
|
||||||
|
|
|
@ -7,10 +7,6 @@ public interface ObjectPropertyStatement {
|
||||||
|
|
||||||
public String toString();
|
public String toString();
|
||||||
|
|
||||||
public String getDescription();
|
|
||||||
|
|
||||||
public void setDescription(String description);
|
|
||||||
|
|
||||||
public boolean isSubjectOriented();
|
public boolean isSubjectOriented();
|
||||||
|
|
||||||
public void setSubjectOriented(boolean subjectOriented);
|
public void setSubjectOriented(boolean subjectOriented);
|
||||||
|
@ -19,10 +15,6 @@ public interface ObjectPropertyStatement {
|
||||||
|
|
||||||
public void setSubjectURI(String subjectURI);
|
public void setSubjectURI(String subjectURI);
|
||||||
|
|
||||||
public String getQualifier();
|
|
||||||
|
|
||||||
public void setQualifier(String qualifier);
|
|
||||||
|
|
||||||
public String getObjectURI();
|
public String getObjectURI();
|
||||||
|
|
||||||
public void setObjectURI(String objectURI);
|
public void setObjectURI(String objectURI);
|
||||||
|
@ -43,14 +35,6 @@ public interface ObjectPropertyStatement {
|
||||||
|
|
||||||
public void setPropertyURI(String URI);
|
public void setPropertyURI(String URI);
|
||||||
|
|
||||||
public void setSunrise(Date date);
|
|
||||||
|
|
||||||
public Date getSunrise();
|
|
||||||
|
|
||||||
public void setSunset(Date date);
|
|
||||||
|
|
||||||
public Date getSunset();
|
|
||||||
|
|
||||||
public PropertyInstance toPropertyInstance();
|
public PropertyInstance toPropertyInstance();
|
||||||
|
|
||||||
}
|
}
|
|
@ -9,7 +9,7 @@ import java.util.Date;
|
||||||
* a class representing a particular instance of an object property
|
* a class representing a particular instance of an object property
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class ObjectPropertyStatementImpl implements VitroTimeWindowedResource, ObjectPropertyStatement
|
public class ObjectPropertyStatementImpl implements ObjectPropertyStatement
|
||||||
{
|
{
|
||||||
private String subjectURI = null;
|
private String subjectURI = null;
|
||||||
private Individual subject = null;
|
private Individual subject = null;
|
||||||
|
@ -41,22 +41,6 @@ public class ObjectPropertyStatementImpl implements VitroTimeWindowedResource, O
|
||||||
return "Object Property Statements: "+dom+" "+prop+" to "+ran+" "+orent;
|
return "Object Property Statements: "+dom+" "+prop+" to "+ran+" "+orent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement#getDescription()
|
|
||||||
*/
|
|
||||||
public String getDescription() {
|
|
||||||
return description;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement#setDescription(java.lang.String)
|
|
||||||
*/
|
|
||||||
public void setDescription(String description) {
|
|
||||||
this.description = description;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement#isSubjectOriented()
|
* @see edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement#isSubjectOriented()
|
||||||
*/
|
*/
|
||||||
|
@ -87,22 +71,6 @@ public class ObjectPropertyStatementImpl implements VitroTimeWindowedResource, O
|
||||||
this.subjectURI = subjectURI;
|
this.subjectURI = subjectURI;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement#getQualifier()
|
|
||||||
*/
|
|
||||||
public String getQualifier() {
|
|
||||||
return qualifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement#setQualifier(java.lang.String)
|
|
||||||
*/
|
|
||||||
public void setQualifier(String qualifier) {
|
|
||||||
this.qualifier = qualifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement#getObjectURI()
|
* @see edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement#getObjectURI()
|
||||||
*/
|
*/
|
||||||
|
@ -196,32 +164,6 @@ public class ObjectPropertyStatementImpl implements VitroTimeWindowedResource, O
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Date sunrise = null;
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement#setSunrise(java.util.Date)
|
|
||||||
*/
|
|
||||||
public void setSunrise(Date date) {
|
|
||||||
sunrise = date;
|
|
||||||
}
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement#getSunrise()
|
|
||||||
*/
|
|
||||||
public Date getSunrise(){
|
|
||||||
return sunrise;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Date sunset = null;
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement#setSunset(java.util.Date)
|
|
||||||
*/
|
|
||||||
public void setSunset(Date date) {
|
|
||||||
sunset = date;
|
|
||||||
}
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement#getSunset()
|
|
||||||
*/
|
|
||||||
public Date getSunset(){ return sunset; }
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement#toPropertyInstance()
|
* @see edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement#toPropertyInstance()
|
||||||
*/
|
*/
|
||||||
|
@ -231,7 +173,6 @@ public class ObjectPropertyStatementImpl implements VitroTimeWindowedResource, O
|
||||||
pi.setPropertyURI(propertyURI);
|
pi.setPropertyURI(propertyURI);
|
||||||
pi.setSubjectEntURI(subjectURI);
|
pi.setSubjectEntURI(subjectURI);
|
||||||
pi.setObjectEntURI(objectURI);
|
pi.setObjectEntURI(objectURI);
|
||||||
pi.setQualifier(qualifier);
|
|
||||||
pi.setSubjectSide(subjectOriented);
|
pi.setSubjectSide(subjectOriented);
|
||||||
return pi;
|
return pi;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,9 +14,6 @@ public class PropertyInstance implements PropertyInstanceIface, Comparable<Prope
|
||||||
private String propertyURI = null;
|
private String propertyURI = null;
|
||||||
private String objectEntURI = null;
|
private String objectEntURI = null;
|
||||||
private String subjectEntURI = null;
|
private String subjectEntURI = null;
|
||||||
private String qualifier = null;
|
|
||||||
private Date sunrise = null;
|
|
||||||
private Date sunset = null;
|
|
||||||
|
|
||||||
private String subjectName = null;
|
private String subjectName = null;
|
||||||
private String objectName = null;
|
private String objectName = null;
|
||||||
|
@ -86,18 +83,6 @@ public class PropertyInstance implements PropertyInstanceIface, Comparable<Prope
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see edu.cornell.mannlib.vitro.beans.PropertyInstanceIface#getQualifier()
|
* @see edu.cornell.mannlib.vitro.beans.PropertyInstanceIface#getQualifier()
|
||||||
*/
|
*/
|
||||||
public String getQualifier(){return qualifier;}
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see edu.cornell.mannlib.vitro.beans.PropertyInstanceIface#getSunrise()
|
|
||||||
*/
|
|
||||||
public Date getSunrise(){return sunrise;}
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see edu.cornell.mannlib.vitro.beans.PropertyInstanceIface#getSunset()
|
|
||||||
*/
|
|
||||||
public Date getSunset(){return sunset;}
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see edu.cornell.mannlib.vitro.beans.PropertyInstanceIface#getDomainSide()
|
|
||||||
*/
|
|
||||||
public boolean getSubjectSide(){return subjectSide;}
|
public boolean getSubjectSide(){return subjectSide;}
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see edu.cornell.mannlib.vitro.beans.PropertyInstanceIface#getDomainQuickEditJsp()
|
* @see edu.cornell.mannlib.vitro.beans.PropertyInstanceIface#getDomainQuickEditJsp()
|
||||||
|
@ -156,18 +141,6 @@ public class PropertyInstance implements PropertyInstanceIface, Comparable<Prope
|
||||||
* @see edu.cornell.mannlib.vitro.beans.PropertyInstanceIface#setRangePublic(java.lang.String)
|
* @see edu.cornell.mannlib.vitro.beans.PropertyInstanceIface#setRangePublic(java.lang.String)
|
||||||
*/
|
*/
|
||||||
public void setRangePublic(String in){rangePublic=in;}
|
public void setRangePublic(String in){rangePublic=in;}
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see edu.cornell.mannlib.vitro.beans.PropertyInstanceIface#setQualifier(java.lang.String)
|
|
||||||
*/
|
|
||||||
public void setQualifier(String in){qualifier=in;}
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see edu.cornell.mannlib.vitro.beans.PropertyInstanceIface#setSunrise(java.util.Date)
|
|
||||||
*/
|
|
||||||
public void setSunrise(Date in){sunrise=in;}
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see edu.cornell.mannlib.vitro.beans.PropertyInstanceIface#setSunset(java.util.Date)
|
|
||||||
*/
|
|
||||||
public void setSunset(Date in){sunset=in;}
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see edu.cornell.mannlib.vitro.beans.PropertyInstanceIface#setDomainSide(boolean)
|
* @see edu.cornell.mannlib.vitro.beans.PropertyInstanceIface#setDomainSide(boolean)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -10,9 +10,6 @@ public interface PropertyInstanceIface {
|
||||||
public abstract String getPropertyURI();
|
public abstract String getPropertyURI();
|
||||||
public abstract String getObjectEntURI();
|
public abstract String getObjectEntURI();
|
||||||
public abstract String getSubjectEntURI();
|
public abstract String getSubjectEntURI();
|
||||||
public abstract String getQualifier();
|
|
||||||
public abstract Date getSunrise();
|
|
||||||
public abstract Date getSunset();
|
|
||||||
|
|
||||||
// entities
|
// entities
|
||||||
public abstract String getSubjectName();
|
public abstract String getSubjectName();
|
||||||
|
@ -56,12 +53,6 @@ public interface PropertyInstanceIface {
|
||||||
|
|
||||||
public abstract void setRangePublic(String in);
|
public abstract void setRangePublic(String in);
|
||||||
|
|
||||||
public abstract void setQualifier(String in);
|
|
||||||
|
|
||||||
public abstract void setSunrise(Date in);
|
|
||||||
|
|
||||||
public abstract void setSunset(Date in);
|
|
||||||
|
|
||||||
public abstract void setSubjectSide(boolean in);
|
public abstract void setSubjectSide(boolean in);
|
||||||
|
|
||||||
public abstract void setDomainQuickEditJsp(String in);
|
public abstract void setDomainQuickEditJsp(String in);
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
|
||||||
|
|
||||||
package edu.cornell.mannlib.vitro.webapp.beans;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
public interface VitroTimeWindowedResource {
|
|
||||||
public Date getSunrise() ;
|
|
||||||
public Date getSunset() ;
|
|
||||||
}
|
|
|
@ -91,19 +91,6 @@ public class CloneEntityServlet extends BaseEditController {
|
||||||
ind.setName("CLONE OF "+ind.getName());
|
ind.setName("CLONE OF "+ind.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
String timeKeyStr = request.getParameter("timekey");
|
|
||||||
if (timeKeyStr!=null && !timeKeyStr.equals("")) {
|
|
||||||
Date timekey = parseStringToDate(timeKeyStr);
|
|
||||||
if (timekey!=null) {
|
|
||||||
ind.setTimekey(timekey);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// specify other values that do NOT want to be carried over from the existing Individual
|
|
||||||
ind.setSunrise(new DateTime().toDate());
|
|
||||||
// cannot set these values to null because they will still be copies
|
|
||||||
ind.setBlurb("");
|
|
||||||
ind.setDescription("");
|
|
||||||
|
|
||||||
String cloneURI=individualDao.insertNewIndividual(ind);
|
String cloneURI=individualDao.insertNewIndividual(ind);
|
||||||
if (cloneURI == null){ log.error("Error inserting cloned individual"); return; }
|
if (cloneURI == null){ log.error("Error inserting cloned individual"); return; }
|
||||||
|
|
||||||
|
|
|
@ -30,15 +30,11 @@ import edu.cornell.mannlib.vitro.webapp.beans.ApplicationBean;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement;
|
import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.IndividualImpl;
|
import edu.cornell.mannlib.vitro.webapp.beans.IndividualImpl;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Keyword;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.KeywordIndividualRelation;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.PropertyInstance;
|
import edu.cornell.mannlib.vitro.webapp.beans.PropertyInstance;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.VClass;
|
import edu.cornell.mannlib.vitro.webapp.beans.VClass;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.VClassGroup;
|
import edu.cornell.mannlib.vitro.webapp.beans.VClassGroup;
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.Controllers;
|
import edu.cornell.mannlib.vitro.webapp.controller.Controllers;
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.KeywordDao;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.KeywordIndividualRelationDao;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.PropertyInstanceDao;
|
import edu.cornell.mannlib.vitro.webapp.dao.PropertyInstanceDao;
|
||||||
|
|
||||||
public class EntityEditController extends BaseEditController {
|
public class EntityEditController extends BaseEditController {
|
||||||
|
@ -77,11 +73,9 @@ public class EntityEditController extends BaseEditController {
|
||||||
request.setAttribute("entity",ent);
|
request.setAttribute("entity",ent);
|
||||||
|
|
||||||
ArrayList<String> results = new ArrayList<String>();
|
ArrayList<String> results = new ArrayList<String>();
|
||||||
int colCount = 6;
|
int colCount = 4;
|
||||||
results.add("Name");
|
results.add("Name");
|
||||||
results.add("moniker");
|
|
||||||
results.add("class");
|
results.add("class");
|
||||||
results.add("blurb");
|
|
||||||
results.add("display level");
|
results.add("display level");
|
||||||
results.add("edit level");
|
results.add("edit level");
|
||||||
results.add("last updated");
|
results.add("last updated");
|
||||||
|
@ -100,8 +94,6 @@ public class EntityEditController extends BaseEditController {
|
||||||
rName = "[resource]";
|
rName = "[resource]";
|
||||||
}
|
}
|
||||||
results.add(rName);
|
results.add(rName);
|
||||||
String rMoniker = (ent.getMoniker()==null) ? "unspecified" : ent.getMoniker();
|
|
||||||
results.add(rMoniker);
|
|
||||||
|
|
||||||
String classStr = "";
|
String classStr = "";
|
||||||
List<VClass> classList = inferredEnt.getVClasses(false);
|
List<VClass> classList = inferredEnt.getVClasses(false);
|
||||||
|
@ -124,9 +116,6 @@ public class EntityEditController extends BaseEditController {
|
||||||
}
|
}
|
||||||
results.add(classStr);
|
results.add(classStr);
|
||||||
|
|
||||||
String rBlurb = (ent.getBlurb()==null) ? "" : ent.getBlurb();
|
|
||||||
results.add(rBlurb);
|
|
||||||
|
|
||||||
results.add(ent.getHiddenFromDisplayBelowRoleLevel() == null ? "unspecified" : ent.getHiddenFromDisplayBelowRoleLevel().getLabel());
|
results.add(ent.getHiddenFromDisplayBelowRoleLevel() == null ? "unspecified" : ent.getHiddenFromDisplayBelowRoleLevel().getLabel());
|
||||||
results.add(ent.getProhibitedFromUpdateBelowRoleLevel() == null ? "unspecified" : ent.getProhibitedFromUpdateBelowRoleLevel().getLabel());
|
results.add(ent.getProhibitedFromUpdateBelowRoleLevel() == null ? "unspecified" : ent.getProhibitedFromUpdateBelowRoleLevel().getLabel());
|
||||||
|
|
||||||
|
@ -158,10 +147,6 @@ public class EntityEditController extends BaseEditController {
|
||||||
OptionMap.put("externalIds", externalIdOptionList);
|
OptionMap.put("externalIds", externalIdOptionList);
|
||||||
} catch (Exception e) {e.printStackTrace();}
|
} catch (Exception e) {e.printStackTrace();}
|
||||||
|
|
||||||
try {
|
|
||||||
OptionMap.put("ExtraURL", FormUtils.makeOptionListFromBeans(ent.getLinksList(), "URI", "Anchor", null, null, false));
|
|
||||||
} catch (Exception e) {e.printStackTrace();}
|
|
||||||
|
|
||||||
List classGroups = vreq.getFullWebappDaoFactory().getVClassGroupDao().getPublicGroupsWithVClasses(true,true,false); // order by displayRank, include uninstantiated classes, don't count the individuals
|
List classGroups = vreq.getFullWebappDaoFactory().getVClassGroupDao().getPublicGroupsWithVClasses(true,true,false); // order by displayRank, include uninstantiated classes, don't count the individuals
|
||||||
Iterator classGroupIt = classGroups.iterator();
|
Iterator classGroupIt = classGroups.iterator();
|
||||||
ListOrderedMap optGroupMap = new ListOrderedMap();
|
ListOrderedMap optGroupMap = new ListOrderedMap();
|
||||||
|
@ -202,28 +187,6 @@ public class EntityEditController extends BaseEditController {
|
||||||
|
|
||||||
foo.setOptionLists(OptionMap);
|
foo.setOptionLists(OptionMap);
|
||||||
|
|
||||||
List<Option> existingKeywordRelations = new LinkedList();
|
|
||||||
KeywordIndividualRelationDao kirDao = vreq.getFullWebappDaoFactory().getKeys2EntsDao();
|
|
||||||
KeywordDao kDao = vreq.getFullWebappDaoFactory().getKeywordDao();
|
|
||||||
List kirs = kirDao.getKeywordIndividualRelationsByIndividualURI(ent.getURI());
|
|
||||||
if (kirs != null) {
|
|
||||||
Iterator kirIt = kirs.iterator();
|
|
||||||
while (kirIt.hasNext()) {
|
|
||||||
KeywordIndividualRelation kir = (KeywordIndividualRelation) kirIt.next();
|
|
||||||
if (kir.getKeyId() > 0) {
|
|
||||||
Keyword k = kDao.getKeywordById(kir.getKeyId());
|
|
||||||
if (k != null) {
|
|
||||||
Option kOpt = new Option();
|
|
||||||
kOpt.setValue(kir.getURI());
|
|
||||||
kOpt.setBody(k.getTerm()+" ("+kir.getMode()+")");
|
|
||||||
existingKeywordRelations.add(kOpt);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
foo.getOptionLists().put("existingKeywordRelations",existingKeywordRelations);
|
|
||||||
|
|
||||||
epo.setFormObject(foo);
|
epo.setFormObject(foo);
|
||||||
|
|
||||||
RequestDispatcher rd = request.getRequestDispatcher(Controllers.BASIC_JSP);
|
RequestDispatcher rd = request.getRequestDispatcher(Controllers.BASIC_JSP);
|
||||||
|
|
|
@ -172,8 +172,6 @@ public class EntityRetryController extends BaseEditController {
|
||||||
hash.put("VClassURI", optList);
|
hash.put("VClassURI", optList);
|
||||||
}
|
}
|
||||||
|
|
||||||
hash.put("Moniker", getMonikerOptionsList(individualForEditing, ewDao));
|
|
||||||
|
|
||||||
hash.put("HiddenFromDisplayBelowRoleLevelUsingRoleUri",RoleLevelOptionsSetup.getDisplayOptionsList(individualForEditing));
|
hash.put("HiddenFromDisplayBelowRoleLevelUsingRoleUri",RoleLevelOptionsSetup.getDisplayOptionsList(individualForEditing));
|
||||||
hash.put("ProhibitedFromUpdateBelowRoleLevelUsingRoleUri",RoleLevelOptionsSetup.getUpdateOptionsList(individualForEditing));
|
hash.put("ProhibitedFromUpdateBelowRoleLevelUsingRoleUri",RoleLevelOptionsSetup.getUpdateOptionsList(individualForEditing));
|
||||||
|
|
||||||
|
@ -279,20 +277,6 @@ public class EntityRetryController extends BaseEditController {
|
||||||
DateFormat dateOnlyFormat = new SimpleDateFormat("yyyy-MM-dd");
|
DateFormat dateOnlyFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
|
||||||
String html = FormUtils.htmlFormFromBean(individualForEditing,action,epo,foo,epo.getBadValueMap());
|
String html = FormUtils.htmlFormFromBean(individualForEditing,action,epo,foo,epo.getBadValueMap());
|
||||||
if (individualForEditing.getSunrise() != null)
|
|
||||||
foo.getValues().put("Sunrise", dateOnlyFormat.format(individualForEditing.getSunrise()));
|
|
||||||
if (individualForEditing.getSunset() != null)
|
|
||||||
foo.getValues().put("Sunset", minutesOnlyDateFormat.format(individualForEditing.getSunset()));
|
|
||||||
if (individualForEditing.getTimekey() != null)
|
|
||||||
foo.getValues().put("Timekey", minutesOnlyDateFormat.format(individualForEditing.getTimekey()));
|
|
||||||
|
|
||||||
HashMap defaultsHash = new HashMap();
|
|
||||||
if (action.equals("insert")) {
|
|
||||||
Calendar cal = Calendar.getInstance(TimeZone.getDefault());
|
|
||||||
defaultsHash.put("Sunrise", minutesOnlyDateFormat.format(cal.getTime()));
|
|
||||||
defaultsHash.put("Sunset", "9999-12-31");
|
|
||||||
}
|
|
||||||
epo.setDefaultValueMap(defaultsHash);
|
|
||||||
|
|
||||||
List cList = new ArrayList();
|
List cList = new ArrayList();
|
||||||
cList.add(new IndividualDataPropertyStatementProcessor());
|
cList.add(new IndividualDataPropertyStatementProcessor());
|
||||||
|
@ -328,24 +312,6 @@ public class EntityRetryController extends BaseEditController {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Option> getMonikerOptionsList(Individual entity,
|
|
||||||
IndividualDao indDao) {
|
|
||||||
ArrayList<Option> monikerOpts = new ArrayList<Option>();
|
|
||||||
monikerOpts.add(new Option("", "none", (entity.getMoniker() == null)));
|
|
||||||
if (entity.getVClassURI() != null) {
|
|
||||||
List<String> monikers = indDao.monikers(entity.getVClassURI());
|
|
||||||
if (monikers != null) {
|
|
||||||
for (String moniker : monikers) {
|
|
||||||
monikerOpts.add(new Option(
|
|
||||||
moniker, moniker,
|
|
||||||
moniker.equals(entity.getMoniker())));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
monikerOpts.add(new Option("", "[new moniker]"));
|
|
||||||
return monikerOpts;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void doGet (HttpServletRequest request, HttpServletResponse response) {
|
public void doGet (HttpServletRequest request, HttpServletResponse response) {
|
||||||
doPost(request, response);
|
doPost(request, response);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,199 +0,0 @@
|
||||||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
|
||||||
|
|
||||||
package edu.cornell.mannlib.vitro.webapp.controller.edit;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.servlet.RequestDispatcher;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
|
||||||
import org.apache.commons.logging.LogFactory;
|
|
||||||
|
|
||||||
import edu.cornell.mannlib.vedit.beans.EditProcessObject;
|
|
||||||
import edu.cornell.mannlib.vedit.beans.FormObject;
|
|
||||||
import edu.cornell.mannlib.vedit.beans.Option;
|
|
||||||
import edu.cornell.mannlib.vedit.controller.BaseEditController;
|
|
||||||
import edu.cornell.mannlib.vedit.util.FormUtils;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.Actions;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.usepages.EditIndividuals;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Keyword;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.KeywordIndividualRelation;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.Controllers;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.KeywordDao;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.KeywordIndividualRelationDao;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.edit.listener.impl.KeywordSearchReindexer;
|
|
||||||
|
|
||||||
public class Keys2EntsRetryController extends BaseEditController {
|
|
||||||
|
|
||||||
private static final Log log = LogFactory.getLog(Keys2EntsRetryController.class.getName());
|
|
||||||
|
|
||||||
public void doPost (HttpServletRequest req, HttpServletResponse response) {
|
|
||||||
if (!isAuthorizedToDisplayPage(req, response, new Actions(new EditIndividuals()))) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
VitroRequest request = new VitroRequest(req);
|
|
||||||
|
|
||||||
//create an EditProcessObject for this and put it in the session
|
|
||||||
EditProcessObject epo = super.createEpo(request);
|
|
||||||
|
|
||||||
boolean isDashboardForm=false;
|
|
||||||
String action = "insert";
|
|
||||||
if ("dashboardDelete".equals(request.getParameter("action"))){
|
|
||||||
action = "delete"; // will change -- ignore for now
|
|
||||||
isDashboardForm=true;
|
|
||||||
} else if ("dashboardInsert".equals(request.getParameter("action"))){
|
|
||||||
isDashboardForm=true;
|
|
||||||
}
|
|
||||||
|
|
||||||
KeywordIndividualRelationDao k2eDao = request.getFullWebappDaoFactory().getKeys2EntsDao();
|
|
||||||
epo.setDataAccessObject(k2eDao);
|
|
||||||
KeywordDao kDao = request.getFullWebappDaoFactory().getKeywordDao();
|
|
||||||
IndividualDao eDao = request.getFullWebappDaoFactory().getIndividualDao();
|
|
||||||
|
|
||||||
KeywordIndividualRelation objectForEditing = new KeywordIndividualRelation();
|
|
||||||
|
|
||||||
String uri = request.getParameter("uri");
|
|
||||||
if (uri != null) {
|
|
||||||
try {
|
|
||||||
objectForEditing = k2eDao.getKeywordIndividualRelationByURI(uri);
|
|
||||||
action = "update";
|
|
||||||
} catch (NullPointerException e) {
|
|
||||||
log.error("Could not find KeywordIndividualRelation "+uri);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
String individualURI = request.getParameter("individualURI");
|
|
||||||
Individual ent = null;
|
|
||||||
|
|
||||||
HashMap<String,List<Option>> optionMap = new HashMap<String,List<Option>>();
|
|
||||||
List<Option> entList = new LinkedList<Option>();
|
|
||||||
Option entOpt = null;
|
|
||||||
if (individualURI != null) {
|
|
||||||
objectForEditing.setEntURI(individualURI);
|
|
||||||
ent = eDao.getIndividualByURI(objectForEditing.getEntURI());
|
|
||||||
if (ent==null) {
|
|
||||||
log.error("cannot find entity via URI '"+individualURI+"'");
|
|
||||||
throw new Error("cannot find entity via URI '"+individualURI+"' in Keys2EntsRetryController");
|
|
||||||
}
|
|
||||||
entOpt = new Option(ent.getURI(),ent.getName(),true);
|
|
||||||
} else {
|
|
||||||
entOpt = new Option("-1", "Error: the entity must be specified", false);
|
|
||||||
}
|
|
||||||
entList.add(entOpt);
|
|
||||||
optionMap.put("EntId",entList);
|
|
||||||
|
|
||||||
/*
|
|
||||||
List<KeywordIndividualRelation> k2iList = null;
|
|
||||||
if (action.equals("remove")){
|
|
||||||
k2iList = k2eDao.getKeywordIndividualRelationsByIndividualURI(individualURI);
|
|
||||||
} */
|
|
||||||
|
|
||||||
epo.setOriginalBean(objectForEditing);
|
|
||||||
|
|
||||||
populateBeanFromParams(objectForEditing, request);
|
|
||||||
|
|
||||||
//set up any listeners
|
|
||||||
List changeListenerList = new LinkedList();
|
|
||||||
changeListenerList.add(new KeywordSearchReindexer());
|
|
||||||
epo.setChangeListenerList(changeListenerList);
|
|
||||||
|
|
||||||
|
|
||||||
//set the getMethod so we can retrieve a new bean after we've inserted it
|
|
||||||
try {
|
|
||||||
Class[] args = new Class[1];
|
|
||||||
args[0] = String.class;
|
|
||||||
epo.setGetMethod(k2eDao.getClass().getDeclaredMethod("getKeywordIndividualRelationByURI",args));
|
|
||||||
} catch (NoSuchMethodException e) {
|
|
||||||
log.error("Keys2EntsRetryController could not find the getKeywordIndividualRelationByURI method");
|
|
||||||
}
|
|
||||||
|
|
||||||
FormObject foo = new FormObject();
|
|
||||||
|
|
||||||
if (isDashboardForm && action.equals("delete")) {
|
|
||||||
List<Option> existingKeywordRelations = new LinkedList();
|
|
||||||
KeywordIndividualRelationDao kirDao = request.getFullWebappDaoFactory().getKeys2EntsDao();
|
|
||||||
List kirs = kirDao.getKeywordIndividualRelationsByIndividualURI(ent.getURI());
|
|
||||||
if (kirs != null) {
|
|
||||||
Iterator kirIt = kirs.iterator();
|
|
||||||
while (kirIt.hasNext()) {
|
|
||||||
KeywordIndividualRelation kir = (KeywordIndividualRelation) kirIt.next();
|
|
||||||
if (kir.getKeyId() > 0) {
|
|
||||||
Keyword k = kDao.getKeywordById(kir.getKeyId());
|
|
||||||
if (k != null) {
|
|
||||||
Option kOpt = new Option();
|
|
||||||
kOpt.setValue(kir.getURI());
|
|
||||||
kOpt.setBody(k.getTerm()+" ("+kir.getMode()+")");
|
|
||||||
existingKeywordRelations.add(kOpt);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//foo.getOptionLists().put("existingKeywordRelations",existingKeywordRelations);
|
|
||||||
optionMap.put("KeyId",existingKeywordRelations);
|
|
||||||
//optionMap.put("KeyId",FormUtils.makeOptionListFromBeans((List)ent.getKeywordObjects(), "Id", "Term", Integer.toString(objectForEditing.getKeyId()), null));
|
|
||||||
action = "update"; //reset for processing
|
|
||||||
} else {
|
|
||||||
optionMap.put("KeyId",FormUtils.makeOptionListFromBeans((List)kDao.getAllKeywords(), "Id", "Term", Integer.toString(objectForEditing.getKeyId()), null));
|
|
||||||
}
|
|
||||||
|
|
||||||
List modeOptionList = new LinkedList();
|
|
||||||
String VISIBLE = "visible";
|
|
||||||
Option visibleOption = new Option(VISIBLE);
|
|
||||||
if (isDashboardForm){
|
|
||||||
visibleOption.setSelected(true);
|
|
||||||
} else {
|
|
||||||
String HIDDEN = "hidden";
|
|
||||||
Option hiddenOption = new Option(HIDDEN);
|
|
||||||
if (objectForEditing.getMode().equalsIgnoreCase(HIDDEN)) {
|
|
||||||
hiddenOption.setSelected(true);
|
|
||||||
} else /*if (objectForEditing.getMode().equalsIgnoreCase(VISIBLE))*/ { //make this the default
|
|
||||||
visibleOption.setSelected(true);
|
|
||||||
}
|
|
||||||
modeOptionList.add(hiddenOption);
|
|
||||||
}
|
|
||||||
modeOptionList.add(visibleOption);
|
|
||||||
optionMap.put("Mode", modeOptionList);
|
|
||||||
|
|
||||||
foo.setOptionLists(optionMap);
|
|
||||||
epo.setFormObject(foo);
|
|
||||||
|
|
||||||
String html = FormUtils.htmlFormFromBean(objectForEditing,action,foo);
|
|
||||||
|
|
||||||
RequestDispatcher rd = request.getRequestDispatcher(Controllers.BASIC_JSP);
|
|
||||||
request.setAttribute("formHtml",html);
|
|
||||||
request.setAttribute("bodyJsp","/templates/edit/formBasic.jsp");
|
|
||||||
if (isDashboardForm) {
|
|
||||||
request.setAttribute("formJsp","/templates/edit/specific/keys2ents_dashboard_retry.jsp");
|
|
||||||
} else {
|
|
||||||
request.setAttribute("formJsp","/templates/edit/specific/keys2ents_retry.jsp");
|
|
||||||
}
|
|
||||||
request.setAttribute("scripts","/templates/edit/formBasic.js");
|
|
||||||
request.setAttribute("title","Individual-Keyword Link Editing Form");
|
|
||||||
request.setAttribute("_action",action);
|
|
||||||
request.setAttribute("unqualifiedClassName","Keys2Ents");
|
|
||||||
setRequestAttributes(request,epo);
|
|
||||||
|
|
||||||
try {
|
|
||||||
rd.forward(request, response);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("Keys2EntsRetryController could not forward to view.");
|
|
||||||
log.error(e.getMessage());
|
|
||||||
log.error(e.getStackTrace());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void doGet (HttpServletRequest request, HttpServletResponse response) {
|
|
||||||
doPost(request, response);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,67 +0,0 @@
|
||||||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
|
||||||
|
|
||||||
package edu.cornell.mannlib.vitro.webapp.controller.edit;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
import javax.servlet.RequestDispatcher;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
|
||||||
import org.apache.commons.logging.LogFactory;
|
|
||||||
|
|
||||||
import edu.cornell.mannlib.vedit.beans.EditProcessObject;
|
|
||||||
import edu.cornell.mannlib.vedit.beans.FormObject;
|
|
||||||
import edu.cornell.mannlib.vedit.controller.BaseEditController;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.Actions;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.usepages.EditIndividuals;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Keyword;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.Controllers;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
|
||||||
|
|
||||||
public class KeywordEditController extends BaseEditController {
|
|
||||||
|
|
||||||
private static final Log log = LogFactory.getLog(KeywordEditController.class.getName());
|
|
||||||
|
|
||||||
public void doPost (HttpServletRequest request, HttpServletResponse response) {
|
|
||||||
if (!isAuthorizedToDisplayPage(request, response, new Actions(new EditIndividuals()))) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
VitroRequest vreq = new VitroRequest(request);
|
|
||||||
// we need to extract the keyword id from a Fetch parameter
|
|
||||||
String linkwhereId = request.getParameter("linkwhere");
|
|
||||||
String theKeywordId = linkwhereId.substring(15,linkwhereId.length()-1);
|
|
||||||
int kwId = Integer.decode(theKeywordId);
|
|
||||||
|
|
||||||
Keyword k = vreq.getFullWebappDaoFactory().getKeywordDao().getKeywordById(kwId);
|
|
||||||
|
|
||||||
EditProcessObject epo = super.createEpo(request);
|
|
||||||
FormObject foo = new FormObject();
|
|
||||||
HashMap OptionMap = new HashMap();
|
|
||||||
foo.setOptionLists(OptionMap);
|
|
||||||
epo.setFormObject(foo);
|
|
||||||
|
|
||||||
RequestDispatcher rd = request.getRequestDispatcher(Controllers.BASIC_JSP);
|
|
||||||
request.setAttribute("epoKey",epo.getKey());
|
|
||||||
request.setAttribute("keyword", k);
|
|
||||||
request.setAttribute("bodyJsp","/templates/edit/specific/keyterms_edit.jsp");
|
|
||||||
request.setAttribute("title","Keyword Control Panel");
|
|
||||||
request.setAttribute("css", "<link rel=\"stylesheet\" type=\"text/css\" href=\""+vreq.getAppBean().getThemeDir()+"css/edit.css\"/>");
|
|
||||||
|
|
||||||
try {
|
|
||||||
rd.forward(request, response);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("KeywordEditController could not forward to view.");
|
|
||||||
log.error(e.getMessage());
|
|
||||||
log.error(e.getStackTrace());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void doGet (HttpServletRequest request, HttpServletResponse response) {
|
|
||||||
doPost(request,response);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,204 +0,0 @@
|
||||||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
|
||||||
|
|
||||||
package edu.cornell.mannlib.vitro.webapp.controller.edit;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.servlet.RequestDispatcher;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
|
||||||
import org.apache.commons.logging.LogFactory;
|
|
||||||
|
|
||||||
import edu.cornell.mannlib.vedit.beans.EditProcessObject;
|
|
||||||
import edu.cornell.mannlib.vedit.beans.FormObject;
|
|
||||||
import edu.cornell.mannlib.vedit.beans.Option;
|
|
||||||
import edu.cornell.mannlib.vedit.controller.BaseEditController;
|
|
||||||
import edu.cornell.mannlib.vedit.listener.ChangeListener;
|
|
||||||
import edu.cornell.mannlib.vedit.util.FormUtils;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.Actions;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.usepages.EditIndividuals;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Keyword;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.KeywordIndividualRelation;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.Controllers;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.KeywordDao;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.KeywordIndividualRelationDao;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.edit.listener.impl.KeywordSearchReindexer;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.edit.validator.impl.KeywordStemmerAndValidator;
|
|
||||||
|
|
||||||
public class KeywordRetryController extends BaseEditController {
|
|
||||||
|
|
||||||
private static final Log log = LogFactory.getLog(KeywordRetryController.class.getName());
|
|
||||||
|
|
||||||
public void doPost (HttpServletRequest req, HttpServletResponse response) {
|
|
||||||
if (!isAuthorizedToDisplayPage(req, response, new Actions(new EditIndividuals()))) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
VitroRequest request = new VitroRequest(req);
|
|
||||||
|
|
||||||
//create an EditProcessObject for this and put it in the session
|
|
||||||
EditProcessObject epo = super.createEpo(request);
|
|
||||||
|
|
||||||
/*for testing*/
|
|
||||||
Keyword testMask = new Keyword();
|
|
||||||
epo.setBeanClass(Keyword.class);
|
|
||||||
epo.setBeanMask(testMask);
|
|
||||||
|
|
||||||
KeywordDao kDao = request.getFullWebappDaoFactory().getKeywordDao();
|
|
||||||
epo.setDataAccessObject(kDao);
|
|
||||||
epo.getAdditionalDaoMap().put("KeywordIndividualRelationDao", request.getFullWebappDaoFactory().getKeys2EntsDao());
|
|
||||||
|
|
||||||
String action="insert";
|
|
||||||
|
|
||||||
Keyword keywordForEditing = null;
|
|
||||||
if (!epo.getUseRecycledBean()){
|
|
||||||
if (request.getParameter("id") != null) {
|
|
||||||
int id = Integer.parseInt(request.getParameter("id"));
|
|
||||||
if (id > 0) {
|
|
||||||
try {
|
|
||||||
keywordForEditing = kDao.getKeywordById(id);
|
|
||||||
action = "update";
|
|
||||||
} catch (NullPointerException e) {
|
|
||||||
log.error("Need to implement 'record not found' error message.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
keywordForEditing = new Keyword();
|
|
||||||
keywordForEditing.setType("keyword");
|
|
||||||
keywordForEditing.setOrigin("unspecified"); // may be reset below
|
|
||||||
keywordForEditing.setSource("unspecified"); // may be reset below
|
|
||||||
}
|
|
||||||
epo.setOriginalBean(keywordForEditing);
|
|
||||||
} else {
|
|
||||||
keywordForEditing = (Keyword) epo.getNewBean();
|
|
||||||
keywordForEditing.setType("keyword");
|
|
||||||
keywordForEditing.setOrigin("unspecified"); // may be reset below
|
|
||||||
keywordForEditing.setSource("unspecified"); // may be reset below
|
|
||||||
}
|
|
||||||
|
|
||||||
//make a simple mask for the class's id
|
|
||||||
Object[] simpleMaskPair = new Object[2];
|
|
||||||
simpleMaskPair[0]="Id";
|
|
||||||
simpleMaskPair[1]=Integer.valueOf(keywordForEditing.getId());
|
|
||||||
epo.getSimpleMask().add(simpleMaskPair);
|
|
||||||
|
|
||||||
//set up any validators
|
|
||||||
LinkedList lnList = new LinkedList();
|
|
||||||
lnList.add(new KeywordStemmerAndValidator(epo,kDao));
|
|
||||||
epo.getValidatorMap().put("Term",lnList);
|
|
||||||
|
|
||||||
//set up any listeners
|
|
||||||
String entityURI = request.getParameter("individualURI");
|
|
||||||
if (entityURI != null && request.getParameter("mode") != null) {
|
|
||||||
List listenerList = new LinkedList();
|
|
||||||
listenerList.add(new newKeywordToEntityLinker(entityURI, request.getParameter("mode")));
|
|
||||||
listenerList.add(new KeywordSearchReindexer());
|
|
||||||
epo.setChangeListenerList(listenerList);
|
|
||||||
}
|
|
||||||
|
|
||||||
//set the getMethod so we can retrieve a new bean after we've inserted it
|
|
||||||
try {
|
|
||||||
Class[] args = new Class[1];
|
|
||||||
args[0] = int.class;
|
|
||||||
epo.setGetMethod(kDao.getClass().getDeclaredMethod("getKeywordById",args));
|
|
||||||
} catch (NoSuchMethodException e) {
|
|
||||||
log.error("KeywordRetryController could not find the getKeywordById method");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
FormObject foo = new FormObject();
|
|
||||||
|
|
||||||
boolean useShortForm=false;
|
|
||||||
if ("dashboardCreate".equals(request.getParameter("action"))) {
|
|
||||||
keywordForEditing.setOrigin("user-added");
|
|
||||||
keywordForEditing.setSource("user-added");
|
|
||||||
useShortForm=true;
|
|
||||||
} else if ("editorCreate".equals(request.getParameter("action"))) {
|
|
||||||
keywordForEditing.setOrigin("curator-added");
|
|
||||||
keywordForEditing.setSource("curator-added");
|
|
||||||
useShortForm=true;
|
|
||||||
} else {
|
|
||||||
HashMap OptionMap = new HashMap();
|
|
||||||
List originsList = kDao.getAllOrigins();
|
|
||||||
List originsOptList = new LinkedList();
|
|
||||||
originsOptList.add(new Option("","[new origin]",false));
|
|
||||||
Iterator originsIt = originsList.iterator();
|
|
||||||
while (originsIt.hasNext()) {
|
|
||||||
String optStr = (String)originsIt.next();
|
|
||||||
boolean selected = (keywordForEditing.getOrigin()==null) ? false : keywordForEditing.getOrigin().equals(optStr);
|
|
||||||
Option opt = new Option(optStr, optStr, selected);
|
|
||||||
originsOptList.add(opt);
|
|
||||||
}
|
|
||||||
OptionMap.put("Origin", originsOptList);
|
|
||||||
foo.setOptionLists(OptionMap);
|
|
||||||
}
|
|
||||||
|
|
||||||
foo.setErrorMap(epo.getErrMsgMap());
|
|
||||||
|
|
||||||
epo.setFormObject(foo);
|
|
||||||
|
|
||||||
String html = FormUtils.htmlFormFromBean(keywordForEditing,action,foo,epo.getBadValueMap());
|
|
||||||
|
|
||||||
RequestDispatcher rd = request.getRequestDispatcher(Controllers.BASIC_JSP);
|
|
||||||
request.setAttribute("formHtml",html);
|
|
||||||
request.setAttribute("bodyJsp","/templates/edit/formBasic.jsp");
|
|
||||||
if (useShortForm) {
|
|
||||||
request.setAttribute("formJsp","/templates/edit/specific/keyterms_dashboard_retry.jsp");
|
|
||||||
} else {
|
|
||||||
request.setAttribute("formJsp","/templates/edit/specific/keyterms_retry.jsp");
|
|
||||||
}
|
|
||||||
request.setAttribute("scripts","/templates/edit/formBasic.js");
|
|
||||||
request.setAttribute("title","Keyword Editing Form");
|
|
||||||
request.setAttribute("_action",action);
|
|
||||||
request.setAttribute("unqualifiedClassName","Keyword");
|
|
||||||
setRequestAttributes(request,epo);
|
|
||||||
|
|
||||||
try {
|
|
||||||
rd.forward(request, response);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("KeywordRetryController could not forward to view.");
|
|
||||||
log.error(e.getMessage());
|
|
||||||
log.error(e.getStackTrace());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void doGet (HttpServletRequest request, HttpServletResponse response) {
|
|
||||||
doPost(request, response);
|
|
||||||
}
|
|
||||||
|
|
||||||
public class newKeywordToEntityLinker implements ChangeListener {
|
|
||||||
// should be a better way to do this
|
|
||||||
// cascading deletes should be implemented differently
|
|
||||||
String entityURI = null;
|
|
||||||
String mode = "hidden";
|
|
||||||
private newKeywordToEntityLinker(String entityURI, String mode) {
|
|
||||||
this.entityURI = entityURI;
|
|
||||||
this.mode = mode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void doInserted(Object newObj, EditProcessObject epo) {
|
|
||||||
Keyword k = (Keyword) newObj;
|
|
||||||
KeywordIndividualRelation k2e = new KeywordIndividualRelation();
|
|
||||||
k2e.setKeyId(k.getId());
|
|
||||||
k2e.setEntURI(entityURI);
|
|
||||||
k2e.setMode(mode);
|
|
||||||
((KeywordIndividualRelationDao)epo.getAdditionalDaoMap().get("KeywordIndividualRelationDao")).insertNewKeywordIndividualRelation(k2e);
|
|
||||||
}
|
|
||||||
public void doUpdated(Object oldObj, Object newObj, EditProcessObject epo) {
|
|
||||||
// nothing required
|
|
||||||
}
|
|
||||||
public void doDeleted(Object oldObj, EditProcessObject epo) {
|
|
||||||
// nothing required
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,146 +0,0 @@
|
||||||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
|
||||||
|
|
||||||
package edu.cornell.mannlib.vitro.webapp.controller.edit;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.servlet.RequestDispatcher;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
|
||||||
import org.apache.commons.logging.LogFactory;
|
|
||||||
|
|
||||||
import edu.cornell.mannlib.vedit.beans.EditProcessObject;
|
|
||||||
import edu.cornell.mannlib.vedit.beans.FormObject;
|
|
||||||
import edu.cornell.mannlib.vedit.beans.Option;
|
|
||||||
import edu.cornell.mannlib.vedit.controller.BaseEditController;
|
|
||||||
import edu.cornell.mannlib.vedit.util.FormUtils;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.Actions;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.usepages.EditIndividuals;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Link;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.Controllers;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.LinksDao;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.LinktypeDao;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
|
|
||||||
|
|
||||||
public class LinkRetryController extends BaseEditController {
|
|
||||||
|
|
||||||
private static final Log log = LogFactory.getLog(LinkRetryController.class.getName());
|
|
||||||
|
|
||||||
public void doPost (HttpServletRequest req, HttpServletResponse response) {
|
|
||||||
if (!isAuthorizedToDisplayPage(req, response, new Actions(new EditIndividuals()))) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
VitroRequest request = new VitroRequest(req);
|
|
||||||
|
|
||||||
//create an EditProcessObject for this and put it in the session
|
|
||||||
EditProcessObject epo = super.createEpo(request);
|
|
||||||
request.setAttribute("epo",epo);
|
|
||||||
|
|
||||||
/*for testing*/
|
|
||||||
Link testMask = new Link();
|
|
||||||
epo.setBeanClass(Link.class);
|
|
||||||
epo.setBeanMask(testMask);
|
|
||||||
|
|
||||||
String action = "insert";
|
|
||||||
|
|
||||||
WebappDaoFactory wadf = (request.getAssertionsWebappDaoFactory() != null)
|
|
||||||
? request.getAssertionsWebappDaoFactory()
|
|
||||||
: request.getFullWebappDaoFactory();
|
|
||||||
|
|
||||||
LinksDao lDao = wadf.getLinksDao();
|
|
||||||
epo.setDataAccessObject(lDao);
|
|
||||||
LinktypeDao ltDao = wadf.getLinktypeDao();
|
|
||||||
IndividualDao eDao = wadf.getIndividualDao();
|
|
||||||
|
|
||||||
Link linkForEditing = null;
|
|
||||||
if (!epo.getUseRecycledBean()){
|
|
||||||
String linkUri = request.getParameter("uri");
|
|
||||||
if (linkUri != null) {
|
|
||||||
try {
|
|
||||||
linkForEditing = lDao.getLinkByURI(linkUri);
|
|
||||||
action = "update";
|
|
||||||
} catch (NullPointerException e) {
|
|
||||||
log.error("Need to implement 'record not found' error message.");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
linkForEditing = new Link();
|
|
||||||
if (request.getParameter("entityUri") != null) {
|
|
||||||
try {
|
|
||||||
linkForEditing.setEntityURI(request.getParameter("entityUri"));
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
// oh well; it was worth a shot
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
epo.setOriginalBean(linkForEditing);
|
|
||||||
} else {
|
|
||||||
linkForEditing = (Link) epo.getNewBean();
|
|
||||||
action = "update";
|
|
||||||
log.error("using newBean");
|
|
||||||
}
|
|
||||||
|
|
||||||
//set up any listeners
|
|
||||||
|
|
||||||
//set the getMethod so we can retrieve a new bean after we've inserted it
|
|
||||||
try {
|
|
||||||
Class[] args = new Class[1];
|
|
||||||
args[0] = int.class;
|
|
||||||
epo.setGetMethod(lDao.getClass().getDeclaredMethod("getLinkById",args));
|
|
||||||
} catch (NoSuchMethodException e) {
|
|
||||||
log.error("LinkRetryController could not find the namespaceById method in the facade");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
FormObject foo = new FormObject();
|
|
||||||
HashMap OptionMap = new HashMap();
|
|
||||||
List entityList = new LinkedList();
|
|
||||||
if (linkForEditing.getEntityURI() != null) {
|
|
||||||
Individual theEnt = eDao.getIndividualByURI(linkForEditing.getEntityURI());
|
|
||||||
entityList.add(new Option(theEnt.getURI(),theEnt.getName(),true));
|
|
||||||
} else {
|
|
||||||
entityList.add(new Option ("", "Error: the entity must be specified", true));
|
|
||||||
}
|
|
||||||
OptionMap.put("EntityId",entityList);
|
|
||||||
List linkTypeOptList = FormUtils.makeOptionListFromBeans(ltDao.getAllLinktypes(), "URI", "Type", linkForEditing.getTypeURI(),"");
|
|
||||||
linkTypeOptList.add(0,new Option("","unspecified"));
|
|
||||||
OptionMap.put("TypeURI", linkTypeOptList);
|
|
||||||
foo.setOptionLists(OptionMap);
|
|
||||||
foo.setErrorMap(epo.getErrMsgMap());
|
|
||||||
|
|
||||||
epo.setFormObject(foo);
|
|
||||||
|
|
||||||
String html = FormUtils.htmlFormFromBean(linkForEditing,action,foo,epo.getBadValueMap());
|
|
||||||
|
|
||||||
RequestDispatcher rd = request.getRequestDispatcher(Controllers.BASIC_JSP);
|
|
||||||
request.setAttribute("formHtml",html);
|
|
||||||
request.setAttribute("bodyJsp","/templates/edit/formBasic.jsp");
|
|
||||||
request.setAttribute("formJsp","/templates/edit/specific/links_retry.jsp");
|
|
||||||
request.setAttribute("scripts","/templates/edit/formBasic.js");
|
|
||||||
request.setAttribute("title","Hyperlink Editing Form");
|
|
||||||
request.setAttribute("_action",action);
|
|
||||||
request.setAttribute("unqualifiedClassName","Link");
|
|
||||||
setRequestAttributes(request,epo);
|
|
||||||
|
|
||||||
try {
|
|
||||||
rd.forward(request, response);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("NamespaceRetryController could not forward to view.");
|
|
||||||
log.error(e.getMessage());
|
|
||||||
log.error(e.getStackTrace());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void doGet (HttpServletRequest request, HttpServletResponse response) {
|
|
||||||
doPost(request, response);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -54,10 +54,21 @@ public class ObjectPropertyStatementRetryController extends BaseEditController {
|
||||||
Class[] classarray = {PropertyInstanceIface.class};
|
Class[] classarray = {PropertyInstanceIface.class};
|
||||||
try {
|
try {
|
||||||
epo.setInsertMethod(PropertyInstanceDao.class.getMethod("insertProp", classarray));
|
epo.setInsertMethod(PropertyInstanceDao.class.getMethod("insertProp", classarray));
|
||||||
|
epo.setUpdateMethod(epo.getInsertMethod());
|
||||||
} catch (NoSuchMethodException nsme) {
|
} catch (NoSuchMethodException nsme) {
|
||||||
log.error("Unable to find "+PropertyInstanceDao.class.getName()+".insertProp("+PropertyInstanceIface.class.getName()+")");
|
log.error("Unable to find "+PropertyInstanceDao.class.getName()+".insertProp("+PropertyInstanceIface.class.getName()+")");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
epo.setDeleteMethod(
|
||||||
|
PropertyInstanceDao.class.getMethod(
|
||||||
|
"deletePropertyInstance", classarray));
|
||||||
|
} catch(NoSuchMethodException nsme) {
|
||||||
|
log.error("Unable to find "+PropertyInstanceDao.class.getName()+
|
||||||
|
".deletePropertyInstance("+
|
||||||
|
PropertyInstanceIface.class.getName()+")");
|
||||||
|
}
|
||||||
|
|
||||||
String action = "insert";
|
String action = "insert";
|
||||||
|
|
||||||
PropertyInstanceDao piDao = vreq.getFullWebappDaoFactory().getPropertyInstanceDao();
|
PropertyInstanceDao piDao = vreq.getFullWebappDaoFactory().getPropertyInstanceDao();
|
||||||
|
|
|
@ -61,7 +61,6 @@ public class IndividualsListingController extends BaseEditController {
|
||||||
results.add("XX");
|
results.add("XX");
|
||||||
results.add("Individual");
|
results.add("Individual");
|
||||||
results.add("class");
|
results.add("class");
|
||||||
results.add("moniker");
|
|
||||||
|
|
||||||
if (inds != null && inds.size()>0) {
|
if (inds != null && inds.size()>0) {
|
||||||
Iterator indsIt = inds.iterator();
|
Iterator indsIt = inds.iterator();
|
||||||
|
@ -93,9 +92,6 @@ public class IndividualsListingController extends BaseEditController {
|
||||||
results.add(vclassURI);
|
results.add(vclassURI);
|
||||||
}
|
}
|
||||||
|
|
||||||
String monikerStr = (ind.getMoniker() != null) ? ind.getMoniker() : "unspecified";
|
|
||||||
results.add(monikerStr);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
results.add("XX");
|
results.add("XX");
|
||||||
|
@ -104,13 +100,10 @@ public class IndividualsListingController extends BaseEditController {
|
||||||
|
|
||||||
request.setAttribute("results",results);
|
request.setAttribute("results",results);
|
||||||
|
|
||||||
request.setAttribute("columncount",new Integer(4));
|
request.setAttribute("columncount",new Integer(3));
|
||||||
request.setAttribute("suppressquery","true");
|
request.setAttribute("suppressquery","true");
|
||||||
request.setAttribute("title", "Individuals in Class "+ ( (vc != null) ? vc.getName() : vclassURI ) );
|
request.setAttribute("title", "Individuals in Class "+ ( (vc != null) ? vc.getName() : vclassURI ) );
|
||||||
request.setAttribute("bodyJsp", Controllers.HORIZONTAL_JSP);
|
request.setAttribute("bodyJsp", Controllers.HORIZONTAL_JSP);
|
||||||
// request.setAttribute("horizontalJspAddButtonUrl", Controllers.RETRY_URL);
|
|
||||||
// request.setAttribute("horizontalJspAddButtonText", "Add new individual");
|
|
||||||
// request.setAttribute("horizontalJspAddButtonControllerParam", "Individual");
|
|
||||||
|
|
||||||
// new individual button
|
// new individual button
|
||||||
List <ButtonForm> buttons = new ArrayList<ButtonForm>();
|
List <ButtonForm> buttons = new ArrayList<ButtonForm>();
|
||||||
|
|
|
@ -111,7 +111,7 @@ public class IndividualController extends FreemarkerHttpServlet {
|
||||||
return doHelp();
|
return doHelp();
|
||||||
}
|
}
|
||||||
|
|
||||||
if( individual == null || checkForHidden(vreq, individual) || checkForSunset(vreq, individual)){
|
if( individual == null ){
|
||||||
return doNotFound(vreq);
|
return doNotFound(vreq);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -255,7 +255,6 @@ public class IndividualController extends FreemarkerHttpServlet {
|
||||||
|
|
||||||
IndividualDao iwDao = vreq.getWebappDaoFactory().getIndividualDao();
|
IndividualDao iwDao = vreq.getWebappDaoFactory().getIndividualDao();
|
||||||
|
|
||||||
individual.setKeywords(iwDao.getKeywordsForIndividualByMode(individual.getURI(),"visible"));
|
|
||||||
individual.sortForDisplay();
|
individual.sortForDisplay();
|
||||||
|
|
||||||
return new IndividualTemplateModel(individual, vreq);
|
return new IndividualTemplateModel(individual, vreq);
|
||||||
|
@ -583,18 +582,6 @@ public class IndividualController extends FreemarkerHttpServlet {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private boolean checkForSunset(VitroRequest vreq, Individual entity) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private boolean checkForHidden(VitroRequest vreq, Individual entity){
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If this entity represents a File Bytestream, get its alias URL so we can
|
* If this entity represents a File Bytestream, get its alias URL so we can
|
||||||
* properly serve the file contents.
|
* properly serve the file contents.
|
||||||
|
|
|
@ -146,7 +146,9 @@ public class RDFUploadController extends BaseEditController {
|
||||||
OntModel tboxChangeModel=null;
|
OntModel tboxChangeModel=null;
|
||||||
Model aboxChangeModel=null;
|
Model aboxChangeModel=null;
|
||||||
if (tboxModel != null) {
|
if (tboxModel != null) {
|
||||||
tboxChangeModel = xutil.extractTBox(uploadModel);
|
boolean AGGRESSIVE = true;
|
||||||
|
tboxChangeModel = xutil.extractTBox(uploadModel, AGGRESSIVE);
|
||||||
|
// aggressively seek all statements that are part of the TBox
|
||||||
tboxstmtCount = operateOnModel(
|
tboxstmtCount = operateOnModel(
|
||||||
request.getFullWebappDaoFactory(),
|
request.getFullWebappDaoFactory(),
|
||||||
tboxModel,tboxChangeModel,
|
tboxModel,tboxChangeModel,
|
||||||
|
|
|
@ -107,19 +107,6 @@ public interface IndividualDao extends ObjectSourceIface {
|
||||||
|
|
||||||
void fillVClassForIndividual(Individual individual);
|
void fillVClassForIndividual(Individual individual);
|
||||||
|
|
||||||
List<String> monikers(String vclassURI);
|
|
||||||
|
|
||||||
List<String> getKeywordsForIndividual(String individualURI);
|
|
||||||
|
|
||||||
List<String> getKeywordsForIndividualByMode(String individualURI,
|
|
||||||
String modeStr);
|
|
||||||
|
|
||||||
List<Keyword> getKeywordObjectsForIndividual(String individualURI);
|
|
||||||
|
|
||||||
String getNetId(String entityURI);
|
|
||||||
|
|
||||||
String getStatus(String entityURI);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Standard way to get a new URI that is not yet used.
|
* Standard way to get a new URI that is not yet used.
|
||||||
* @param individual, may be null
|
* @param individual, may be null
|
||||||
|
@ -130,12 +117,4 @@ public interface IndividualDao extends ObjectSourceIface {
|
||||||
|
|
||||||
EditLiteral getLabelEditLiteral(String individualUri);
|
EditLiteral getLabelEditLiteral(String individualUri);
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public abstract Individual getIndividualByExternalId(int externalIdType,
|
|
||||||
String externalIdValue);
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
Individual getIndividualByExternalId(int externalIdType,
|
|
||||||
String externalIdValue,
|
|
||||||
String vClassURI);
|
|
||||||
}
|
}
|
|
@ -1,30 +0,0 @@
|
||||||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
|
||||||
|
|
||||||
package edu.cornell.mannlib.vitro.webapp.dao;
|
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Keyword;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by IntelliJ IDEA.
|
|
||||||
* User: bdc34
|
|
||||||
* Date: Apr 18, 2007
|
|
||||||
* Time: 3:18:29 PM
|
|
||||||
* To change this template use File | Settings | File Templates.
|
|
||||||
*/
|
|
||||||
public interface KeywordDao {
|
|
||||||
Keyword getKeywordById(int id);
|
|
||||||
|
|
||||||
List<Keyword> getAllKeywords();
|
|
||||||
|
|
||||||
List<Keyword> getKeywordsByStem(String stem);
|
|
||||||
|
|
||||||
int insertNewKeyword(Keyword k);
|
|
||||||
|
|
||||||
void updateKeyword(Keyword k);
|
|
||||||
|
|
||||||
void deleteKeyword(Keyword keyword);
|
|
||||||
|
|
||||||
List /*String*/ getAllOrigins();
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
|
||||||
|
|
||||||
package edu.cornell.mannlib.vitro.webapp.dao;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.KeywordIndividualRelation;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by IntelliJ IDEA.
|
|
||||||
* User: bdc34
|
|
||||||
* Date: Apr 18, 2007
|
|
||||||
* Time: 3:17:51 PM
|
|
||||||
* To change this template use File | Settings | File Templates.
|
|
||||||
*/
|
|
||||||
public interface KeywordIndividualRelationDao {
|
|
||||||
KeywordIndividualRelation getKeywordIndividualRelationByURI(String URI);
|
|
||||||
|
|
||||||
List<KeywordIndividualRelation> getKeywordIndividualRelationsByIndividualURI(String individualURI);
|
|
||||||
|
|
||||||
String insertNewKeywordIndividualRelation(KeywordIndividualRelation k);
|
|
||||||
|
|
||||||
void updateKeywordIndividualRelation(KeywordIndividualRelation k);
|
|
||||||
|
|
||||||
void deleteKeywordIndividualRelation(KeywordIndividualRelation k);
|
|
||||||
}
|
|
|
@ -42,7 +42,6 @@ public class VitroVocabulary {
|
||||||
|
|
||||||
// properties found on the beans
|
// properties found on the beans
|
||||||
|
|
||||||
public static final String DESCRIPTION = vitroURI+"description";
|
|
||||||
public static final String DESCRIPTION_ANNOT = vitroURI + "descriptionAnnot";
|
public static final String DESCRIPTION_ANNOT = vitroURI + "descriptionAnnot";
|
||||||
public static final String PUBLIC_DESCRIPTION_ANNOT = vitroURI + "publicDescriptionAnnot";
|
public static final String PUBLIC_DESCRIPTION_ANNOT = vitroURI + "publicDescriptionAnnot";
|
||||||
public static final String SHORTDEF = vitroURI+"shortDef";
|
public static final String SHORTDEF = vitroURI+"shortDef";
|
||||||
|
@ -69,32 +68,21 @@ public class VitroVocabulary {
|
||||||
|
|
||||||
public static final String SEARCH_BOOST_ANNOT = vitroURI + "searchBoostAnnot";
|
public static final String SEARCH_BOOST_ANNOT = vitroURI + "searchBoostAnnot";
|
||||||
|
|
||||||
public static final String SUNRISE = vitroURI+"sunrise";
|
|
||||||
public static final String SUNSET = vitroURI+"sunset";
|
|
||||||
|
|
||||||
public static final String DEPENDENT_RESORUCE = "http://vivoweb.org/ontology/core#DependentResource";
|
public static final String DEPENDENT_RESORUCE = "http://vivoweb.org/ontology/core#DependentResource";
|
||||||
|
|
||||||
//////////////////////////////////////////
|
//////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
public static final String CURATOR_NOTE = vitroURI+"curatorNote";
|
|
||||||
|
|
||||||
public static final String MONIKER = vitroURI+"moniker";
|
public static final String MONIKER = vitroURI+"moniker";
|
||||||
|
|
||||||
public static final String BLURB = vitroURI+"blurb";
|
|
||||||
|
|
||||||
public static final String CLASSGROUP = vitroURI+"ClassGroup";
|
public static final String CLASSGROUP = vitroURI+"ClassGroup";
|
||||||
public static final String IN_CLASSGROUP = vitroURI+"inClassGroup";
|
public static final String IN_CLASSGROUP = vitroURI+"inClassGroup";
|
||||||
|
|
||||||
public static final String MODTIME = vitroURI+"modTime";
|
public static final String MODTIME = vitroURI+"modTime";
|
||||||
public static final String TIMEKEY = vitroURI+"timekey";
|
|
||||||
|
|
||||||
public static final String DISPLAY_RANK = vitroURI+"displayRank";
|
public static final String DISPLAY_RANK = vitroURI+"displayRank";
|
||||||
public static final String DISPLAY_RANK_ANNOT = vitroURI+"displayRankAnnot";
|
public static final String DISPLAY_RANK_ANNOT = vitroURI+"displayRankAnnot";
|
||||||
public static final String DISPLAY_LIMIT = vitroURI+"displayLimitAnnot";
|
public static final String DISPLAY_LIMIT = vitroURI+"displayLimitAnnot";
|
||||||
|
|
||||||
public static final String CITATION = vitroURI+"citation";
|
|
||||||
|
|
||||||
// ================== property related =================================
|
// ================== property related =================================
|
||||||
|
|
||||||
public static final String PROPERTY_ENTITYSORTDIRECTION = vitroURI+"individualSortDirectionAnnot";
|
public static final String PROPERTY_ENTITYSORTDIRECTION = vitroURI+"individualSortDirectionAnnot";
|
||||||
|
@ -102,8 +90,6 @@ public class VitroVocabulary {
|
||||||
public static final String PROPERTY_OBJECTINDIVIDUALSORTPROPERTY = vitroURI+"objectIndividualSortProperty";
|
public static final String PROPERTY_OBJECTINDIVIDUALSORTPROPERTY = vitroURI+"objectIndividualSortProperty";
|
||||||
public static final String PROPERTY_FULLPROPERTYNAMEANNOT = vitroURI+"fullPropertyNameAnnot";
|
public static final String PROPERTY_FULLPROPERTYNAMEANNOT = vitroURI+"fullPropertyNameAnnot";
|
||||||
public static final String PROPERTY_CUSTOMSEARCHVIEWANNOT = vitroURI+"customSearchViewAnnot";
|
public static final String PROPERTY_CUSTOMSEARCHVIEWANNOT = vitroURI+"customSearchViewAnnot";
|
||||||
//public static final String PROPERTY_SELFEDITPROHIBITEDANNOT = vitroURI+"selfEditProhibitedAnnot";
|
|
||||||
//public static final String PROPERTY_CURATOREDITPROHIBITEDANNOT = vitroURI+"curatorEditProhibitedAnnot";
|
|
||||||
public static final String PROPERTY_CUSTOMENTRYFORMANNOT = vitroURI+"customEntryFormAnnot";
|
public static final String PROPERTY_CUSTOMENTRYFORMANNOT = vitroURI+"customEntryFormAnnot";
|
||||||
public static final String PROPERTY_CUSTOMDISPLAYVIEWANNOT = vitroURI+"customDisplayViewAnnot";
|
public static final String PROPERTY_CUSTOMDISPLAYVIEWANNOT = vitroURI+"customDisplayViewAnnot";
|
||||||
public static final String PROPERTY_CUSTOMSHORTVIEWANNOT = vitroURI+"customShortViewAnnot";
|
public static final String PROPERTY_CUSTOMSHORTVIEWANNOT = vitroURI+"customShortViewAnnot";
|
||||||
|
@ -117,19 +103,6 @@ public class VitroVocabulary {
|
||||||
public static final String PROPERTY_STUBOBJECTPROPERTYANNOT = vitroURI + "stubObjectPropertyAnnot";
|
public static final String PROPERTY_STUBOBJECTPROPERTYANNOT = vitroURI + "stubObjectPropertyAnnot";
|
||||||
public static final String PROPERTY_COLLATEBYSUBCLASSANNOT = vitroURI + "collateBySubclassAnnot";
|
public static final String PROPERTY_COLLATEBYSUBCLASSANNOT = vitroURI + "collateBySubclassAnnot";
|
||||||
|
|
||||||
// ================== keyword related ==================================
|
|
||||||
|
|
||||||
public static final String KEYWORD = vitroURI+"Keyword";
|
|
||||||
public static final String KEYWORD_STEM = vitroURI+"keywordStem";
|
|
||||||
public static final String KEYWORD_TYPE = vitroURI+"keywordType";
|
|
||||||
public static final String KEYWORD_SOURCE = vitroURI+"keywordSource";
|
|
||||||
public static final String KEYWORD_ORIGIN = vitroURI+"keywordOrigin";
|
|
||||||
public static final String KEYWORD_COMMENTS = vitroURI+"keywordComment";
|
|
||||||
public static final String KEYWORD_INDIVIDUALRELATION = vitroURI+"KeywordRelation";
|
|
||||||
public static final String KEYWORD_INDIVIDUALRELATION_INVOLVESKEYWORD = vitroURI+"involvesKeyword";
|
|
||||||
public static final String KEYWORD_INDIVIDUALRELATION_INVOLVESINDIVIDUAL = vitroURI+"involvesIndividual";
|
|
||||||
public static final String KEYWORD_INDIVIDUALRELATION_MODE = vitroURI+"keywordMode";
|
|
||||||
|
|
||||||
// ================== link related =====================================
|
// ================== link related =====================================
|
||||||
|
|
||||||
public static final String LINK = vitroURI+"Link";
|
public static final String LINK = vitroURI+"Link";
|
||||||
|
|
|
@ -111,12 +111,6 @@ public interface WebappDaoFactory {
|
||||||
|
|
||||||
public ApplicationDao getApplicationDao();
|
public ApplicationDao getApplicationDao();
|
||||||
|
|
||||||
public KeywordIndividualRelationDao getKeys2EntsDao();
|
|
||||||
public KeywordDao getKeywordDao();
|
|
||||||
|
|
||||||
public LinksDao getLinksDao();
|
|
||||||
public LinktypeDao getLinktypeDao();
|
|
||||||
|
|
||||||
public UserAccountsDao getUserAccountsDao();
|
public UserAccountsDao getUserAccountsDao();
|
||||||
|
|
||||||
public VClassGroupDao getVClassGroupDao();
|
public VClassGroupDao getVClassGroupDao();
|
||||||
|
|
|
@ -54,14 +54,6 @@ public class DataPropertyStatementFiltering implements DataPropertyStatement {
|
||||||
return innerStmt.getDatapropURI();
|
return innerStmt.getDatapropURI();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Date getSunrise() {
|
|
||||||
return innerStmt.getSunrise();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getSunset() {
|
|
||||||
return innerStmt.getSunset();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getString() {
|
public String getString() {
|
||||||
return innerStmt.getString();
|
return innerStmt.getString();
|
||||||
}
|
}
|
||||||
|
@ -90,12 +82,4 @@ public class DataPropertyStatementFiltering implements DataPropertyStatement {
|
||||||
innerStmt.setDatapropURI(datapropURI);
|
innerStmt.setDatapropURI(datapropURI);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSunrise(Date date) {
|
|
||||||
innerStmt.setSunrise(date);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSunset(Date date) {
|
|
||||||
innerStmt.setSunset(date);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,25 +63,6 @@ class IndividualDaoFiltering extends BaseFiltering implements IndividualDao{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public Individual getIndividualByExternalId(int externalIdType,
|
|
||||||
String externalIdValue, String classURI) {
|
|
||||||
Individual ind = innerIndividualDao.getIndividualByExternalId(externalIdType,externalIdValue,classURI);
|
|
||||||
if( ind != null && filters.getIndividualFilter().fn(ind) )
|
|
||||||
return new IndividualFiltering(ind, filters );
|
|
||||||
else
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public Individual getIndividualByExternalId(int externalIdType,
|
|
||||||
String externalIdValue) {
|
|
||||||
Individual ind = innerIndividualDao.getIndividualByExternalId(externalIdType,externalIdValue);
|
|
||||||
if( ind != null && filters.getIndividualFilter().fn(ind))
|
|
||||||
return new IndividualFiltering(ind,filters);
|
|
||||||
else
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
public void fillVClassForIndividual(Individual individual) {
|
public void fillVClassForIndividual(Individual individual) {
|
||||||
innerIndividualDao.fillVClassForIndividual(individual);
|
innerIndividualDao.fillVClassForIndividual(individual);
|
||||||
}
|
}
|
||||||
|
@ -192,31 +173,6 @@ class IndividualDaoFiltering extends BaseFiltering implements IndividualDao{
|
||||||
innerIndividualDao.markModified(individual);
|
innerIndividualDao.markModified(individual);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getKeywordsForIndividual(String individualURI) {
|
|
||||||
return innerIndividualDao.getKeywordsForIndividual(individualURI);
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> getKeywordsForIndividualByMode(String individualURI,
|
|
||||||
String modeStr) {
|
|
||||||
return innerIndividualDao.getKeywordsForIndividualByMode(individualURI,modeStr);
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Keyword> getKeywordObjectsForIndividual(String individualURI) {
|
|
||||||
return innerIndividualDao.getKeywordObjectsForIndividual(individualURI);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getNetId(String entityURI) {
|
|
||||||
return innerIndividualDao.getNetId(entityURI);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getStatus(String entityURI) {
|
|
||||||
return innerIndividualDao.getStatus(entityURI);
|
|
||||||
}
|
|
||||||
|
|
||||||
public List monikers(String vclassURI) {
|
|
||||||
return innerIndividualDao.monikers(vclassURI);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toString(){
|
public String toString(){
|
||||||
return "IndividualDaoFiltering filter: " + filters.getIndividualFilter().toString() + "\n" +
|
return "IndividualDaoFiltering filter: " + filters.getIndividualFilter().toString() + "\n" +
|
||||||
"InnerDao: " + innerIndividualDao.toString();
|
"InnerDao: " + innerIndividualDao.toString();
|
||||||
|
@ -230,7 +186,6 @@ class IndividualDaoFiltering extends BaseFiltering implements IndividualDao{
|
||||||
return innerIndividualDao.getUnusedURI(individual);
|
return innerIndividualDao.getUnusedURI(individual);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EditLiteral getLabelEditLiteral(String individualUri) {
|
public EditLiteral getLabelEditLiteral(String individualUri) {
|
||||||
return innerIndividualDao.getLabelEditLiteral(individualUri);
|
return innerIndividualDao.getLabelEditLiteral(individualUri);
|
||||||
|
|
|
@ -210,21 +210,6 @@ public class IndividualFiltering implements Individual {
|
||||||
return _innerIndividual.equals(obj);
|
return _innerIndividual.equals(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getAnchor() {
|
|
||||||
return _innerIndividual.getAnchor();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getBlurb() {
|
|
||||||
return _innerIndividual.getBlurb();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getDescription() {
|
|
||||||
return _innerIndividual.getDescription();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DataPropertyStatement> getExternalIds() {
|
public List<DataPropertyStatement> getExternalIds() {
|
||||||
return _innerIndividual.getExternalIds();
|
return _innerIndividual.getExternalIds();
|
||||||
|
@ -251,26 +236,6 @@ public class IndividualFiltering implements Individual {
|
||||||
return _innerIndividual.getThumbUrl();
|
return _innerIndividual.getThumbUrl();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<String> getKeywords() {
|
|
||||||
return _innerIndividual.getKeywords();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getKeywordString() {
|
|
||||||
return _innerIndividual.getKeywordString();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Link> getLinksList() {
|
|
||||||
return _innerIndividual.getLinksList();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Link getPrimaryLink() {
|
|
||||||
return _innerIndividual.getPrimaryLink();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getLocalName() {
|
public String getLocalName() {
|
||||||
return _innerIndividual.getLocalName();
|
return _innerIndividual.getLocalName();
|
||||||
|
@ -281,11 +246,6 @@ public class IndividualFiltering implements Individual {
|
||||||
return _innerIndividual.getModTime();
|
return _innerIndividual.getModTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getMoniker() {
|
|
||||||
return _innerIndividual.getMoniker();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return _innerIndividual.getName();
|
return _innerIndividual.getName();
|
||||||
|
@ -301,43 +261,11 @@ public class IndividualFiltering implements Individual {
|
||||||
return _innerIndividual.getNamespace();
|
return _innerIndividual.getNamespace();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getStatus() {
|
|
||||||
return _innerIndividual.getStatus();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getStatusId() {
|
|
||||||
return _innerIndividual.getStatusId();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Date getSunrise() {
|
|
||||||
return _innerIndividual.getSunrise();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Date getSunset() {
|
|
||||||
return _innerIndividual.getSunset();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Date getTimekey() {
|
|
||||||
return _innerIndividual.getTimekey();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getURI() {
|
public String getURI() {
|
||||||
return _innerIndividual.getURI();
|
return _innerIndividual.getURI();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getUrl() {
|
|
||||||
return _innerIndividual.getUrl();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VClass getVClass() {
|
public VClass getVClass() {
|
||||||
return _innerIndividual.getVClass();
|
return _innerIndividual.getVClass();
|
||||||
|
@ -353,16 +281,6 @@ public class IndividualFiltering implements Individual {
|
||||||
return _innerIndividual.hashCode();
|
return _innerIndividual.hashCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setAnchor(String in) {
|
|
||||||
_innerIndividual.setAnchor(in);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setBlurb(String in) {
|
|
||||||
_innerIndividual.setBlurb(in);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setDatatypePropertyList(List<DataProperty> datatypePropertyList) {
|
public void setDatatypePropertyList(List<DataProperty> datatypePropertyList) {
|
||||||
_innerIndividual.setDatatypePropertyList(datatypePropertyList);
|
_innerIndividual.setDatatypePropertyList(datatypePropertyList);
|
||||||
|
@ -373,11 +291,6 @@ public class IndividualFiltering implements Individual {
|
||||||
_innerIndividual.setPopulatedDataPropertyList(dataPropertyList);
|
_innerIndividual.setPopulatedDataPropertyList(dataPropertyList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setDescription(String in) {
|
|
||||||
_innerIndividual.setDescription(in);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setObjectPropertyStatements(List<ObjectPropertyStatement> list) {
|
public void setObjectPropertyStatements(List<ObjectPropertyStatement> list) {
|
||||||
_innerIndividual.setObjectPropertyStatements(list);
|
_innerIndividual.setObjectPropertyStatements(list);
|
||||||
|
@ -398,21 +311,6 @@ public class IndividualFiltering implements Individual {
|
||||||
_innerIndividual.setMainImageUri(mainImageUri);
|
_innerIndividual.setMainImageUri(mainImageUri);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setKeywords(List<String> keywords) {
|
|
||||||
_innerIndividual.setKeywords(keywords);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setLinksList(List<Link> linksList) {
|
|
||||||
_innerIndividual.setLinksList(linksList);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setPrimaryLink(Link link) {
|
|
||||||
_innerIndividual.setPrimaryLink(link);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setLocalName(String localName) {
|
public void setLocalName(String localName) {
|
||||||
_innerIndividual.setLocalName(localName);
|
_innerIndividual.setLocalName(localName);
|
||||||
|
@ -423,11 +321,6 @@ public class IndividualFiltering implements Individual {
|
||||||
_innerIndividual.setModTime(in);
|
_innerIndividual.setModTime(in);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setMoniker(String in) {
|
|
||||||
_innerIndividual.setMoniker(in);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setName(String in) {
|
public void setName(String in) {
|
||||||
_innerIndividual.setName(in);
|
_innerIndividual.setName(in);
|
||||||
|
@ -448,41 +341,11 @@ public class IndividualFiltering implements Individual {
|
||||||
_innerIndividual.setPopulatedObjectPropertyList(propertyList);
|
_innerIndividual.setPopulatedObjectPropertyList(propertyList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setStatus(String s) {
|
|
||||||
_innerIndividual.setStatus(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setStatusId(int in) {
|
|
||||||
_innerIndividual.setStatusId(in);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setSunrise(Date in) {
|
|
||||||
_innerIndividual.setSunrise(in);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setSunset(Date in) {
|
|
||||||
_innerIndividual.setSunset(in);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setTimekey(Date in) {
|
|
||||||
_innerIndividual.setTimekey(in);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setURI(String URI) {
|
public void setURI(String URI) {
|
||||||
_innerIndividual.setURI(URI);
|
_innerIndividual.setURI(URI);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setUrl(String url) {
|
|
||||||
_innerIndividual.setUrl(url);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setVClass(VClass class1) {
|
public void setVClass(VClass class1) {
|
||||||
_innerIndividual.setVClass(class1);
|
_innerIndividual.setVClass(class1);
|
||||||
|
@ -493,20 +356,11 @@ public class IndividualFiltering implements Individual {
|
||||||
_innerIndividual.setVClassURI(in);
|
_innerIndividual.setVClassURI(in);
|
||||||
}
|
}
|
||||||
|
|
||||||
// public void shallowCopy(Individual target) {
|
|
||||||
// _innerIndividual.shallowCopy(target);
|
|
||||||
// }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sortForDisplay() {
|
public void sortForDisplay() {
|
||||||
_innerIndividual.sortForDisplay();
|
_innerIndividual.sortForDisplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Keyword> getKeywordObjects() {
|
|
||||||
return _innerIndividual.getKeywordObjects();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<VClass> getVClasses() {
|
public List<VClass> getVClasses() {
|
||||||
return _innerIndividual.getVClasses();
|
return _innerIndividual.getVClasses();
|
||||||
|
@ -532,11 +386,6 @@ public class IndividualFiltering implements Individual {
|
||||||
_innerIndividual.setDataPropertyMap(propertyMap);
|
_innerIndividual.setDataPropertyMap(propertyMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setKeywordObjects(List<Keyword> keywords) {
|
|
||||||
_innerIndividual.setKeywordObjects(keywords);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setObjectPropertyMap(Map<String, ObjectProperty> propertyMap) {
|
public void setObjectPropertyMap(Map<String, ObjectProperty> propertyMap) {
|
||||||
_innerIndividual.setObjectPropertyMap(propertyMap);
|
_innerIndividual.setObjectPropertyMap(propertyMap);
|
||||||
|
|
|
@ -44,10 +44,6 @@ public class ObjectPropertyStatementFiltering implements ObjectPropertyStatement
|
||||||
return innerStmt.toString();
|
return innerStmt.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDescription() {
|
|
||||||
return innerStmt.getDescription();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getObjectURI() {
|
public String getObjectURI() {
|
||||||
return innerStmt.getObjectURI();
|
return innerStmt.getObjectURI();
|
||||||
}
|
}
|
||||||
|
@ -56,30 +52,14 @@ public class ObjectPropertyStatementFiltering implements ObjectPropertyStatement
|
||||||
return innerStmt.getPropertyURI();
|
return innerStmt.getPropertyURI();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getQualifier() {
|
|
||||||
return innerStmt.getQualifier();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSubjectURI() {
|
public String getSubjectURI() {
|
||||||
return innerStmt.getSubjectURI();
|
return innerStmt.getSubjectURI();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Date getSunrise() {
|
|
||||||
return innerStmt.getSunrise();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getSunset() {
|
|
||||||
return innerStmt.getSunset();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isSubjectOriented() {
|
public boolean isSubjectOriented() {
|
||||||
return innerStmt.isSubjectOriented();
|
return innerStmt.isSubjectOriented();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDescription(String description) {
|
|
||||||
innerStmt.setDescription(description);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setObject(Individual object) {
|
public void setObject(Individual object) {
|
||||||
innerStmt.setObject(object);
|
innerStmt.setObject(object);
|
||||||
}
|
}
|
||||||
|
@ -96,10 +76,6 @@ public class ObjectPropertyStatementFiltering implements ObjectPropertyStatement
|
||||||
innerStmt.setPropertyURI(URI);
|
innerStmt.setPropertyURI(URI);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setQualifier(String qualifier) {
|
|
||||||
innerStmt.setQualifier(qualifier);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSubject(Individual subject) {
|
public void setSubject(Individual subject) {
|
||||||
innerStmt.setSubject(subject);
|
innerStmt.setSubject(subject);
|
||||||
}
|
}
|
||||||
|
@ -112,12 +88,4 @@ public class ObjectPropertyStatementFiltering implements ObjectPropertyStatement
|
||||||
innerStmt.setSubjectURI(subjectURI);
|
innerStmt.setSubjectURI(subjectURI);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSunrise(Date date) {
|
|
||||||
innerStmt.setSunrise(date);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSunset(Date date) {
|
|
||||||
innerStmt.setSunset(date);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,10 +13,6 @@ import edu.cornell.mannlib.vitro.webapp.dao.DataPropertyStatementDao;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.DatatypeDao;
|
import edu.cornell.mannlib.vitro.webapp.dao.DatatypeDao;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.DisplayModelDao;
|
import edu.cornell.mannlib.vitro.webapp.dao.DisplayModelDao;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao;
|
import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.KeywordDao;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.KeywordIndividualRelationDao;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.LinksDao;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.LinktypeDao;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.MenuDao;
|
import edu.cornell.mannlib.vitro.webapp.dao.MenuDao;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.NamespaceDao;
|
import edu.cornell.mannlib.vitro.webapp.dao.NamespaceDao;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.ObjectPropertyDao;
|
import edu.cornell.mannlib.vitro.webapp.dao.ObjectPropertyDao;
|
||||||
|
@ -168,22 +164,6 @@ public class WebappDaoFactoryFiltering implements WebappDaoFactory {
|
||||||
return innerWebappDaoFactory.getUserURI();
|
return innerWebappDaoFactory.getUserURI();
|
||||||
}
|
}
|
||||||
|
|
||||||
public KeywordIndividualRelationDao getKeys2EntsDao() {
|
|
||||||
return innerWebappDaoFactory.getKeys2EntsDao();
|
|
||||||
}
|
|
||||||
|
|
||||||
public KeywordDao getKeywordDao() {
|
|
||||||
return innerWebappDaoFactory.getKeywordDao();
|
|
||||||
}
|
|
||||||
|
|
||||||
public LinksDao getLinksDao() {
|
|
||||||
return innerWebappDaoFactory.getLinksDao();
|
|
||||||
}
|
|
||||||
|
|
||||||
public LinktypeDao getLinktypeDao() {
|
|
||||||
return innerWebappDaoFactory.getLinktypeDao();
|
|
||||||
}
|
|
||||||
|
|
||||||
public ApplicationDao getApplicationDao() {
|
public ApplicationDao getApplicationDao() {
|
||||||
return innerWebappDaoFactory.getApplicationDao();
|
return innerWebappDaoFactory.getApplicationDao();
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,30 +60,11 @@ public class VitroFilterUtils {
|
||||||
private final Comparator<? super Individual> comparator;
|
private final Comparator<? super Individual> comparator;
|
||||||
|
|
||||||
public EntitySortTransform( String fieldName, boolean ascending){
|
public EntitySortTransform( String fieldName, boolean ascending){
|
||||||
if ( "timekey".equalsIgnoreCase( fieldName )){
|
|
||||||
if( ascending )
|
|
||||||
comparator = timekeyComp;
|
|
||||||
else
|
|
||||||
comparator = timekeyCompDesc;
|
|
||||||
|
|
||||||
} else if ( "sunset".equalsIgnoreCase( fieldName )){
|
|
||||||
if( ascending )
|
|
||||||
comparator = sunsetComp;
|
|
||||||
else
|
|
||||||
comparator = sunsetCompDesc;
|
|
||||||
|
|
||||||
} else if ( "sunrise".equalsIgnoreCase( fieldName )){
|
|
||||||
if( ascending )
|
|
||||||
comparator = sunriseComp;
|
|
||||||
else
|
|
||||||
comparator = sunriseCompDesc;
|
|
||||||
} else {
|
|
||||||
if( ascending )
|
if( ascending )
|
||||||
comparator = nameComp;
|
comparator = nameComp;
|
||||||
else
|
else
|
||||||
comparator = nameCompDesc;
|
comparator = nameCompDesc;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Individual> fn(List<Individual> individuals) {
|
public List<Individual> fn(List<Individual> individuals) {
|
||||||
|
@ -91,57 +72,6 @@ public class VitroFilterUtils {
|
||||||
return individuals;
|
return individuals;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Comparator<? super Individual> timekeyComp =
|
|
||||||
new Comparator<Individual>(){
|
|
||||||
@Override
|
|
||||||
public int compare(Individual o1, Individual o2) {
|
|
||||||
Date time1 = o1.getTimekey();
|
|
||||||
Date time2 = o2.getTimekey();
|
|
||||||
if( time1 == null && time2 == null )
|
|
||||||
return 0;
|
|
||||||
if( time1 == null )
|
|
||||||
return 1;
|
|
||||||
if( time2 == null)
|
|
||||||
return -1;
|
|
||||||
return time1.compareTo(time2);
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String toString(){ return "timekeyComp"; }
|
|
||||||
};
|
|
||||||
private static Comparator<? super Individual> sunsetComp =
|
|
||||||
new Comparator<Individual>(){
|
|
||||||
@Override
|
|
||||||
public int compare(Individual o1, Individual o2) {
|
|
||||||
Date time1 = o1.getSunset();
|
|
||||||
Date time2 = o2.getSunset();
|
|
||||||
if( time1 == null && time2 == null )
|
|
||||||
return 0;
|
|
||||||
if( time1 == null )
|
|
||||||
return 1;
|
|
||||||
if( time2 == null)
|
|
||||||
return -1;
|
|
||||||
return time1.compareTo(time2);
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String toString(){ return "sunsetComp"; }
|
|
||||||
};
|
|
||||||
private static Comparator<? super Individual> sunriseComp =
|
|
||||||
new Comparator<Individual>(){
|
|
||||||
@Override
|
|
||||||
public int compare(Individual o1, Individual o2) {
|
|
||||||
Date time1 = o1.getSunrise();
|
|
||||||
Date time2 = o2.getSunrise();
|
|
||||||
if( time1 == null && time2 == null )
|
|
||||||
return 0;
|
|
||||||
if( time1 == null )
|
|
||||||
return 1;
|
|
||||||
if( time2 == null)
|
|
||||||
return -1;
|
|
||||||
return time1.compareTo(time2);
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String toString(){ return "sunriseComp"; }
|
|
||||||
};
|
|
||||||
private static Comparator<? super Individual> nameComp =
|
private static Comparator<? super Individual> nameComp =
|
||||||
new Comparator<Individual>(){
|
new Comparator<Individual>(){
|
||||||
// return ((Individual)o1).getName().compareTo(((Individual)o2).getName());
|
// return ((Individual)o1).getName().compareTo(((Individual)o2).getName());
|
||||||
|
@ -164,57 +94,6 @@ public class VitroFilterUtils {
|
||||||
public String toString(){ return "nameComp"; }
|
public String toString(){ return "nameComp"; }
|
||||||
};
|
};
|
||||||
|
|
||||||
private static Comparator<? super Individual> timekeyCompDesc =
|
|
||||||
new Comparator<Individual>(){
|
|
||||||
@Override
|
|
||||||
public int compare(Individual o1, Individual o2) {
|
|
||||||
Date time1 = o1.getTimekey();
|
|
||||||
Date time2 = o2.getTimekey();
|
|
||||||
if( time1 == null && time2 == null )
|
|
||||||
return 0;
|
|
||||||
if( time1 == null )
|
|
||||||
return -1;
|
|
||||||
if( time2 == null)
|
|
||||||
return 1;
|
|
||||||
return time2.compareTo(time1);
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String toString(){ return "timkeyCompDesc"; }
|
|
||||||
};
|
|
||||||
private static Comparator<? super Individual> sunsetCompDesc =
|
|
||||||
new Comparator<Individual>(){
|
|
||||||
@Override
|
|
||||||
public int compare(Individual o1, Individual o2) {
|
|
||||||
Date time1 = o1.getSunset();
|
|
||||||
Date time2 = o2.getSunset();
|
|
||||||
if( time1 == null && time2 == null )
|
|
||||||
return 0;
|
|
||||||
if( time1 == null )
|
|
||||||
return -1;
|
|
||||||
if( time2 == null)
|
|
||||||
return 1;
|
|
||||||
return time2.compareTo(time1);
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String toString(){ return "sunsetCompDesc"; }
|
|
||||||
};
|
|
||||||
private static Comparator<? super Individual> sunriseCompDesc =
|
|
||||||
new Comparator<Individual>(){
|
|
||||||
@Override
|
|
||||||
public int compare(Individual o1, Individual o2) {
|
|
||||||
Date time1 = o1.getSunrise();
|
|
||||||
Date time2 = o2.getSunrise();
|
|
||||||
if( time1 == null && time2 == null )
|
|
||||||
return 0;
|
|
||||||
if( time1 == null )
|
|
||||||
return -1;
|
|
||||||
if( time2 == null)
|
|
||||||
return 1;
|
|
||||||
return time2.compareTo(time1);
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String toString(){ return "sunriseCompDesc"; }
|
|
||||||
};
|
|
||||||
private static Comparator<? super Individual> nameCompDesc =
|
private static Comparator<? super Individual> nameCompDesc =
|
||||||
new Comparator<Individual>(){
|
new Comparator<Individual>(){
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -89,6 +89,7 @@ public class DataPropertyStatementDaoSDB extends DataPropertyStatementDaoJena
|
||||||
boolean addToList = /*allowAnyNameSpace ? st.getObject().canAs(Literal.class) :*/ st.getObject().isLiteral() &&
|
boolean addToList = /*allowAnyNameSpace ? st.getObject().canAs(Literal.class) :*/ st.getObject().isLiteral() &&
|
||||||
(
|
(
|
||||||
(RDF.value.equals(st.getPredicate()) || VitroVocabulary.value.equals(st.getPredicate().getURI()))
|
(RDF.value.equals(st.getPredicate()) || VitroVocabulary.value.equals(st.getPredicate().getURI()))
|
||||||
|
|| this.MONIKER.equals(st.getPredicate())
|
||||||
|| !(NONUSER_NAMESPACES.contains(st.getPredicate().getNameSpace()))
|
|| !(NONUSER_NAMESPACES.contains(st.getPredicate().getNameSpace()))
|
||||||
);
|
);
|
||||||
if( addToList )
|
if( addToList )
|
||||||
|
|
|
@ -2,12 +2,10 @@
|
||||||
|
|
||||||
package edu.cornell.mannlib.vitro.webapp.dao.jena;
|
package edu.cornell.mannlib.vitro.webapp.dao.jena;
|
||||||
|
|
||||||
import java.text.Collator;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
@ -50,11 +48,9 @@ import com.hp.hpl.jena.vocabulary.RDFS;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement;
|
import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Keyword;
|
import edu.cornell.mannlib.vitro.webapp.beans.Keyword;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.KeywordIndividualRelation;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.VClass;
|
import edu.cornell.mannlib.vitro.webapp.beans.VClass;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao;
|
import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.InsertException;
|
import edu.cornell.mannlib.vitro.webapp.dao.InsertException;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.KeywordDao;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
|
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.jena.event.IndividualCreationEvent;
|
import edu.cornell.mannlib.vitro.webapp.dao.jena.event.IndividualCreationEvent;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.jena.event.IndividualDeletionEvent;
|
import edu.cornell.mannlib.vitro.webapp.dao.jena.event.IndividualDeletionEvent;
|
||||||
|
@ -260,49 +256,13 @@ public class IndividualDaoJena extends JenaBaseDao implements IndividualDao {
|
||||||
ind.addRDFType(ResourceFactory.createResource(vc.getURI()));
|
ind.addRDFType(ResourceFactory.createResource(vc.getURI()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
addPropertyStringValue(ind,MONIKER,ent.getMoniker(),ontModel);
|
|
||||||
addPropertyStringValue(ind,BLURB,ent.getBlurb(),ontModel);
|
|
||||||
addPropertyStringValue(ind,DESCRIPTION,ent.getDescription(),ontModel);
|
|
||||||
addPropertyDateTimeValue(ind,SUNRISE,ent.getSunrise(), ontModel);
|
|
||||||
addPropertyDateTimeValue(ind,SUNSET,ent.getSunset(), ontModel);
|
|
||||||
addPropertyDateTimeValue(ind,TIMEKEY,ent.getTimekey(), ontModel);
|
|
||||||
addPropertyDateTimeValue(ind,MODTIME,Calendar.getInstance().getTime(),ontModel);
|
addPropertyDateTimeValue(ind,MODTIME,Calendar.getInstance().getTime(),ontModel);
|
||||||
if (ent.getMainImageUri() != null) {
|
if (ent.getMainImageUri() != null) {
|
||||||
addPropertyResourceURIValue(ind, IND_MAIN_IMAGE, ent.getMainImageUri());
|
addPropertyResourceURIValue(ind, IND_MAIN_IMAGE, ent.getMainImageUri());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ent.getAnchor()!= null && ent.getAnchor().length()>0 && LINK != null) {
|
|
||||||
com.hp.hpl.jena.ontology.Individual primaryLink = ontModel.createIndividual(entURI+"_primaryLink", LINK);
|
|
||||||
primaryLink.addProperty(RDF.type, LINK);
|
|
||||||
if (log.isTraceEnabled()) {
|
|
||||||
log.trace("added RDF type Link to primary link in insertNewIndividual() for new individual "+ent.getName());
|
|
||||||
}
|
|
||||||
addPropertyStringValue(primaryLink, LINK_ANCHOR, ent.getAnchor(),ontModel);
|
|
||||||
addPropertyStringValue(primaryLink, LINK_URL,ent.getUrl(),ontModel);
|
|
||||||
ind.addProperty(PRIMARY_LINK,primaryLink);
|
|
||||||
}
|
|
||||||
if( ent.getSearchBoost() != null ) {
|
if( ent.getSearchBoost() != null ) {
|
||||||
addPropertyFloatValue(ind,SEARCH_BOOST_ANNOT, ent.getSearchBoost(), ontModel);
|
addPropertyFloatValue(ind,SEARCH_BOOST_ANNOT, ent.getSearchBoost(), ontModel);
|
||||||
}
|
}
|
||||||
/* 2009-01-27 hold off on individual-level filtering for now
|
|
||||||
ind.removeAll(HIDDEN_FROM_DISPLAY_BELOW_ROLE_LEVEL_ANNOT);
|
|
||||||
if (HIDDEN_FROM_DISPLAY_BELOW_ROLE_LEVEL_ANNOT != null && ent.getHiddenFromDisplayBelowRoleLevel() != null) { // only need to add if present
|
|
||||||
try {
|
|
||||||
ind.addProperty(HIDDEN_FROM_DISPLAY_BELOW_ROLE_LEVEL_ANNOT, ResourceFactory.createResource(ent.getHiddenFromDisplayBelowRoleLevel().getURI()));
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("error adding HiddenFromDisplayBelowRoleLevel annotation to individual "+ent.getURI());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ind.removeAll(PROHIBITED_FROM_UPDATE_BELOW_ROLE_LEVEL_ANNOT);
|
|
||||||
if (PROHIBITED_FROM_UPDATE_BELOW_ROLE_LEVEL_ANNOT != null && ent.getProhibitedFromUpdateBelowRoleLevel() != null) { // only need to add if present
|
|
||||||
try {
|
|
||||||
ind.addProperty(PROHIBITED_FROM_UPDATE_BELOW_ROLE_LEVEL_ANNOT, ResourceFactory.createResource(ent.getProhibitedFromUpdateBelowRoleLevel().getURI()));
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("error adding ProhibitedFromUpdateBelowRoleLevel annotation to individual "+ent.getURI());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Exception inserting individual: ",e);
|
log.error("Exception inserting individual: ",e);
|
||||||
}
|
}
|
||||||
|
@ -323,37 +283,19 @@ public class IndividualDaoJena extends JenaBaseDao implements IndividualDao {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initInd(Individual ent) {
|
private void initInd(Individual ent) {
|
||||||
ent.getAnchor();
|
|
||||||
ent.getBlurb();
|
|
||||||
ent.getClass();
|
ent.getClass();
|
||||||
ent.getVClasses(false);
|
ent.getVClasses(false);
|
||||||
ent.getDataPropertyList();
|
ent.getDataPropertyList();
|
||||||
ent.getDataPropertyStatements();
|
ent.getDataPropertyStatements();
|
||||||
ent.getDescription();
|
|
||||||
ent.getExternalIds();
|
ent.getExternalIds();
|
||||||
ent.getMainImageUri();
|
ent.getMainImageUri();
|
||||||
ent.getImageUrl();
|
|
||||||
ent.getThumbUrl();
|
|
||||||
ent.getKeywords();
|
|
||||||
ent.getKeywordString();
|
|
||||||
ent.getLinksList();
|
|
||||||
ent.getPrimaryLink();
|
|
||||||
ent.getModTime();
|
ent.getModTime();
|
||||||
ent.getMoniker();
|
|
||||||
ent.getName();
|
ent.getName();
|
||||||
ent.getNamespace();
|
ent.getNamespace();
|
||||||
ent.getObjectPropertyList();
|
ent.getObjectPropertyList();
|
||||||
ent.getStatus();
|
|
||||||
ent.getStatusId();
|
|
||||||
ent.getSunrise();
|
|
||||||
ent.getSunset();
|
|
||||||
ent.getTimekey();
|
|
||||||
ent.getUrl();
|
|
||||||
ent.getVClassURI();
|
ent.getVClassURI();
|
||||||
ent.getVClass();
|
ent.getVClass();
|
||||||
ent.getVClassURI();
|
ent.getVClassURI();
|
||||||
//ent.getHiddenFromDisplayBelowRoleLevel();
|
|
||||||
//ent.getProhibitedFromUpdateBelowRoleLevel();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int updateIndividual(Individual ent, OntModel ontModel) {
|
public int updateIndividual(Individual ent, OntModel ontModel) {
|
||||||
|
@ -402,83 +344,11 @@ public class IndividualDaoJena extends JenaBaseDao implements IndividualDao {
|
||||||
ind.addRDFType(ResourceFactory.createResource(uri));
|
ind.addRDFType(ResourceFactory.createResource(uri));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
updatePropertyStringValue(ind,MONIKER,ent.getMoniker(),ontModel);
|
|
||||||
updatePropertyStringValue(ind,BLURB,ent.getBlurb(),ontModel);
|
|
||||||
updatePropertyStringValue(ind,DESCRIPTION,ent.getDescription(),ontModel);
|
|
||||||
updatePropertyDateTimeValue(ind,SUNRISE,ent.getSunrise(), ontModel);
|
|
||||||
updatePropertyDateTimeValue(ind,SUNSET,ent.getSunset(), ontModel);
|
|
||||||
updatePropertyDateTimeValue(ind,TIMEKEY,ent.getTimekey(), ontModel);
|
|
||||||
updatePropertyDateTimeValue(ind,MODTIME,Calendar.getInstance().getTime(),ontModel);
|
updatePropertyDateTimeValue(ind,MODTIME,Calendar.getInstance().getTime(),ontModel);
|
||||||
updatePropertyResourceURIValue(ind, IND_MAIN_IMAGE, ent.getMainImageUri(), ontModel);
|
updatePropertyResourceURIValue(ind, IND_MAIN_IMAGE, ent.getMainImageUri(), ontModel);
|
||||||
if (ent.getAnchor()!= null && ent.getAnchor().length()>0) {
|
|
||||||
if (LINK != null && PRIMARY_LINK != null) {
|
|
||||||
boolean updatedExisting = false;
|
|
||||||
try {
|
|
||||||
Resource primaryLink = (Resource) ind.getPropertyValue(PRIMARY_LINK);
|
|
||||||
if (primaryLink != null) {
|
|
||||||
if (log.isTraceEnabled()) {
|
|
||||||
log.trace("Modifying the primary link to entity "+ent.getName());
|
|
||||||
}
|
|
||||||
updatePropertyStringValue(primaryLink, LINK_ANCHOR, ent.getAnchor(), ontModel);
|
|
||||||
updatePropertyStringValue(primaryLink, LINK_URL, ent.getUrl(), ontModel);
|
|
||||||
updatedExisting = true;
|
|
||||||
}
|
|
||||||
} catch (Exception e) {}
|
|
||||||
if (!updatedExisting) {
|
|
||||||
if (log.isTraceEnabled()) {
|
|
||||||
log.trace("Adding a primary link to entity "+ent.getName());
|
|
||||||
}
|
|
||||||
ind.removeAll(PRIMARY_LINK);
|
|
||||||
com.hp.hpl.jena.ontology.Individual primaryLink = LINK.createIndividual(ent.getURI()+"_primaryLink");
|
|
||||||
primaryLink.addProperty(RDF.type, LINK);
|
|
||||||
addPropertyStringValue(primaryLink, LINK_ANCHOR, ent.getAnchor(), ontModel);
|
|
||||||
addPropertyStringValue(primaryLink, LINK_URL,ent.getUrl(), ontModel);
|
|
||||||
ind.addProperty(PRIMARY_LINK,primaryLink);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
ind.removeAll(PRIMARY_LINK);
|
|
||||||
}
|
|
||||||
if( ent.getSearchBoost() != null ) {
|
if( ent.getSearchBoost() != null ) {
|
||||||
updatePropertyFloatValue(ind, SEARCH_BOOST_ANNOT, ent.getSearchBoost(), ontModel);
|
updatePropertyFloatValue(ind, SEARCH_BOOST_ANNOT, ent.getSearchBoost(), ontModel);
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
if (HIDDEN_FROM_DISPLAY_BELOW_ROLE_LEVEL_ANNOT != null) {
|
|
||||||
try {
|
|
||||||
ind.removeAll(HIDDEN_FROM_DISPLAY_BELOW_ROLE_LEVEL_ANNOT);
|
|
||||||
if (ent.getHiddenFromDisplayBelowRoleLevel()!=null) {
|
|
||||||
String badURIErrorStr = checkURI(ent.getHiddenFromDisplayBelowRoleLevel().getURI());
|
|
||||||
if (badURIErrorStr == null) {
|
|
||||||
ind.addProperty(HIDDEN_FROM_DISPLAY_BELOW_ROLE_LEVEL_ANNOT, ResourceFactory.createResource(ent.getHiddenFromDisplayBelowRoleLevel().getURI()));
|
|
||||||
} else {
|
|
||||||
log.error(badURIErrorStr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("error linking individual "+ent.getURI()+" to HIDDEN_FROM_DISPLAY_BELOW_ROLE_LEVEL edit role");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
log.error("vitro:hiddenFromDisplayBelowRoleLevelAnnot property not found in RBox");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (PROHIBITED_FROM_UPDATE_BELOW_ROLE_LEVEL_ANNOT != null) {
|
|
||||||
try {
|
|
||||||
ind.removeAll(PROHIBITED_FROM_UPDATE_BELOW_ROLE_LEVEL_ANNOT);
|
|
||||||
if (ent.getProhibitedFromUpdateBelowRoleLevel()!=null) {
|
|
||||||
String badURIErrorStr = checkURI(ent.getProhibitedFromUpdateBelowRoleLevel().getURI());
|
|
||||||
if (badURIErrorStr == null) {
|
|
||||||
ind.addProperty(PROHIBITED_FROM_UPDATE_BELOW_ROLE_LEVEL_ANNOT, ResourceFactory.createResource(ent.getProhibitedFromUpdateBelowRoleLevel().getURI()));
|
|
||||||
} else {
|
|
||||||
log.error(badURIErrorStr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("error linking individual "+ent.getURI()+" to PROHIBITED_FROM_UPDATE_BELOW_ROLE_LEVEL edit role");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
log.error("vitro:prohibitedFromUpdateBelowRoleLevelAnnot property not found in RBox");
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -569,89 +439,6 @@ public class IndividualDaoJena extends JenaBaseDao implements IndividualDao {
|
||||||
entity.setVClass(getWebappDaoFactory().getVClassDao().getVClassByURI(entity.getVClassURI()));
|
entity.setVClass(getWebappDaoFactory().getVClassDao().getVClassByURI(entity.getVClassURI()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> monikers( String typeURI ) {
|
|
||||||
getOntModel().enterCriticalSection(Lock.READ);
|
|
||||||
try {
|
|
||||||
HashSet<String> monikers = new HashSet<String>();
|
|
||||||
OntClass cls = getOntModel().getOntClass(typeURI);
|
|
||||||
ResIterator inds = getOntModel().listSubjectsWithProperty(
|
|
||||||
RDF.type, ResourceFactory.createResource(typeURI));
|
|
||||||
while (inds.hasNext()) {
|
|
||||||
Resource ind = inds.nextResource();
|
|
||||||
if (MONIKER != null) {
|
|
||||||
Iterator<Statement> monikerIt = ind.listProperties(MONIKER);
|
|
||||||
while (monikerIt.hasNext()) {
|
|
||||||
Statement monikerStmt = monikerIt.next();
|
|
||||||
monikers.add(((Literal)monikerStmt.getObject()).getString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
List<String> monikerList = new ArrayList<String>();
|
|
||||||
if (monikers.size()>0) {
|
|
||||||
Iterator<String> monikerIt = monikers.iterator();
|
|
||||||
while (monikerIt.hasNext()) {
|
|
||||||
monikerList.add(monikerIt.next());
|
|
||||||
}
|
|
||||||
Collections.sort(monikerList,new Comparator<String>() {
|
|
||||||
public int compare( String first, String second ) {
|
|
||||||
if (first==null) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
if (second==null) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
Collator collator = Collator.getInstance();
|
|
||||||
return collator.compare(first,second);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return monikerList;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return null;
|
|
||||||
} finally {
|
|
||||||
getOntModel().leaveCriticalSection();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> getKeywordsForIndividual(String entityURI) {
|
|
||||||
KeywordDao kDao = getWebappDaoFactory().getKeywordDao();
|
|
||||||
List<String> keywords = new LinkedList<String>();
|
|
||||||
List<KeywordIndividualRelation> kirs = getWebappDaoFactory().getKeys2EntsDao().getKeywordIndividualRelationsByIndividualURI(entityURI);
|
|
||||||
Iterator<KeywordIndividualRelation> kirsIt = kirs.iterator();
|
|
||||||
while (kirsIt.hasNext()) {
|
|
||||||
Keyword keyword = kDao.getKeywordById(kirsIt.next().getKeyId());
|
|
||||||
keywords.add(keyword.getTerm());
|
|
||||||
}
|
|
||||||
return keywords;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> getKeywordsForIndividualByMode(String entityURI, String modeStr) {
|
|
||||||
KeywordDao kDao = getWebappDaoFactory().getKeywordDao();
|
|
||||||
List<String> keywords = new LinkedList<String>();
|
|
||||||
List<KeywordIndividualRelation> kirs = getWebappDaoFactory().getKeys2EntsDao().getKeywordIndividualRelationsByIndividualURI(entityURI);
|
|
||||||
Iterator<KeywordIndividualRelation> kirsIt = kirs.iterator();
|
|
||||||
while (kirsIt.hasNext()) {
|
|
||||||
KeywordIndividualRelation kir = kirsIt.next();
|
|
||||||
if (kir.getMode().equalsIgnoreCase(modeStr)) {
|
|
||||||
Keyword keyword = kDao.getKeywordById(kir.getKeyId());
|
|
||||||
keywords.add(keyword.getTerm());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return keywords;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Keyword> getKeywordObjectsForIndividual(String entityURI) {
|
|
||||||
KeywordDao kDao = getWebappDaoFactory().getKeywordDao();
|
|
||||||
List<Keyword> keywords = new LinkedList<Keyword>();
|
|
||||||
List<KeywordIndividualRelation> kirs = getWebappDaoFactory().getKeys2EntsDao().getKeywordIndividualRelationsByIndividualURI(entityURI);
|
|
||||||
Iterator<KeywordIndividualRelation> kirsIt = kirs.iterator();
|
|
||||||
while (kirsIt.hasNext()) {
|
|
||||||
Keyword keyword = kDao.getKeywordById(kirsIt.next().getKeyId());
|
|
||||||
keywords.add(keyword);
|
|
||||||
}
|
|
||||||
return keywords;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* In Jena it can be difficult to get an object with a given dataproperty if
|
* In Jena it can be difficult to get an object with a given dataproperty if
|
||||||
* you do not care about the datatype or lang of the literal. Use this
|
* you do not care about the datatype or lang of the literal. Use this
|
||||||
|
@ -822,24 +609,6 @@ public class IndividualDaoJena extends JenaBaseDao implements IndividualDao {
|
||||||
return inds;
|
return inds;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public Individual getIndividualByExternalId(int externalIdType, String externalIdValue ) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public Individual getIndividualByExternalId(int externalIdType, String externalIdValue, String vClassURI) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getNetId(String entityURI) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getStatus(String entityURI) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Iterator<String> getAllOfThisTypeIterator() {
|
public Iterator<String> getAllOfThisTypeIterator() {
|
||||||
//this is implemented in IndivdiualSDB
|
//this is implemented in IndivdiualSDB
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
|
|
|
@ -34,7 +34,6 @@ import com.hp.hpl.jena.rdf.model.ResourceFactory;
|
||||||
import com.hp.hpl.jena.rdf.model.Statement;
|
import com.hp.hpl.jena.rdf.model.Statement;
|
||||||
import com.hp.hpl.jena.rdf.model.StmtIterator;
|
import com.hp.hpl.jena.rdf.model.StmtIterator;
|
||||||
import com.hp.hpl.jena.shared.Lock;
|
import com.hp.hpl.jena.shared.Lock;
|
||||||
import com.hp.hpl.jena.util.iterator.ClosableIterator;
|
|
||||||
import com.hp.hpl.jena.vocabulary.RDFS;
|
import com.hp.hpl.jena.vocabulary.RDFS;
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
||||||
|
@ -50,7 +49,6 @@ public class IndividualDaoSDB extends IndividualDaoJena {
|
||||||
|
|
||||||
private DatasetWrapperFactory dwf;
|
private DatasetWrapperFactory dwf;
|
||||||
private SDBDatasetMode datasetMode;
|
private SDBDatasetMode datasetMode;
|
||||||
private WebappDaoFactoryJena wadf;
|
|
||||||
|
|
||||||
public IndividualDaoSDB(DatasetWrapperFactory dwf,
|
public IndividualDaoSDB(DatasetWrapperFactory dwf,
|
||||||
SDBDatasetMode datasetMode,
|
SDBDatasetMode datasetMode,
|
||||||
|
@ -176,10 +174,6 @@ public class IndividualDaoSDB extends IndividualDaoJena {
|
||||||
" ?ind a <" + theClass.getURI() + "> . \n" +
|
" ?ind a <" + theClass.getURI() + "> . \n" +
|
||||||
" ?ind <" + RDFS.label.getURI() + "> ?label \n" +
|
" ?ind <" + RDFS.label.getURI() + "> ?label \n" +
|
||||||
"} \n" +
|
"} \n" +
|
||||||
"UNION { \n" +
|
|
||||||
" ?ind a <" + theClass.getURI() + "> . \n" +
|
|
||||||
" ?ind <" + VitroVocabulary.MONIKER + "> ?moniker \n" +
|
|
||||||
"} \n" +
|
|
||||||
"} ORDER BY ?ind ?label";
|
"} ORDER BY ?ind ?label";
|
||||||
ResultSet rs =QueryExecutionFactory.create(
|
ResultSet rs =QueryExecutionFactory.create(
|
||||||
QueryFactory.create(query), dataset)
|
QueryFactory.create(query), dataset)
|
||||||
|
@ -194,13 +188,12 @@ public class IndividualDaoSDB extends IndividualDaoJena {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (uri != null && !uri.equals(currRes.getURI())) {
|
if (uri != null && !uri.equals(currRes.getURI())) {
|
||||||
Individual ent = makeIndividual(uri, label, moniker);
|
Individual ent = makeIndividual(uri, label);
|
||||||
if (ent != null) {
|
if (ent != null) {
|
||||||
ents.add(ent);
|
ents.add(ent);
|
||||||
}
|
}
|
||||||
uri = currRes.getURI();
|
uri = currRes.getURI();
|
||||||
label = null;
|
label = null;
|
||||||
moniker = null;
|
|
||||||
} else if (uri == null) {
|
} else if (uri == null) {
|
||||||
uri = currRes.getURI();
|
uri = currRes.getURI();
|
||||||
}
|
}
|
||||||
|
@ -208,12 +201,8 @@ public class IndividualDaoSDB extends IndividualDaoJena {
|
||||||
if (labelLit != null) {
|
if (labelLit != null) {
|
||||||
label = labelLit.getLexicalForm();
|
label = labelLit.getLexicalForm();
|
||||||
}
|
}
|
||||||
Literal monikerLit = sol.getLiteral("moniker");
|
|
||||||
if (monikerLit != null) {
|
|
||||||
moniker = monikerLit.getLexicalForm();
|
|
||||||
}
|
|
||||||
if (!rs.hasNext()) {
|
if (!rs.hasNext()) {
|
||||||
Individual ent = makeIndividual(uri, label, moniker);
|
Individual ent = makeIndividual(uri, label);
|
||||||
if (ent != null) {
|
if (ent != null) {
|
||||||
ents.add(ent);
|
ents.add(ent);
|
||||||
}
|
}
|
||||||
|
@ -250,7 +239,7 @@ public class IndividualDaoSDB extends IndividualDaoJena {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
filteredIndividualList.add(
|
filteredIndividualList.add(
|
||||||
makeIndividual(currRes.getURI(), null, null));
|
makeIndividual(currRes.getURI(), null));
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
dataset.getLock().leaveCriticalSection();
|
dataset.getLock().leaveCriticalSection();
|
||||||
|
@ -259,14 +248,11 @@ public class IndividualDaoSDB extends IndividualDaoJena {
|
||||||
return filteredIndividualList;
|
return filteredIndividualList;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Individual makeIndividual(String uri,
|
private Individual makeIndividual(String uri, String label) {
|
||||||
String label,
|
|
||||||
String moniker) {
|
|
||||||
Individual ent = new IndividualSDB(uri,
|
Individual ent = new IndividualSDB(uri,
|
||||||
this.dwf, datasetMode, getWebappDaoFactory(),
|
this.dwf, datasetMode, getWebappDaoFactory(),
|
||||||
SKIP_INITIALIZATION);
|
SKIP_INITIALIZATION);
|
||||||
ent.setName(label);
|
ent.setName(label);
|
||||||
ent.setMoniker(moniker);
|
|
||||||
return ent;
|
return ent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
package edu.cornell.mannlib.vitro.webapp.dao.jena;
|
package edu.cornell.mannlib.vitro.webapp.dao.jena;
|
||||||
|
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.net.URLDecoder;
|
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.text.Collator;
|
import java.text.Collator;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -153,41 +151,6 @@ public class IndividualJena extends IndividualImpl implements Individual {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public int getFlag1Numeric() {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public String getFlag1Set() {
|
|
||||||
return "1";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public String getFlag2Set() {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public boolean doesFlag1Match(int flagBitMask) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public Date getSunrise() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public Date getSunset() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public Date getTimekey() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Timestamp getModTime() {
|
public Timestamp getModTime() {
|
||||||
if (modTime != null) {
|
if (modTime != null) {
|
||||||
return modTime;
|
return modTime;
|
||||||
|
@ -205,118 +168,6 @@ public class IndividualJena extends IndividualImpl implements Individual {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getMoniker() {
|
|
||||||
if (moniker != null) {
|
|
||||||
return moniker;
|
|
||||||
} else {
|
|
||||||
ind.getOntModel().enterCriticalSection(Lock.READ);
|
|
||||||
try {
|
|
||||||
moniker = webappDaoFactory.getJenaBaseDao().getPropertyStringValue(ind,webappDaoFactory.getJenaBaseDao().MONIKER);
|
|
||||||
if (moniker == null) {
|
|
||||||
//Changing behavior to moniker because it is taking extra time to get the vclass
|
|
||||||
//alternative if the moniker isn't filled out. That time is wasted if the vclass alternative isn't desired.
|
|
||||||
//see NIHVIVO-2001
|
|
||||||
moniker = "";
|
|
||||||
}
|
|
||||||
return moniker;
|
|
||||||
} finally {
|
|
||||||
ind.getOntModel().leaveCriticalSection();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 2009-01-27 hold off on individual-level filtering for now
|
|
||||||
@Override
|
|
||||||
public RoleLevel getHiddenFromDisplayBelowRoleLevel(){
|
|
||||||
if( this.hiddenFromDisplayBelowRoleLevel != null )
|
|
||||||
return this.hiddenFromDisplayBelowRoleLevel;
|
|
||||||
|
|
||||||
OntModel model = ind.getOntModel();
|
|
||||||
model.enterCriticalSection(Lock.READ);
|
|
||||||
try {
|
|
||||||
NodeIterator it = model.listObjectsOfProperty(ind, model.getAnnotationProperty(VitroVocabulary.HIDDEN_FROM_DISPLAY_BELOW_ROLE_LEVEL_ANNOT));
|
|
||||||
if( it == null )
|
|
||||||
return BaseResourceBean.RoleLevel.values()[0];
|
|
||||||
BaseResourceBean.RoleLevel role = BaseResourceBean.RoleLevel.values()[0];
|
|
||||||
while( it.hasNext() ) {
|
|
||||||
RDFNode node = it.nextNode();
|
|
||||||
if( node != null && node.isURIResource() ) {
|
|
||||||
BaseResourceBean.RoleLevel foundRole = BaseResourceBean.RoleLevel.getRoleByUri( node.asNode().getURI() );
|
|
||||||
if( role.compareTo(foundRole ) < 0 ) { // find the lowest of all levels
|
|
||||||
role = foundRole;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return this.hiddenFromDisplayBelowRoleLevel = role;
|
|
||||||
} finally {
|
|
||||||
model.leaveCriticalSection();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* this seems like a mismatch with the RDF storage model.
|
|
||||||
* We could have multiple statements in the model that associated
|
|
||||||
* the individual with multiple or redundant edit display levels.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
@Override
|
|
||||||
public RoleLevel getProhibitedFromUpdateBelowRoleLevel() {
|
|
||||||
if( this.prohibitedFromUpdateBelowRoleLevel != null )
|
|
||||||
return this.prohibitedFromUpdateBelowRoleLevel;
|
|
||||||
|
|
||||||
OntModel model = ind.getOntModel();
|
|
||||||
model.enterCriticalSection(Lock.READ);
|
|
||||||
try {
|
|
||||||
NodeIterator it = model.listObjectsOfProperty(ind, model.getAnnotationProperty(VitroVocabulary.PROHIBITED_FROM_UPDATE_BELOW_ROLE_LEVEL_ANNOT));
|
|
||||||
if( it == null )
|
|
||||||
return BaseResourceBean.RoleLevel.values()[0];
|
|
||||||
BaseResourceBean.RoleLevel role = BaseResourceBean.RoleLevel.values()[0];
|
|
||||||
while( it.hasNext() ){
|
|
||||||
RDFNode node = it.nextNode();
|
|
||||||
if( node != null && node.isURIResource() ) {
|
|
||||||
BaseResourceBean.RoleLevel foundRole = BaseResourceBean.RoleLevel.getRoleByUri( node.asNode().getURI() );
|
|
||||||
if( role.compareTo(foundRole ) < 0 ) // find the lowest of all roles
|
|
||||||
role = foundRole;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return this.prohibitedFromUpdateBelowRoleLevel = role;
|
|
||||||
} finally {
|
|
||||||
model.leaveCriticalSection();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
public String getBlurb() {
|
|
||||||
if (this.blurb != null) {
|
|
||||||
return blurb;
|
|
||||||
} else {
|
|
||||||
ind.getOntModel().enterCriticalSection(Lock.READ);
|
|
||||||
try {
|
|
||||||
blurb = webappDaoFactory.getJenaBaseDao().getPropertyStringValue(ind,webappDaoFactory.getJenaBaseDao().BLURB);
|
|
||||||
return blurb;
|
|
||||||
} finally {
|
|
||||||
ind.getOntModel().leaveCriticalSection();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDescription() {
|
|
||||||
if (this.description != null) {
|
|
||||||
return description;
|
|
||||||
} else {
|
|
||||||
ind.getOntModel().enterCriticalSection(Lock.READ);
|
|
||||||
try {
|
|
||||||
description = webappDaoFactory.getJenaBaseDao().getPropertyStringValue(ind,webappDaoFactory.getJenaBaseDao().DESCRIPTION);
|
|
||||||
return description;
|
|
||||||
} finally {
|
|
||||||
ind.getOntModel().leaveCriticalSection();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public Float getSearchBoost(){
|
public Float getSearchBoost(){
|
||||||
if( this._searchBoostJena != null ){
|
if( this._searchBoostJena != null ){
|
||||||
return this._searchBoostJena;
|
return this._searchBoostJena;
|
||||||
|
@ -380,122 +231,12 @@ public class IndividualJena extends IndividualImpl implements Individual {
|
||||||
return this.imageInfo.getThumbnail().getBytestreamAliasUrl();
|
return this.imageInfo.getThumbnail().getBytestreamAliasUrl();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAnchor() {
|
|
||||||
if (this.anchor != null) {
|
|
||||||
return anchor;
|
|
||||||
} else {
|
|
||||||
doUrlAndAnchor();
|
|
||||||
return anchor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUrl() {
|
|
||||||
if (this.url != null) {
|
|
||||||
return url;
|
|
||||||
} else {
|
|
||||||
doUrlAndAnchor();
|
|
||||||
return url;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void doUrlAndAnchor() {
|
|
||||||
ind.getOntModel().enterCriticalSection(Lock.READ);
|
|
||||||
try {
|
|
||||||
if (webappDaoFactory.getJenaBaseDao().PRIMARY_LINK != null) {
|
|
||||||
Iterator links = ind.listPropertyValues(webappDaoFactory.getJenaBaseDao().PRIMARY_LINK);
|
|
||||||
if (links.hasNext()) {
|
|
||||||
try {
|
|
||||||
com.hp.hpl.jena.ontology.Individual linkInd = ((com.hp.hpl.jena.ontology.Individual)((Resource) links.next()).as(com.hp.hpl.jena.ontology.Individual.class));
|
|
||||||
if (webappDaoFactory.getJenaBaseDao().LINK_ANCHOR != null) {
|
|
||||||
try {
|
|
||||||
Literal l = (Literal) linkInd.getPropertyValue(webappDaoFactory.getJenaBaseDao().LINK_ANCHOR);
|
|
||||||
if (l != null) {
|
|
||||||
anchor = l.getString();
|
|
||||||
}
|
|
||||||
} catch (ClassCastException e) {}
|
|
||||||
}
|
|
||||||
if (webappDaoFactory.getJenaBaseDao().LINK_URL != null) {
|
|
||||||
try {
|
|
||||||
Literal l = (Literal) linkInd.getPropertyValue(webappDaoFactory.getJenaBaseDao().LINK_URL);
|
|
||||||
if (l != null) {
|
|
||||||
try {
|
|
||||||
url = URLDecoder.decode(l.getString(), "UTF-8");
|
|
||||||
} catch (UnsupportedEncodingException use) {}
|
|
||||||
}
|
|
||||||
} catch (ClassCastException e) {}
|
|
||||||
}
|
|
||||||
} catch (ClassCastException cce) {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
ind.getOntModel().leaveCriticalSection();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public List <Link> getLinksList() {
|
|
||||||
if (this.linksList != null) {
|
|
||||||
return this.linksList;
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
webappDaoFactory.getLinksDao().addLinksToIndividual( this );
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.debug(this.getClass().getName()+" could not addLinksToIndividual for "+this.getURI());
|
|
||||||
}
|
|
||||||
return this.linksList;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Link getPrimaryLink() {
|
|
||||||
if (this.primaryLink != null) {
|
|
||||||
return this.primaryLink;
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
webappDaoFactory.getLinksDao().addPrimaryLinkToIndividual( this );
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.debug(this.getClass().getName()+" could not addPrimaryLinkToIndividual for "+this.getURI());
|
|
||||||
}
|
|
||||||
return this.primaryLink;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public List<String> getKeywords() {
|
|
||||||
if (this.keywords != null) {
|
|
||||||
return this.keywords;
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
this.setKeywords(webappDaoFactory.getIndividualDao().getKeywordsForIndividual(this.getURI()));
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.debug(this.getClass().getName()+" could not getKeywords for "+this.getURI());
|
|
||||||
}
|
|
||||||
return this.keywords;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Keyword> getKeywordObjects() {
|
|
||||||
if (this.keywordObjects != null) {
|
|
||||||
return this.keywordObjects;
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
this.setKeywordObjects(webappDaoFactory.getIndividualDao().getKeywordObjectsForIndividual(this.getURI()));
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(this.getClass().getName()+" could not get Keyword Objects for "+this.getURI());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return this.keywordObjects;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<ObjectPropertyStatement> getObjectPropertyStatements() {
|
public List<ObjectPropertyStatement> getObjectPropertyStatements() {
|
||||||
if (this.objectPropertyStatements != null) {
|
if (this.objectPropertyStatements != null) {
|
||||||
return this.objectPropertyStatements;
|
return this.objectPropertyStatements;
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
webappDaoFactory.getObjectPropertyStatementDao().fillExistingObjectPropertyStatements(this);
|
webappDaoFactory.getObjectPropertyStatementDao().fillExistingObjectPropertyStatements(this);
|
||||||
//Iterator stmtIt = this.getObjectPropertyStatements().iterator();
|
|
||||||
//while (stmtIt.hasNext()) {
|
|
||||||
// ObjectPropertyStatement stmt = (ObjectPropertyStatement) stmtIt.next();
|
|
||||||
// stmt.setObject(webappDaoFactory.getIndividualDao().getIndividualByURI(stmt.getObject().getURI()));
|
|
||||||
//}
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(this.getClass().getName()+" could not fill existing ObjectPropertyStatements for "+this.getURI(), e);
|
log.error(this.getClass().getName()+" could not fill existing ObjectPropertyStatements for "+this.getURI(), e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,15 +88,11 @@ public class IndividualSDB extends IndividualImpl implements Individual {
|
||||||
"{ <"+individualURI+"> <" + RDFS.label.getURI() +
|
"{ <"+individualURI+"> <" + RDFS.label.getURI() +
|
||||||
"> ?ooo. \n" +
|
"> ?ooo. \n" +
|
||||||
"<"+individualURI+"> a ?type . \n" +
|
"<"+individualURI+"> a ?type . \n" +
|
||||||
"<"+individualURI+"> <" + VitroVocabulary.MONIKER +
|
|
||||||
"> ?moniker \n" +
|
|
||||||
"} \n" +
|
"} \n" +
|
||||||
"WHERE { \n" +
|
"WHERE { \n" +
|
||||||
"{ <"+individualURI+"> <" + RDFS.label.getURI() +
|
"{ <"+individualURI+"> <" + RDFS.label.getURI() +
|
||||||
"> ?ooo } \n" +
|
"> ?ooo } \n" +
|
||||||
" UNION { <"+individualURI+"> a ?type } \n" +
|
" UNION { <"+individualURI+"> a ?type } \n" +
|
||||||
" UNION { <"+individualURI+"> <" + VitroVocabulary.MONIKER +
|
|
||||||
"> ?moniker } \n" +
|
|
||||||
"} ";
|
"} ";
|
||||||
this.model = QueryExecutionFactory.create(
|
this.model = QueryExecutionFactory.create(
|
||||||
QueryFactory.create(getStatements), initModel)
|
QueryFactory.create(getStatements), initModel)
|
||||||
|
@ -134,18 +130,11 @@ public class IndividualSDB extends IndividualImpl implements Individual {
|
||||||
"CONSTRUCT " +
|
"CONSTRUCT " +
|
||||||
"{ <"+individualURI+"> <" + RDFS.label.getURI() +
|
"{ <"+individualURI+"> <" + RDFS.label.getURI() +
|
||||||
"> ?ooo. \n" +
|
"> ?ooo. \n" +
|
||||||
// "<"+individualURI+"> a ?type . \n" +
|
|
||||||
"<"+individualURI+"> <" + VitroVocabulary.MONIKER +
|
"<"+individualURI+"> <" + VitroVocabulary.MONIKER +
|
||||||
"> ?moniker \n" +
|
"> ?moniker \n" +
|
||||||
"} WHERE {" +
|
"} WHERE {" +
|
||||||
"{ <"+individualURI+"> <" + RDFS.label.getURI() +
|
"{ <"+individualURI+"> <" + RDFS.label.getURI() +
|
||||||
"> ?ooo } \n" +
|
"> ?ooo } \n" +
|
||||||
"UNION { <" +
|
|
||||||
individualURI+"> <" + VitroVocabulary.MONIKER +
|
|
||||||
"> ?moniker \n" +
|
|
||||||
"} \n" +
|
|
||||||
// "UNION { <"
|
|
||||||
// + individualURI + "> a ?type } \n" +
|
|
||||||
"}";
|
"}";
|
||||||
model = QueryExecutionFactory.create(
|
model = QueryExecutionFactory.create(
|
||||||
QueryFactory.create(getStatements), dataset)
|
QueryFactory.create(getStatements), dataset)
|
||||||
|
@ -278,39 +267,6 @@ public class IndividualSDB extends IndividualImpl implements Individual {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public int getFlag1Numeric() {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public String getFlag1Set() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public String getFlag2Set() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public boolean doesFlag1Match(int flagBitMask) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public Date getSunrise() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getSunset() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getTimekey() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Timestamp getModTime() {
|
public Timestamp getModTime() {
|
||||||
if (modTime != null) {
|
if (modTime != null) {
|
||||||
return modTime;
|
return modTime;
|
||||||
|
@ -332,62 +288,6 @@ public class IndividualSDB extends IndividualImpl implements Individual {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getMoniker() {
|
|
||||||
if (moniker != null) {
|
|
||||||
return moniker;
|
|
||||||
} else {
|
|
||||||
ind.getOntModel().enterCriticalSection(Lock.READ);
|
|
||||||
try {
|
|
||||||
moniker = webappDaoFactory.getJenaBaseDao()
|
|
||||||
.getPropertyStringValue(
|
|
||||||
ind,webappDaoFactory.getJenaBaseDao().MONIKER);
|
|
||||||
if (moniker == null) {
|
|
||||||
//Changing behavior to moniker because it is taking extra time to get the vclass
|
|
||||||
//alternative if the moniker isn't filled out. That time is wasted if the vclass alternative isn't desired.
|
|
||||||
//see NIHVIVO-2001
|
|
||||||
moniker = "";
|
|
||||||
}
|
|
||||||
return moniker;
|
|
||||||
} finally {
|
|
||||||
ind.getOntModel().leaveCriticalSection();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getBlurb() {
|
|
||||||
if (this.blurb != null) {
|
|
||||||
return blurb;
|
|
||||||
} else {
|
|
||||||
constructProperty(ind, VitroVocabulary.BLURB);
|
|
||||||
ind.getOntModel().enterCriticalSection(Lock.READ);
|
|
||||||
try {
|
|
||||||
blurb = webappDaoFactory.getJenaBaseDao().getPropertyStringValue(ind,webappDaoFactory.getJenaBaseDao().BLURB);
|
|
||||||
return blurb;
|
|
||||||
} finally {
|
|
||||||
|
|
||||||
ind.getOntModel().leaveCriticalSection();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDescription() {
|
|
||||||
if (this.description != null) {
|
|
||||||
return description;
|
|
||||||
} else {
|
|
||||||
constructProperty(ind, VitroVocabulary.DESCRIPTION);
|
|
||||||
ind.getOntModel().enterCriticalSection(Lock.READ);
|
|
||||||
try {
|
|
||||||
description = webappDaoFactory.getJenaBaseDao()
|
|
||||||
.getPropertyStringValue(
|
|
||||||
ind,webappDaoFactory.getJenaBaseDao().DESCRIPTION);
|
|
||||||
return description;
|
|
||||||
} finally {
|
|
||||||
|
|
||||||
ind.getOntModel().leaveCriticalSection();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private synchronized void constructProperty(OntResource ind, String propertyURI) {
|
private synchronized void constructProperty(OntResource ind, String propertyURI) {
|
||||||
DatasetWrapper w = getDatasetWrapper();
|
DatasetWrapper w = getDatasetWrapper();
|
||||||
Dataset dataset = w.getDataset();
|
Dataset dataset = w.getDataset();
|
||||||
|
@ -526,125 +426,6 @@ public class IndividualSDB extends IndividualImpl implements Individual {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getAnchor() {
|
|
||||||
if (this.anchor != null) {
|
|
||||||
return anchor;
|
|
||||||
} else {
|
|
||||||
doUrlAndAnchor();
|
|
||||||
return anchor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUrl() {
|
|
||||||
if (this.url != null) {
|
|
||||||
return url;
|
|
||||||
} else {
|
|
||||||
doUrlAndAnchor();
|
|
||||||
return url;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void doUrlAndAnchor() {
|
|
||||||
Model tempModel = ModelFactory.createDefaultModel();
|
|
||||||
OntModel ontModel = ModelFactory.createOntologyModel(
|
|
||||||
OntModelSpec.OWL_MEM);
|
|
||||||
DatasetWrapper w = getDatasetWrapper();
|
|
||||||
Dataset dataset = w.getDataset();
|
|
||||||
dataset.getLock().enterCriticalSection(Lock.READ);
|
|
||||||
try {
|
|
||||||
StringBuffer selectPrimaryLinkQueryBuff = new StringBuffer().append(
|
|
||||||
"SELECT ?url ?anchor \n" ).append(" WHERE { \n").append(
|
|
||||||
" <" + this.individualURI + "> ").append(
|
|
||||||
"<" + VitroVocabulary.PRIMARY_LINK + "> " ).append(
|
|
||||||
"?link . \n").append(
|
|
||||||
" ?link <" + VitroVocabulary.LINK_URL + "> ?url . \n"
|
|
||||||
).append(
|
|
||||||
" ?link <" + VitroVocabulary.LINK_ANCHOR + "> ?anchor . \n"
|
|
||||||
).append(
|
|
||||||
"} \n");
|
|
||||||
QueryExecution qexec = QueryExecutionFactory.create(
|
|
||||||
QueryFactory.create(selectPrimaryLinkQueryBuff.toString())
|
|
||||||
, dataset);
|
|
||||||
try {
|
|
||||||
ResultSet linkResults = qexec.execSelect();
|
|
||||||
if (linkResults.hasNext()) {
|
|
||||||
QuerySolution solution = linkResults.next();
|
|
||||||
this.setUrl(solution.getLiteral("url").getLexicalForm());
|
|
||||||
this.setAnchor(solution.getLiteral("anchor")
|
|
||||||
.getLexicalForm());
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
qexec.close();
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
tempModel.close();
|
|
||||||
ontModel.close();
|
|
||||||
dataset.getLock().leaveCriticalSection();
|
|
||||||
w.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public List <Link> getLinksList() {
|
|
||||||
if (this.linksList != null) {
|
|
||||||
return this.linksList;
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
webappDaoFactory.getLinksDao().addLinksToIndividual(this);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.debug(this.getClass().getName() +
|
|
||||||
" could not addLinksToIndividual for " + this.getURI());
|
|
||||||
}
|
|
||||||
return this.linksList;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Link getPrimaryLink() {
|
|
||||||
if (this.primaryLink != null) {
|
|
||||||
return this.primaryLink;
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
webappDaoFactory.getLinksDao().addPrimaryLinkToIndividual(this);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.debug(this.getClass().getName() +
|
|
||||||
" could not addPrimaryLinkToIndividual for " +
|
|
||||||
this.getURI());
|
|
||||||
}
|
|
||||||
return this.primaryLink;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public List<String> getKeywords() {
|
|
||||||
if (this.keywords != null) {
|
|
||||||
return this.keywords;
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
this.setKeywords(webappDaoFactory.getIndividualDao()
|
|
||||||
.getKeywordsForIndividual(this.getURI()));
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.debug(this.getClass().getName() +
|
|
||||||
" could not getKeywords for " + this.getURI());
|
|
||||||
}
|
|
||||||
return this.keywords;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Keyword> getKeywordObjects() {
|
|
||||||
if (this.keywordObjects != null) {
|
|
||||||
return this.keywordObjects;
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
this.setKeywordObjects(webappDaoFactory.getIndividualDao()
|
|
||||||
.getKeywordObjectsForIndividual(this.getURI()));
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(this.getClass().getName() +
|
|
||||||
" could not get Keyword Objects for " + this.getURI());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return this.keywordObjects;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<ObjectPropertyStatement> getObjectPropertyStatements() {
|
public List<ObjectPropertyStatement> getObjectPropertyStatements() {
|
||||||
if (this.objectPropertyStatements != null) {
|
if (this.objectPropertyStatements != null) {
|
||||||
return this.objectPropertyStatements;
|
return this.objectPropertyStatements;
|
||||||
|
|
|
@ -36,14 +36,10 @@ public class JenaBaseDaoCon {
|
||||||
|
|
||||||
/* ***************** Vitro ontology constants ***************** */
|
/* ***************** Vitro ontology constants ***************** */
|
||||||
|
|
||||||
public DatatypeProperty SUNRISE = _constModel.createDatatypeProperty(VitroVocabulary.SUNRISE);
|
|
||||||
public DatatypeProperty SUNSET = _constModel.createDatatypeProperty(VitroVocabulary.SUNSET);
|
|
||||||
protected AnnotationProperty DATAPROPERTY_ISEXTERNALID = _constModel.createAnnotationProperty(VitroVocabulary.DATAPROPERTY_ISEXTERNALID);
|
protected AnnotationProperty DATAPROPERTY_ISEXTERNALID = _constModel.createAnnotationProperty(VitroVocabulary.DATAPROPERTY_ISEXTERNALID);
|
||||||
|
|
||||||
protected AnnotationProperty HIDDEN_FROM_DISPLAY_BELOW_ROLE_LEVEL_ANNOT = _constModel.createAnnotationProperty(VitroVocabulary.HIDDEN_FROM_DISPLAY_BELOW_ROLE_LEVEL_ANNOT);
|
protected AnnotationProperty HIDDEN_FROM_DISPLAY_BELOW_ROLE_LEVEL_ANNOT = _constModel.createAnnotationProperty(VitroVocabulary.HIDDEN_FROM_DISPLAY_BELOW_ROLE_LEVEL_ANNOT);
|
||||||
//protected AnnotationProperty PROHIBITED_FROM_CREATE_BELOW_ROLE_LEVEL_ANNOT = _constModel.createAnnotationProperty(VitroVocabulary.PROHIBITED_FROM_CREATE_BELOW_ROLE_LEVEL_ANNOT);
|
|
||||||
protected AnnotationProperty PROHIBITED_FROM_UPDATE_BELOW_ROLE_LEVEL_ANNOT = _constModel.createAnnotationProperty(VitroVocabulary.PROHIBITED_FROM_UPDATE_BELOW_ROLE_LEVEL_ANNOT);
|
protected AnnotationProperty PROHIBITED_FROM_UPDATE_BELOW_ROLE_LEVEL_ANNOT = _constModel.createAnnotationProperty(VitroVocabulary.PROHIBITED_FROM_UPDATE_BELOW_ROLE_LEVEL_ANNOT);
|
||||||
//protected AnnotationProperty PROHIBITED_FROM_DELETE_BELOW_ROLE_LEVEL_ANNOT = _constModel.createAnnotationProperty(VitroVocabulary.PROHIBITED_FROM_DELETE_BELOW_ROLE_LEVEL_ANNOT);
|
|
||||||
|
|
||||||
protected AnnotationProperty SEARCH_BOOST_ANNOT = _constModel.createAnnotationProperty(VitroVocabulary.SEARCH_BOOST_ANNOT);
|
protected AnnotationProperty SEARCH_BOOST_ANNOT = _constModel.createAnnotationProperty(VitroVocabulary.SEARCH_BOOST_ANNOT);
|
||||||
|
|
||||||
|
@ -52,15 +48,10 @@ public class JenaBaseDaoCon {
|
||||||
protected AnnotationProperty PUBLIC_DESCRIPTION_ANNOT = _constModel.createAnnotationProperty(VitroVocabulary.PUBLIC_DESCRIPTION_ANNOT);
|
protected AnnotationProperty PUBLIC_DESCRIPTION_ANNOT = _constModel.createAnnotationProperty(VitroVocabulary.PUBLIC_DESCRIPTION_ANNOT);
|
||||||
protected AnnotationProperty SHORTDEF = _constModel.createAnnotationProperty(VitroVocabulary.SHORTDEF);
|
protected AnnotationProperty SHORTDEF = _constModel.createAnnotationProperty(VitroVocabulary.SHORTDEF);
|
||||||
|
|
||||||
protected DatatypeProperty CURATOR_NOTE = _constModel.createDatatypeProperty(VitroVocabulary.CURATOR_NOTE);
|
|
||||||
protected DatatypeProperty MONIKER = _constModel.createDatatypeProperty(VitroVocabulary.MONIKER);
|
protected DatatypeProperty MONIKER = _constModel.createDatatypeProperty(VitroVocabulary.MONIKER);
|
||||||
protected DatatypeProperty DESCRIPTION = _constModel.createDatatypeProperty(VitroVocabulary.DESCRIPTION);
|
|
||||||
protected DatatypeProperty BLURB = _constModel.createDatatypeProperty(VitroVocabulary.BLURB);
|
|
||||||
protected OntClass CLASSGROUP = _constModel.createClass(VitroVocabulary.CLASSGROUP);
|
protected OntClass CLASSGROUP = _constModel.createClass(VitroVocabulary.CLASSGROUP);
|
||||||
protected AnnotationProperty IN_CLASSGROUP = _constModel.createAnnotationProperty(VitroVocabulary.IN_CLASSGROUP);
|
protected AnnotationProperty IN_CLASSGROUP = _constModel.createAnnotationProperty(VitroVocabulary.IN_CLASSGROUP);
|
||||||
protected DatatypeProperty MODTIME = _constModel.createDatatypeProperty(VitroVocabulary.MODTIME);
|
protected DatatypeProperty MODTIME = _constModel.createDatatypeProperty(VitroVocabulary.MODTIME);
|
||||||
protected DatatypeProperty TIMEKEY = _constModel.createDatatypeProperty(VitroVocabulary.TIMEKEY);
|
|
||||||
protected DatatypeProperty CITATION = _constModel.createDatatypeProperty(VitroVocabulary.CITATION);
|
|
||||||
|
|
||||||
protected DatatypeProperty DISPLAY_RANK = _constModel.createDatatypeProperty(VitroVocabulary.DISPLAY_RANK);
|
protected DatatypeProperty DISPLAY_RANK = _constModel.createDatatypeProperty(VitroVocabulary.DISPLAY_RANK);
|
||||||
protected AnnotationProperty DISPLAY_RANK_ANNOT = _constModel.createAnnotationProperty(VitroVocabulary.DISPLAY_RANK_ANNOT);
|
protected AnnotationProperty DISPLAY_RANK_ANNOT = _constModel.createAnnotationProperty(VitroVocabulary.DISPLAY_RANK_ANNOT);
|
||||||
|
@ -76,7 +67,6 @@ public class JenaBaseDaoCon {
|
||||||
protected AnnotationProperty PROPERTY_CUSTOMSHORTVIEWANNOT = _constModel.createAnnotationProperty(VitroVocabulary.PROPERTY_CUSTOMSHORTVIEWANNOT);
|
protected AnnotationProperty PROPERTY_CUSTOMSHORTVIEWANNOT = _constModel.createAnnotationProperty(VitroVocabulary.PROPERTY_CUSTOMSHORTVIEWANNOT);
|
||||||
protected AnnotationProperty PROPERTY_CUSTOM_LIST_VIEW_ANNOT = _constModel.createAnnotationProperty(VitroVocabulary.PROPERTY_CUSTOM_LIST_VIEW_ANNOT);
|
protected AnnotationProperty PROPERTY_CUSTOM_LIST_VIEW_ANNOT = _constModel.createAnnotationProperty(VitroVocabulary.PROPERTY_CUSTOM_LIST_VIEW_ANNOT);
|
||||||
protected AnnotationProperty PROPERTY_CUSTOMSEARCHVIEWANNOT = _constModel.createAnnotationProperty(VitroVocabulary.PROPERTY_CUSTOMSEARCHVIEWANNOT);
|
protected AnnotationProperty PROPERTY_CUSTOMSEARCHVIEWANNOT = _constModel.createAnnotationProperty(VitroVocabulary.PROPERTY_CUSTOMSEARCHVIEWANNOT);
|
||||||
//protected AnnotationProperty PROPERTY_FORCESTUBDELETIONANNOT = _constModel.createAnnotationProperty(VitroVocabulary.PROPERTY_FORCESTUBDELETIONANNOT);
|
|
||||||
protected AnnotationProperty PROPERTY_SELECTFROMEXISTINGANNOT = _constModel.createAnnotationProperty(VitroVocabulary.PROPERTY_SELECTFROMEXISTINGANNOT);
|
protected AnnotationProperty PROPERTY_SELECTFROMEXISTINGANNOT = _constModel.createAnnotationProperty(VitroVocabulary.PROPERTY_SELECTFROMEXISTINGANNOT);
|
||||||
protected AnnotationProperty PROPERTY_OFFERCREATENEWOPTIONANNOT = _constModel.createAnnotationProperty(VitroVocabulary.PROPERTY_OFFERCREATENEWOPTIONANNOT);
|
protected AnnotationProperty PROPERTY_OFFERCREATENEWOPTIONANNOT = _constModel.createAnnotationProperty(VitroVocabulary.PROPERTY_OFFERCREATENEWOPTIONANNOT);
|
||||||
protected AnnotationProperty PROPERTY_INPROPERTYGROUPANNOT = _constModel.createAnnotationProperty(VitroVocabulary.PROPERTY_INPROPERTYGROUPANNOT);
|
protected AnnotationProperty PROPERTY_INPROPERTYGROUPANNOT = _constModel.createAnnotationProperty(VitroVocabulary.PROPERTY_INPROPERTYGROUPANNOT);
|
||||||
|
@ -85,17 +75,6 @@ public class JenaBaseDaoCon {
|
||||||
|
|
||||||
protected OntClass PROPERTYGROUP = _constModel.createClass(VitroVocabulary.PROPERTYGROUP);
|
protected OntClass PROPERTYGROUP = _constModel.createClass(VitroVocabulary.PROPERTYGROUP);
|
||||||
|
|
||||||
protected OntClass KEYWORD = _constModel.createClass(VitroVocabulary.KEYWORD);
|
|
||||||
protected DatatypeProperty KEYWORD_STEM = _constModel.createDatatypeProperty(VitroVocabulary.KEYWORD_STEM);
|
|
||||||
protected DatatypeProperty KEYWORD_TYPE = _constModel.createDatatypeProperty(VitroVocabulary.KEYWORD_TYPE);
|
|
||||||
protected DatatypeProperty KEYWORD_SOURCE = _constModel.createDatatypeProperty(VitroVocabulary.KEYWORD_SOURCE);
|
|
||||||
protected DatatypeProperty KEYWORD_ORIGIN = _constModel.createDatatypeProperty(VitroVocabulary.KEYWORD_ORIGIN);
|
|
||||||
protected DatatypeProperty KEYWORD_COMMENTS = _constModel.createDatatypeProperty(VitroVocabulary.KEYWORD_COMMENTS);
|
|
||||||
protected OntClass KEYWORD_INDIVIDUALRELATION = _constModel.createClass(VitroVocabulary.KEYWORD_INDIVIDUALRELATION);
|
|
||||||
protected ObjectProperty KEYWORD_INDIVIDUALRELATION_INVOLVESKEYWORD = _constModel.createObjectProperty(VitroVocabulary.KEYWORD_INDIVIDUALRELATION_INVOLVESKEYWORD);
|
|
||||||
protected ObjectProperty KEYWORD_INDIVIDUALRELATION_INVOLVESINDIVIDUAL = _constModel.createObjectProperty(VitroVocabulary.KEYWORD_INDIVIDUALRELATION_INVOLVESINDIVIDUAL);
|
|
||||||
protected DatatypeProperty KEYWORD_INDIVIDUALRELATION_MODE = _constModel.createDatatypeProperty(VitroVocabulary.KEYWORD_INDIVIDUALRELATION_MODE);
|
|
||||||
|
|
||||||
protected OntClass LINK = _constModel.createClass(VitroVocabulary.LINK);
|
protected OntClass LINK = _constModel.createClass(VitroVocabulary.LINK);
|
||||||
protected ObjectProperty PRIMARY_LINK = _constModel.createObjectProperty(VitroVocabulary.PRIMARY_LINK);
|
protected ObjectProperty PRIMARY_LINK = _constModel.createObjectProperty(VitroVocabulary.PRIMARY_LINK);
|
||||||
protected ObjectProperty ADDITIONAL_LINK = _constModel.createObjectProperty(VitroVocabulary.ADDITIONAL_LINK);
|
protected ObjectProperty ADDITIONAL_LINK = _constModel.createObjectProperty(VitroVocabulary.ADDITIONAL_LINK);
|
||||||
|
@ -104,22 +83,9 @@ public class JenaBaseDaoCon {
|
||||||
protected DatatypeProperty LINK_TYPE = _constModel.createDatatypeProperty(VitroVocabulary.LINK_TYPE);
|
protected DatatypeProperty LINK_TYPE = _constModel.createDatatypeProperty(VitroVocabulary.LINK_TYPE);
|
||||||
protected DatatypeProperty LINK_DISPLAYRANK = _constModel.createDatatypeProperty(VitroVocabulary.LINK_DISPLAYRANK_URL);
|
protected DatatypeProperty LINK_DISPLAYRANK = _constModel.createDatatypeProperty(VitroVocabulary.LINK_DISPLAYRANK_URL);
|
||||||
|
|
||||||
// protected OntClass APPLICATION = null;
|
|
||||||
// protected DatatypeProperty APPLICATION_FLAG1NAME = null;
|
|
||||||
// protected DatatypeProperty APPLICATION_FLAG2NAME = null;
|
|
||||||
// protected DatatypeProperty APPLICATION_FLAG3NAME = null;
|
|
||||||
// protected DatatypeProperty APPLICATION_MINSHAREDPORTALID = null;
|
|
||||||
// protected DatatypeProperty APPLICATION_MAXSHAREDPORTALID = null;
|
|
||||||
// protected DatatypeProperty APPLICATION_KEYWORDHEADING = null;
|
|
||||||
// protected DatatypeProperty APPLICATION_ROOTLOGOTYPEIMAGE = null;
|
|
||||||
// protected DatatypeProperty APPLICATION_ONLYCURRENT = null;
|
|
||||||
// protected DatatypeProperty APPLICATION_MAXPORTALID = null;
|
|
||||||
|
|
||||||
protected OntClass PORTAL = _constModel.createClass(VitroVocabulary.PORTAL);
|
protected OntClass PORTAL = _constModel.createClass(VitroVocabulary.PORTAL);
|
||||||
protected DatatypeProperty APPLICATION_THEMEDIR = _constModel.createDatatypeProperty(VitroVocabulary.PORTAL_THEMEDIR);
|
protected DatatypeProperty APPLICATION_THEMEDIR = _constModel.createDatatypeProperty(VitroVocabulary.PORTAL_THEMEDIR);
|
||||||
protected DatatypeProperty PORTAL_BANNERIMAGE = _constModel.createDatatypeProperty(VitroVocabulary.PORTAL_BANNERIMAGE);
|
protected DatatypeProperty PORTAL_BANNERIMAGE = _constModel.createDatatypeProperty(VitroVocabulary.PORTAL_BANNERIMAGE);
|
||||||
//protected DatatypeProperty PORTAL_FLAG2VALUES = null;
|
|
||||||
//protected DatatypeProperty PORTAL_FLAG1VALUES = null;
|
|
||||||
protected DatatypeProperty APPLICATION_CONTACTMAIL = _constModel.createDatatypeProperty(VitroVocabulary.PORTAL_CONTACTMAIL);
|
protected DatatypeProperty APPLICATION_CONTACTMAIL = _constModel.createDatatypeProperty(VitroVocabulary.PORTAL_CONTACTMAIL);
|
||||||
protected DatatypeProperty APPLICATION_CORRECTIONMAIL = _constModel.createDatatypeProperty(VitroVocabulary.PORTAL_CORRECTIONMAIL);
|
protected DatatypeProperty APPLICATION_CORRECTIONMAIL = _constModel.createDatatypeProperty(VitroVocabulary.PORTAL_CORRECTIONMAIL);
|
||||||
protected DatatypeProperty PORTAL_SHORTHAND = _constModel.createDatatypeProperty(VitroVocabulary.PORTAL_SHORTHAND);
|
protected DatatypeProperty PORTAL_SHORTHAND = _constModel.createDatatypeProperty(VitroVocabulary.PORTAL_SHORTHAND);
|
||||||
|
@ -127,7 +93,6 @@ public class JenaBaseDaoCon {
|
||||||
protected DatatypeProperty APPLICATION_ACKNOWLEGETEXT = _constModel.createDatatypeProperty(VitroVocabulary.PORTAL_ACKNOWLEGETEXT);
|
protected DatatypeProperty APPLICATION_ACKNOWLEGETEXT = _constModel.createDatatypeProperty(VitroVocabulary.PORTAL_ACKNOWLEGETEXT);
|
||||||
protected DatatypeProperty PORTAL_BANNERWIDTH = _constModel.createDatatypeProperty(VitroVocabulary.PORTAL_BANNERWIDTH);
|
protected DatatypeProperty PORTAL_BANNERWIDTH = _constModel.createDatatypeProperty(VitroVocabulary.PORTAL_BANNERWIDTH);
|
||||||
protected DatatypeProperty PORTAL_BANNERHEIGHT = _constModel.createDatatypeProperty(VitroVocabulary.PORTAL_BANNERHEIGHT);
|
protected DatatypeProperty PORTAL_BANNERHEIGHT = _constModel.createDatatypeProperty(VitroVocabulary.PORTAL_BANNERHEIGHT);
|
||||||
//protected DatatypeProperty PORTAL_FLAG3VALUES = null;
|
|
||||||
protected DatatypeProperty APPLICATION_COPYRIGHTURL = _constModel.createDatatypeProperty(VitroVocabulary.PORTAL_COPYRIGHTURL);
|
protected DatatypeProperty APPLICATION_COPYRIGHTURL = _constModel.createDatatypeProperty(VitroVocabulary.PORTAL_COPYRIGHTURL);
|
||||||
protected DatatypeProperty APPLICATION_COPYRIGHTANCHOR = _constModel.createDatatypeProperty(VitroVocabulary.PORTAL_COPYRIGHTANCHOR);
|
protected DatatypeProperty APPLICATION_COPYRIGHTANCHOR = _constModel.createDatatypeProperty(VitroVocabulary.PORTAL_COPYRIGHTANCHOR);
|
||||||
protected DatatypeProperty PORTAL_ROOTBREADCRUMBURL = _constModel.createDatatypeProperty(VitroVocabulary.PORTAL_ROOTBREADCRUMBURL);
|
protected DatatypeProperty PORTAL_ROOTBREADCRUMBURL = _constModel.createDatatypeProperty(VitroVocabulary.PORTAL_ROOTBREADCRUMBURL);
|
||||||
|
|
|
@ -103,17 +103,29 @@ public class JenaModelUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
private final OntModelSpec DEFAULT_ONT_MODEL_SPEC = OntModelSpec.OWL_MEM;
|
private final OntModelSpec DEFAULT_ONT_MODEL_SPEC = OntModelSpec.OWL_MEM;
|
||||||
|
private final boolean NORMAL = false;
|
||||||
|
private final boolean AGGRESSIVE = true;
|
||||||
|
|
||||||
|
|
||||||
public OntModel extractTBox( Model inputModel ) {
|
public OntModel extractTBox( Model inputModel ) {
|
||||||
return extractTBox(inputModel, null);
|
return extractTBox(inputModel, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public OntModel extractTBox( Model inputModel, boolean MODE ) {
|
||||||
|
Dataset dataset = DatasetFactory.create(inputModel);
|
||||||
|
return extractTBox(dataset, null, null, MODE);
|
||||||
|
}
|
||||||
|
|
||||||
public OntModel extractTBox( Model inputModel, String namespace ) {
|
public OntModel extractTBox( Model inputModel, String namespace ) {
|
||||||
Dataset dataset = DatasetFactory.create(inputModel);
|
Dataset dataset = DatasetFactory.create(inputModel);
|
||||||
return extractTBox( dataset, namespace, null );
|
return extractTBox( dataset, namespace, null, NORMAL );
|
||||||
}
|
}
|
||||||
|
|
||||||
public OntModel extractTBox( Dataset dataset, String namespace, String graphURI) {
|
public OntModel extractTBox( Dataset dataset, String namespace, String graphURI) {
|
||||||
|
return extractTBox( dataset, namespace, graphURI, NORMAL);
|
||||||
|
}
|
||||||
|
|
||||||
|
public OntModel extractTBox( Dataset dataset, String namespace, String graphURI, boolean mode ) {
|
||||||
OntModel tboxModel = ModelFactory.createOntologyModel(DEFAULT_ONT_MODEL_SPEC);
|
OntModel tboxModel = ModelFactory.createOntologyModel(DEFAULT_ONT_MODEL_SPEC);
|
||||||
|
|
||||||
List<String> queryStrList = new LinkedList<String>();
|
List<String> queryStrList = new LinkedList<String>();
|
||||||
|
@ -121,6 +133,7 @@ private final OntModelSpec DEFAULT_ONT_MODEL_SPEC = OntModelSpec.OWL_MEM;
|
||||||
// Use SPARQL DESCRIBE queries to extract the RDF for named ontology entities
|
// Use SPARQL DESCRIBE queries to extract the RDF for named ontology entities
|
||||||
|
|
||||||
queryStrList.add( makeDescribeQueryStr( OWL.Class.getURI(), namespace, graphURI ) );
|
queryStrList.add( makeDescribeQueryStr( OWL.Class.getURI(), namespace, graphURI ) );
|
||||||
|
queryStrList.add( makeDescribeQueryStr( OWL.Restriction.getURI(), namespace, graphURI ) );
|
||||||
queryStrList.add( makeDescribeQueryStr( OWL.ObjectProperty.getURI(), namespace, graphURI ) );
|
queryStrList.add( makeDescribeQueryStr( OWL.ObjectProperty.getURI(), namespace, graphURI ) );
|
||||||
queryStrList.add( makeDescribeQueryStr( OWL.DatatypeProperty.getURI(), namespace, graphURI ) );
|
queryStrList.add( makeDescribeQueryStr( OWL.DatatypeProperty.getURI(), namespace, graphURI ) );
|
||||||
queryStrList.add( makeDescribeQueryStr( OWL.AnnotationProperty.getURI(), namespace, graphURI ) );
|
queryStrList.add( makeDescribeQueryStr( OWL.AnnotationProperty.getURI(), namespace, graphURI ) );
|
||||||
|
@ -144,8 +157,56 @@ private final OntModelSpec DEFAULT_ONT_MODEL_SPEC = OntModelSpec.OWL_MEM;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Perform possibly-redundant extraction to try ensure we don't miss
|
||||||
|
// individual axioms floating around. We still might miss things;
|
||||||
|
// this approach isn't perfect.
|
||||||
|
if (mode = AGGRESSIVE) {
|
||||||
|
tboxModel.add(construct(dataset, namespace, graphURI, RDFS.subClassOf));
|
||||||
|
tboxModel.add(construct(dataset, namespace, graphURI, RDFS.subPropertyOf));
|
||||||
|
tboxModel.add(construct(dataset, namespace, graphURI, OWL.equivalentClass));
|
||||||
|
tboxModel.add(construct(dataset, namespace, graphURI, OWL.unionOf));
|
||||||
|
tboxModel.add(construct(dataset, namespace, graphURI, OWL.intersectionOf));
|
||||||
|
tboxModel.add(construct(dataset, namespace, graphURI, OWL.complementOf));
|
||||||
|
tboxModel.add(construct(dataset, namespace, graphURI, OWL.onProperty));
|
||||||
|
tboxModel.add(construct(dataset, namespace, graphURI, OWL.allValuesFrom));
|
||||||
|
tboxModel.add(construct(dataset, namespace, graphURI, OWL.someValuesFrom));
|
||||||
|
tboxModel.add(construct(dataset, namespace, graphURI, OWL.hasValue));
|
||||||
|
tboxModel.add(construct(dataset, namespace, graphURI, OWL.minCardinality));
|
||||||
|
tboxModel.add(construct(dataset, namespace, graphURI, OWL.maxCardinality));
|
||||||
|
tboxModel.add(construct(dataset, namespace, graphURI, OWL.cardinality));
|
||||||
|
tboxModel.add(construct(dataset, namespace, graphURI, OWL.disjointWith));
|
||||||
|
}
|
||||||
return tboxModel;
|
return tboxModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Model construct(Dataset dataset,
|
||||||
|
String namespace,
|
||||||
|
String graphURI,
|
||||||
|
Resource property) {
|
||||||
|
dataset.getLock().enterCriticalSection(Lock.READ);
|
||||||
|
try {
|
||||||
|
StringBuffer buff = new StringBuffer();
|
||||||
|
buff.append("PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> \n")
|
||||||
|
.append("CONSTRUCT { \n")
|
||||||
|
.append(" ?res <" + property.getURI() + "> ?o WHERE { \n");
|
||||||
|
if (graphURI != null) {
|
||||||
|
buff.append(" GRAPH " + graphURI + " { \n");
|
||||||
|
}
|
||||||
|
buff.append(" ?res <" + property.getURI() + "> ?o \n");
|
||||||
|
buff.append(getNamespaceFilter(namespace));
|
||||||
|
if (graphURI != null) {
|
||||||
|
buff.append(" } \n");
|
||||||
|
}
|
||||||
|
Query constructProp = QueryFactory.create(buff.toString());
|
||||||
|
QueryExecution qe = QueryExecutionFactory.create(constructProp, dataset);
|
||||||
|
try {
|
||||||
|
return qe.execConstruct();
|
||||||
|
} finally {
|
||||||
|
qe.close();
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
dataset.getLock().leaveCriticalSection();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private String makeDescribeQueryStr( String typeURI, String namespace ) {
|
private String makeDescribeQueryStr( String typeURI, String namespace ) {
|
||||||
|
@ -166,31 +227,10 @@ private final OntModelSpec DEFAULT_ONT_MODEL_SPEC = OntModelSpec.OWL_MEM;
|
||||||
.append(" ?res rdf:type <").append(typeURI).append("> . \n");
|
.append(" ?res rdf:type <").append(typeURI).append("> . \n");
|
||||||
|
|
||||||
describeQueryStrBuff
|
describeQueryStrBuff
|
||||||
.append(" FILTER (!isBlank(?res)) \n");
|
.append(" FILTER (!isBlank(?res)) \n")
|
||||||
|
|
||||||
|
.append(getNamespaceFilter(namespace));
|
||||||
|
|
||||||
if (namespace == null) {
|
|
||||||
// exclude resources in the Vitro internal namespace or in the
|
|
||||||
// OWL namespace, but allow all others
|
|
||||||
describeQueryStrBuff
|
|
||||||
//.append(" FILTER (afn:namespace(?res) != \"")
|
|
||||||
//.append("http://vitro.mannlib.cornell.edu/ns/vitro/0.7#")
|
|
||||||
//.append("\") \n")
|
|
||||||
.append(" FILTER (afn:namespace(?res) != \"")
|
|
||||||
.append("http://www.w3.org/2002/07/owl#")
|
|
||||||
.append("\") \n")
|
|
||||||
//.append(" FILTER (?res != <")
|
|
||||||
//.append("http://vitro.mannlib.cornell.edu/ns/vitro/0.7")
|
|
||||||
//.append(">) \n")
|
|
||||||
.append(" FILTER (?res != <")
|
|
||||||
.append("http://www.w3.org/2002/07/owl")
|
|
||||||
.append(">) \n");
|
|
||||||
} else {
|
|
||||||
// limit resources to those in the supplied namespace
|
|
||||||
describeQueryStrBuff
|
|
||||||
.append(" FILTER (afn:namespace(?res) = \"")
|
|
||||||
.append(namespace)
|
|
||||||
.append("\") \n");
|
|
||||||
}
|
|
||||||
if (graphURI != null) {
|
if (graphURI != null) {
|
||||||
describeQueryStrBuff
|
describeQueryStrBuff
|
||||||
.append("} \n");
|
.append("} \n");
|
||||||
|
@ -202,6 +242,28 @@ private final OntModelSpec DEFAULT_ONT_MODEL_SPEC = OntModelSpec.OWL_MEM;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String getNamespaceFilter(String namespace) {
|
||||||
|
StringBuffer buff = new StringBuffer();
|
||||||
|
if (namespace == null) {
|
||||||
|
// exclude resources in the Vitro internal namespace or in the
|
||||||
|
// OWL namespace, but allow all others
|
||||||
|
buff
|
||||||
|
.append(" FILTER (afn:namespace(?res) != \"")
|
||||||
|
.append("http://www.w3.org/2002/07/owl#")
|
||||||
|
.append("\") \n")
|
||||||
|
.append(" FILTER (?res != <")
|
||||||
|
.append("http://www.w3.org/2002/07/owl")
|
||||||
|
.append(">) \n");
|
||||||
|
} else {
|
||||||
|
// limit resources to those in the supplied namespace
|
||||||
|
buff
|
||||||
|
.append(" FILTER (afn:namespace(?res) = \"")
|
||||||
|
.append(namespace)
|
||||||
|
.append("\") \n");
|
||||||
|
}
|
||||||
|
return buff.toString();
|
||||||
|
}
|
||||||
|
|
||||||
public Model extractABox(Model inputModel){
|
public Model extractABox(Model inputModel){
|
||||||
Dataset dataset = DatasetFactory.create(inputModel);
|
Dataset dataset = DatasetFactory.create(inputModel);
|
||||||
return extractABox(dataset, null, null);
|
return extractABox(dataset, null, null);
|
||||||
|
@ -221,7 +283,6 @@ private final OntModelSpec DEFAULT_ONT_MODEL_SPEC = OntModelSpec.OWL_MEM;
|
||||||
//: ModelFactory.createOntologyModel( DEFAULT_ONT_MODEL_SPEC, inputModel );
|
//: ModelFactory.createOntologyModel( DEFAULT_ONT_MODEL_SPEC, inputModel );
|
||||||
OntModel ontModel = extractTBox(unionDataset, null, graphURI);
|
OntModel ontModel = extractTBox(unionDataset, null, graphURI);
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ontModel.enterCriticalSection(Lock.READ);
|
ontModel.enterCriticalSection(Lock.READ);
|
||||||
Iterator classIt = ontModel.listNamedClasses();
|
Iterator classIt = ontModel.listNamedClasses();
|
||||||
|
|
|
@ -1,212 +0,0 @@
|
||||||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
|
||||||
|
|
||||||
package edu.cornell.mannlib.vitro.webapp.dao.jena;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
|
||||||
import org.apache.commons.logging.LogFactory;
|
|
||||||
|
|
||||||
import com.hp.hpl.jena.rdf.model.Literal;
|
|
||||||
import com.hp.hpl.jena.rdf.model.Statement;
|
|
||||||
import com.hp.hpl.jena.shared.Lock;
|
|
||||||
import com.hp.hpl.jena.util.iterator.ClosableIterator;
|
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatementImpl;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.IndividualImpl;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Keyword;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.VClass;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.InsertException;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.KeywordDao;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
|
|
||||||
|
|
||||||
public class KeywordDaoJena extends JenaBaseDao implements KeywordDao {
|
|
||||||
private static final Log log = LogFactory.getLog(KeywordDaoJena.class.getName());
|
|
||||||
|
|
||||||
private String KEYWORD_URI_PREFIX = DEFAULT_NAMESPACE + "keyword";
|
|
||||||
|
|
||||||
private WebappDaoFactory webappDaoFactory = null;
|
|
||||||
|
|
||||||
public KeywordDaoJena(WebappDaoFactoryJena wadf) {
|
|
||||||
super(wadf);
|
|
||||||
this.webappDaoFactory = getWebappDaoFactory();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void deleteKeyword(Keyword keyword) {
|
|
||||||
webappDaoFactory.getIndividualDao().deleteIndividual(KEYWORD_URI_PREFIX+keyword.getId());
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Keyword> getAllKeywords() {
|
|
||||||
VClass keywordClass = webappDaoFactory.getVClassDao().getVClassByURI(KEYWORD.getURI());
|
|
||||||
List keywordInds = webappDaoFactory.getIndividualDao().getIndividualsByVClass(keywordClass);
|
|
||||||
List keywords = new ArrayList();
|
|
||||||
Iterator keywordIndIt = keywordInds.iterator();
|
|
||||||
while (keywordIndIt.hasNext()) {
|
|
||||||
keywords.add(keywordFromKeywordIndividual((Individual)keywordIndIt.next()));
|
|
||||||
}
|
|
||||||
return keywords;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Keyword> getKeywordsByStem(String stem) {
|
|
||||||
List<Keyword> matchingKeywords = new ArrayList<Keyword>();
|
|
||||||
List<Keyword> all = getAllKeywords();
|
|
||||||
Iterator<Keyword> allIt = all.iterator();
|
|
||||||
while (allIt.hasNext()) {
|
|
||||||
Keyword k = allIt.next();
|
|
||||||
if (k.getStem()!= null && k.getStem().equalsIgnoreCase(stem)) {
|
|
||||||
matchingKeywords.add(k);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return matchingKeywords;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List getAllOrigins() {
|
|
||||||
List origins = new ArrayList();
|
|
||||||
HashSet originSet = new HashSet();
|
|
||||||
getOntModel().enterCriticalSection(Lock.READ);
|
|
||||||
try {
|
|
||||||
ClosableIterator stmtIt = getOntModel().listStatements(null, KEYWORD_ORIGIN, (Literal)null);
|
|
||||||
try {
|
|
||||||
while (stmtIt.hasNext()) {
|
|
||||||
Statement stmt = (Statement) stmtIt.next();
|
|
||||||
Literal lit = (Literal) stmt.getObject();
|
|
||||||
String originStr = (String)lit.getString();
|
|
||||||
if (!originSet.contains(originStr)) {
|
|
||||||
originSet.add(originStr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
stmtIt.close();
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
getOntModel().leaveCriticalSection();
|
|
||||||
}
|
|
||||||
origins.addAll(originSet);
|
|
||||||
return origins;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Keyword getKeywordById(int id) {
|
|
||||||
Individual keywordIndividual = webappDaoFactory.getIndividualDao().getIndividualByURI(KEYWORD_URI_PREFIX+id);
|
|
||||||
Keyword k = keywordFromKeywordIndividual(keywordIndividual);
|
|
||||||
k.setId(id);
|
|
||||||
return k;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Keyword keywordFromKeywordIndividual(Individual keywordIndividual) {
|
|
||||||
Keyword keyword = new Keyword();
|
|
||||||
if (keywordIndividual != null) {
|
|
||||||
keyword.setTerm(keywordIndividual.getName());
|
|
||||||
keyword.setId(Integer.decode(keywordIndividual.getLocalName().substring(7,keywordIndividual.getLocalName().length())));
|
|
||||||
try {
|
|
||||||
keyword.setStem( ((DataPropertyStatement)(webappDaoFactory.getDataPropertyStatementDao().getDataPropertyStatementsForIndividualByDataPropertyURI(keywordIndividual, KEYWORD_STEM.getURI()).toArray())[0]).getData() );
|
|
||||||
} catch (Exception e) {
|
|
||||||
// e.printStackTrace();
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
keyword.setOrigin( ((DataPropertyStatement)(webappDaoFactory.getDataPropertyStatementDao().getDataPropertyStatementsForIndividualByDataPropertyURI(keywordIndividual, KEYWORD_ORIGIN.getURI()).toArray())[0]).getData() );
|
|
||||||
} catch (Exception e) {
|
|
||||||
// e.printStackTrace();
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
keyword.setType( ((DataPropertyStatement)(webappDaoFactory.getDataPropertyStatementDao().getDataPropertyStatementsForIndividualByDataPropertyURI(keywordIndividual, KEYWORD_TYPE.getURI()).toArray())[0]).getData() );
|
|
||||||
} catch (Exception e) {
|
|
||||||
// e.printStackTrace();
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
keyword.setSource( ((DataPropertyStatement)(webappDaoFactory.getDataPropertyStatementDao().getDataPropertyStatementsForIndividualByDataPropertyURI(keywordIndividual, KEYWORD_SOURCE.getURI()).toArray())[0]).getData() );
|
|
||||||
} catch (Exception e) {
|
|
||||||
// e.printStackTrace();
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
keyword.setComments( ((DataPropertyStatement)(webappDaoFactory.getDataPropertyStatementDao().getDataPropertyStatementsForIndividualByDataPropertyURI(keywordIndividual, KEYWORD_COMMENTS.getURI()).toArray())[0]).getData() );
|
|
||||||
} catch (Exception e) {
|
|
||||||
// e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return keyword;
|
|
||||||
}
|
|
||||||
|
|
||||||
public synchronized int insertNewKeyword(Keyword k) {
|
|
||||||
int kId = -1;
|
|
||||||
if (k.getId()>0) {
|
|
||||||
kId = k.getId();
|
|
||||||
} else {
|
|
||||||
String term = k.getTerm();
|
|
||||||
int count = 0;
|
|
||||||
while ((webappDaoFactory.getIndividualDao().getIndividualByURI(KEYWORD_URI_PREFIX+Math.abs(term.hashCode())) != null) && count < 32) {
|
|
||||||
term+="a";
|
|
||||||
log.debug(term);
|
|
||||||
log.debug(KEYWORD_URI_PREFIX+Math.abs(term.hashCode()));
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
|
|
||||||
kId = Math.abs(term.hashCode());
|
|
||||||
}
|
|
||||||
Individual keywordIndividual = new IndividualImpl();
|
|
||||||
keywordIndividual.setURI(KEYWORD_URI_PREFIX+kId);
|
|
||||||
keywordIndividual.setVClassURI(KEYWORD.getURI());
|
|
||||||
keywordIndividual.setName(k.getTerm());
|
|
||||||
String keywordURI = null;
|
|
||||||
try {
|
|
||||||
keywordURI = webappDaoFactory.getIndividualDao().insertNewIndividual(keywordIndividual);
|
|
||||||
} catch (InsertException e) {
|
|
||||||
log.error(e, e);
|
|
||||||
}
|
|
||||||
log.debug("KeywordDaoJena.insertNewKeyword() : "+keywordURI);
|
|
||||||
|
|
||||||
DataPropertyStatement stem = new DataPropertyStatementImpl();
|
|
||||||
log.debug("KeywordDaoJena.insertNewKeyword() stem : "+k.getStem());
|
|
||||||
stem.setData(k.getStem());
|
|
||||||
stem.setDatapropURI(KEYWORD_STEM.getURI());
|
|
||||||
stem.setIndividualURI(keywordURI);
|
|
||||||
webappDaoFactory.getDataPropertyStatementDao().insertNewDataPropertyStatement(stem);
|
|
||||||
|
|
||||||
log.debug("KeywordDaoJena.insertNewKeyword() type : "+k.getType());
|
|
||||||
DataPropertyStatement type = new DataPropertyStatementImpl();
|
|
||||||
type.setData(k.getType());
|
|
||||||
type.setDatapropURI(KEYWORD_TYPE.getURI());
|
|
||||||
type.setIndividualURI(keywordURI);
|
|
||||||
webappDaoFactory.getDataPropertyStatementDao().insertNewDataPropertyStatement(type);
|
|
||||||
|
|
||||||
log.debug("KeywordDaoJena.insertNewKeyword() source : "+k.getSource());
|
|
||||||
if (k.getSource()==null || k.getSource().equals("")) {
|
|
||||||
k.setSource("unspecified");
|
|
||||||
}
|
|
||||||
DataPropertyStatement source = new DataPropertyStatementImpl();
|
|
||||||
source.setData(k.getSource());
|
|
||||||
source.setDatapropURI(KEYWORD_SOURCE.getURI());
|
|
||||||
source.setIndividualURI(keywordURI);
|
|
||||||
webappDaoFactory.getDataPropertyStatementDao().insertNewDataPropertyStatement(source);
|
|
||||||
|
|
||||||
log.debug("KeywordDaoJena.insertNewKeyword() origin : "+k.getOrigin());
|
|
||||||
if (k.getOrigin()==null || k.getOrigin().equals("")) {
|
|
||||||
k.setOrigin("unspecified");
|
|
||||||
}
|
|
||||||
DataPropertyStatement origin = new DataPropertyStatementImpl();
|
|
||||||
origin.setData(k.getOrigin());
|
|
||||||
origin.setDatapropURI(KEYWORD_ORIGIN.getURI());
|
|
||||||
origin.setIndividualURI(keywordURI);
|
|
||||||
webappDaoFactory.getDataPropertyStatementDao().insertNewDataPropertyStatement(origin);
|
|
||||||
|
|
||||||
if (k.getComments()!=null && !k.getComments().equals("")) {
|
|
||||||
log.debug("KeywordDaoJena.insertNewKeyword() comments : "+k.getComments());
|
|
||||||
DataPropertyStatement comments = new DataPropertyStatementImpl();
|
|
||||||
comments.setData(k.getComments());
|
|
||||||
comments.setDatapropURI(KEYWORD_COMMENTS.getURI());
|
|
||||||
comments.setIndividualURI(keywordURI);
|
|
||||||
webappDaoFactory.getDataPropertyStatementDao().insertNewDataPropertyStatement(comments);
|
|
||||||
}
|
|
||||||
return kId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateKeyword(Keyword k) {
|
|
||||||
deleteKeyword(k);
|
|
||||||
insertNewKeyword(k);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,184 +0,0 @@
|
||||||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
|
||||||
|
|
||||||
package edu.cornell.mannlib.vitro.webapp.dao.jena;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.hp.hpl.jena.ontology.OntClass;
|
|
||||||
import com.hp.hpl.jena.ontology.OntModel;
|
|
||||||
import com.hp.hpl.jena.rdf.model.Resource;
|
|
||||||
import com.hp.hpl.jena.rdf.model.ResourceFactory;
|
|
||||||
import com.hp.hpl.jena.rdf.model.Statement;
|
|
||||||
import com.hp.hpl.jena.shared.Lock;
|
|
||||||
import com.hp.hpl.jena.util.iterator.ClosableIterator;
|
|
||||||
import com.hp.hpl.jena.vocabulary.RDF;
|
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.KeywordIndividualRelation;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.KeywordIndividualRelationDao;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
|
|
||||||
|
|
||||||
public class KeywordIndividualRelationDaoJena extends JenaBaseDao implements KeywordIndividualRelationDao {
|
|
||||||
|
|
||||||
public KeywordIndividualRelationDaoJena(WebappDaoFactoryJena wadf) {
|
|
||||||
super(wadf);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected OntModel getOntModel() {
|
|
||||||
return getOntModelSelector().getABoxModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void deleteKeywordIndividualRelation(KeywordIndividualRelation k) {
|
|
||||||
deleteKeywordIndividualRelation(k,getOntModel());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void deleteKeywordIndividualRelation(KeywordIndividualRelation k, OntModel ontModel) {
|
|
||||||
ontModel.enterCriticalSection(Lock.WRITE);
|
|
||||||
try {
|
|
||||||
com.hp.hpl.jena.ontology.Individual kirInd = ontModel.getIndividual(k.getURI());
|
|
||||||
if (kirInd != null) {
|
|
||||||
kirInd.remove();
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
ontModel.leaveCriticalSection();
|
|
||||||
}
|
|
||||||
if (k.getEntURI() != null) {
|
|
||||||
Individual ind = getWebappDaoFactory().getIndividualDao().getIndividualByURI(k.getEntURI());
|
|
||||||
getWebappDaoFactory().getIndividualDao().markModified(ind);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public KeywordIndividualRelation getKeywordIndividualRelationByURI(String URI) {
|
|
||||||
com.hp.hpl.jena.ontology.Individual kirInd = getOntModel().getIndividual(URI);
|
|
||||||
if (kirInd != null) {
|
|
||||||
return keywordIndividualRelationFromIndividual(kirInd);
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<KeywordIndividualRelation> getKeywordIndividualRelationsByIndividualURI(String individualURI) {
|
|
||||||
List kirList = new ArrayList();
|
|
||||||
if (individualURI == null) {
|
|
||||||
return kirList;
|
|
||||||
}
|
|
||||||
getOntModel().enterCriticalSection(Lock.READ);
|
|
||||||
try {
|
|
||||||
Resource individual = ResourceFactory.createResource(individualURI);
|
|
||||||
if (individual != null) {
|
|
||||||
ClosableIterator stmtIt = getOntModel().listStatements(null, KEYWORD_INDIVIDUALRELATION_INVOLVESINDIVIDUAL, individual);
|
|
||||||
try {
|
|
||||||
while (stmtIt.hasNext()) {
|
|
||||||
Statement stmt = (Statement) stmtIt.next();
|
|
||||||
Resource kirRes = stmt.getSubject();
|
|
||||||
if (kirRes != null) {
|
|
||||||
boolean checked = false;
|
|
||||||
ClosableIterator checkIt = kirRes.listProperties(RDF.type);
|
|
||||||
try {
|
|
||||||
while (checkIt.hasNext()) {
|
|
||||||
Statement chk = (Statement) checkIt.next();
|
|
||||||
if (((Resource)chk.getObject()).getURI().equals(KEYWORD_INDIVIDUALRELATION.getURI())) {
|
|
||||||
checked = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
checkIt.close();
|
|
||||||
}
|
|
||||||
if (checked) {
|
|
||||||
com.hp.hpl.jena.ontology.Individual kirInd = getOntModel().getIndividual(kirRes.getURI());
|
|
||||||
kirList.add(keywordIndividualRelationFromIndividual(kirInd));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
stmtIt.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
getOntModel().leaveCriticalSection();
|
|
||||||
}
|
|
||||||
return kirList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String insertNewKeywordIndividualRelation(KeywordIndividualRelation k) {
|
|
||||||
return insertNewKeywordIndividualRelation(k,getOntModel());
|
|
||||||
}
|
|
||||||
|
|
||||||
public String insertNewKeywordIndividualRelation(KeywordIndividualRelation k, OntModel ontModel) {
|
|
||||||
ontModel.enterCriticalSection(Lock.WRITE);
|
|
||||||
String uriToUse = null;
|
|
||||||
try {
|
|
||||||
Resource individual = ontModel.getResource(k.getEntURI());
|
|
||||||
Resource keyword = ontModel.getResource(DEFAULT_NAMESPACE+"keyword"+k.getKeyId());
|
|
||||||
if (k.getURI() != null) {
|
|
||||||
uriToUse = k.getURI();
|
|
||||||
} else {
|
|
||||||
String dedup = DEFAULT_NAMESPACE+"keywordIndividualRelation_"+k.getKeyId()+"_"+individual.getLocalName();
|
|
||||||
//while (ontModel.getResource(dedup) != null) {
|
|
||||||
// dedup += "a";
|
|
||||||
//}
|
|
||||||
uriToUse = dedup;
|
|
||||||
}
|
|
||||||
OntClass KeywordIndividualRelationOntClass = ontModel.getOntClass(VitroVocabulary.KEYWORD_INDIVIDUALRELATION);
|
|
||||||
if (KeywordIndividualRelationOntClass != null) {
|
|
||||||
com.hp.hpl.jena.ontology.Individual tirInd = KeywordIndividualRelationOntClass.createIndividual(uriToUse);
|
|
||||||
addPropertyResourceValue(tirInd, KEYWORD_INDIVIDUALRELATION_INVOLVESKEYWORD, keyword);
|
|
||||||
addPropertyResourceValue(tirInd, KEYWORD_INDIVIDUALRELATION_INVOLVESINDIVIDUAL, individual);
|
|
||||||
addPropertyStringValue(tirInd, KEYWORD_INDIVIDUALRELATION_MODE, k.getMode(), ontModel);
|
|
||||||
} else {
|
|
||||||
log.error(VitroVocabulary.KEYWORD_INDIVIDUALRELATION+" class not found");
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
ontModel.leaveCriticalSection();
|
|
||||||
}
|
|
||||||
if (k.getEntURI() != null) {
|
|
||||||
Individual ind = getWebappDaoFactory().getIndividualDao().getIndividualByURI(k.getEntURI());
|
|
||||||
getWebappDaoFactory().getIndividualDao().markModified(ind);
|
|
||||||
}
|
|
||||||
return uriToUse;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateKeywordIndividualRelation(KeywordIndividualRelation k) {
|
|
||||||
updateKeywordIndividualRelation(k,getOntModel());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateKeywordIndividualRelation(KeywordIndividualRelation k, OntModel ontModel) {
|
|
||||||
ontModel.enterCriticalSection(Lock.WRITE);
|
|
||||||
try {
|
|
||||||
com.hp.hpl.jena.ontology.Individual kirInd = ontModel.getIndividual(k.getURI());
|
|
||||||
Resource individual = ontModel.getResource(k.getEntURI());
|
|
||||||
Resource keyword = ontModel.getResource(DEFAULT_NAMESPACE+"keyword"+k.getKeyId());
|
|
||||||
updatePropertyResourceValue(kirInd, KEYWORD_INDIVIDUALRELATION_INVOLVESKEYWORD, keyword);
|
|
||||||
updatePropertyResourceValue(kirInd, KEYWORD_INDIVIDUALRELATION_INVOLVESINDIVIDUAL, individual);
|
|
||||||
updatePropertyStringValue(kirInd, KEYWORD_INDIVIDUALRELATION_MODE, k.getMode(), ontModel);
|
|
||||||
} finally {
|
|
||||||
ontModel.leaveCriticalSection();
|
|
||||||
}
|
|
||||||
if (k.getEntURI() != null) {
|
|
||||||
Individual ind = getWebappDaoFactory().getIndividualDao().getIndividualByURI(k.getEntURI());
|
|
||||||
getWebappDaoFactory().getIndividualDao().markModified(ind);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private KeywordIndividualRelation keywordIndividualRelationFromIndividual(com.hp.hpl.jena.ontology.Individual ind) {
|
|
||||||
KeywordIndividualRelation kir = new KeywordIndividualRelation();
|
|
||||||
kir.setURI(ind.getURI());
|
|
||||||
try {
|
|
||||||
kir.setEntURI(((Resource)ind.getPropertyValue(KEYWORD_INDIVIDUALRELATION_INVOLVESINDIVIDUAL)).getURI());
|
|
||||||
} catch (Exception e) {/* TODO log */}
|
|
||||||
try {
|
|
||||||
String keywordLocalName = ((Resource)ind.getPropertyValue(KEYWORD_INDIVIDUALRELATION_INVOLVESKEYWORD)).getLocalName();
|
|
||||||
kir.setKeyId(Integer.decode(keywordLocalName.substring(7,keywordLocalName.length())));
|
|
||||||
|
|
||||||
} catch (Exception e) {/* TODO log */}
|
|
||||||
kir.setMode(getPropertyStringValue(ind,KEYWORD_INDIVIDUALRELATION_MODE));
|
|
||||||
return kir;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,385 +0,0 @@
|
||||||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
|
||||||
|
|
||||||
package edu.cornell.mannlib.vitro.webapp.dao.jena;
|
|
||||||
|
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.net.URLDecoder;
|
|
||||||
import java.net.URLEncoder;
|
|
||||||
import java.text.Collator;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
|
||||||
import org.apache.commons.logging.LogFactory;
|
|
||||||
|
|
||||||
import com.hp.hpl.jena.datatypes.xsd.XSDDatatype;
|
|
||||||
import com.hp.hpl.jena.ontology.OntModel;
|
|
||||||
import com.hp.hpl.jena.rdf.model.Literal;
|
|
||||||
import com.hp.hpl.jena.rdf.model.Resource;
|
|
||||||
import com.hp.hpl.jena.rdf.model.ResourceFactory;
|
|
||||||
import com.hp.hpl.jena.rdf.model.Statement;
|
|
||||||
import com.hp.hpl.jena.shared.Lock;
|
|
||||||
import com.hp.hpl.jena.util.iterator.ClosableIterator;
|
|
||||||
import com.hp.hpl.jena.vocabulary.RDF;
|
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Link;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatementImpl;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.LinksDao;
|
|
||||||
|
|
||||||
public class LinksDaoJena extends JenaBaseDao implements LinksDao {
|
|
||||||
|
|
||||||
protected static final Log log = LogFactory.getLog(LinksDaoJena.class.getName());
|
|
||||||
|
|
||||||
public LinksDaoJena(WebappDaoFactoryJena wadf) {
|
|
||||||
super(wadf);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected OntModel getOntModel() {
|
|
||||||
return getOntModelSelector().getABoxModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addLinksToIndividual(Individual individual) {
|
|
||||||
List<Link> linksList = new ArrayList<Link>();
|
|
||||||
getOntModel().enterCriticalSection(Lock.READ);
|
|
||||||
try {
|
|
||||||
Resource entInd = ResourceFactory.createResource(individual.getURI());
|
|
||||||
if (ADDITIONAL_LINK != null) {
|
|
||||||
ClosableIterator<Statement> links = getOntModel().listStatements(entInd,ADDITIONAL_LINK,(Resource)null);
|
|
||||||
try {
|
|
||||||
while (links.hasNext()) {
|
|
||||||
try {
|
|
||||||
Resource linkRes = (Resource) links.next().getObject();
|
|
||||||
linksList.add(linkFromLinkResource(linkRes, ADDITIONAL_LINK));
|
|
||||||
} catch (ClassCastException cce) {/*no thanks; we don't want any*/}
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
links.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (linksList.size()>1) { // sort
|
|
||||||
Collections.sort(linksList,new Comparator<Link>() {
|
|
||||||
public int compare( Link first, Link second ) {
|
|
||||||
if (first==null) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
if (second==null) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
Collator collator = Collator.getInstance();
|
|
||||||
int compval = collator.compare(first.getDisplayRank(),second.getDisplayRank());
|
|
||||||
if (compval == 0) {
|
|
||||||
String firstAnchor = first.getAnchor();
|
|
||||||
String secondAnchor = second.getAnchor();
|
|
||||||
if (firstAnchor == null) {
|
|
||||||
if (secondAnchor == null) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
if (secondAnchor == null) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
compval = collator.compare(firstAnchor, secondAnchor);
|
|
||||||
}
|
|
||||||
return compval;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
individual.setLinksList(linksList);
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
getOntModel().leaveCriticalSection();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addPrimaryLinkToIndividual(Individual individual) {
|
|
||||||
List<Link> linksList = new ArrayList<Link>();
|
|
||||||
getOntModel().enterCriticalSection(Lock.READ);
|
|
||||||
try {
|
|
||||||
com.hp.hpl.jena.ontology.Individual entInd = getOntModel().getIndividual(individual.getURI());
|
|
||||||
if (PRIMARY_LINK != null) {
|
|
||||||
ClosableIterator<Statement> links = getOntModel().listStatements(entInd,PRIMARY_LINK,(Resource)null);
|
|
||||||
try {
|
|
||||||
while (links.hasNext()) {
|
|
||||||
try {
|
|
||||||
Resource linkRes = (Resource) links.next().getObject();
|
|
||||||
linksList.add(linkFromLinkResource(linkRes,PRIMARY_LINK));
|
|
||||||
} catch (ClassCastException cce) {/*no thanks; we don't want any*/}
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
links.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (linksList.size()>1) { // sort
|
|
||||||
Collections.sort(linksList,new Comparator<Link>() {
|
|
||||||
public int compare( Link first, Link second ) {
|
|
||||||
if (first==null) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
if (second==null) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
Collator collator = Collator.getInstance();
|
|
||||||
int compval = collator.compare(first.getDisplayRank(),second.getDisplayRank());
|
|
||||||
if (compval == 0) {
|
|
||||||
String firstAnchor = first.getAnchor();
|
|
||||||
String secondAnchor = second.getAnchor();
|
|
||||||
if (firstAnchor == null) {
|
|
||||||
if (secondAnchor == null) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
if (secondAnchor == null) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
compval = collator.compare(firstAnchor, secondAnchor);
|
|
||||||
}
|
|
||||||
return compval;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (linksList.size()>0) {
|
|
||||||
Iterator<Link> iter = linksList.iterator();
|
|
||||||
if (iter.hasNext()) { // take the first only
|
|
||||||
individual.setPrimaryLink(iter.next());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
getOntModel().leaveCriticalSection();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void addLinksToIndividualsInObjectPropertyStatement(List<ObjectPropertyStatement> objectPropertyStatements) {
|
|
||||||
if (objectPropertyStatements != null) {
|
|
||||||
Iterator<ObjectPropertyStatement> objectPropertyStatementsIt = objectPropertyStatements.iterator();
|
|
||||||
while (objectPropertyStatementsIt.hasNext()) {
|
|
||||||
ObjectPropertyStatement ops = objectPropertyStatementsIt.next();
|
|
||||||
if (ops.getSubject() != null && ops.getSubject() instanceof Individual)
|
|
||||||
addLinksToIndividual((Individual)ops.getSubject());
|
|
||||||
if (ops.getObject() != null && ops.getObject() instanceof Individual)
|
|
||||||
addLinksToIndividual((Individual)ops.getObject());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void deleteLink(Link link) {
|
|
||||||
deleteLink(link,getOntModel());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void deleteLink(Link link, OntModel ontModel) {
|
|
||||||
ontModel.enterCriticalSection(Lock.WRITE);
|
|
||||||
try {
|
|
||||||
Resource linkRes = ontModel.getResource(link.getURI());
|
|
||||||
if (linkRes != null) {
|
|
||||||
ontModel.removeAll(linkRes, null, null);
|
|
||||||
ontModel.removeAll(null, null, linkRes);
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
ontModel.leaveCriticalSection();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Link getLinkByURI(String URI) {
|
|
||||||
getOntModel().enterCriticalSection(Lock.READ);
|
|
||||||
try {
|
|
||||||
Resource linkRes = getOntModel().getResource(URI);
|
|
||||||
if (linkRes != null) {
|
|
||||||
return linkFromLinkResource(linkRes,ADDITIONAL_LINK);
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
getOntModel().leaveCriticalSection();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public String insertNewLink(Link link) {
|
|
||||||
return insertNewLink(link,getOntModel());
|
|
||||||
}
|
|
||||||
|
|
||||||
public String insertNewLink(Link link, OntModel ontModel) {
|
|
||||||
ontModel.enterCriticalSection(Lock.WRITE);
|
|
||||||
try {
|
|
||||||
Resource indRes = ontModel.getResource(link.getEntityURI());
|
|
||||||
if (indRes == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
String linkUri = null;
|
|
||||||
if (link.getURI() != null && link.getURI().length()>0) {
|
|
||||||
linkUri = link.getURI();
|
|
||||||
} else {
|
|
||||||
linkUri = DEFAULT_NAMESPACE+"link_"+indRes.getLocalName()+link.getAnchor().replaceAll("\\W","");
|
|
||||||
}
|
|
||||||
Resource test = ontModel.getResource(linkUri);
|
|
||||||
int count = 0;
|
|
||||||
while (test != null) {
|
|
||||||
++count;
|
|
||||||
linkUri+="_"+count;
|
|
||||||
test = ontModel.getIndividual(linkUri);
|
|
||||||
}
|
|
||||||
Resource linkRes = ontModel.createResource(linkUri);
|
|
||||||
linkRes.addProperty(RDF.type, LINK);
|
|
||||||
if (link.getTypeURI() != null && link.getTypeURI().length()>0) {
|
|
||||||
try {
|
|
||||||
linkRes.addProperty(RDF.type, ontModel.getResource(link.getTypeURI()));
|
|
||||||
} catch (Exception e) {}
|
|
||||||
}
|
|
||||||
String urlString = link.getUrl();
|
|
||||||
try {
|
|
||||||
urlString = URLEncoder.encode(urlString, "UTF-8");
|
|
||||||
} catch (UnsupportedEncodingException e) {}
|
|
||||||
|
|
||||||
linkRes.addProperty(LINK_URL, urlString, XSDDatatype.XSDanyURI);
|
|
||||||
linkRes.addProperty(LINK_ANCHOR, link.getAnchor(), XSDDatatype.XSDstring);
|
|
||||||
linkRes.addProperty(LINK_DISPLAYRANK, ontModel.createTypedLiteral(link.getDisplayRank())); // String for now
|
|
||||||
|
|
||||||
ontModel.add(indRes, ADDITIONAL_LINK, linkRes);
|
|
||||||
return linkUri;
|
|
||||||
} finally {
|
|
||||||
ontModel.leaveCriticalSection();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateLink(Link link) {
|
|
||||||
updateLink(link,getOntModel());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateLink(Link link, OntModel ontModel) {
|
|
||||||
ontModel.enterCriticalSection(Lock.WRITE);
|
|
||||||
try {
|
|
||||||
Resource linkRes = ontModel.getResource(link.getURI());
|
|
||||||
Resource indRes = ontModel.getResource(link.getEntityURI());
|
|
||||||
if (linkRes != null) {
|
|
||||||
linkRes.removeAll(RDF.type); // BJL note: a transactionless DL reasoner might choke on this approach
|
|
||||||
linkRes.addProperty(RDF.type, LINK);
|
|
||||||
if (link.getTypeURI() != null && link.getTypeURI().length()>0) {
|
|
||||||
try {
|
|
||||||
linkRes.addProperty(RDF.type, ontModel.getResource(link.getTypeURI()));
|
|
||||||
} catch (Exception e) {e.printStackTrace();}
|
|
||||||
}
|
|
||||||
linkRes.removeAll(LINK_URL);
|
|
||||||
String urlString = link.getUrl();
|
|
||||||
try {
|
|
||||||
urlString = URLEncoder.encode(urlString, "UTF-8");
|
|
||||||
} catch (UnsupportedEncodingException e) {}
|
|
||||||
linkRes.addProperty(LINK_URL, urlString, XSDDatatype.XSDanyURI);
|
|
||||||
linkRes.removeAll(LINK_ANCHOR);
|
|
||||||
linkRes.addProperty(LINK_ANCHOR, link.getAnchor(), XSDDatatype.XSDstring);
|
|
||||||
if (indRes != null) {
|
|
||||||
ontModel.removeAll(null, ADDITIONAL_LINK, linkRes);
|
|
||||||
ontModel.add(indRes, ADDITIONAL_LINK, linkRes);
|
|
||||||
}
|
|
||||||
linkRes.removeAll(LINK_DISPLAYRANK);
|
|
||||||
linkRes.addProperty(LINK_DISPLAYRANK, ontModel.createTypedLiteral(link.getDisplayRank())); // String for now
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
ontModel.leaveCriticalSection();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private Link linkFromLinkResource(Resource linkRes, com.hp.hpl.jena.ontology.ObjectProperty whichLinkProp) {
|
|
||||||
Link link = new Link();
|
|
||||||
link.setURI(linkRes.getURI());
|
|
||||||
ClosableIterator<Statement> typesIt = linkRes.listProperties(RDF.type);
|
|
||||||
try {
|
|
||||||
while (typesIt.hasNext()) {
|
|
||||||
Statement st = typesIt.next();
|
|
||||||
try {
|
|
||||||
Resource typeRes = (Resource) st.getObject();
|
|
||||||
if (!typeRes.getURI().equalsIgnoreCase(LINK.getURI())) { // TODO: remove IgnoreCase ; there because some serializations use "link" instead of "Link"
|
|
||||||
link.setTypeURI(typeRes.getURI());
|
|
||||||
}
|
|
||||||
} catch (ClassCastException e) {}
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
typesIt.close();
|
|
||||||
}
|
|
||||||
if (LINK_ANCHOR != null) {
|
|
||||||
try {
|
|
||||||
ClosableIterator<Statement> anchorStatements = getOntModel().listStatements(linkRes, LINK_ANCHOR, (Literal)null);
|
|
||||||
try {
|
|
||||||
if (anchorStatements.hasNext()) {
|
|
||||||
Literal l = (Literal) anchorStatements.next().getObject();
|
|
||||||
if (l != null) {
|
|
||||||
link.setAnchor(l.getString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
anchorStatements.close();
|
|
||||||
}
|
|
||||||
} catch (ClassCastException e) {}
|
|
||||||
}
|
|
||||||
if (LINK_URL != null) {
|
|
||||||
try {
|
|
||||||
ClosableIterator<Statement> UrlStatements = getOntModel().listStatements(linkRes, LINK_URL, (Literal)null);
|
|
||||||
try {
|
|
||||||
if (UrlStatements.hasNext()) {
|
|
||||||
Literal l = (Literal) UrlStatements.next().getObject();
|
|
||||||
if (l != null) {
|
|
||||||
if( (l.getDatatype() != null) && XSDDatatype.XSDanyURI.equals(l.getDatatype()) ) {
|
|
||||||
try {
|
|
||||||
link.setUrl(URLDecoder.decode(l.getLexicalForm(),"UTF-8"));
|
|
||||||
} catch (UnsupportedEncodingException use) {}
|
|
||||||
} else {
|
|
||||||
link.setUrl(l.getLexicalForm());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
UrlStatements.close();
|
|
||||||
}
|
|
||||||
} catch (ClassCastException e) {}
|
|
||||||
}
|
|
||||||
if (LINK_DISPLAYRANK != null) {
|
|
||||||
try {
|
|
||||||
ClosableIterator<Statement> rankStatements = getOntModel().listStatements(linkRes, LINK_DISPLAYRANK, (Literal)null);
|
|
||||||
try {
|
|
||||||
if (rankStatements.hasNext()) {
|
|
||||||
Literal l = (Literal) rankStatements.next().getObject();
|
|
||||||
if (l != null) {
|
|
||||||
if (l.getDatatype()==XSDDatatype.XSDinteger) {
|
|
||||||
link.setDisplayRank(String.valueOf(l.getInt()));
|
|
||||||
} else if (l.getDatatype()==XSDDatatype.XSDstring) {
|
|
||||||
link.setDisplayRank(l.getString());
|
|
||||||
} else {
|
|
||||||
log.debug("unexpected literal datatype; saved as displayRank 10");
|
|
||||||
link.setDisplayRank("10");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
rankStatements.close();
|
|
||||||
}
|
|
||||||
} catch (ClassCastException e) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
ClosableIterator<Statement> stmtIt = getOntModel().listStatements(null, (com.hp.hpl.jena.rdf.model.Property)whichLinkProp, linkRes); // jena Property, not vitro Property
|
|
||||||
try {
|
|
||||||
if (stmtIt.hasNext()) {
|
|
||||||
Statement stmt = stmtIt.next();
|
|
||||||
Resource indRes = stmt.getSubject();
|
|
||||||
link.setEntityURI(indRes.getURI());
|
|
||||||
ObjectPropertyStatement op = new ObjectPropertyStatementImpl();
|
|
||||||
op.setPropertyURI(whichLinkProp.getURI()); // "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#additionalLink");
|
|
||||||
op.setSubjectURI(indRes.getURI());
|
|
||||||
op.setObjectURI(linkRes.getURI());
|
|
||||||
link.setObjectPropertyStatement(op);
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
stmtIt.close();
|
|
||||||
}
|
|
||||||
return link;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,53 +0,0 @@
|
||||||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
|
||||||
|
|
||||||
package edu.cornell.mannlib.vitro.webapp.dao.jena;
|
|
||||||
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.hp.hpl.jena.ontology.OntClass;
|
|
||||||
import com.hp.hpl.jena.ontology.OntModel;
|
|
||||||
import com.hp.hpl.jena.rdf.model.ModelFactory;
|
|
||||||
import com.hp.hpl.jena.shared.Lock;
|
|
||||||
import com.hp.hpl.jena.util.iterator.ClosableIterator;
|
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Linktype;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.LinktypeDao;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
|
|
||||||
|
|
||||||
public class LinktypeDaoJena extends JenaBaseDao implements LinktypeDao {
|
|
||||||
|
|
||||||
public LinktypeDaoJena(WebappDaoFactoryJena wadf) {
|
|
||||||
super(wadf);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected OntModel getOntModel() {
|
|
||||||
return getOntModelSelector().getABoxModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Linktype> getAllLinktypes() {
|
|
||||||
List<Linktype> linkTypes = new LinkedList<Linktype>();
|
|
||||||
getOntModel().enterCriticalSection(Lock.READ);
|
|
||||||
try {
|
|
||||||
OntClass linkClass = getOntModel().getOntClass(LINK.getURI());
|
|
||||||
ClosableIterator cIt = linkClass.listSubClasses();
|
|
||||||
try {
|
|
||||||
while (cIt.hasNext()) {
|
|
||||||
OntClass lCls = (OntClass) cIt.next();
|
|
||||||
Linktype lt = new Linktype();
|
|
||||||
lt.setURI(lCls.getURI());
|
|
||||||
lt.setType(getLabelOrId(lCls));
|
|
||||||
linkTypes.add(lt);
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
cIt.close();
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
getOntModel().leaveCriticalSection();
|
|
||||||
}
|
|
||||||
return linkTypes;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -48,7 +48,7 @@ public class PropertyInstanceDaoJena extends JenaBaseDao implements
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteObjectPropertyStatement(String subjectURI, String propertyURI, String objectURI) {
|
public void deleteObjectPropertyStatement(String subjectURI, String propertyURI, String objectURI) {
|
||||||
deleteObjectPropertyStatement(subjectURI, propertyURI, objectURI, getOntModelSelector().getFullModel());
|
deleteObjectPropertyStatement(subjectURI, propertyURI, objectURI, getOntModelSelector().getABoxModel());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteObjectPropertyStatement(String subjectURI, String propertyURI, String objectURI, OntModel ontModel) {
|
public void deleteObjectPropertyStatement(String subjectURI, String propertyURI, String objectURI, OntModel ontModel) {
|
||||||
|
|
|
@ -42,8 +42,6 @@ import edu.cornell.mannlib.vitro.webapp.dao.DatatypeDao;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.DisplayModelDao;
|
import edu.cornell.mannlib.vitro.webapp.dao.DisplayModelDao;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.FlagDao;
|
import edu.cornell.mannlib.vitro.webapp.dao.FlagDao;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao;
|
import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.KeywordDao;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.KeywordIndividualRelationDao;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.LinksDao;
|
import edu.cornell.mannlib.vitro.webapp.dao.LinksDao;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.LinktypeDao;
|
import edu.cornell.mannlib.vitro.webapp.dao.LinktypeDao;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.MenuDao;
|
import edu.cornell.mannlib.vitro.webapp.dao.MenuDao;
|
||||||
|
@ -61,14 +59,11 @@ import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
|
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.jena.pellet.PelletListener;
|
import edu.cornell.mannlib.vitro.webapp.dao.jena.pellet.PelletListener;
|
||||||
import edu.cornell.mannlib.vitro.webapp.servlet.setup.JenaDataSourceSetupBase;
|
import edu.cornell.mannlib.vitro.webapp.servlet.setup.JenaDataSourceSetupBase;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.jena.PropertyGroupDaoJena;
|
|
||||||
|
|
||||||
public class WebappDaoFactoryJena implements WebappDaoFactory {
|
public class WebappDaoFactoryJena implements WebappDaoFactory {
|
||||||
|
|
||||||
protected IndividualDao entityWebappDao;
|
protected IndividualDao entityWebappDao;
|
||||||
protected FlagDao flagDao;
|
protected FlagDao flagDao;
|
||||||
protected KeywordIndividualRelationDao keys2EntsDao;
|
|
||||||
protected KeywordDao keywordDao;
|
|
||||||
protected LinksDao linksDao;
|
protected LinksDao linksDao;
|
||||||
protected LinktypeDao linktypeDao;
|
protected LinktypeDao linktypeDao;
|
||||||
protected ApplicationDaoJena applicationDao;
|
protected ApplicationDaoJena applicationDao;
|
||||||
|
@ -444,34 +439,6 @@ public class WebappDaoFactoryJena implements WebappDaoFactory {
|
||||||
return entityWebappDao = new IndividualDaoJena(this);
|
return entityWebappDao = new IndividualDaoJena(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public KeywordIndividualRelationDao getKeys2EntsDao() {
|
|
||||||
if (keys2EntsDao != null)
|
|
||||||
return keys2EntsDao;
|
|
||||||
else
|
|
||||||
return keys2EntsDao = new KeywordIndividualRelationDaoJena(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public KeywordDao getKeywordDao() {
|
|
||||||
if (keywordDao != null)
|
|
||||||
return keywordDao;
|
|
||||||
else
|
|
||||||
return keywordDao = new KeywordDaoJena(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public LinksDao getLinksDao() {
|
|
||||||
if (linksDao != null)
|
|
||||||
return linksDao;
|
|
||||||
else
|
|
||||||
return linksDao = new LinksDaoJena(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public LinktypeDao getLinktypeDao() {
|
|
||||||
if (linktypeDao != null)
|
|
||||||
return linktypeDao;
|
|
||||||
else
|
|
||||||
return linktypeDao = new LinktypeDaoJena(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ApplicationDao getApplicationDao() {
|
public ApplicationDao getApplicationDao() {
|
||||||
if (applicationDao != null) {
|
if (applicationDao != null) {
|
||||||
return applicationDao;
|
return applicationDao;
|
||||||
|
@ -697,10 +664,6 @@ public class WebappDaoFactoryJena implements WebappDaoFactory {
|
||||||
//and tbox model
|
//and tbox model
|
||||||
WebappDaoFactoryJena specialWadfj = new WebappDaoFactoryJena(specialSelector);
|
WebappDaoFactoryJena specialWadfj = new WebappDaoFactoryJena(specialSelector);
|
||||||
entityWebappDao = specialWadfj.getIndividualDao();
|
entityWebappDao = specialWadfj.getIndividualDao();
|
||||||
keys2EntsDao = specialWadfj.getKeys2EntsDao();
|
|
||||||
keywordDao = specialWadfj.getKeywordDao();
|
|
||||||
linksDao = specialWadfj.getLinksDao();
|
|
||||||
linktypeDao = specialWadfj.getLinktypeDao();
|
|
||||||
vClassGroupDao = specialWadfj.getVClassGroupDao();
|
vClassGroupDao = specialWadfj.getVClassGroupDao();
|
||||||
//To allow for testing, add a property group, this will allow
|
//To allow for testing, add a property group, this will allow
|
||||||
//the unassigned group method section to be executed and main Image to be assigned to that group
|
//the unassigned group method section to be executed and main Image to be assigned to that group
|
||||||
|
|
|
@ -62,47 +62,6 @@ public class EntityDWR {
|
||||||
return ind;
|
return ind;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
Gets entities that can be in a propertyId relation with classId but
|
|
||||||
excludes entity with id of ignoredEntId. If classId < 0 then it the
|
|
||||||
query is not limited by vclass.
|
|
||||||
@param propertyId - which relation to get entities for column properties.id
|
|
||||||
@param ignoredEntId - the entity with this id is excluded from the
|
|
||||||
result collection. Set to < 0 if you don't want to ignore any entities.
|
|
||||||
@param classId - if > 0 then only ents with this vClassId or which are subclasses
|
|
||||||
of this are included in results.
|
|
||||||
@param domainSide - if true, return RANGE entities of relation, if false return
|
|
||||||
DOMAIN entities of relation.
|
|
||||||
@return - Entities that can satisify the property. Only the name and id of the
|
|
||||||
object will be filled out.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public Collection getEntitiesByProperties(String propertyURI,
|
|
||||||
String ignoredEntURI,
|
|
||||||
String classURI,
|
|
||||||
boolean domainSide ){
|
|
||||||
return new LinkedList();
|
|
||||||
// WebContext ctx = WebContextFactory.get();
|
|
||||||
// HttpServletRequest req = ctx.getHttpServletRequest();
|
|
||||||
// VitroRequest vreq = new VitroRequest(req);
|
|
||||||
// IndividualDao entityWADao = vreq.getWebappDaoFactory().getIndividualDao();
|
|
||||||
//
|
|
||||||
// return entityWADao.getIndividualsByProperty(
|
|
||||||
// propertyURI,ignoredEntURI,classURI,domainSide);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the monikers for a vclass.
|
|
||||||
*/
|
|
||||||
public List monikers( String vClassURI ){
|
|
||||||
WebContext ctx = WebContextFactory.get();
|
|
||||||
HttpServletRequest req = ctx.getHttpServletRequest();
|
|
||||||
VitroRequest vreq = new VitroRequest(req);
|
|
||||||
IndividualDao entityWADao = vreq.getWebappDaoFactory().getIndividualDao();
|
|
||||||
|
|
||||||
return entityWADao.monikers( vClassURI );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets all of the entities given the vclass.
|
* Gets all of the entities given the vclass.
|
||||||
* This returns a collection of EntityWebapp objects.
|
* This returns a collection of EntityWebapp objects.
|
||||||
|
|
|
@ -82,31 +82,6 @@ public class PropertyDWR {
|
||||||
return wdf.getPropertyInstanceDao().getProperty(subjectURI, predicateURI, objectURI);
|
return wdf.getPropertyInstanceDao().getProperty(subjectURI, predicateURI, objectURI);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
The following fields are used by this method to write this property
|
|
||||||
to the object property statement table:
|
|
||||||
|
|
||||||
domainEntId
|
|
||||||
rangeEntId
|
|
||||||
PropertyId
|
|
||||||
sunrise - optional
|
|
||||||
sunset - optional
|
|
||||||
qualifier - optional
|
|
||||||
|
|
||||||
Initially this tries an insert, if that fails then an update is attempted.
|
|
||||||
@return -1 for error, 0 for no write due to duplicate, > 0 is auto-gen
|
|
||||||
objectPropertyStatement.id
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public int writeProp(PropertyInstance prop ){
|
|
||||||
// WebContext ctx = WebContextFactory.get();
|
|
||||||
// HttpServletRequest req = ctx.getHttpServletRequest();
|
|
||||||
// VitroRequest vreq = new VitroRequest(req);
|
|
||||||
//
|
|
||||||
// return getUnfilteredWebappDaoFactory(vreq).getPropertyInstanceDao().writeProp(prop);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int insertProp( PropertyInstance prop) {
|
public int insertProp( PropertyInstance prop) {
|
||||||
WebContext ctx = WebContextFactory.get();
|
WebContext ctx = WebContextFactory.get();
|
||||||
HttpServletRequest req = ctx.getHttpServletRequest();
|
HttpServletRequest req = ctx.getHttpServletRequest();
|
||||||
|
|
|
@ -34,7 +34,7 @@ public class IndividualDataPropertyStatementProcessor implements ChangeListener
|
||||||
}
|
}
|
||||||
|
|
||||||
public void doDeleted(Object oldObj, EditProcessObject epo) {
|
public void doDeleted(Object oldObj, EditProcessObject epo) {
|
||||||
// sunset all data property statements associated with entity
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
private void processDataprops (EditProcessObject epo) {
|
private void processDataprops (EditProcessObject epo) {
|
||||||
|
|
|
@ -304,14 +304,6 @@ public class SelectListGenerator {
|
||||||
if (individuals.size()==0){
|
if (individuals.size()==0){
|
||||||
log.error("No individuals of type "+vclass.getName()+" to add to pick list in SelectListGenerator.getOptions(); check portal visibility");
|
log.error("No individuals of type "+vclass.getName()+" to add to pick list in SelectListGenerator.getOptions(); check portal visibility");
|
||||||
optionsMap.put("", "No " + vclass.getName() + " found");
|
optionsMap.put("", "No " + vclass.getName() + " found");
|
||||||
}else{
|
|
||||||
for( Individual ind : individuals ) {
|
|
||||||
// note that don't want the individual URI -- the option should hold 2 copies of the moniker //
|
|
||||||
if (ind.getMoniker()!=null && ind.getMoniker().trim().length()>0) {
|
|
||||||
optionsMap.put(ind.getMoniker(),ind.getMoniker().trim());
|
|
||||||
++optionsCount;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,69 +0,0 @@
|
||||||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
|
||||||
|
|
||||||
package edu.cornell.mannlib.vitro.webapp.edit.validator.impl;
|
|
||||||
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import edu.cornell.mannlib.vedit.beans.EditProcessObject;
|
|
||||||
import edu.cornell.mannlib.vedit.validator.ValidationObject;
|
|
||||||
import edu.cornell.mannlib.vedit.validator.Validator;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Keyword;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.KeywordDao;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.edit.listener.impl.KeywordPreProcessor;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.utils.Stemmer;
|
|
||||||
|
|
||||||
public class KeywordStemmerAndValidator implements Validator {
|
|
||||||
|
|
||||||
private int MAX_LENGTH = 32;
|
|
||||||
|
|
||||||
private EditProcessObject epo = null;
|
|
||||||
private KeywordDao kDao = null;
|
|
||||||
|
|
||||||
public KeywordStemmerAndValidator(EditProcessObject in, KeywordDao keywordDao) {
|
|
||||||
this.epo = in;
|
|
||||||
this.kDao = keywordDao;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ValidationObject validate (Object obj) throws IllegalArgumentException {
|
|
||||||
|
|
||||||
ValidationObject vo = new ValidationObject();
|
|
||||||
|
|
||||||
if (obj==null || (obj instanceof String && ((String)obj).length()>0)) {
|
|
||||||
String keywordString = (String) obj;
|
|
||||||
String stemmedString = Stemmer.StemString(keywordString, MAX_LENGTH);
|
|
||||||
epo.getPreProcessorList().add(new KeywordPreProcessor(stemmedString));
|
|
||||||
List<Keyword> matches = kDao.getKeywordsByStem(stemmedString);
|
|
||||||
if (matches.size() > 0) {
|
|
||||||
vo.setValid(false);
|
|
||||||
String suggestionsStr = new String();
|
|
||||||
Iterator<Keyword> matchesIt = matches.iterator();
|
|
||||||
boolean first = true;
|
|
||||||
while (matchesIt.hasNext()) {
|
|
||||||
Keyword k = matchesIt.next();
|
|
||||||
if (!matchesIt.hasNext() && !first) {
|
|
||||||
suggestionsStr += "or ";
|
|
||||||
}
|
|
||||||
suggestionsStr += "'"+k.getTerm();
|
|
||||||
if (matchesIt.hasNext()) {
|
|
||||||
suggestionsStr += ",' ";
|
|
||||||
} else {
|
|
||||||
suggestionsStr += "'";
|
|
||||||
}
|
|
||||||
first = false;
|
|
||||||
}
|
|
||||||
vo.setMessage("Keyword identified as redundant. Please modify term or consider canceling and instead linking individual to existing keyword "+suggestionsStr);
|
|
||||||
} else {
|
|
||||||
vo.setValid(true);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
vo.setValid(false);
|
|
||||||
vo.setMessage("Please enter a keyword.");
|
|
||||||
}
|
|
||||||
vo.setValidatedObject(obj);
|
|
||||||
|
|
||||||
return vo;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -18,21 +18,11 @@ public class VitroSearchTermNames {
|
||||||
|
|
||||||
/** time of index in msec since epoc */
|
/** time of index in msec since epoc */
|
||||||
public static String INDEXEDTIME= "indexedTime";
|
public static String INDEXEDTIME= "indexedTime";
|
||||||
/** timekey of entity in yyyymmddhhmm */
|
|
||||||
public static String TIMEKEY="TIMEKEY";
|
|
||||||
/** time of sunset/end of entity in yyyymmddhhmm */
|
|
||||||
public static String SUNSET="SUNSET";
|
|
||||||
/** time of sunrise/start of entity in yyyymmddhhmm */
|
|
||||||
public static String SUNRISE="SUNRISE";
|
|
||||||
/** entity's moniker */
|
|
||||||
public static String MONIKER="moniker";
|
|
||||||
/** text for 'full text' search, this is stemmed */
|
/** text for 'full text' search, this is stemmed */
|
||||||
public static String ALLTEXT = "ALLTEXT";
|
public static String ALLTEXT = "ALLTEXT";
|
||||||
/** text for 'full text' search, this is unstemmed for
|
/** text for 'full text' search, this is unstemmed for
|
||||||
* use with wildcards and prefix queries */
|
* use with wildcards and prefix queries */
|
||||||
public static String ALLTEXTUNSTEMMED = "ALLTEXTUNSTEMMED";
|
public static String ALLTEXTUNSTEMMED = "ALLTEXTUNSTEMMED";
|
||||||
/** keywords */
|
|
||||||
public static final String KEYWORDS = "KEYWORDS";
|
|
||||||
/** Does the individual have a thumbnail image? 1=yes 0=no */
|
/** Does the individual have a thumbnail image? 1=yes 0=no */
|
||||||
public static final String THUMBNAIL = "THUMBNAIL";
|
public static final String THUMBNAIL = "THUMBNAIL";
|
||||||
/** Should individual be included in full text search results? 1=yes 0=no */
|
/** Should individual be included in full text search results? 1=yes 0=no */
|
||||||
|
|
|
@ -51,10 +51,7 @@ public abstract class VitroHighlighter extends UnaryFunctor<String,String> {
|
||||||
if( ent == null)
|
if( ent == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ent.setBlurb( this.highlight(ent.getBlurb()));
|
|
||||||
ent.setName( this.highlight(ent.getName()));
|
ent.setName( this.highlight(ent.getName()));
|
||||||
ent.setMoniker( this.highlight(ent.getMoniker()));
|
|
||||||
ent.setDescription( this.highlight(ent.getDescription()));
|
|
||||||
Iterator edIt = ent.getDataPropertyStatements().iterator();
|
Iterator edIt = ent.getDataPropertyStatements().iterator();
|
||||||
while (edIt.hasNext()) {
|
while (edIt.hasNext()) {
|
||||||
DataPropertyStatement dataPropertyStmt = (DataPropertyStatement)edIt.next();
|
DataPropertyStatement dataPropertyStmt = (DataPropertyStatement)edIt.next();
|
||||||
|
@ -68,7 +65,6 @@ public abstract class VitroHighlighter extends UnaryFunctor<String,String> {
|
||||||
object.setName(this.highlight(object.getName()));
|
object.setName(this.highlight(object.getName()));
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
highlightKeywords(ent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -83,21 +79,9 @@ public abstract class VitroHighlighter extends UnaryFunctor<String,String> {
|
||||||
//highlight the name, anchor and moniker and place back in entity object
|
//highlight the name, anchor and moniker and place back in entity object
|
||||||
if( ent.getName() != null )
|
if( ent.getName() != null )
|
||||||
ent.setName( highlight( stripHtml(ent.getName() )));
|
ent.setName( highlight( stripHtml(ent.getName() )));
|
||||||
if( ent.getAnchor() != null )
|
|
||||||
ent.setAnchor( highlight( stripHtml(ent.getAnchor() )));
|
|
||||||
if( ent.getMoniker() != null )
|
|
||||||
ent.setMoniker( highlight( stripHtml(ent.getMoniker() )));
|
|
||||||
|
|
||||||
//make a buffer of text to use the fragmenting hightlighter on
|
//make a buffer of text to use the fragmenting hightlighter on
|
||||||
StringBuffer sb = new StringBuffer("");
|
StringBuffer sb = new StringBuffer("");
|
||||||
if(ent.getBlurb() != null){
|
|
||||||
sb.append(ent.getBlurb());
|
|
||||||
sb.append(' ');
|
|
||||||
}
|
|
||||||
if(ent.getDescription() != null ){
|
|
||||||
sb.append(ent.getDescription());
|
|
||||||
sb.append(' ');
|
|
||||||
}
|
|
||||||
if(ent.getDataPropertyStatements() != null) {
|
if(ent.getDataPropertyStatements() != null) {
|
||||||
Iterator edIt = ent.getDataPropertyStatements().iterator();
|
Iterator edIt = ent.getDataPropertyStatements().iterator();
|
||||||
while (edIt.hasNext()) {
|
while (edIt.hasNext()) {
|
||||||
|
@ -120,22 +104,6 @@ public abstract class VitroHighlighter extends UnaryFunctor<String,String> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
String keywords = ent.getKeywordString();
|
|
||||||
if( keywords != null )
|
|
||||||
sb.append(keywords);
|
|
||||||
|
|
||||||
ent.setDescription(getHighlightFragments( stripHtml( sb.toString() )));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void highlightKeywords(Individual ent){
|
|
||||||
List<String> terms = ent.getKeywords();
|
|
||||||
if( terms == null || terms.size() == 0) return;
|
|
||||||
|
|
||||||
List<String> replacement = new ArrayList<String>(terms.size());
|
|
||||||
for(String term : ent.getKeywords()){
|
|
||||||
replacement.add( highlight(term ) );
|
|
||||||
}
|
|
||||||
ent.setKeywords(replacement);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private final String stripHtml(String in){
|
private final String stripHtml(String in){
|
||||||
|
|
|
@ -685,7 +685,6 @@ public class PagedSearchController extends FreemarkerHttpServlet implements Sear
|
||||||
VitroLuceneTermNames.NAME_STEMMED,
|
VitroLuceneTermNames.NAME_STEMMED,
|
||||||
VitroLuceneTermNames.NAME_UNSTEMMED,
|
VitroLuceneTermNames.NAME_UNSTEMMED,
|
||||||
VitroLuceneTermNames.RDFTYPE,
|
VitroLuceneTermNames.RDFTYPE,
|
||||||
VitroLuceneTermNames.MONIKER,
|
|
||||||
VitroLuceneTermNames.ALLTEXT,
|
VitroLuceneTermNames.ALLTEXT,
|
||||||
VitroLuceneTermNames.ALLTEXTUNSTEMMED,
|
VitroLuceneTermNames.ALLTEXTUNSTEMMED,
|
||||||
VitroLuceneTermNames.NAME_LOWERCASE,
|
VitroLuceneTermNames.NAME_LOWERCASE,
|
||||||
|
|
|
@ -52,14 +52,6 @@ public class Entity2LuceneDoc implements Obj2DocIface{
|
||||||
|
|
||||||
/** time of index in msec since epoc */
|
/** time of index in msec since epoc */
|
||||||
public static String INDEXEDTIME= "indexedTime";
|
public static String INDEXEDTIME= "indexedTime";
|
||||||
/** timekey of entity in yyyymmddhhmm */
|
|
||||||
public static String TIMEKEY="TIMEKEY";
|
|
||||||
/** time of sunset/end of entity in yyyymmddhhmm */
|
|
||||||
public static String SUNSET="SUNSET";
|
|
||||||
/** time of sunrise/start of entity in yyyymmddhhmm */
|
|
||||||
public static String SUNRISE="SUNRISE";
|
|
||||||
/** entity's moniker */
|
|
||||||
public static String MONIKER="moniker";
|
|
||||||
/** text for 'full text' search, this is stemmed */
|
/** text for 'full text' search, this is stemmed */
|
||||||
public static String ALLTEXT = "ALLTEXT";
|
public static String ALLTEXT = "ALLTEXT";
|
||||||
/** text for 'full text' search, this is unstemmed for
|
/** text for 'full text' search, this is unstemmed for
|
||||||
|
@ -67,8 +59,6 @@ public class Entity2LuceneDoc implements Obj2DocIface{
|
||||||
public static String ALLTEXTUNSTEMMED = "ALLTEXTUNSTEMMED";
|
public static String ALLTEXTUNSTEMMED = "ALLTEXTUNSTEMMED";
|
||||||
/** class name for storing context nodes **/
|
/** class name for storing context nodes **/
|
||||||
public static final String CONTEXTNODE = "contextNode";
|
public static final String CONTEXTNODE = "contextNode";
|
||||||
/** keywords */
|
|
||||||
public static final String KEYWORDS = "KEYWORDS";
|
|
||||||
/** Does the individual have a thumbnail image? 1=yes 0=no */
|
/** Does the individual have a thumbnail image? 1=yes 0=no */
|
||||||
public static final String THUMBNAIL = "THUMBNAIL";
|
public static final String THUMBNAIL = "THUMBNAIL";
|
||||||
/** Should individual be included in full text search results? 1=yes 0=no */
|
/** Should individual be included in full text search results? 1=yes 0=no */
|
||||||
|
@ -255,13 +245,6 @@ public class Entity2LuceneDoc implements Obj2DocIface{
|
||||||
/* Field contextNodeInformation = new Field(term.CONTEXTNODE, contextNodePropertyValues, Field.Store.YES, Field.Index.ANALYZED );
|
/* Field contextNodeInformation = new Field(term.CONTEXTNODE, contextNodePropertyValues, Field.Store.YES, Field.Index.ANALYZED );
|
||||||
doc.add(contextNodeInformation);*/
|
doc.add(contextNodeInformation);*/
|
||||||
|
|
||||||
//Moniker
|
|
||||||
|
|
||||||
if(ent.getMoniker() != null){
|
|
||||||
Field moniker = new Field(term.MONIKER, ent.getMoniker(), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS);
|
|
||||||
doc.add(moniker);
|
|
||||||
}
|
|
||||||
|
|
||||||
//boost for entity
|
//boost for entity
|
||||||
if( ent.getSearchBoost() != null && ent.getSearchBoost() != 0 )
|
if( ent.getSearchBoost() != null && ent.getSearchBoost() != 0 )
|
||||||
doc.setBoost(ent.getSearchBoost());
|
doc.setBoost(ent.getSearchBoost());
|
||||||
|
@ -275,17 +258,6 @@ public class Entity2LuceneDoc implements Obj2DocIface{
|
||||||
// }
|
// }
|
||||||
// doc.add( new Field(term.MODTIME, value , Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));
|
// doc.add( new Field(term.MODTIME, value , Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));
|
||||||
|
|
||||||
/* timekey */
|
|
||||||
// try{
|
|
||||||
// value = null;
|
|
||||||
// if( ent.getTimekey() != null ){
|
|
||||||
// value = (new DateTime(ent.getTimekey().getTime())).toString(LuceneIndexer.DATE_FORMAT);
|
|
||||||
// doc.add(new Field(term.TIMEKEY, value, Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));
|
|
||||||
// }
|
|
||||||
// }catch(Exception ex){
|
|
||||||
// log.error("could not save timekey " + ex);
|
|
||||||
// }
|
|
||||||
|
|
||||||
/* thumbnail */
|
/* thumbnail */
|
||||||
try{
|
try{
|
||||||
value = null;
|
value = null;
|
||||||
|
@ -309,10 +281,6 @@ public class Entity2LuceneDoc implements Obj2DocIface{
|
||||||
String t=null;
|
String t=null;
|
||||||
value ="";
|
value ="";
|
||||||
value+= " "+( ((t=ent.getName()) == null)?"":t );
|
value+= " "+( ((t=ent.getName()) == null)?"":t );
|
||||||
value+= " "+( ((t=ent.getAnchor()) == null)?"":t);
|
|
||||||
value+= " "+ ( ((t=ent.getMoniker()) == null)?"":t );
|
|
||||||
value+= " "+ ( ((t=ent.getDescription()) == null)?"":t );
|
|
||||||
value+= " "+ ( ((t=ent.getBlurb()) == null)?"":t );
|
|
||||||
value+= " "+ getKeyterms(ent);
|
value+= " "+ getKeyterms(ent);
|
||||||
|
|
||||||
value+= " " + classPublicNames;
|
value+= " " + classPublicNames;
|
||||||
|
|
|
@ -254,53 +254,6 @@ public class LuceneSearcher implements Searcher {
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
//bdc34 as of 2009-01-30, getting rid of time windows
|
|
||||||
// public synchronized Filter getTimeWindowCachingFilter(){
|
|
||||||
// if( timeWindowCachingFilter == null || timeWinCacheStale() ){
|
|
||||||
// Filter defaultFilter = new QueryFilter( makeDefaultTimeWindowQuery() );
|
|
||||||
// timeWindowCachingFilter = new CachingWrapperFilter( defaultFilter );
|
|
||||||
// timeWinFilterBorn = System.currentTimeMillis();
|
|
||||||
// log.debug("getTimeWindowCachingFilter() made new cache " + timeWinFilterBorn);
|
|
||||||
// }
|
|
||||||
// return timeWindowCachingFilter;
|
|
||||||
// }
|
|
||||||
|
|
||||||
//bdc34 as of 2009-01-30, getting rid of time windows
|
|
||||||
// private final long timeWinCacheShelfLife = ( 60 * 1000 ) * 1; //in msec
|
|
||||||
// private boolean timeWinCacheStale(){
|
|
||||||
// long dt = (System.currentTimeMillis() - timeWinFilterBorn);
|
|
||||||
// return dt > timeWinCacheShelfLife;
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
//bdc34 as of 2009-01-30, getting rid of time windows
|
|
||||||
/**
|
|
||||||
* Adds a Query that will get doc where the
|
|
||||||
* SUNSET is > NOW and SUNRISE <= NOW. We'll do
|
|
||||||
* this by creating two RangeQueries, one to
|
|
||||||
* check that SUNRISE is between [BEGINNING_OF_TIME, NOW]
|
|
||||||
* and that SUNSET is between [NOW, END_OF_TIME]
|
|
||||||
* There don't seem to be any GraterThanQuery
|
|
||||||
* or LessThanQuery classes in lucene.
|
|
||||||
*/
|
|
||||||
// private BooleanQuery makeDefaultTimeWindowQuery(){
|
|
||||||
// String nowStr = new DateTime().toString(LuceneIndexer.DATE_FORMAT);
|
|
||||||
//
|
|
||||||
// Term BEGINNING_OF_TIME = null;
|
|
||||||
// Term now = new Term(Entity2LuceneDoc.term.SUNRISE,nowStr );
|
|
||||||
// RangeQuery sunriseBeforeNow = new RangeQuery(BEGINNING_OF_TIME,now, true);
|
|
||||||
//
|
|
||||||
// Term END_OF_TIME = null;
|
|
||||||
// now = new Term(Entity2LuceneDoc.term.SUNSET,nowStr);
|
|
||||||
// RangeQuery sunsetAfterNow = new RangeQuery(now,END_OF_TIME, false);
|
|
||||||
//
|
|
||||||
// BooleanQuery qRv = new BooleanQuery();
|
|
||||||
// qRv.add( sunriseBeforeNow, BooleanClause.Occur.MUST);
|
|
||||||
// qRv.add( sunsetAfterNow, BooleanClause.Occur.MUST);
|
|
||||||
//
|
|
||||||
// return qRv;
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We need access to the index to make a highligher because
|
* We need access to the index to make a highligher because
|
||||||
* we need to 'rewrite' the query. That takes any wild cards
|
* we need to 'rewrite' the query. That takes any wild cards
|
||||||
|
|
|
@ -7,7 +7,6 @@ import static edu.cornell.mannlib.vitro.webapp.search.lucene.Entity2LuceneDoc.Vi
|
||||||
import static edu.cornell.mannlib.vitro.webapp.search.lucene.Entity2LuceneDoc.VitroLuceneTermNames.CLASSLOCALNAME;
|
import static edu.cornell.mannlib.vitro.webapp.search.lucene.Entity2LuceneDoc.VitroLuceneTermNames.CLASSLOCALNAME;
|
||||||
import static edu.cornell.mannlib.vitro.webapp.search.lucene.Entity2LuceneDoc.VitroLuceneTermNames.CLASSLOCALNAMELOWERCASE;
|
import static edu.cornell.mannlib.vitro.webapp.search.lucene.Entity2LuceneDoc.VitroLuceneTermNames.CLASSLOCALNAMELOWERCASE;
|
||||||
import static edu.cornell.mannlib.vitro.webapp.search.lucene.Entity2LuceneDoc.VitroLuceneTermNames.CONTEXTNODE;
|
import static edu.cornell.mannlib.vitro.webapp.search.lucene.Entity2LuceneDoc.VitroLuceneTermNames.CONTEXTNODE;
|
||||||
import static edu.cornell.mannlib.vitro.webapp.search.lucene.Entity2LuceneDoc.VitroLuceneTermNames.MONIKER;
|
|
||||||
import static edu.cornell.mannlib.vitro.webapp.search.lucene.Entity2LuceneDoc.VitroLuceneTermNames.NAME_STEMMED;
|
import static edu.cornell.mannlib.vitro.webapp.search.lucene.Entity2LuceneDoc.VitroLuceneTermNames.NAME_STEMMED;
|
||||||
import static edu.cornell.mannlib.vitro.webapp.search.lucene.Entity2LuceneDoc.VitroLuceneTermNames.NAME_UNSTEMMED;
|
import static edu.cornell.mannlib.vitro.webapp.search.lucene.Entity2LuceneDoc.VitroLuceneTermNames.NAME_UNSTEMMED;
|
||||||
import static edu.cornell.mannlib.vitro.webapp.search.lucene.Entity2LuceneDoc.VitroLuceneTermNames.RDFTYPE;
|
import static edu.cornell.mannlib.vitro.webapp.search.lucene.Entity2LuceneDoc.VitroLuceneTermNames.RDFTYPE;
|
||||||
|
@ -255,7 +254,6 @@ public class LuceneSetup implements javax.servlet.ServletContextListener {
|
||||||
analyzer.addAnalyzer(ALLTEXTUNSTEMMED, new HtmlLowerStopAnalyzer());
|
analyzer.addAnalyzer(ALLTEXTUNSTEMMED, new HtmlLowerStopAnalyzer());
|
||||||
analyzer.addAnalyzer(NAME_UNSTEMMED, new HtmlLowerStopAnalyzer());
|
analyzer.addAnalyzer(NAME_UNSTEMMED, new HtmlLowerStopAnalyzer());
|
||||||
analyzer.addAnalyzer(NAME_STEMMED, new HtmlLowerStopStemAnalyzer());
|
analyzer.addAnalyzer(NAME_STEMMED, new HtmlLowerStopStemAnalyzer());
|
||||||
analyzer.addAnalyzer(MONIKER, new StandardAnalyzer(Version.LUCENE_29));
|
|
||||||
analyzer.addAnalyzer(RDFTYPE, new StandardAnalyzer(Version.LUCENE_29));
|
analyzer.addAnalyzer(RDFTYPE, new StandardAnalyzer(Version.LUCENE_29));
|
||||||
analyzer.addAnalyzer(CONTEXTNODE, new StandardAnalyzer(Version.LUCENE_29));
|
analyzer.addAnalyzer(CONTEXTNODE, new StandardAnalyzer(Version.LUCENE_29));
|
||||||
analyzer.addAnalyzer(CLASSLOCALNAME, new HtmlLowerStopAnalyzer());
|
analyzer.addAnalyzer(CLASSLOCALNAME, new HtmlLowerStopAnalyzer());
|
||||||
|
|
|
@ -153,8 +153,6 @@ public class IndividualToSolrDocument {
|
||||||
allTextValue.append(" ");
|
allTextValue.append(" ");
|
||||||
allTextValue.append(((t=ind.getName()) == null)?"":t);
|
allTextValue.append(((t=ind.getName()) == null)?"":t);
|
||||||
allTextValue.append(" ");
|
allTextValue.append(" ");
|
||||||
allTextValue.append(((t=ind.getAnchor()) == null)?"":t);
|
|
||||||
allTextValue.append(" ");
|
|
||||||
allTextValue.append(classPublicNames);
|
allTextValue.append(classPublicNames);
|
||||||
|
|
||||||
//collecting data property statements
|
//collecting data property statements
|
||||||
|
|
|
@ -17,6 +17,7 @@ import org.apache.solr.client.solrj.impl.XMLResponseParser;
|
||||||
|
|
||||||
import com.hp.hpl.jena.ontology.OntModel;
|
import com.hp.hpl.jena.ontology.OntModel;
|
||||||
import com.hp.hpl.jena.query.Dataset;
|
import com.hp.hpl.jena.query.Dataset;
|
||||||
|
import com.hp.hpl.jena.query.DatasetFactory;
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.config.ConfigurationProperties;
|
import edu.cornell.mannlib.vitro.webapp.config.ConfigurationProperties;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.DisplayVocabulary;
|
import edu.cornell.mannlib.vitro.webapp.dao.DisplayVocabulary;
|
||||||
|
@ -73,7 +74,7 @@ public class SolrSetup implements javax.servlet.ServletContextListener{
|
||||||
|
|
||||||
OntModel abox = ModelContext.getBaseOntModelSelector(context).getABoxModel();
|
OntModel abox = ModelContext.getBaseOntModelSelector(context).getABoxModel();
|
||||||
OntModel inferences = (OntModel)context.getAttribute( JenaBaseDao.INFERENCE_ONT_MODEL_ATTRIBUTE_NAME);
|
OntModel inferences = (OntModel)context.getAttribute( JenaBaseDao.INFERENCE_ONT_MODEL_ATTRIBUTE_NAME);
|
||||||
Dataset dataset = WebappDaoFactoryJena.makeInMemoryDataset(abox, inferences);
|
Dataset dataset = DatasetFactory.create(ModelContext.getJenaOntModel(context));
|
||||||
|
|
||||||
OntModel jenaOntModel = ModelContext.getJenaOntModel(context);
|
OntModel jenaOntModel = ModelContext.getJenaOntModel(context);
|
||||||
|
|
||||||
|
|
|
@ -65,20 +65,24 @@ public class ListedIndividualTemplateModel extends BaseTemplateModel {
|
||||||
return thumbUrl == null ? null : getUrl(thumbUrl);
|
return thumbUrl == null ? null : getUrl(thumbUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
public Link getPrimaryLink() {
|
public Link getPrimaryLink() {
|
||||||
Link primaryLink = null;
|
// Link primaryLink = null;
|
||||||
String anchor = individual.getAnchor();
|
// String anchor = individual.getAnchor();
|
||||||
String url = individual.getUrl();
|
// String url = individual.getUrl();
|
||||||
if ( !(StringUtils.isEmpty(anchor)) && !(StringUtils.isEmpty(url)) ) {
|
// if ( !(StringUtils.isEmpty(anchor)) && !(StringUtils.isEmpty(url)) ) {
|
||||||
primaryLink = new Link();
|
// primaryLink = new Link();
|
||||||
primaryLink.setAnchor(anchor);
|
// primaryLink.setAnchor(anchor);
|
||||||
primaryLink.setUrl(url);
|
// primaryLink.setUrl(url);
|
||||||
}
|
// }
|
||||||
return primaryLink;
|
// return primaryLink;
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
public List<Link> getAdditionalLinks() {
|
public List<Link> getAdditionalLinks() {
|
||||||
return individual.getLinksList(); // returns an empty list, but not null
|
// return individual.getLinksList(); // returns an empty list, but not null
|
||||||
|
return new ArrayList<Link>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Link> getLinks() {
|
public List<Link> getLinks() {
|
||||||
|
@ -101,8 +105,10 @@ public class ListedIndividualTemplateModel extends BaseTemplateModel {
|
||||||
return individual.getName();
|
return individual.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
public String getMoniker() {
|
public String getMoniker() {
|
||||||
return individual.getMoniker();
|
return "";
|
||||||
|
// return individual.getMoniker();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUri() {
|
public String getUri() {
|
||||||
|
|
|
@ -47,7 +47,7 @@ public class PropertyRestrictionPolicyHelperTest extends AbstractTestClass {
|
||||||
VitroVocabulary.vitroURI, "" };
|
VitroVocabulary.vitroURI, "" };
|
||||||
|
|
||||||
private static final String[] PERMITTED_EXCEPTIONS = new String[] {
|
private static final String[] PERMITTED_EXCEPTIONS = new String[] {
|
||||||
VitroVocabulary.MONIKER, VitroVocabulary.BLURB };
|
VitroVocabulary.MONIKER };
|
||||||
|
|
||||||
private OntModel ontModel;
|
private OntModel ontModel;
|
||||||
private ModelWrapper wrapper;
|
private ModelWrapper wrapper;
|
||||||
|
|
|
@ -170,7 +170,6 @@ public class HiddenFromDisplayBelowRoleLevelFilterTest extends
|
||||||
private static Individual individual(String moniker,
|
private static Individual individual(String moniker,
|
||||||
RoleLevel displayThreshhold) {
|
RoleLevel displayThreshhold) {
|
||||||
Individual i = new IndividualImpl();
|
Individual i = new IndividualImpl();
|
||||||
i.setMoniker(moniker);
|
|
||||||
i.setURI("uri:" + moniker);
|
i.setURI("uri:" + moniker);
|
||||||
i.setHiddenFromDisplayBelowRoleLevel(displayThreshhold);
|
i.setHiddenFromDisplayBelowRoleLevel(displayThreshhold);
|
||||||
return i;
|
return i;
|
||||||
|
@ -575,7 +574,7 @@ public class HiddenFromDisplayBelowRoleLevelFilterTest extends
|
||||||
if (individual == null) {
|
if (individual == null) {
|
||||||
message += ", individual=null";
|
message += ", individual=null";
|
||||||
} else {
|
} else {
|
||||||
message += ", individual=" + individual.getMoniker();
|
message += ", individual=" + individual.getLocalName();
|
||||||
}
|
}
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
@ -703,7 +702,7 @@ public class HiddenFromDisplayBelowRoleLevelFilterTest extends
|
||||||
if (subject == null) {
|
if (subject == null) {
|
||||||
message += ", subject=null";
|
message += ", subject=null";
|
||||||
} else {
|
} else {
|
||||||
message += ", subject=" + subject.getMoniker();
|
message += ", subject=" + subject.getLocalName();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (predicate == null) {
|
if (predicate == null) {
|
||||||
|
@ -760,7 +759,7 @@ public class HiddenFromDisplayBelowRoleLevelFilterTest extends
|
||||||
if (subject == null) {
|
if (subject == null) {
|
||||||
message += ", subject=null";
|
message += ", subject=null";
|
||||||
} else {
|
} else {
|
||||||
message += ", subject=" + subject.getMoniker();
|
message += ", subject=" + subject.getLocalName();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (predicate == null) {
|
if (predicate == null) {
|
||||||
|
@ -772,7 +771,7 @@ public class HiddenFromDisplayBelowRoleLevelFilterTest extends
|
||||||
if (object == null) {
|
if (object == null) {
|
||||||
message += ", object=null";
|
message += ", object=null";
|
||||||
} else {
|
} else {
|
||||||
message += ", object=" + object.getMoniker();
|
message += ", object=" + object.getLocalName();
|
||||||
}
|
}
|
||||||
|
|
||||||
return message;
|
return message;
|
||||||
|
|
|
@ -169,63 +169,12 @@ public class IndividualDaoStub implements IndividualDao {
|
||||||
"IndividualDaoStub.fillVClassForIndividual() not implemented.");
|
"IndividualDaoStub.fillVClassForIndividual() not implemented.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<String> monikers(String vclassURI) {
|
|
||||||
throw new RuntimeException(
|
|
||||||
"IndividualDaoStub.monikers() not implemented.");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<String> getKeywordsForIndividual(String individualURI) {
|
|
||||||
throw new RuntimeException(
|
|
||||||
"IndividualDaoStub.getKeywordsForIndividual() not implemented.");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<String> getKeywordsForIndividualByMode(String individualURI,
|
|
||||||
String modeStr) {
|
|
||||||
throw new RuntimeException(
|
|
||||||
"IndividualDaoStub.getKeywordsForIndividualByMode() not implemented.");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Keyword> getKeywordObjectsForIndividual(String individualURI) {
|
|
||||||
throw new RuntimeException(
|
|
||||||
"IndividualDaoStub.getKeywordObjectsForIndividual() not implemented.");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getNetId(String entityURI) {
|
|
||||||
throw new RuntimeException(
|
|
||||||
"IndividualDaoStub.getNetId() not implemented.");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getStatus(String entityURI) {
|
|
||||||
throw new RuntimeException(
|
|
||||||
"IndividualDaoStub.getStatus() not implemented.");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnusedURI(Individual individual) throws InsertException {
|
public String getUnusedURI(Individual individual) throws InsertException {
|
||||||
throw new RuntimeException(
|
throw new RuntimeException(
|
||||||
"IndividualDaoStub.getUnusedURI() not implemented.");
|
"IndividualDaoStub.getUnusedURI() not implemented.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Individual getIndividualByExternalId(int externalIdType,
|
|
||||||
String externalIdValue) {
|
|
||||||
throw new RuntimeException(
|
|
||||||
"IndividualDaoStub.getIndividualByExternalId() not implemented.");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Individual getIndividualByExternalId(int externalIdType,
|
|
||||||
String externalIdValue, String vClassURI) {
|
|
||||||
throw new RuntimeException(
|
|
||||||
"IndividualDaoStub.getIndividualByExternalId() not implemented.");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EditLiteral getLabelEditLiteral(String individualUri) {
|
public EditLiteral getLabelEditLiteral(String individualUri) {
|
||||||
throw new RuntimeException(
|
throw new RuntimeException(
|
||||||
|
|
|
@ -13,10 +13,6 @@ import edu.cornell.mannlib.vitro.webapp.dao.DataPropertyStatementDao;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.DatatypeDao;
|
import edu.cornell.mannlib.vitro.webapp.dao.DatatypeDao;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.DisplayModelDao;
|
import edu.cornell.mannlib.vitro.webapp.dao.DisplayModelDao;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao;
|
import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.KeywordDao;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.KeywordIndividualRelationDao;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.LinksDao;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.LinktypeDao;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.MenuDao;
|
import edu.cornell.mannlib.vitro.webapp.dao.MenuDao;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.NamespaceDao;
|
import edu.cornell.mannlib.vitro.webapp.dao.NamespaceDao;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.ObjectPropertyDao;
|
import edu.cornell.mannlib.vitro.webapp.dao.ObjectPropertyDao;
|
||||||
|
@ -198,30 +194,6 @@ public class WebappDaoFactoryStub implements WebappDaoFactory {
|
||||||
"WebappDaoFactory.getApplicationDao() not implemented.");
|
"WebappDaoFactory.getApplicationDao() not implemented.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public KeywordIndividualRelationDao getKeys2EntsDao() {
|
|
||||||
throw new RuntimeException(
|
|
||||||
"WebappDaoFactory.getKeys2EntsDao() not implemented.");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public KeywordDao getKeywordDao() {
|
|
||||||
throw new RuntimeException(
|
|
||||||
"WebappDaoFactory.getKeywordDao() not implemented.");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public LinksDao getLinksDao() {
|
|
||||||
throw new RuntimeException(
|
|
||||||
"WebappDaoFactory.getLinksDao() not implemented.");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public LinktypeDao getLinktypeDao() {
|
|
||||||
throw new RuntimeException(
|
|
||||||
"WebappDaoFactory.getLinktypeDao() not implemented.");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VClassGroupDao getVClassGroupDao() {
|
public VClassGroupDao getVClassGroupDao() {
|
||||||
throw new RuntimeException(
|
throw new RuntimeException(
|
||||||
|
|
|
@ -332,8 +332,6 @@ function fillForm(aprop) {
|
||||||
var vclass = gProperty.domainClass;
|
var vclass = gProperty.domainClass;
|
||||||
|
|
||||||
DWRUtil.setValues(gProperty);
|
DWRUtil.setValues(gProperty);
|
||||||
setDateValue("sunset", gProperty.sunset );
|
|
||||||
setDateValue("sunrise", gProperty.sunrise );
|
|
||||||
|
|
||||||
toggleDisabled("newPropButton");
|
toggleDisabled("newPropButton");
|
||||||
|
|
||||||
|
@ -612,23 +610,7 @@ Check to see if property edit form is valid
|
||||||
*****************************************************************/
|
*****************************************************************/
|
||||||
function validateForm(){
|
function validateForm(){
|
||||||
var dateEx = "\nDates should be in the format YYYY-MM-DD";
|
var dateEx = "\nDates should be in the format YYYY-MM-DD";
|
||||||
var value = DWRUtil.getValue("sunrise");
|
/* used to check dates here */
|
||||||
try{
|
|
||||||
var date = parseDateString(value);
|
|
||||||
}catch(e){ date = null; }
|
|
||||||
if( value && value.length > 0 && ! isDate(date)) {
|
|
||||||
alert( "Surise date " + value + " is invalid: \n" + date + dateEx);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
value = DWRUtil.getValue("sunset");
|
|
||||||
try{
|
|
||||||
date = parseDateString(value);
|
|
||||||
}catch(e){ date = null; }
|
|
||||||
if( value && value.length > 0 && ! isDate(date)) {
|
|
||||||
alert( "Sunset date " + value + " is invalid: \n" + date + dateEx);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -650,15 +632,6 @@ function writeProp() {
|
||||||
newP.subjectEntURI= gEntity.URI;
|
newP.subjectEntURI= gEntity.URI;
|
||||||
newP.objectEntURI = selected ;
|
newP.objectEntURI = selected ;
|
||||||
|
|
||||||
try{
|
|
||||||
var date = parseDateString( DWRUtil.getValue("sunrise") );
|
|
||||||
newP.sunrise = ( isDate( date ) ? date : null );
|
|
||||||
}catch(e){ newP.sunrise = null; }
|
|
||||||
try{
|
|
||||||
var date = parseDateString( DWRUtil.getValue("sunset") );
|
|
||||||
newP.sunset = ( isDate( date ) ? date : null );
|
|
||||||
}catch(e){ newP.sunset = null; }
|
|
||||||
|
|
||||||
var callback = function(result){
|
var callback = function(result){
|
||||||
editingNewProp = false;
|
editingNewProp = false;
|
||||||
justwritenProp = newP;
|
justwritenProp = newP;
|
||||||
|
|
|
@ -5,34 +5,11 @@
|
||||||
<tr class="editformcell" id="entityNameTr">
|
<tr class="editformcell" id="entityNameTr">
|
||||||
<td valign="bottom" id="entityNameTd" colspan="2">
|
<td valign="bottom" id="entityNameTd" colspan="2">
|
||||||
<b>Individual Name</b><br/>
|
<b>Individual Name</b><br/>
|
||||||
<input style="width:80%;" type="text" name="Name" value="<form:value name="Name"/>" maxlength="255" />
|
<input style="width:80%;" type="text" name="Name" value="<form:value name="Name"/>" />
|
||||||
<p class="error"><form:error name="Name"/></p>
|
<p class="error"><form:error name="Name"/></p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr class='editformcell' id='GenericTypeTr'>
|
|
||||||
<td valign="top" id="genericTypeTd" colspan="2">
|
|
||||||
<b>Generic Type<br/>
|
|
||||||
<select disabled="disabled" id="VClassURI" name="VClassURI" onChange="update();">
|
|
||||||
<form:option name="VClassURI"/>
|
|
||||||
</select>
|
|
||||||
<p class="error"><form:error name="VClassURI"/></p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr class="editformcell" id='urlTr'>
|
|
||||||
<td id="urlTd" valign="bottom" colspan="1">
|
|
||||||
<b>URL</b><br />
|
|
||||||
<input style="width:80%;" type="text" name="Url" value="<form:value name="Url"/>" maxlength="255" />
|
|
||||||
<p><form:error name="Url"/></p>
|
|
||||||
</td>
|
|
||||||
<td id="urlAnchorTd" valign="bottom" colspan="1">
|
|
||||||
<b>Anchor Text for URL</b> <em> Required if URL is to be visible</em><br />
|
|
||||||
<input style="width:65%;" type="text" name="Anchor" value="<form:value name="Anchor"/>" maxlength="255" />
|
|
||||||
<p class="error"><form:error name="Anchor"/></p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<!-- begin datatype properties section -->
|
<!-- begin datatype properties section -->
|
||||||
|
|
||||||
<tr class="editformcell" style="border-collapse:collapse;">
|
<tr class="editformcell" style="border-collapse:collapse;">
|
||||||
|
@ -46,20 +23,4 @@
|
||||||
<!-- end datatype properties section -->
|
<!-- end datatype properties section -->
|
||||||
|
|
||||||
|
|
||||||
<tr class="editformcell" id='blurbTr'>
|
|
||||||
<td id="blurbTd" valign="bottom" colspan="2">
|
|
||||||
<b>Blurb</b> <em>Usually optional; shows up when this entity is included underneath a tab;</em> <b> max 255 chars</b><br />
|
|
||||||
<input style="width:80%;" type="text" name="Blurb" value="<form:value name="Blurb"/>" maxlength="255" />
|
|
||||||
<p class="error"><form:error name="Blurb"/></p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="editformcell" id='descriptionTr'>
|
|
||||||
<td id="descriptionTd" valign="bottom" colspan="2">
|
|
||||||
<b>Description</b> <em>Optional. Consider using more specific datatype properties where possible.</em><br/>
|
|
||||||
<textarea id="Description" name="Description" ROWS="15" COLS="115" wrap="physical"><form:value name="Description"/></textarea>
|
|
||||||
<p class="error"><form:error name="Description"/></p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -26,44 +26,5 @@
|
||||||
<br><font size="2" color="red"><form:error name="VClassId"/></font>
|
<br><font size="2" color="red"><form:error name="VClassId"/></font>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class='editformcell' id='specificTypeTr'>
|
|
||||||
<td valign="top" id="specificTypeTd" colspan="1">
|
|
||||||
<b>Specific Type</b><br/>
|
|
||||||
<select name="Moniker" id="Moniker">
|
|
||||||
<form:option name="Moniker"/>
|
|
||||||
</select>
|
|
||||||
<br><font size="2" color="red"><form:error name="Moniker"/></font>
|
|
||||||
</td>
|
|
||||||
<td id="newMonikerTd" valign="top">If [new moniker] is selected, enter here:<br/>
|
|
||||||
<input name="Moniker" value="<form:value name="Moniker"/>"/>
|
|
||||||
<i>otherwise leave this field blank</i>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="editformcell" id='urlTr'>
|
|
||||||
<td id="urlTd" valign="bottom" colspan="1">
|
|
||||||
<b>URL</b><br />
|
|
||||||
<input type="text" name="Url" value="<form:value name="Url"/>" size="80" maxlength="255" />
|
|
||||||
<font size="2" color="red"><form:error name="Url"/></font>
|
|
||||||
</td>
|
|
||||||
<td id="urlAnchorTd" valign="bottom" colspan="1">
|
|
||||||
<b>Anchor Text for URL</b> <em> Required if URL is to be visible</em><br />
|
|
||||||
<input type="text" name="Anchor" value="<form:value name="Anchor"/>" size="30" maxlength="255" />
|
|
||||||
<font size="2" color="red"><form:error name="Anchor"/></font>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="editformcell" id='blurbTr'>
|
|
||||||
<td id="blurbTd" valign="bottom" colspan="2">
|
|
||||||
<b>Blurb</b> <em>Usually optional; shows up when this entity is included underneath a tab;</em> <b> max 255 chars</b><br />
|
|
||||||
<input type="text" name="Blurb" value="<form:value name="Blurb"/>" size="153" maxlength="255" />
|
|
||||||
<font size="2" color="red"><form:error name="Blurb"/></font>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="editformcell" id='descriptionTr'>
|
|
||||||
<td id="descriptionTd" valign="bottom" colspan="2">
|
|
||||||
<b>Description</b> <em>Optional; may include valid HTML</em><br/>
|
|
||||||
<textarea name="Description" ROWS="5" COLS="115" wrap="physical"><form:value name="Description"/></textarea>
|
|
||||||
<font size="2" color="red"><form:error name="Description"/></font>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,19 +20,3 @@
|
||||||
</select> <span class="warning"><form:error name="DomainId"/></span>
|
</select> <span class="warning"><form:error name="DomainId"/></span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="editformcell">
|
|
||||||
<td valign="top" colspan="2">
|
|
||||||
<b>Sunrise</b><br/>
|
|
||||||
<input name="Sunrise" value="<form:value name="Sunrise"/>" />
|
|
||||||
</td>
|
|
||||||
<td valign="top" colspan="1">
|
|
||||||
<b>Sunset</b><br/>
|
|
||||||
<input name="Sunset" value="<form:value name="Sunset"/>"/>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="editformcell">
|
|
||||||
<td valign="top">
|
|
||||||
<b>Qualifier</b><br/>
|
|
||||||
<input name="Qualifier" value="<form:value name="Qualifier"/>"/>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
|
@ -70,20 +70,9 @@
|
||||||
<form action="editForm" method="get">
|
<form action="editForm" method="get">
|
||||||
<input name="uri" type = "hidden" value="${individual.URI}" />
|
<input name="uri" type = "hidden" value="${individual.URI}" />
|
||||||
<input name="controller" type = "hidden" value="Entity" />
|
<input name="controller" type = "hidden" value="Entity" />
|
||||||
<input type="submit" class="form-button" value="Edit This Individual"/>
|
<input type="submit" class="form-button" value="Edit This Individual's Datatype Properties"/>
|
||||||
</form><br/>
|
</form><br/>
|
||||||
|
|
||||||
|
|
||||||
<c:if test="${!empty individual.linksList}">
|
|
||||||
<form action="editForm" method="get">
|
|
||||||
<select name="uri" class="form-item">
|
|
||||||
<form:option name="ExtraURL"/>
|
|
||||||
</select><br />
|
|
||||||
<input type="submit" class="form-button" value="Edit Extra URLs"/>
|
|
||||||
<input type="hidden" name="controller" value="Link"/>
|
|
||||||
</form>
|
|
||||||
</c:if>
|
|
||||||
|
|
||||||
<c:if test="${!empty individual.externalIds}">
|
<c:if test="${!empty individual.externalIds}">
|
||||||
<form action="editForm" method="get">
|
<form action="editForm" method="get">
|
||||||
<select name="multiplexedParam" class="form-item">
|
<select name="multiplexedParam" class="form-item">
|
||||||
|
@ -104,11 +93,6 @@
|
||||||
<input type="hidden" name="controller" value="Entity"/>
|
<input type="hidden" name="controller" value="Entity"/>
|
||||||
</form>
|
</form>
|
||||||
<form action="editForm" method="get">
|
<form action="editForm" method="get">
|
||||||
<input type="submit" class="form-button" value="Add Another URL"/>
|
|
||||||
<input type="hidden" name="entityUri" value="${individual.URI}"/>
|
|
||||||
<input type="hidden" name="controller" value="Link"/>
|
|
||||||
</form>
|
|
||||||
<form action="editForm" method="get">
|
|
||||||
<input type="submit" class="form-button" value="Add an External Identifier"/>
|
<input type="submit" class="form-button" value="Add an External Identifier"/>
|
||||||
<input type="hidden" name="IndividualURI" value="${individual.URI}"/>
|
<input type="hidden" name="IndividualURI" value="${individual.URI}"/>
|
||||||
<input type="hidden" name="controller" value="ExternalId"/>
|
<input type="hidden" name="controller" value="ExternalId"/>
|
||||||
|
@ -119,10 +103,6 @@
|
||||||
<input type="hidden" name="mode" value="renameResource"/>
|
<input type="hidden" name="mode" value="renameResource"/>
|
||||||
<input type="hidden" name="controller" value="Refactor"/>
|
<input type="hidden" name="controller" value="Refactor"/>
|
||||||
</form>
|
</form>
|
||||||
<form action="uploadImages" method="get">
|
|
||||||
<input type="submit" class="form-button" value="Upload Image"/>
|
|
||||||
<input type="hidden" name="entityUri" value="${individual.URI}"/>
|
|
||||||
</form>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr><td colspan="3"><hr/></td></tr>
|
<tr><td colspan="3"><hr/></td></tr>
|
||||||
|
@ -216,11 +196,6 @@
|
||||||
<td colspan="9"><select id="entitiesList" class="form-item"><option>select individual</option></select></td>
|
<td colspan="9"><select id="entitiesList" class="form-item"><option>select individual</option></select></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<!-- no longer available in v.0.7 : something to reimplement in 0.8 or 0.9 -->
|
|
||||||
<tr style="display:none;">
|
|
||||||
<td>Sunrise:</td><td><input id="sunrise" class="form-item" type="text"/></td>
|
|
||||||
<td>Sunset:</td><td><input id="sunset" class="form-item" type="text"/></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><input type="button" id="saveButt" class="form-button"
|
<td><input type="button" id="saveButt" class="form-button"
|
||||||
|
@ -236,51 +211,6 @@
|
||||||
|
|
||||||
</c:if> <!-- end dwr section -->
|
</c:if> <!-- end dwr section -->
|
||||||
|
|
||||||
<!-- __________ Relationships to object nodes (domain id is broader or parent side, range id is narrower or child side) _________________ -->
|
|
||||||
|
|
||||||
<table class="form-background" border="0" cellpadding="2" cellspacing="2" width="100%">
|
|
||||||
<tr><td colspan="3" align="center">
|
|
||||||
<div style="color: black; cursor: pointer;" onclick="javascript:switchGroupDisplay('oldEditing','oldEditingSw0','${appBean.themeDir}site_icons')" title="old editing" class="navlinkblock" onmouseover="onMouseOverHeading(this)" onmouseout="onMouseOutHeading(this)">
|
|
||||||
<span class="entityRelationsSpan"><img src="${appBean.themeDir}site_icons/plus.gif" id="oldEditingSw0"/>
|
|
||||||
Click here for original-style object property statement editing (should work on any browser)</span>
|
|
||||||
</div>
|
|
||||||
</td></tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<div id="oldEditing" style="display:none;">
|
|
||||||
<table class="form-background" border="0" cellpadding="2" cellspacing="2" width="100%">
|
|
||||||
<tr valign="bottom" align="center">
|
|
||||||
<td colspan="3"><i>This individual is the subject in the following relationships to other object individuals</i></td>
|
|
||||||
</tr>
|
|
||||||
<tr valign="bottom" align="center">
|
|
||||||
<td/>
|
|
||||||
<td valign="bottom" align="center">
|
|
||||||
<c:if test="${!empty epo.formObject.optionLists['ExistingPropertyInstances']}">
|
|
||||||
<form action="editForm" method="edit">
|
|
||||||
<select name="multiplexedParam" class="form-item">
|
|
||||||
<form:option name="ExistingPropertyInstances"/>
|
|
||||||
</select><br/>
|
|
||||||
<input type="hidden" name="SubjectEntURI" value="${individual.URI}"/>
|
|
||||||
<input type="submit" class="form-button" value="Edit Statement"/>
|
|
||||||
<input type="hidden" name="controller" value="ObjectPropertyStatement"/>
|
|
||||||
</form>
|
|
||||||
</c:if>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<form action="editForm" method="get">
|
|
||||||
<input type="hidden" name="SubjectEntURI" value="${individual.URI}"/>
|
|
||||||
<select name="PropertyURI" class="form-item">
|
|
||||||
<form:option name="PropertyURI"/>
|
|
||||||
</select><br/>
|
|
||||||
<input type="hidden" name="controller" value="ObjectPropertyStatement"/>
|
|
||||||
<input type="hidden" name="domainSide" value="true"/>
|
|
||||||
<input type="submit" class="form-button" value="new link for this individual"/>
|
|
||||||
</form>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr><td colspan="3"></td></tr>
|
|
||||||
</table>
|
|
||||||
</div><!-- END div "oldEditing" -->
|
|
||||||
</div><!-- END div "authorized" -->
|
</div><!-- END div "authorized" -->
|
||||||
</c:if><!-- end if (securityLevel less than MIN_EDIT_ROLE) -->
|
</c:if><!-- end if (securityLevel less than MIN_EDIT_ROLE) -->
|
||||||
</div><!-- END div "anybody" -->
|
</div><!-- END div "anybody" -->
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
|
|
||||||
|
|
||||||
<%@ taglib prefix="form" uri="http://vitro.mannlib.cornell.edu/edit/tags" %>
|
|
||||||
<tr class="editformcell">
|
|
||||||
<td valign="bottom" colspan="2">
|
|
||||||
<b>Keyword</b><br/>
|
|
||||||
<select name="KeyId">
|
|
||||||
<form:option name="KeyId"/>
|
|
||||||
</select>
|
|
||||||
<font size="2" color="red"><form:error name="KeyId"/></font>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
|
@ -1,29 +0,0 @@
|
||||||
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
|
|
||||||
|
|
||||||
<%@ taglib prefix="form" uri="http://vitro.mannlib.cornell.edu/edit/tags" %>
|
|
||||||
<tr class="editformcell">
|
|
||||||
<td valign="bottom" colspan="2">
|
|
||||||
<b>Keyword</b><br/>
|
|
||||||
<select name="KeyId">
|
|
||||||
<form:option name="KeyId"/>
|
|
||||||
</select>
|
|
||||||
<font size="2" color="red"><form:error name="KeyId"/></font>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="editformcell">
|
|
||||||
<td valign="top" colspan="2">
|
|
||||||
<b>Individual</b><br>
|
|
||||||
<select name="EntId">
|
|
||||||
<form:option name="EntId"/>
|
|
||||||
</select>
|
|
||||||
<font size="2" color="red"><form:error name="EntId"/></font>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="editformcell">
|
|
||||||
<td valign="bottom" colspan="2">
|
|
||||||
<select name="Mode">
|
|
||||||
<form:option name="Mode"/>
|
|
||||||
</select>
|
|
||||||
<font size="2" color="red"><form:error name="Mode"/></font>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
|
@ -1,17 +0,0 @@
|
||||||
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
|
|
||||||
|
|
||||||
<%@ taglib prefix="form" uri="http://vitro.mannlib.cornell.edu/edit/tags" %>
|
|
||||||
<tr class="editformcell">
|
|
||||||
<td valign="top" colspan="2">
|
|
||||||
<b>Keyword</b><br />
|
|
||||||
<input type="text" name="Term" value="<form:value name="Term"/>" size="60" maxlength="255" />
|
|
||||||
<p><font size="2" color="red"><form:error name="Term"/></font></p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="editformcell">
|
|
||||||
<td valign="bottom" colspan="3">
|
|
||||||
<b>Comment</b> <i>limited to ~255 characters</i><br />
|
|
||||||
<textarea name="Comments" ROWS="3" COLS="80" wrap="physical"><form:value name="Comments"/></textarea>
|
|
||||||
<font size="2" color="red"><form:error name="Comments"/></font>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
|
@ -1,29 +0,0 @@
|
||||||
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
|
|
||||||
|
|
||||||
<%@ taglib prefix="form" uri="http://vitro.mannlib.cornell.edu/edit/tags" %>
|
|
||||||
<tr class="editformcell">
|
|
||||||
<td valign="top" colspan="2">
|
|
||||||
<b>Keyword</b><br />
|
|
||||||
<input type="text" name="Term" value="<form:value name="Term"/>" size="60" maxlength="255" />
|
|
||||||
<p><font size="2" color="red"><form:error name="Term"/></font></p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="editformcell">
|
|
||||||
<td valign="top" colspan="1">
|
|
||||||
<b>Origin</b> <i>(source of 1st use of this keyword)</i><br/>
|
|
||||||
<select name="Origin" >
|
|
||||||
<form:option name="Origin"/>
|
|
||||||
</select>
|
|
||||||
<font size="2" color="red"><form:error name="Origin"/></font>
|
|
||||||
</td>
|
|
||||||
<td valign="top"><sup>*</sup>If [new origin] is selected, optionally enter a <b>new origin</b> here:<br/>
|
|
||||||
<input type="text" name="Origin" size="30" maxlength="80" /><br>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="editformcell">
|
|
||||||
<td valign="bottom" colspan="3">
|
|
||||||
<b>Comment</b> <i>limited to ~255 characters</i><br />
|
|
||||||
<textarea name="Comments" ROWS="3" COLS="80" wrap="physical"><form:value name="Comments"/></textarea>
|
|
||||||
<font size="2" color="red"><form:error name="Comments"/></font>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
|
|
||||||
|
|
||||||
<%@ taglib prefix="form" uri="http://vitro.mannlib.cornell.edu/edit/tags" %>
|
|
||||||
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
|
|
||||||
|
|
||||||
<tr class="editformcell">
|
|
||||||
<td valign="top" colspan="3">
|
|
||||||
<b>Individual Name</b><br/>
|
|
||||||
<select name="EntityId" >
|
|
||||||
<form:option name="EntityId"/></option>
|
|
||||||
</select>
|
|
||||||
<font size="2" color="red"><form:error name="EntityId"/></font>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<c:if test="${!empty epo.formObject.optionLists['TypeURI']}">
|
|
||||||
<tr class='editformcell'>
|
|
||||||
<td valign="top" colspan="3">
|
|
||||||
<b>Link Type</b><br>
|
|
||||||
<select name="TypeURI">
|
|
||||||
<form:option name="TypeURI"/>
|
|
||||||
</select>
|
|
||||||
<br><font size="2" color="red"><form:error name="TypeURI"/></font>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</c:if>
|
|
||||||
<tr class="editformcell">
|
|
||||||
<td valign="bottom" colspan="3">
|
|
||||||
<b>URL</b> itself (http://...)<br/>
|
|
||||||
<input type="text" name="Url" style="width:32em;" value="<form:value name="Url"/>"/>
|
|
||||||
<font size="2" color="red"><form:error name="Url"/></font>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="editformcell">
|
|
||||||
<td valign="bottom" colspan="2">
|
|
||||||
<b>anchor text for above URL</b><br/>
|
|
||||||
<input type="text" name="Anchor" value="<form:value name="Anchor"/>" style="width:24em;" maxlength="255" />
|
|
||||||
<font size="2" color="red"><form:error name="Anchor"/></font>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
|
@ -135,7 +135,7 @@
|
||||||
<tr class="editformcell">
|
<tr class="editformcell">
|
||||||
<td valign="bottom" colspan="2">
|
<td valign="bottom" colspan="2">
|
||||||
<em>Optional: <strong>sort related individuals</strong> by<br />
|
<em>Optional: <strong>sort related individuals</strong> by<br />
|
||||||
(name,timekey,sunrise,or sunset; default is name)</em><br/>
|
(default is sort by name)</em><br/>
|
||||||
<input name="DomainEntitySortField" value="<form:value name="DomainEntitySortField"/>" />
|
<input name="DomainEntitySortField" value="<form:value name="DomainEntitySortField"/>" />
|
||||||
<font size="2" color="red"><form:error name="DomainEntitySortField"/></font><br />
|
<font size="2" color="red"><form:error name="DomainEntitySortField"/></font><br />
|
||||||
</td>
|
</td>
|
||||||
|
@ -254,7 +254,7 @@
|
||||||
<tr class="editformcell">
|
<tr class="editformcell">
|
||||||
<td valign="bottom" colspan="2">
|
<td valign="bottom" colspan="2">
|
||||||
<em>Optional: <strong>sort related object individuals of inverse property</strong> by<br />
|
<em>Optional: <strong>sort related object individuals of inverse property</strong> by<br />
|
||||||
(name,timekey,sunrise,or sunset; default is name)</em><br/>
|
(default is sort by name)</em><br/>
|
||||||
<input name="RangeEntitySortField" value="<form:value name="RangeEntitySortField"/>" />
|
<input name="RangeEntitySortField" value="<form:value name="RangeEntitySortField"/>" />
|
||||||
<font size="2" color="red"><form:error name="RangeEntitySortField"/></font>
|
<font size="2" color="red"><form:error name="RangeEntitySortField"/></font>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -77,10 +77,8 @@
|
||||||
<c:param name="uri" value="${ent.URI}"/>
|
<c:param name="uri" value="${ent.URI}"/>
|
||||||
</c:url>
|
</c:url>
|
||||||
<div class="tab-image"><a class="image" href="<c:out value="${imageHref}"/>"><img width="${IMG_WIDTH}" src="${pageContext.request.contextPath}${ent.thumbUrl}" title="${ent.name}" alt="" /></a></div>
|
<div class="tab-image"><a class="image" href="<c:out value="${imageHref}"/>"><img width="${IMG_WIDTH}" src="${pageContext.request.contextPath}${ent.thumbUrl}" title="${ent.name}" alt="" /></a></div>
|
||||||
<c:if test="${not empty ent.blurb}"><div class='blurb'>${ent.blurb}</div></c:if>
|
|
||||||
</c:when>
|
</c:when>
|
||||||
<c:otherwise>
|
<c:otherwise>
|
||||||
<c:if test="${not empty ent.blurb}"><div class='blurb'>${ent.blurb}</div></c:if>
|
|
||||||
</c:otherwise>
|
</c:otherwise>
|
||||||
</c:choose>
|
</c:choose>
|
||||||
</li>
|
</li>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue