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

@ -188,8 +188,15 @@ public class JenaIngestController extends BaseEditController {
request.setAttribute("bodyJsp",INGEST_MENU_JSP);
}
maker = getModelMaker(vreq);
request.setAttribute("modelNames", maker.listModels().toList());
maker = getModelMaker(vreq);
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()) {