2 posts / 0 new
Last post
AppCode Configuration
How do I configure AppCode on my instance?
You voted 4. Total votes: 2719

Kindly use the below given steps in order to setup AppCode on your instance.

Note: Before proceeding with the below given steps, Eclipse Luna with Java 1.8 must be installed on the machine.

Step 1: Creating Eclipse project
i. File  new  java project
ii. Enter project name and finish

Step 2:Setting up the project
i. Right click on ProjectName in package explorer  new  folder
ii. Name it as “lib”
iii. Right click on ProjectName in package explorer  new  XML file
iv. Name it as “appcode-deploy.xml”
Copy the below content and paste it in “appcode-deploy.xml”

<?xml version="1.0" encoding="UTF-8"?>
<projectname="AppCode-Deploy"default="deploy"basedir=".">
<description>
Build script for AppCode
</description>
<!-- set global properties for this build -->
<!-- Setup Deployment specific properties -->
<propertyname="appcode.name"value=""/>
<propertyname="appcode"location=""/>
<propertyname="environment"value=""/>
<propertyname="dbsync.server.url"value=""/>
<propertyname="dbsync.server.username"value=""/>
<propertyname="dbsync.server.password"value=""/>
<propertyname="appcode.src"location="${appcode}/src"/>
<propertyname="appcode.lib"location="${appcode}/lib"/>
<propertyname="deploy.dir"location="${appcode}/deploy"/>
<propertyname="compile.dir"location="${appcode}/compile"/>

<!-- Point to dbsync-sdk -->
<propertyname="sdk"location="C:/Users/User/Downloads/dbsync-sdk/dbsync-sdk"/>
<propertyname="sdk-bin"location="${sdk}/classes"/>
<propertyname="sdk-lib"location="${sdk}/lib"/>

<propertyname="javac.debug.flag"value="true"/>

<taskdefname="deploy"classname="com.appmashups.appcode.deploy.AppCodeDeployTask">
<classpath>
<pathelementpath="${sdk-bin}"/>
<pathelementlocation="${sdk-lib}/httpclient-4.3.4.jar"/>
<pathelementlocation="${sdk-lib}/httpcore-4.3.2.jar"/>
<pathelementlocation="${sdk-lib}/httpmime-4.3.4.jar"/>
<pathelementlocation="${sdk-lib}/commons-logging-1.1.3.jar"/>

</classpath>
</taskdef>

<targetname="init">
<!-- Create the time stamp -->
<tstamp/>
<mkdirdir="${deploy.dir}"/>
<mkdirdir="${compile.dir}"/>
<mkdirdir="${deploy.dir}/zip"/>
<!-- add src and target files -->

<deletefile="${deploy.dir}/${appcode.name}.jar"></delete>
<deletefile="${deploy.dir}/zip/${appcode.name}.zip"></delete>

</target>

<!-- Modified by Sambit -->
<targetname="build"depends="init">

<javacsrcdir="${appcode.src}"destdir="${compile.dir}"debug="${javac.debug.flag}"
deprecation="false"nowarn="on"verbose="false"fork="true"
memoryInitialSize="128m"memoryMaximumSize="1024m">

<classpath>
<filesetdir="${appcode.lib}">
<includename="**/*.jar"/>
<includename="**/*.zip"/>
</fileset>

<filesetdir="${sdk-lib}">
<includename="**/*.jar"/>
<includename="**/*.zip"/>
</fileset>
</classpath>
</javac>

<jardestfile="${deploy.dir}/${appcode.name}.jar"
basedir="${compile.dir}">

</jar>
</target>

<targetname="zip"depends="build"description="creates zip files">

<zipdestfile="${deploy.dir}/zip/${appcode.name}.zip">
<zipfilesetdir="${appcode.lib}"includes="*.jar"excludes="dbsync-sdk*.jar,jax*.jar,apache*.jar,http*.jar,istack*.jar,common*.jar"></zipfileset>
<zipfilesetdir="${deploy.dir}"includes="*.jar"></zipfileset>
</zip>
</target>

<targetname="deploy"depends="zip"description="compile the source ">

<deployserver="${dbsync.server.url}"
username="${dbsync.server.username}"
password="${dbsync.server.password}"
environment="${environment}"
profile="${profile}"
zip="${deploy.dir}/zip/${appcode.name}.zip"/>
</target>
</project>

v. Apply/Change the below properties values in this xml:
1. Appcode.name = give any name, it will reflect in jar name.
2. Appcode location = “Right click on your project  properties – Resources  location” copy and paste the location given here
3. Environment = is nothing but a name. This is the name you use to connect from DBSync.
4.dbsync.server.url = dbsync application running url.
5. Dbsync.server.username = provide username to connect dbsync.
6. Dbsync.server.password = corresponding password for the username

vi. Download the dbsync-sdk.jar from the below url.
http://www.mydbsync.com/download/dbsync-sdk.zip
vii. Extract the downloaded zip file.
viii. From your eclipse right click on project  properties Java Build Path  Libraries  add external jars
locate your extracted dbsync-sdk folder and select the jar, click ok.
ix. Now go to app-deploy.xml and change the value of “sdk” property.
copy your dbsync-sdk location and paste the value in “sdk” location.

Step 3: Creating adapter classes
i. Create your functionality classes under the folder src.
ii. To make your classes as adapter class you need to inherit AppCode interface. NOTE: All the methods in the class which extends AppCode will be available in DBSync.
iii. com.appmashups.appcode.AppCodethis is the class to Implements.
iv. Once AppCode interface is implemented then override the necessary methods.

Step 4: Deploy AppCode
i. Start your dbsync application if it’s not running already
ii. Right click on app-deploy.xml  Run as  Ant Build
iii. If build is successful then the appcode is successfully deployed into DBSync. If Build Failed, please follow from Step 1 properly.

Step 5: Adding your adapter into DBSync.
i. Go to DBSync page  choose any project  Connectors  Create new Connector.
Enter any name and choose connector type as “java Connector”
ii. Give classpath as exactly as the environment name you have given in the app-deploy.xml.
iii. Leave other fields as blank and save.
iv. Go to the selected project  choose any process  choose any workflow.
v. QueryBuilder  select Datasource
you will be able to see your connector, choose that.
vi. Click Select object.
Now all the methods which you have created under the adapter class will be shown. Choose any click preview, you will be able to see the result right there.

You voted 2. Total votes: 2479