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?
Solved! Go to Solution.
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.
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.
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.
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.
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.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.