mirror of
https://github.com/sismics/docs.git
synced 2024-11-22 14:07:55 +01:00
#177: truncate data to fit the database
This commit is contained in:
parent
ba4470f155
commit
66cd4abd8b
@ -14,6 +14,7 @@ import com.sismics.util.ImageUtil;
|
|||||||
import com.sismics.util.Scalr;
|
import com.sismics.util.Scalr;
|
||||||
import com.sismics.util.context.ThreadLocalContext;
|
import com.sismics.util.context.ThreadLocalContext;
|
||||||
import com.sismics.util.mime.MimeTypeUtil;
|
import com.sismics.util.mime.MimeTypeUtil;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@ -228,7 +229,7 @@ public class FileUtil {
|
|||||||
File file = new File();
|
File file = new File();
|
||||||
file.setOrder(order);
|
file.setOrder(order);
|
||||||
file.setDocumentId(documentId);
|
file.setDocumentId(documentId);
|
||||||
file.setName(name);
|
file.setName(StringUtils.abbreviate(name, 200));
|
||||||
file.setMimeType(mimeType);
|
file.setMimeType(mimeType);
|
||||||
file.setUserId(userId);
|
file.setUserId(userId);
|
||||||
String fileId = fileDao.create(file, userId);
|
String fileId = fileDao.create(file, userId);
|
||||||
|
@ -31,6 +31,7 @@ import com.sismics.util.EmailUtil;
|
|||||||
import com.sismics.util.JsonUtil;
|
import com.sismics.util.JsonUtil;
|
||||||
import com.sismics.util.context.ThreadLocalContext;
|
import com.sismics.util.context.ThreadLocalContext;
|
||||||
import com.sismics.util.mime.MimeType;
|
import com.sismics.util.mime.MimeType;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.glassfish.jersey.media.multipart.FormDataBodyPart;
|
import org.glassfish.jersey.media.multipart.FormDataBodyPart;
|
||||||
import org.glassfish.jersey.media.multipart.FormDataParam;
|
import org.glassfish.jersey.media.multipart.FormDataParam;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
@ -824,10 +825,10 @@ public class DocumentResource extends BaseResource {
|
|||||||
if (mailContent.getSubject() == null) {
|
if (mailContent.getSubject() == null) {
|
||||||
document.setTitle("Imported email from EML file");
|
document.setTitle("Imported email from EML file");
|
||||||
} else {
|
} else {
|
||||||
document.setTitle(mailContent.getSubject());
|
document.setTitle(StringUtils.abbreviate(mailContent.getSubject(), 100));
|
||||||
}
|
}
|
||||||
document.setDescription(mailContent.getMessage());
|
document.setDescription(StringUtils.abbreviate(mailContent.getMessage(), 4000));
|
||||||
document.setSubject(mailContent.getSubject());
|
document.setSubject(StringUtils.abbreviate(mailContent.getSubject(), 500));
|
||||||
document.setFormat("EML");
|
document.setFormat("EML");
|
||||||
document.setSource("Email");
|
document.setSource("Email");
|
||||||
document.setLanguage("eng");
|
document.setLanguage("eng");
|
||||||
|
Loading…
Reference in New Issue
Block a user