Custom type not effect with image

cancel
Showing results for 
Search instead for 
Did you mean: 
phong_van
Active Member II

Custom type not effect with image

Jump to solution

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("cmisSmiley SurprisedbjectTypeId") == null) {
props.put("cmisSmiley SurprisedbjectTypeId", "D:mc:loanDocs");
// ,P:scSmiley TongueroductRelated,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("mcSmiley TongueroductCode", "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?

1 Solution

Accepted Solutions
cesarista
Customer

Re: Custom type not effect with image

Jump 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.

View solution in original post

4 Replies
cesarista
Customer

Re: Custom type not effect with image

Jump to solution

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. 

phong_van
Active Member II

Re: Custom type not effect with image

Jump to solution

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.

cesarista
Customer

Re: Custom type not effect with image

Jump 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.

phong_van
Active Member II

Re: Custom type not effect with image

Jump to solution

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.