Foren

Create Custom Document type and set values

vivek pothagoni, geändert vor 8 Jahren.

Create Custom Document type and set values

New Member Beiträge: 6 Beitrittsdatum: 20.03.15 Neueste Beiträge
I am writing a connector, to export documents from Documentum to Liferay. For this I defined web service and I am able to pass content and meta-data from Documentum to Liferay.
Below is my code, addFileEntry function accepting file, file size and InputStream. From web service I am receiving bytes, and convert to inputsteam.
When I pass file as null, its throwing error. How to set file?
Do I have to write file local and then create File and pass as argument?



DLFolder dir = DLFolderServiceUtil.getFolder(importArgs.getGroupId(), DLFolderConstants.DEFAULT_PARENT_FOLDER_ID, "Inbound");
		String mimeType = MimeTypesUtil.getContentType(IdxUtility.fileExt(objectName));
		
		long fileTypeId =0; 
		List<dlfileentrytype> lFileEntryType = DLFileEntryTypeLocalServiceUtil.getFileEntryTypes(groupIds);
		for (Iterator<dlfileentrytype> iter= lFileEntryType.iterator(); iter.hasNext();) {
			DLFileEntryType fileentryType = (DLFileEntryType)iter.next();
			fileTypeId = fileentryType.getFileEntryTypeId();
			logger.debug("FileEntryType Name: "+ fileentryType.getFileEntryTypeId());
		}
		InputStream is = new ByteArrayInputStream(content);
		File file = new File("");
		logger.debug("Attribute Size :"+mFields.size());
		DLFileEntryServiceUtil.addFileEntry(importArgs.getGroupId(), importArgs.getGroupId(), dir.getFolderId(), objectName, mimeType, objectName, "", "",fileTypeId , mFields, new File(objectName), is, new File(objectName+".xml").length(), sContext);

</dlfileentrytype></dlfileentrytype>


Thanks in advance
Vivek
vivek pothagoni, geändert vor 8 Jahren.

RE: Create Custom Document type and set values

New Member Beiträge: 6 Beitrittsdatum: 20.03.15 Neueste Beiträge
Can anyone shed some light.

Who worked on Alfresco or sharepoint to liferay connector should know, how are you creating custom type document into liferay?