[VIVO-1309] [VIVO-1307] Update DWR to version 3.0.2 and remove dom4j
This commit is contained in:
parent
2efe4b4a87
commit
1a292d8011
8 changed files with 81 additions and 74 deletions
6
dependencies/pom.xml
vendored
6
dependencies/pom.xml
vendored
|
@ -56,12 +56,12 @@
|
||||||
<artifactId>cxf-xjc-ts</artifactId>
|
<artifactId>cxf-xjc-ts</artifactId>
|
||||||
<version>2.6.2</version>
|
<version>2.6.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<!-- Added for runtime -->
|
<!-- Added for runtime -->
|
||||||
|
<!-- dependency>
|
||||||
<groupId>dom4j</groupId>
|
<groupId>dom4j</groupId>
|
||||||
<artifactId>dom4j</artifactId>
|
<artifactId>dom4j</artifactId>
|
||||||
<version>1.6.1</version>
|
<version>1.6.1</version>
|
||||||
</dependency>
|
</dependency -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -202,7 +202,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.directwebremoting</groupId>
|
<groupId>org.directwebremoting</groupId>
|
||||||
<artifactId>dwr</artifactId>
|
<artifactId>dwr</artifactId>
|
||||||
<version>2.0.M2.8</version><!-- Resolved from VIVO repository as not in central; newer causes errors -->
|
<version>3.0.2-RELEASE</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.freemarker</groupId>
|
<groupId>org.freemarker</groupId>
|
||||||
|
|
|
@ -48,6 +48,8 @@
|
||||||
<!--</convert>-->
|
<!--</convert>-->
|
||||||
|
|
||||||
<convert converter="bean" match="Date"/>
|
<convert converter="bean" match="Date"/>
|
||||||
|
<convert match="java.lang.Exception" converter="exception"/>
|
||||||
|
<convert match="java.lang.StackTraceElement" converter="bean"/>
|
||||||
</allow>
|
</allow>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -939,7 +939,7 @@
|
||||||
|
|
||||||
<servlet>
|
<servlet>
|
||||||
<servlet-name>dwr-invoker</servlet-name>
|
<servlet-name>dwr-invoker</servlet-name>
|
||||||
<servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
|
<servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
|
||||||
<init-param>
|
<init-param>
|
||||||
<param-name>debug</param-name>
|
<param-name>debug</param-name>
|
||||||
<param-value>true</param-value>
|
<param-value>true</param-value>
|
||||||
|
|
|
@ -42,7 +42,7 @@ function monikerInit(){
|
||||||
|
|
||||||
function update(){ //updates moniker list when type is changed
|
function update(){ //updates moniker list when type is changed
|
||||||
|
|
||||||
DWRUtil.useLoadingMessage();
|
dwr.util.useLoadingMessage();
|
||||||
|
|
||||||
EntityDWR.monikers(createList, document.getElementById("VClassURI").value );
|
EntityDWR.monikers(createList, document.getElementById("VClassURI").value );
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ function createList(data) { //puts options in moniker select list
|
||||||
var opt = new Option("[new moniker]","");
|
var opt = new Option("[new moniker]","");
|
||||||
ele.options[ele.options.length] = opt;
|
ele.options[ele.options.length] = opt;
|
||||||
|
|
||||||
DWRUtil.setValue("Moniker",getCurrentMoniker()); // getCurrentMoniker() is defined on jsp
|
dwr.util.setValue("Moniker",getCurrentMoniker()); // getCurrentMoniker() is defined on jsp
|
||||||
|
|
||||||
checkMonikers();
|
checkMonikers();
|
||||||
}
|
}
|
||||||
|
@ -111,7 +111,7 @@ function fillList(id, data, selectedtext) {
|
||||||
|
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
|
|
||||||
var text = DWRUtil.toDescriptiveString(data[i]);
|
var text = dwr.util.toDescriptiveString(data[i]);
|
||||||
|
|
||||||
var value = text;
|
var value = text;
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||||
|
|
||||||
/* this code uses:
|
/* this code uses:
|
||||||
dwrutil in util.js
|
dwr.util in util.js
|
||||||
vitro.js
|
vitro.js
|
||||||
detect.js
|
detect.js
|
||||||
*/
|
*/
|
||||||
dojo.require("dojo.io.*");
|
dojo.require("dojo.io.*");
|
||||||
dojo.require("dojo.event.*");
|
dojo.require("dojo.event.*");
|
||||||
|
|
||||||
//DWREngine.setErrorHandler(function(data){alert("DWREngine error: " + data);});
|
//dwr.engine.setErrorHandler(function(data){alert("dwr.engine error: " + data);});
|
||||||
//DWREngine.setWarningHandler(function(data){alert("DWREngine warning: " + data);});
|
//dwr.engine.setWarningHandler(function(data){alert("dwr.engine warning: " + data);});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
ents_edit.js has several tasks:
|
ents_edit.js has several tasks:
|
||||||
|
@ -68,7 +68,7 @@ function update( ) {
|
||||||
clearProp();
|
clearProp();
|
||||||
updateTable();
|
updateTable();
|
||||||
updateEntityAndPropHash();
|
updateEntityAndPropHash();
|
||||||
var but = $("newPropButton");
|
var but = dwr.util.byId("newPropButton");
|
||||||
if( but ) { but.disabled = false; }
|
if( but ) { but.disabled = false; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,11 +78,11 @@ function clearProp() {
|
||||||
var clearMap={sunrise:"",sunset: ""};
|
var clearMap={sunrise:"",sunset: ""};
|
||||||
editingNewProp = false;
|
editingNewProp = false;
|
||||||
gVClassUri = null;
|
gVClassUri = null;
|
||||||
DWRUtil.setValues( clearMap );
|
dwr.util.setValues( clearMap );
|
||||||
clear($("propertyList"));
|
clear(dwr.util.byId("propertyList"));
|
||||||
clear($("vClassList"));
|
clear(dwr.util.byId("vClassList"));
|
||||||
|
|
||||||
var ele = $("entitiesList");
|
var ele = dwr.util.byId("entitiesList");
|
||||||
while( ele != null && ele.length > 0){
|
while( ele != null && ele.length > 0){
|
||||||
ele.remove(0);
|
ele.remove(0);
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,7 @@ function updateEntityAndPropHash(){
|
||||||
//once we set the gEntity we can get the ents2ents properties.
|
//once we set the gEntity we can get the ents2ents properties.
|
||||||
//PropertyDWR.getAllPropInstByVClass(setPropertyHash, entityObj.VClassURI );
|
//PropertyDWR.getAllPropInstByVClass(setPropertyHash, entityObj.VClassURI );
|
||||||
if( entityObj != null && 'URI' in entityObj )
|
if( entityObj != null && 'URI' in entityObj )
|
||||||
PropertyDWR.getAllPossiblePropInstForIndividual(setPropertyHash, entityObj.URI);
|
PropertyDWR.getAllPossiblePropInstForIndividual(entityObj.URI, { callback:setPropertyHash });
|
||||||
//else
|
//else
|
||||||
//alert("could not find an individual, usually this means that there is no type for the URI");
|
//alert("could not find an individual, usually this means that there is no type for the URI");
|
||||||
};
|
};
|
||||||
|
@ -126,7 +126,7 @@ function updateEntityAndPropHash(){
|
||||||
};
|
};
|
||||||
|
|
||||||
//get the gEntity and then build the gPropertyHash
|
//get the gEntity and then build the gPropertyHash
|
||||||
EntityDWR.entityByURI(setGEntity, gEntityURI);
|
EntityDWR.entityByURI(gEntityURI, { callback:setGEntity });
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************
|
/*****************************************************************
|
||||||
|
@ -139,7 +139,7 @@ function doNoPropsWarning(){
|
||||||
"The button you have clicked adds a new object property statement relating this individual " +
|
"The button you have clicked adds a new object property statement relating this individual " +
|
||||||
"to another individual. If you are looking to add new object properties to the " +
|
"to another individual. If you are looking to add new object properties to the " +
|
||||||
"system, look under the 'About' menu.");
|
"system, look under the 'About' menu.");
|
||||||
var but = $("newPropButton");
|
var but = dwr.util.byId("newPropButton");
|
||||||
if( but ) { but.disabled = true; }
|
if( but ) { but.disabled = true; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,18 +149,18 @@ because dwr calls are async we have a callback
|
||||||
function updateTable(callback) {
|
function updateTable(callback) {
|
||||||
var cb = callback;
|
var cb = callback;
|
||||||
function fillTable(props) {
|
function fillTable(props) {
|
||||||
DWRUtil.removeAllRows("propbody");
|
dwr.util.removeAllRows("propbody");
|
||||||
/* This makes the row that gets added to the ents_edit form for each ents2ents object. */
|
/* This makes the row that gets added to the ents_edit form for each ents2ents object. */
|
||||||
addRows($("propbody"), props,
|
addRows(dwr.util.byId("propbody"), props,
|
||||||
[getDomain, getProperty, getRange, getEdit, getDelete],
|
[getDomain, getProperty, getRange, getEdit, getDelete],
|
||||||
makeTr);
|
makeTr);
|
||||||
var newPropTr = $("justwritenTr");
|
var newPropTr = dwr.util.byId("justwritenTr");
|
||||||
if( newPropTr != null ){
|
if( newPropTr != null ){
|
||||||
Fat.fade_element( "justwritenTr" );
|
Fat.fade_element( "justwritenTr" );
|
||||||
}
|
}
|
||||||
if(cb !== undefined && cb !== null ) { cb(); }
|
if(cb !== undefined && cb !== null ) { cb(); }
|
||||||
}
|
}
|
||||||
PropertyDWR.getExistingProperties(fillTable,gEntityURI);
|
PropertyDWR.getExistingProperties(gEntityURI, { callback: fillTable });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
|
@ -252,7 +252,7 @@ var makeTr = (function(){ /* outer func */
|
||||||
/* called when Edit button is clicked */
|
/* called when Edit button is clicked */
|
||||||
function editTable(inputElement, subjectURI, predicateURI, objectURI){
|
function editTable(inputElement, subjectURI, predicateURI, objectURI){
|
||||||
var rowIndex = inputElement.parentNode.parentNode.rowIndex-1 ;
|
var rowIndex = inputElement.parentNode.parentNode.rowIndex-1 ;
|
||||||
var table = $("propbody");
|
var table = dwr.util.byId("propbody");
|
||||||
table.deleteRow( rowIndex );
|
table.deleteRow( rowIndex );
|
||||||
table.insertRow(rowIndex);
|
table.insertRow(rowIndex);
|
||||||
table.rows[rowIndex].insertCell(0);
|
table.rows[rowIndex].insertCell(0);
|
||||||
|
@ -261,7 +261,7 @@ function editTable(inputElement, subjectURI, predicateURI, objectURI){
|
||||||
table.rows[rowIndex].cells[0].colSpan = tableMaxColspan( table );
|
table.rows[rowIndex].cells[0].colSpan = tableMaxColspan( table );
|
||||||
vform.style.display="block";
|
vform.style.display="block";
|
||||||
|
|
||||||
PropertyDWR.getProperty(fillForm, subjectURI, predicateURI, objectURI);
|
PropertyDWR.getProperty(subjectURI, predicateURI, objectURI, { callback: fillForm });
|
||||||
inputElement.parentNode.parentNode.style.display="none";
|
inputElement.parentNode.parentNode.style.display="none";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -270,7 +270,7 @@ function deleteProp( subjectURI, predicateURI, objectURI, objectName, predicateN
|
||||||
if( PropertyDWR.deleteProp ){
|
if( PropertyDWR.deleteProp ){
|
||||||
if (confirm("Are you sure you want to delete the property\n"
|
if (confirm("Are you sure you want to delete the property\n"
|
||||||
+ objectName + " " + predicateName + "?")) {
|
+ objectName + " " + predicateName + "?")) {
|
||||||
PropertyDWR.deleteProp(update, subjectURI, predicateURI, objectURI);
|
PropertyDWR.deleteProp(subjectURI, predicateURI, objectURI, { callback:update });
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
alert("Deletion of object property statements is disabled.");
|
alert("Deletion of object property statements is disabled.");
|
||||||
|
@ -312,7 +312,7 @@ function newProp() {
|
||||||
fillForm( newP );
|
fillForm( newP );
|
||||||
editingNewProp = true;
|
editingNewProp = true;
|
||||||
fillRangeVClassList();
|
fillRangeVClassList();
|
||||||
var table = $("propbody");
|
var table = dwr.util.byId("propbody");
|
||||||
var tr = table.insertRow(0);
|
var tr = table.insertRow(0);
|
||||||
tr.id = "newrow";
|
tr.id = "newrow";
|
||||||
appendPropForm( tr, tableMaxColspan( table ) );
|
appendPropForm( tr, tableMaxColspan( table ) );
|
||||||
|
@ -331,7 +331,7 @@ function fillForm(aprop) {
|
||||||
gProperty = aprop;
|
gProperty = aprop;
|
||||||
var vclass = gProperty.domainClass;
|
var vclass = gProperty.domainClass;
|
||||||
|
|
||||||
DWRUtil.setValues(gProperty);
|
dwr.util.setValues(gProperty);
|
||||||
|
|
||||||
toggleDisabled("newPropButton");
|
toggleDisabled("newPropButton");
|
||||||
|
|
||||||
|
@ -346,7 +346,7 @@ function fillPropList(classId) {
|
||||||
/* This function fills up the form's select list with options
|
/* This function fills up the form's select list with options
|
||||||
Notice that the option id is the propertyid + 'D' or 'R'
|
Notice that the option id is the propertyid + 'D' or 'R'
|
||||||
so that domain and range properties can be distinguished */
|
so that domain and range properties can be distinguished */
|
||||||
var propList = $("propertyList");
|
var propList = dwr.util.byId("propertyList");
|
||||||
clear(propList);
|
clear(propList);
|
||||||
|
|
||||||
//add properties as options
|
//add properties as options
|
||||||
|
@ -383,10 +383,10 @@ function fillPropList(classId) {
|
||||||
*****************************************************************/
|
*****************************************************************/
|
||||||
function fillRangeVClassList( propId ){
|
function fillRangeVClassList( propId ){
|
||||||
//If propId is null then the one on the property select list will be used
|
//If propId is null then the one on the property select list will be used
|
||||||
if( propId == null ) { propId = DWRUtil.getValue("propertyList");}
|
if( propId == null ) { propId = dwr.util.getValue("propertyList");}
|
||||||
|
|
||||||
//clear the list and put the loading message up
|
//clear the list and put the loading message up
|
||||||
var vclassListEle = $("vClassList");
|
var vclassListEle = dwr.util.byId("vClassList");
|
||||||
clear(vclassListEle);
|
clear(vclassListEle);
|
||||||
vclassListEle.options[vclassListEle.options.length] = new Option("Loading...",-10);
|
vclassListEle.options[vclassListEle.options.length] = new Option("Loading...",-10);
|
||||||
//vclassListEle.options[0].selected = true;
|
//vclassListEle.options[0].selected = true;
|
||||||
|
@ -394,11 +394,11 @@ function fillRangeVClassList( propId ){
|
||||||
|
|
||||||
var prop = gPropertyHash[propId];
|
var prop = gPropertyHash[propId];
|
||||||
|
|
||||||
VClassDWR.getVClasses(
|
VClassDWR.getVClasses(prop.domainClassURI, prop.propertyURI, prop.subjectSide,
|
||||||
function(vclasses){
|
function(vclasses){
|
||||||
addVClassOptions( vclasses );
|
addVClassOptions( vclasses );
|
||||||
},
|
}
|
||||||
prop.domainClassURI, prop.propertyURI, prop.subjectSide);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************
|
/****************************************************************
|
||||||
|
@ -406,14 +406,14 @@ function fillRangeVClassList( propId ){
|
||||||
the entitiesList.
|
the entitiesList.
|
||||||
****************************************************************/
|
****************************************************************/
|
||||||
function addVClassOptions( vclassArray ){
|
function addVClassOptions( vclassArray ){
|
||||||
// DWRUtil.addOptions("entitiesList",null);
|
// dwr.util.addOptions("entitiesList",null);
|
||||||
var vclassEle = $("vClassList");
|
var vclassEle = dwr.util.byId("vClassList");
|
||||||
clear( vclassEle );
|
clear( vclassEle );
|
||||||
vclassEle.disabled = false;
|
vclassEle.disabled = false;
|
||||||
|
|
||||||
if( vclassArray == null || vclassArray.length < 1){
|
if( vclassArray == null || vclassArray.length < 1){
|
||||||
vclassEle.disabled = true;
|
vclassEle.disabled = true;
|
||||||
entsEle = $("entitiesList");
|
entsEle = dwr.util.byId("entitiesList");
|
||||||
clear(entsEle);
|
clear(entsEle);
|
||||||
var msg="There are no entities defined yet that could fill this role";
|
var msg="There are no entities defined yet that could fill this role";
|
||||||
var opt = new Option(msg,-1);
|
var opt = new Option(msg,-1);
|
||||||
|
@ -435,15 +435,15 @@ function addVClassOptions( vclassArray ){
|
||||||
|
|
||||||
//attempt to set the selected option to the current vclass
|
//attempt to set the selected option to the current vclass
|
||||||
var vclassURI = null;
|
var vclassURI = null;
|
||||||
var prop = gPropertyHash[ DWRUtil.getValue("propertyList") ];
|
var prop = gPropertyHash[ dwr.util.getValue("propertyList") ];
|
||||||
if( gProperty.propertyURI == prop.propertyURI ){
|
if( gProperty.propertyURI == prop.propertyURI ){
|
||||||
vclassURI = gProperty.rangeClassURI;
|
vclassURI = gProperty.rangeClassURI;
|
||||||
|
|
||||||
DWRUtil.setValue(vclassEle, vclassURI );
|
dwr.util.setValue(vclassEle, vclassURI );
|
||||||
//here we were unable to set the vclass select option to the vclassid
|
//here we were unable to set the vclass select option to the vclassid
|
||||||
//of the entity. this means that the vclass of the entity is not one that
|
//of the entity. this means that the vclass of the entity is not one that
|
||||||
//is permited by the PropertyInheritance and other restrictions.
|
//is permited by the PropertyInheritance and other restrictions.
|
||||||
if( DWRUtil.getValue(vclassEle) != vclassURI){
|
if( dwr.util.getValue(vclassEle) != vclassURI){
|
||||||
alert("This entity's class does not match the class of this property. This is usually the "+
|
alert("This entity's class does not match the class of this property. This is usually the "+
|
||||||
"result of the class of the entity having been changed. Properties that were added when " +
|
"result of the class of the entity having been changed. Properties that were added when " +
|
||||||
"this entity had the old class still reflect that value.\n" +
|
"this entity had the old class still reflect that value.\n" +
|
||||||
|
@ -461,15 +461,15 @@ function addVClassOptions( vclassArray ){
|
||||||
*****************************************************************/
|
*****************************************************************/
|
||||||
function fillEntsList( vclassEle ){
|
function fillEntsList( vclassEle ){
|
||||||
if( vclassEle == null )
|
if( vclassEle == null )
|
||||||
vclassEle = $("vClassList");
|
vclassEle = dwr.util.byId("vClassList");
|
||||||
var vclassUri = DWRUtil.getValue( vclassEle );
|
var vclassUri = dwr.util.getValue( vclassEle );
|
||||||
|
|
||||||
if( vclassUri == gVClassUri )
|
if( vclassUri == gVClassUri )
|
||||||
return;
|
return;
|
||||||
else
|
else
|
||||||
gVClassUri = vclassUri;
|
gVClassUri = vclassUri;
|
||||||
|
|
||||||
var entsListEle = $("entitiesList");
|
var entsListEle = dwr.util.byId("entitiesList");
|
||||||
clear(entsListEle);
|
clear(entsListEle);
|
||||||
entityOptToSelect = null;
|
entityOptToSelect = null;
|
||||||
|
|
||||||
|
@ -494,7 +494,7 @@ function fillEntsList( vclassEle ){
|
||||||
},
|
},
|
||||||
load: function(type, data, evt){
|
load: function(type, data, evt){
|
||||||
//clear here since we will be using addEntOptions for multiple adds
|
//clear here since we will be using addEntOptions for multiple adds
|
||||||
// var entsListEle = $("entitiesList");
|
// var entsListEle = dwr.util.byId("entitiesList");
|
||||||
// clear(entsListEle);
|
// clear(entsListEle);
|
||||||
addEntOptions(data, -1);
|
addEntOptions(data, -1);
|
||||||
},
|
},
|
||||||
|
@ -509,7 +509,7 @@ function fillEntsList( vclassEle ){
|
||||||
|
|
||||||
/** add entities in entArray as options elements to select element "Individual" */
|
/** add entities in entArray as options elements to select element "Individual" */
|
||||||
function addEntOptions( entArray ){
|
function addEntOptions( entArray ){
|
||||||
var entsListEle = $("entitiesList");
|
var entsListEle = dwr.util.byId("entitiesList");
|
||||||
|
|
||||||
if( entArray == null || entArray.length == 0){
|
if( entArray == null || entArray.length == 0){
|
||||||
clear(entsListEle);
|
clear(entsListEle);
|
||||||
|
@ -623,12 +623,12 @@ function writeProp() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if( !validateForm() ) { return; }
|
if( !validateForm() ) { return; }
|
||||||
var prop = gPropertyHash[DWRUtil.getValue("propertyList")];
|
var prop = gPropertyHash[dwr.util.getValue("propertyList")];
|
||||||
var newP = {};
|
var newP = {};
|
||||||
var oldP = gProperty;
|
var oldP = gProperty;
|
||||||
newP.propertyURI = prop.propertyURI;
|
newP.propertyURI = prop.propertyURI;
|
||||||
|
|
||||||
var selected = DWRUtil.getValue("entitiesList");
|
var selected = dwr.util.getValue("entitiesList");
|
||||||
newP.subjectEntURI= gEntity.URI;
|
newP.subjectEntURI= gEntity.URI;
|
||||||
newP.objectEntURI = selected ;
|
newP.objectEntURI = selected ;
|
||||||
|
|
||||||
|
@ -639,16 +639,17 @@ function writeProp() {
|
||||||
|
|
||||||
if( editingNewProp ){
|
if( editingNewProp ){
|
||||||
newP.ents2entsId = -1;
|
newP.ents2entsId = -1;
|
||||||
PropertyDWR.insertProp(callback, newP );
|
PropertyDWR.insertProp(newP, { callback:callback } );
|
||||||
} else {
|
} else {
|
||||||
var afterDelete=
|
var afterDelete=
|
||||||
function(result){
|
function(result){
|
||||||
PropertyDWR.insertProp(callback, newP);
|
PropertyDWR.insertProp(newP, { callback:callback });
|
||||||
};
|
};
|
||||||
PropertyDWR.deleteProp(afterDelete,
|
PropertyDWR.deleteProp(
|
||||||
gProperty.subjectEntURI,
|
gProperty.subjectEntURI,
|
||||||
gProperty.propertyURI,
|
gProperty.propertyURI,
|
||||||
gProperty.objectEntURI);
|
gProperty.objectEntURI,
|
||||||
|
{ callback:afterDelete });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -657,10 +658,10 @@ addEvent(window, 'load', update);
|
||||||
|
|
||||||
/********************* some utilities ***********************************/
|
/********************* some utilities ***********************************/
|
||||||
/* this clones the property edit from a div on the ents_edit.jsp */
|
/* this clones the property edit from a div on the ents_edit.jsp */
|
||||||
function getForm(){ return $("propeditdiv").cloneNode(true); }
|
function getForm(){ return dwr.util.byId("propeditdiv").cloneNode(true); }
|
||||||
|
|
||||||
/* a function to display a lot of info about an object */
|
/* a function to display a lot of info about an object */
|
||||||
function disy( obj, note ){ alert( (note!==null?note:"") + DWRUtil.toDescriptiveString(obj, 3));}
|
function disy( obj, note ){ alert( (note!==null?note:"") + dwr.util.toDescriptiveString(obj, 3));}
|
||||||
|
|
||||||
/* attempts to get the URI of the entity being edited */
|
/* attempts to get the URI of the entity being edited */
|
||||||
function getEntityUriFromPage(){
|
function getEntityUriFromPage(){
|
||||||
|
|
|
@ -30,7 +30,7 @@ function init(){
|
||||||
|
|
||||||
function update(){ //updates moniker list when type is changed
|
function update(){ //updates moniker list when type is changed
|
||||||
|
|
||||||
DWRUtil.useLoadingMessage();
|
dwr.util.useLoadingMessage();
|
||||||
|
|
||||||
EntityDWR.monikers(createList, document.getElementById("field2Value").value );
|
EntityDWR.monikers(createList, document.getElementById("field2Value").value );
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ function createList(data) { //puts options in moniker select list
|
||||||
var opt = new Option("[new moniker]","");
|
var opt = new Option("[new moniker]","");
|
||||||
ele.options[ele.options.length] = opt;
|
ele.options[ele.options.length] = opt;
|
||||||
|
|
||||||
DWRUtil.setValue("monikerSelect",getCurrentMoniker()); // getCurrentMoniker() is defined on jsp
|
dwr.util.setValue("monikerSelect",getCurrentMoniker()); // getCurrentMoniker() is defined on jsp
|
||||||
|
|
||||||
checkMonikers();
|
checkMonikers();
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ function fillList(id, data, selectedtext) {
|
||||||
|
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
|
|
||||||
var text = DWRUtil.toDescriptiveString(data[i]);
|
var text = dwr.util.toDescriptiveString(data[i]);
|
||||||
|
|
||||||
var value = text;
|
var value = text;
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ function encodeUrl(pstrString) {
|
||||||
*/
|
*/
|
||||||
function addRows(ele, data, cellFuncs, rowFunc) {
|
function addRows(ele, data, cellFuncs, rowFunc) {
|
||||||
var frag = document.createDocumentFragment();
|
var frag = document.createDocumentFragment();
|
||||||
if (DWRUtil._isArray(data)) {
|
if (dwr.util._isArray(data)) {
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
frag.appendChild( makeRow( data[i], cellFuncs, rowFunc) );
|
frag.appendChild( makeRow( data[i], cellFuncs, rowFunc) );
|
||||||
}
|
}
|
||||||
|
@ -77,9 +77,9 @@ function makeRow( row, cellFuncs, rowFunc){
|
||||||
var func = cellFuncs[j]
|
var func = cellFuncs[j]
|
||||||
var td
|
var td
|
||||||
var reply = func(row)
|
var reply = func(row)
|
||||||
if (DWRUtil._isHTMLElement(reply, "td")) {
|
if (dwr.util._isHTMLElement(reply, "td")) {
|
||||||
td = reply;
|
td = reply;
|
||||||
} else if (DWRUtil._isHTMLElement(reply, "a")) {
|
} else if (dwr.util._isHTMLElement(reply, "a")) {
|
||||||
td = document.createElement("td");
|
td = document.createElement("td");
|
||||||
td.appendChild( reply );
|
td.appendChild( reply );
|
||||||
} else {
|
} else {
|
||||||
|
@ -91,7 +91,7 @@ function makeRow( row, cellFuncs, rowFunc){
|
||||||
return tr;
|
return tr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** added this from the DWRUtil.js */
|
/** added this from the dwr.util.js */
|
||||||
isDate = function(data) {
|
isDate = function(data) {
|
||||||
return (data && data.toUTCString) ? true : false;
|
return (data && data.toUTCString) ? true : false;
|
||||||
};
|
};
|
||||||
|
@ -147,8 +147,8 @@ function date2iso8601( jdate ){
|
||||||
function setDateValue(ele, date, date2StrFunc){
|
function setDateValue(ele, date, date2StrFunc){
|
||||||
if( date == null || ! isDate(date)) { return; }
|
if( date == null || ! isDate(date)) { return; }
|
||||||
if( date2StrFunc == null ) { date2StrFunc = date2iso8601; }
|
if( date2StrFunc == null ) { date2StrFunc = date2iso8601; }
|
||||||
ele = $(ele);
|
ele = dwr.util.byId(ele);
|
||||||
DWRUtil.setValue(ele, date2StrFunc( date ));
|
dwr.util.setValue(ele, date2StrFunc( date ));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* removes all children and if it can, removes options */
|
/* removes all children and if it can, removes options */
|
||||||
|
@ -160,7 +160,7 @@ function clear(ele){
|
||||||
}
|
}
|
||||||
|
|
||||||
function hideElementById(eleId){
|
function hideElementById(eleId){
|
||||||
var ele = $(eleId);
|
var ele = dwr.util.byId(eleId);
|
||||||
if( ele != null ){ ele.style.display="none"; }
|
if( ele != null ){ ele.style.display="none"; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,7 +168,7 @@ function makeEntLinkElement(entityURI, text){
|
||||||
link = document.createElement("a");
|
link = document.createElement("a");
|
||||||
link.href = "entityEdit?uri=" + encodeUrl(entityURI);
|
link.href = "entityEdit?uri=" + encodeUrl(entityURI);
|
||||||
link.innerHTML = text;
|
link.innerHTML = text;
|
||||||
//DWRUtil.setValue(link, "test" + text);
|
//dwr.util.setValue(link, "test" + text);
|
||||||
return link;
|
return link;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -375,7 +375,7 @@ function adjustIFrameSize(id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleDisabled(ele){
|
function toggleDisabled(ele){
|
||||||
ele = $(ele);
|
ele = dwr.util.byId(ele);
|
||||||
if(ele == null) {return;}
|
if(ele == null) {return;}
|
||||||
ele.disabled = !ele.disabled ;
|
ele.disabled = !ele.disabled ;
|
||||||
}
|
}
|
||||||
|
@ -403,16 +403,16 @@ and returns a value for use in the select option value.
|
||||||
textFun is a function that takes one parameter, an object,
|
textFun is a function that takes one parameter, an object,
|
||||||
and returns a value for use in the select option text.
|
and returns a value for use in the select option text.
|
||||||
|
|
||||||
This is based on the code in DWRUtil but lacks the error checking.
|
This is based on the code in dwr.util but lacks the error checking.
|
||||||
*/
|
*/
|
||||||
addOptions = function(ele, data, valueFunc, textFunc) {
|
addOptions = function(ele, data, valueFunc, textFunc) {
|
||||||
var orig = ele;
|
var orig = ele;
|
||||||
ele = $(ele);
|
ele = dwr.util.byId(ele);
|
||||||
if (ele == null) {
|
if (ele == null) {
|
||||||
DWRUtil.debug("addOptions() can't find an element with id: " + orig + ".");
|
dwr.util.debug("addOptions() can't find an element with id: " + orig + ".");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var useOptions = DWRUtil._isHTMLElement(ele, "select");
|
var useOptions = dwr.util._isHTMLElement(ele, "select");
|
||||||
if (data == null) return;
|
if (data == null) return;
|
||||||
|
|
||||||
var text;
|
var text;
|
||||||
|
|
|
@ -12,19 +12,23 @@ String context = request.getContextPath();
|
||||||
if (!(Boolean)request.getAttribute("dwrDisabled")) {
|
if (!(Boolean)request.getAttribute("dwrDisabled")) {
|
||||||
%>
|
%>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
// DWR 3 is a better citizen for co-existing with jQuery.
|
||||||
|
// All of the ents_edit.js and vitro.js have been updated so that $(..) references use the dwr.util method directly
|
||||||
|
// As such, it should be possible to avoid the noConflict() mode.
|
||||||
|
// This then prevents a few errors that would otherwise occur in jQuery expecting JS on the same page
|
||||||
// relinquish jQuery's control of the $ variable to avoid conflicts with DWR
|
// relinquish jQuery's control of the $ variable to avoid conflicts with DWR
|
||||||
jQuery.noConflict();
|
// jQuery.noConflict();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/javascript" xml:space="preserve">
|
<script type="text/javascript" xml:space="preserve">
|
||||||
var gEntityURI="${entity.URI}";
|
var gEntityURI="${entity.URI}";
|
||||||
</script> <!-- There has got to be a better way to pass this to the js -->
|
</script> <!-- There has got to be a better way to pass this to the js -->
|
||||||
|
|
||||||
|
<script type="text/javascript" src="<%=context%>/dwr/engine.js"></script>
|
||||||
|
<script type="text/javascript" src="<%=context%>/dwr/util.js"></script>
|
||||||
<script type="text/javascript" src="<%=context%>/dwr/interface/PropertyDWR.js"></script>
|
<script type="text/javascript" src="<%=context%>/dwr/interface/PropertyDWR.js"></script>
|
||||||
<script type="text/javascript" src="<%=context%>/dwr/interface/EntityDWR.js"></script>
|
<script type="text/javascript" src="<%=context%>/dwr/interface/EntityDWR.js"></script>
|
||||||
<script type="text/javascript" src="<%=context%>/dwr/interface/VClassDWR.js"></script>
|
<script type="text/javascript" src="<%=context%>/dwr/interface/VClassDWR.js"></script>
|
||||||
<script type="text/javascript" src="<%=context%>/dwr/engine.js"></script>
|
|
||||||
<script type="text/javascript" src="<%=context%>/dwr/util.js"></script>
|
|
||||||
<script type="text/javascript" src="<%=context%>/js/betterDateInput.js"></script>
|
<script type="text/javascript" src="<%=context%>/js/betterDateInput.js"></script>
|
||||||
<script type="text/javascript" src="<%=context%>/js/vitro.js"></script>
|
<script type="text/javascript" src="<%=context%>/js/vitro.js"></script>
|
||||||
<script type="text/javascript" src="<%=context%>/dojo.js"></script>
|
<script type="text/javascript" src="<%=context%>/dojo.js"></script>
|
||||||
|
|
Loading…
Add table
Reference in a new issue