07-11-2017 12:38 AM
Dear everyone,
I've define custom type, I try to create new document belong custom type is OK. But when i try JPG file System auto attach aspect EXIF (exif:exif), and It seem custom type not effect.
this is my code
Session cmisSession = getCmisSession();
String fileName = file.getName();
// create a map of properties if one wasn't passed in
if (props == null) {
props = new HashMap<String, Object>();
}
// Add the object type ID if it wasn't already
if (props.get("cmisbjectTypeId") == null) {
props.put("cmisbjectTypeId", "D:mc:loanDocs");
// ,P:scroductRelated,P:cm:titled
}
// Add the name if it wasn't already
if (props.get("cmis:name") == null) {
props.put("cmis:name", fileName);
}
props.put("mc:refNumber","142");
props.put("mc:refName", "142");
props.put("mc:customerName", "Le Trong Oanh");
props.put("mc:idCardNumber", "12345678910");
props.put("mc:loanTerm", "6");
props.put("mc:contractNumber", "123456789012345");
props.put("mcroductCode", "tragop");
props.put("mc:loanAmount", 500000);
ContentStream contentStream = cmisSession.getObjectFactory().createContentStream(fileName, file.length(),
fileType, new FileInputStream(file));
Document document = null;
try {
document = parentFolder.createDocument(props, contentStream, null);
System.out.println("Created new document: " + document.getId());
} catch (CmisContentAlreadyExistsException ccaee) {
document = (Document) cmisSession.getObjectByPath(parentFolder.getPath() + "/" + fileName);
System.out.println("Document already exists: " + fileName);
}
Anyone can help?
07-11-2017 11:23 AM
Hi:
Try setting extracter.TikaAuto.enabled=false in alfresco-global.properties (tested some time ago).
- How to deactivate metadata extraction in Alfresco - zylk
Regards.
--C.
07-11-2017 03:21 AM
Hi:
Did you check node details in Node Browser or in CMIS workbench ? I would say that the problem is how Alfresco forms are viewed (configured), when Alfresco applies automatically EXIF aspect to your custom type. Check in Node Browser if the document has the given custom type. You can also delete aspect and look if your custom type is applied.
Regards.
--C.
07-11-2017 03:30 AM
Dear Cesar Capillas,
Thanks for reply. I'm using Node Brower. yes, when i remove exif aspect, all property of custom type is display. But I want to stop auto attach exif aspect.
07-11-2017 11:23 AM
Hi:
Try setting extracter.TikaAuto.enabled=false in alfresco-global.properties (tested some time ago).
- How to deactivate metadata extraction in Alfresco - zylk
Regards.
--C.
07-11-2017 10:55 PM
Dear Cesar Capillas,
Thanks for your heplp, I've try to do as your instruction and I sucess.
Once again many thanks for your help.
Explore our Alfresco products with the links below. Use labels to filter content by product module.