Java Actions

0
Hi Could you please tell that in what format does the word documents/pdf’s are stored in mendix database and how to retrieve it using Java Actions to read or covert according to our needs.   Below are my screen shots and please tell me in which column does the word/pdf’s documents are saved and in which format too? And how to retrieve it using Java Actions? Thanks!
asked
3 answers
1

The documents are stored in filesystem. The database tables only contains references.

answered
0

Hi,

Mendix Store files in FileDocument Entity as blob data.

You can receive file document content in java action using the core API method.

Core.getFileDocumentContent(IContext context,IMendixObject fileDocument)
answered
0
package myfirstmodule.actions;

import java.nio.file.Files;
import java.nio.file.Paths;
import com.mendix.core.Core;
import com.mendix.systemwideinterfaces.core.IContext;
import com.mendix.webui.CustomJavaAction;
import com.mendix.systemwideinterfaces.core.IMendixObject;

public class Java_action extends CustomJavaAction<IMendixObject>
{
	private IMendixObject __inputAssets;
	private system.proxies.FileDocument inputAssets;

	public Java_action(IContext context, IMendixObject inputAssets)
	{
		super(context);
		this.__inputAssets = inputAssets;
	}

	@java.lang.Override
	public IMendixObject executeAction() throws Exception
	{
		this.inputAssets = __inputAssets == null ? null : system.proxies.FileDocument.initialize(getContext(), __inputAssets);

		// BEGIN USER CODE
		IMendixObject IMendixObject;
		String assetsAssetName = Core.getFileDocumentContent(IContext context,IMendixObject fileDocument);
		
		
		return null;
		// END USER CODE
	}

 

answered