Merge branch 'develop' of git://github.com/vivo-project/Vitro into develop

# By Graham Triggs
# Via grahamtriggs (2) and Graham Triggs (1)
* 'develop' of git://github.com/vivo-project/Vitro:
  [VIVO-1224] Suppress default "synthetic" model from the lists on the ingest pages
  [VIVO-1230] Make contact form compatible with SMTP relays
  [VIVO-1233] Wrap large buttons on ontology edit page
  Fix error message (change erroneous UPDATE to SELECT)
This commit is contained in:
Jim Blake 2016-06-21 10:09:02 -04:00
commit 0709ca504e
4 changed files with 99 additions and 72 deletions

View file

@ -12,6 +12,7 @@ import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import javax.mail.Address;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.SendFailedException;
@ -256,13 +257,13 @@ public class ContactMailController extends FreemarkerHttpServlet {
MimeMessage msg = new MimeMessage( s );
//System.out.println("trying to send message from servlet");
// Set the from address
// Set the reply address
try {
msg.setFrom( new InternetAddress( webuseremail, webusername ));
msg.setReplyTo( new Address[] { new InternetAddress( webuseremail, webusername ) } );
} catch (UnsupportedEncodingException e) {
log.error("Can't set message sender with personal name " + webusername +
log.error("Can't set message reply with personal name " + webusername +
" due to UnsupportedEncodingException");
msg.setFrom( new InternetAddress( webuseremail ) );
// msg.setFrom( new InternetAddress( webuseremail ) );
}
// Set the recipient address
@ -272,6 +273,13 @@ public class ContactMailController extends FreemarkerHttpServlet {
}
msg.setRecipients( Message.RecipientType.TO, address );
// Set the from address
if (address != null && address.length > 0) {
msg.setFrom(address[0]);
} else {
msg.setFrom( new InternetAddress( webuseremail ) );
}
// Set the subject and text
msg.setSubject( deliveryfrom );

View file

@ -189,7 +189,14 @@ public class JenaIngestController extends BaseEditController {
}
maker = getModelMaker(vreq);
request.setAttribute("modelNames", maker.listModels().toList());
List<String> modelNames = maker.listModels().toList();
for (int mnIdx = modelNames.size() - 1; mnIdx > -1; mnIdx--) {
if (!modelNames.get(mnIdx).startsWith("http")) {
modelNames.remove(mnIdx);
}
}
request.setAttribute("modelNames", modelNames);
RequestDispatcher rd = request.getRequestDispatcher(
Controllers.BASIC_JSP);

View file

@ -304,7 +304,7 @@ public class RDFServiceSparql extends RDFServiceImpl implements RDFService {
if (statusCode > 399) {
log.error("response " + statusCode + " to query. \n");
log.debug("update string: \n" + queryStr);
throw new RDFServiceException("Unable to perform SPARQL UPDATE");
throw new RDFServiceException("Unable to perform SPARQL SELECT");
}
try (InputStream in = response.getEntity().getContent()) {

View file

@ -10,13 +10,18 @@
<div class="editingForm">
<style>
.editingForm .form-button {
white-space: normal;
}
</style>
<jsp:include page="/templates/edit/fetch/vertical.jsp"/>
<div align="center">
<table class="form-background" border="0" cellpadding="2" cellspacing="2">
<tr valign="bottom" align="center">
<td>
<td width="46%">
<form action="listOntologies" method="get">
<input type="submit" class="form-button" value="All Ontologies"/>
</form>
@ -33,14 +38,14 @@
<input type="hidden" name="ontologyUri" value="${Ontology.URI}" />
</form>
</td>
<td valign="bottom" align="center">
<td valign="bottom" align="center" width="27%">
<form action="editForm" method="get">
<input type="submit" class="form-button" value="Edit ${Ontology.name}"/>
<input name="uri" type = "hidden" value="${Ontology.URI}" />
<input type="hidden" name="controller" value="Ontology"/>
</form>
</td>
<td valign="bottom">
<td valign="bottom" width="27%">
<form action="editForm" method="get">
<input type="submit" class="form-button" value="Add New Ontology"/>
<input type="hidden" name="controller" value="Ontology"/>
@ -52,7 +57,14 @@
<input type="hidden" name="controller" value="Refactor"/>
</form>
<div style="margin-left:-0.5em;margin-top:0.5em;padding:0.5em;border-style:solid;border-width:1px;">
</td>
</tr>
<tr><td colspan="3"><hr></hr></td></tr>
</table>
<table class="form-background" border="0" cellpadding="2" cellspacing="2">
<tr valign="bottom" align="center">
<td>
<div style="margin-left:-0.5em;margin-top:0.5em;padding:0.5em;border-style:solid;border-width:1px;float:right">
<form action="${exportURL}" method="get">
<input type="hidden" name="subgraph" value="tbox"/>
<input type="hidden" name="assertedOrInferred" value="asserted"/>