From 17ef726ad8a7079af32a381b3c685b85fd8e9129 Mon Sep 17 00:00:00 2001 From: hjk54 Date: Mon, 12 Apr 2010 16:23:45 +0000 Subject: [PATCH] Changes and updates related to Datastar (and or testing) --- .../webapp/controller/EntityController.java | 3 +-- .../FedoraDatastreamController.java | 26 +++---------------- .../webapp/controller/MailUsersServlet.java | 5 ++-- .../webapp/utils/FedoraConfiguration.java | 1 - .../webapp/utils/jena/JenaIngestUtils.java | 1 - 5 files changed, 6 insertions(+), 30 deletions(-) diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/EntityController.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/EntityController.java index 131bf7415..061aa7b89 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/EntityController.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/EntityController.java @@ -67,7 +67,6 @@ public class EntityController extends VitroHttpServlet { VitroRequest vreq = new VitroRequest(req); //get URL without hostname or servlet context String url = req.getRequestURI().substring(req.getContextPath().length()); - //Check to see if the request is for a non-information resource, redirect if it is. String redirectURL = checkForRedirect ( url, req.getHeader("accept") ); if( redirectURL != null ){ @@ -77,6 +76,7 @@ public class EntityController extends VitroHttpServlet { ContentType rdfFormat = checkForLinkedDataRequest(url,req.getHeader("accept")); if( rdfFormat != null ){ + System.out.println("RDF Format? "); doRdf( vreq, res, rdfFormat ); return; } @@ -229,7 +229,6 @@ public class EntityController extends VitroHttpServlet { vreq.setAttribute("css",css); vreq.setAttribute("scripts", "/templates/entity/entity_inject_head.jsp"); - RequestDispatcher rd = vreq.getRequestDispatcher( view ); rd.forward(vreq,res); } diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/FedoraDatastreamController.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/FedoraDatastreamController.java index 414b03443..5eb47b965 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/FedoraDatastreamController.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/FedoraDatastreamController.java @@ -318,7 +318,7 @@ public class FedoraDatastreamController extends VitroHttpServlet implements Cons fileUri = queryParameters.get("fileUri").get(0); } boolean useNewName=false; - if( "true".equals(queryParameters.get("useNewName"))){System.out.println("Use new name parameter is true"); + if( "true".equals(queryParameters.get("useNewName"))){ useNewName = true; } if( pId == null || pId.length() == 0 ) @@ -413,7 +413,6 @@ public class FedoraDatastreamController extends VitroHttpServlet implements Cons DataProperty contentType = wdf.getDataPropertyDao().getDataPropertyByURI(this.contentTypeProperty); if(contentType != null) { - System.out.println("Setting content type to " + fileRes.getContentType()); wdf.getDataPropertyStatementDao().deleteDataPropertyStatementsForIndividualByDataProperty(fileEntity, contentType); dps = new DataPropertyStatementImpl(); dps.setIndividualURI(fileEntity.getURI()); @@ -462,29 +461,10 @@ public class FedoraDatastreamController extends VitroHttpServlet implements Cons } else { //System.out.println("file name property is null"); } - - //This doesn't seem to be settable as a data property - how else could we set this? - /* - DataProperty fileLocationProperty = wdf.getDataPropertyDao().getDataPropertyByURI(this.fileLocationProperty); - if(fileLocationProperty != null) { - wdf.getDataPropertyStatementDao().deleteDataPropertyStatementsForIndividualByDataProperty(fileEntity, fileLocationProperty); - dps = new DataPropertyStatementImpl(); - dps.setIndividualURI(fileEntity.getURI()); - dps.setDatapropURI(fileLocationProperty.getURI()); - dps.setData(saveLocation); //This follows the pattern of the original file upload - the name returned from the uploaded file object - wdf.getDataPropertyStatementDao().insertNewDataPropertyStatement(dps); - } else { - System.out.println("File location property is null"); - } - */ - + //Need to also update the check sum node - how would we do that //Find checksum node related to this particular file uri, then go ahead and update two specific fields - //ObjectProperty checksumNode = wdf.getObjectPropertyDao().getObjectPropertyByURI(this.checksumNodeProperty); - //if(checksumNode != null) { - // System.out.println("Check sum node is not equal to null"); - // fileEntity. - //} + ListcsNodeStatements = fileEntity.getObjectPropertyMap().get(this.checksumNodeProperty).getObjectPropertyStatements(); if(csNodeStatements.size() == 0) { System.out.println("No object property statements correspond to this property"); diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/MailUsersServlet.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/MailUsersServlet.java index 8d8882c03..8f2449401 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/MailUsersServlet.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/MailUsersServlet.java @@ -75,9 +75,8 @@ public class MailUsersServlet extends VitroHttpServlet { if (smtpHost==null || smtpHost.equals("")){ status = "This application has not yet been configured to send mail " + "-- smtp host has not been identified in the Configuration Properties file."; - System.out.println("Status incorrect - would redirect otherwise"); - //response.sendRedirect( "test?bodyJsp=" + errpage + "&ERR=" + status + "&home=" + portal.getPortalId() ); - //return; + response.sendRedirect( "test?bodyJsp=" + errpage + "&ERR=" + status + "&home=" + portal.getPortalId() ); + return; } String SPAM_MESSAGE = "Your message was flagged as spam."; diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/FedoraConfiguration.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/FedoraConfiguration.java index 2c5e9bba8..3ab93bbaf 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/FedoraConfiguration.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/FedoraConfiguration.java @@ -71,7 +71,6 @@ public class FedoraConfiguration { adminUser = props.getProperty("adminUser"); adminPassword = props.getProperty("adminPassword"); pidNamespace = props.getProperty("pidNamespace"); - if( fedoraUrl == null || adminUser == null || adminPassword == null ){ if( fedoraUrl == null ){ log.error("'fedoraUrl' not found in properties file"); diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/jena/JenaIngestUtils.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/jena/JenaIngestUtils.java index 573264b77..fdfca63cb 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/jena/JenaIngestUtils.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/jena/JenaIngestUtils.java @@ -350,7 +350,6 @@ public class JenaIngestUtils { * @return */ public Model dedupAndExtract( Model model, String preferredNamespace ) { - Model extractsModel = ModelFactory.createDefaultModel(); HashMap rewriteURIUsing = new HashMap();