Here the java content of the action storeURLToFileDocument.
// This file was generated by Mendix Business Modeler 2.5. // // WARNING: Only the following code will be retained when actions are regenerated: // - the import list // - the code between BEGIN USER CODE and END USER CODE // - the code between BEGIN EXTRA CODE and END EXTRA CODE // Other code you write will be lost the next time you deploy the project. // Special characters, e.g., é, ö, à, etc. are supported in comments.
package communitycommons.actions;
import com.mendix.systemwideinterfaces.core.UserAction; import com.mendix.systemwideinterfaces.core.IMendixObject; import communitycommons.Misc;
/** * Retrieve a document from an URL using a HTTP GET request. * - url : the URL to retrieve * - document: the document to store the data into * - filename: the filename to store it under. Only for internal use, so it can be an arbitrary filename. * * Example URL: 'http://www.mendix.com/wordpress/wp-content/themes/mendixnew/images/mendix.png' * * NOTE: For images, no thumbnail will be generated. */ public class storeURLToFileDocument extends UserAction<boolean> { private String url; private IMendixObject _document; private system.proxies.FileDocument document; private String filename;
public storeURLToFileDocument(String url, IMendixObject document, String filename)
{
super();
this.url = url;
this.__document = document;
this.filename = filename;
}
@Override
public Boolean executeAction() throws Exception
{
this.document = __document == null ? null : system.proxies.FileDocument.initialize(this.getContext(), __document);
// BEGIN USER CODE
return Misc.storeURLToFileDocument(this.getContext(), url, __document, filename);
// END USER CODE
}
/**
* Returns a string representation of this action
*/
@Override
public String toString()
{
return "storeURLToFileDocument";
}
// BEGIN EXTRA CODE
// END EXTRA CODE
}