Skip to content
An extensible tool to generate object-model/ERD diagrams from salesforce metadata.
Java JavaScript CSS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
img
objectmodelutil
LICENSE
README.md

README.md

object-model-tool

An extensible tool to generate object-model/ERD diagrams from salesforce metadata.

Screenshot of the created artifact

Introduction

This tool was created to generate object-model/ERD Diagrams for custom objects in salesforce. There was a requirement for external diagrams that could not be filled by the internal salesforce schema builder or any other tool that I could find.

As a result, I built an extensible, lightweight tool to generate and organize object diagrams by functional area. The tool has multiple possible configurations and additional functionality can be built on top of the existing framework with ease.

Summary

This tool is a command line utility (that also has an ant entry point). The output it produces is contained within a objectmodelutil / htmlcharts folder. The utility reads salesforce metadata, either locally or from a salesforce org, and parses this information into object-model/ERD charts. These charts are provided in html format along with several helper files (javascript, css, etc). The charts can be arranged by functional area, in other words, split down into logical groups for easy digestion.

Key Features

  • Multiple processor configurations for different use cases.
  • Shows relationships between objects.
  • Can Provide draggable charts in html format.
  • Can Provide draggable charts split by functional area in html format.
  • Can provide a list of custom objects and fields in CSV format.

Configuration

The ant run command will build a config.properties file before running the utility. This file will contain the processors used by the utility to configure / retrieve / output the chart data. All configuration options are editable in objectmodelutil / build.xml.

####Input Processors:

com.financialforce.objectmodelutil.model.processor.input.InputProcessorXmlFile

Used to pull functional area information from an xml file in order to organise the chart objects by area. (See objectmodelutil / demo / testareas.xml)

Note: a blank input processor can also be used if you do not want to organise your charting output. Use:

<entry key="input" operation="del" />

in the ant <propertyfile></propertyfile> to achieve this.

####Retrieve Processors:

com.financialforce.objectmodelutil.model.processor.retrieve.RetrieveProcessorLocal

Used to pull object definitions from a local src folder.

com.financialforce.objectmodelutil.model.processor.retrieve.RetrieveProcessorRemote

Used to pull object definitions from a salesforce org.

####Output Processors:

com.financialforce.objectmodelutil.model.processor.output.OutputProcessorCSV

Creates a CSV file of objects / fields. (No input processor needed).

com.financialforce.objectmodelutil.model.processor.output.OutputProcessorHTML

Creates a HTML file of objects with supporting resources (No input processor needed).

com.financialforce.objectmodelutil.model.processor.output.OutputProcessorHTMLwithFA

Creates a HTML file of objects with supporting resources (InputProcessorXmlFile needed).

Build & Run

To build the utility, check out the master branch, navigate to the objectmodelutil folder and from your console, type ant (this assumes you have ant installed).

To run the utility, type ant run after building. The default run command in build.xml points at the objectmodelutil / demo folder and performs a local retrieve of metadata, arranging the output into functional areas specified in objectmodelutil / demo / testareas.xml.

Reporting Issues & Enhancements

Please report any issues using the github issues feature. Suggestions / bug reports are welcome as are extensions containing additional functionality.

Known Issues

  1. Known Salesforce Issue : There are certain elements in a salesforce object xml definition that cannot be loaded by the Salesforce Java API Object. These need to be removed as and when they are found (Contributions Welcome!):

    (Example at: objectmodelutil / src / main / java / com / financialforce / objectmodelutil / model / processor / retrieve / RetrieveProcessorLocal.java (lines 109, 110))

    objectAsString = objectAsString.replace("UTF-8", "UTF_8");
    objectAsString = objectAsString.replace("<restrictedPicklist>true</restrictedPicklist>", "");
    

License

Copyright (c) 2014, FinancialForce.com, inc All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of the FinancialForce.com, inc nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

jsPlumb is distributed under the GPLv2 and MIT Licenses: jsPlumb

jQuery is distributed under the MIT License: jQuery

You can’t perform that action at this time.