<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.infinite-erp.co.id/index.php?action=history&amp;feed=atom&amp;title=How_to_Create_new_attachment_method</id>
	<title>How to Create new attachment method - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.infinite-erp.co.id/index.php?action=history&amp;feed=atom&amp;title=How_to_Create_new_attachment_method"/>
	<link rel="alternate" type="text/html" href="https://wiki.infinite-erp.co.id/index.php?title=How_to_Create_new_attachment_method&amp;action=history"/>
	<updated>2026-04-06T13:32:53Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>https://wiki.infinite-erp.co.id/index.php?title=How_to_Create_new_attachment_method&amp;diff=2793&amp;oldid=prev</id>
		<title>Wikiadmin: Created page with &quot;== Introduction == Note that this how to is developers focused. It describes how to implement a new attachment method that integrates any CMS or ECM with Openbravo.  == Attach...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.infinite-erp.co.id/index.php?title=How_to_Create_new_attachment_method&amp;diff=2793&amp;oldid=prev"/>
		<updated>2021-12-16T03:38:41Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Introduction == Note that this how to is developers focused. It describes how to implement a new attachment method that integrates any CMS or ECM with Openbravo.  == Attach...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Introduction ==&lt;br /&gt;
Note that this how to is developers focused. It describes how to implement a new attachment method that integrates any CMS or ECM with Openbravo.&lt;br /&gt;
&lt;br /&gt;
== Attachment Method window ==&lt;br /&gt;
&lt;br /&gt;
As system administrator the new ''Attachment Method'' must be created in that window. The ''Search Key'' is used to identify the Java class implementing the method.&lt;br /&gt;
&lt;br /&gt;
== AttachImplementation class ==&lt;br /&gt;
&lt;br /&gt;
The class that implements the attachment method must implement the ''AttachImplementation'' abstract class. This class defines some methods that must be implemented to have a fully functional attachment method.&lt;br /&gt;
&lt;br /&gt;
The class must have a qualifier to identify it. The name must be the search key set in the Attachment Method window. It has to follow this structure:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt; @ComponentProvider.Qualifier(&amp;quot;CMSSearchKey&amp;quot;)&amp;lt;/source&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{(!) | Don't use ''Default'' qualifier as it is the one used by Core's default attachment method.}}&lt;br /&gt;
&lt;br /&gt;
Once the implementation have been developed, the following guide could be used to [[Projects:Alfresco_Integration/Default_attachment_method_setup | configure an attachment method]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;Java&amp;quot;&amp;gt;&lt;br /&gt;
 /**&lt;br /&gt;
  * Public class to allow extend the functionality&lt;br /&gt;
  */&lt;br /&gt;
 &lt;br /&gt;
 public abstract class AttachImplementation {&lt;br /&gt;
 &lt;br /&gt;
   /**&lt;br /&gt;
    * Abstract method to upload files&lt;br /&gt;
    * &lt;br /&gt;
    * @param attachment&lt;br /&gt;
    *          The attachment created in c_file with empty metadata&lt;br /&gt;
    * @param strDataType&lt;br /&gt;
    *          DataType of the attachment&lt;br /&gt;
    * @param parameters&lt;br /&gt;
    *          A map with the metadata and its values to be updated in the corresponding file&lt;br /&gt;
    *          management system and in the attachment&lt;br /&gt;
    * @param file&lt;br /&gt;
    *          The file to be uploaded&lt;br /&gt;
    * @param strTab&lt;br /&gt;
    *          The tabID where the file is attached&lt;br /&gt;
    * @param parameterValues&lt;br /&gt;
    *          List of metadata saved in database&lt;br /&gt;
    * @throws OBException&lt;br /&gt;
    *           Thrown when any error occurs during the upload&lt;br /&gt;
    */&lt;br /&gt;
   public abstract void uploadFile(Attachment attachment, String strDataType,&lt;br /&gt;
       Map&amp;lt;String, Object&amp;gt; parameters, File file, String strTab) throws OBException;&lt;br /&gt;
 &lt;br /&gt;
   /**&lt;br /&gt;
    * Abstract method to download a single file&lt;br /&gt;
    * &lt;br /&gt;
    * @param attachment&lt;br /&gt;
    *          The attachment that will be downloaded&lt;br /&gt;
    * @return The file being to download&lt;br /&gt;
    * @throws OBException&lt;br /&gt;
    *           Thrown when any error occurs during the download&lt;br /&gt;
    */&lt;br /&gt;
   public abstract File downloadFile(Attachment attachment) throws OBException;&lt;br /&gt;
 &lt;br /&gt;
   /**&lt;br /&gt;
    * Abstract method to delete a file&lt;br /&gt;
    * &lt;br /&gt;
    * @param attachment&lt;br /&gt;
    *          The attachment that want to be removed&lt;br /&gt;
    * @throws OBException&lt;br /&gt;
    *           Thrown when any error occurs when deleting the file&lt;br /&gt;
    */&lt;br /&gt;
   public abstract void deleteFile(Attachment attachment) throws OBException;&lt;br /&gt;
 &lt;br /&gt;
   /**&lt;br /&gt;
    * Abstract method to update file's metadata&lt;br /&gt;
    * &lt;br /&gt;
    * @param attachment&lt;br /&gt;
    *          The attachment to be modified&lt;br /&gt;
    * @param strTab&lt;br /&gt;
    *          The tabID where the file was attached&lt;br /&gt;
    * @param parameters&lt;br /&gt;
    *          The metadata to be modified&lt;br /&gt;
    * @param parameterValues&lt;br /&gt;
    *          List of metadata saved in database&lt;br /&gt;
    * @throws OBException&lt;br /&gt;
    *           Thrown when any error occurs when updating the file&lt;br /&gt;
    */&lt;br /&gt;
   public abstract void updateFile(Attachment attachment, String strTab,&lt;br /&gt;
       Map&amp;lt;String, Object&amp;gt; parameters) throws OBException;&lt;br /&gt;
 &lt;br /&gt;
   /**&lt;br /&gt;
    * This method is used to know whether the attach method is creating a temporary file in the temp&lt;br /&gt;
    * directory of Openbravo server when downloading a file. If it is true, the process will remove&lt;br /&gt;
    * the temporary file. If it s false, the process will not remove the file&lt;br /&gt;
    * &lt;br /&gt;
    * @return true if the attachment method creates a temporary file in Openbravo server.&lt;br /&gt;
    */&lt;br /&gt;
   public abstract boolean isTempFile();&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:HowTo]]&lt;/div&gt;</summary>
		<author><name>Wikiadmin</name></author>
		
	</entry>
</feed>