Monday, July 25, 2016

How to extract metadata along with ER diagrams (html pages)
Step1: Download below files into a folder, I created folder name as 'ER Generation' in my c drive.

(you can download all(Except schemaSpy_5.0.0 ) of the files from this path : https://code.google.com/archive/p/force-metadata-jdbc-driver/downloads)
force-metadata-jdbc-driver-1.4.jar
generated-sforce-partner-18.jar
force.properties
depends.zip(Extract all .jar files into 'From SandBox' folder)
schemaSpy_5.0.0 (Latest file is fine)
install ant

STEP2:
install Graphviz from website : http://www.graphviz.org/ , latest should be fine

STEP3:
Using below create 'build.xml' file and save in the same directory:('ER Generation')

<project default="document">
 <property name="sf.username" value="username"/>
  <property name="sf.password" value="passwordSecurityToken"/>

    <target name="document">
      <echo message="Generating SchemaSpy documentation (requires Graphviz to be installed to produce diagrams)"/>
      <delete dir="doc" failonerror="true"/>
      <java classname="net.sourceforge.schemaspy.Main" fork="true" failonerror="true">
          <arg line="-t ./force"/>
          <arg line="-db Claims"/>
          <arg line="-un ${sf.username}"/>
          <arg line="-pw ${sf.password}"/>
          <arg line="-o doc"/>
          <arg line="-font Arial"/>
          <arg line="-fontsize 8"/>
          <arg line="-hq"/>
          <arg line="-norows"/>
          <arg line='-desc "Extracted from ClaimVantage Claims r${env.SVN_REVISION} on Force.com"'/>
          <arg line="-u fake"/>
          <arg line="-p fake"/>
          <arg line="-host fake"/>

          <classpath>
  <fileset dir="." includes="*.jar"/>
          </classpath>
      </java>
  </target>

</project>

STEP4: add your force.com username and passwordsecuritytoken in force.properties file

Step 5: go to the bin folder of Graphviz which you installed (C:\Program Files (x86)\Graphviz2.38\bin) and copy and paste all the files into your folder ('ER Generation')

Here is my folder strucutre looks like

Step 6:
go to commant promot and go to your folder and type command 'ant'

Step7: a folder with name 'doc' would have created under 'ER Generation'.

got to doc\index.html, then you can navigate to multiple tabs.

Thats it: Njoy