(groups);
52 | sortedGroups.sort();
53 |
54 | for(String g : sortedGroups)
55 | {
56 | ERDEntityGroup grp = new ERDEntityGroup(g,includedGroups.contains(g));
57 | erdGroups.add(grp);
58 | }
59 | return erdGroups;
60 | }
61 | }
--------------------------------------------------------------------------------
/src/classes/ERDUtils.cls-meta.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 30.0
4 | Active
5 |
6 |
--------------------------------------------------------------------------------
/src/components/JQuerySelectable.component:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
7 |
9 |
10 |
21 |
22 |
26 |
27 |
65 |
66 |
--------------------------------------------------------------------------------
/src/components/JQuerySelectable.component-meta.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 31.0
4 | This is a generic template for Visualforce Component. With this template, you may adjust the default elements and values and add new elements and values.
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/objects/ERD__c.object:
--------------------------------------------------------------------------------
1 |
2 |
3 | List
4 | Protected
5 | Saved configs for the ERD Generator
6 | false
7 |
8 | Value__c
9 | false
10 |
11 | 255
12 | true
13 | false
14 | Text
15 | false
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | *
5 | ApexClass
6 |
7 |
8 | JQuerySelectable
9 | ApexComponent
10 |
11 |
12 | *
13 | ApexPage
14 |
15 |
16 | ERD__c
17 | CustomObject
18 |
19 |
20 | *
21 | CustomTab
22 |
23 |
24 | *
25 | StaticResource
26 |
27 | 31.0
28 |
29 |
--------------------------------------------------------------------------------
/src/pages/ERDDownloader.page:
--------------------------------------------------------------------------------
1 |
3 | {!generatedContent}
4 |
--------------------------------------------------------------------------------
/src/pages/ERDDownloader.page-meta.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 31.0
4 | false
5 | false
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/pages/ERDGeneratorPage.page:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
7 |
9 |
10 |
27 |
28 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
Diagram: {!currentSetting}
148 |
151 |
152 |
153 |
154 | Working..
155 |
156 |
157 |
Help
158 |
159 |
160 |
161 |
162 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
172 |
173 |
174 |
175 |
178 |
179 |
180 |
181 |
182 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
199 |
200 |
201 |
223 |
224 |
225 |
226 |
227 |
228 |
229 | Loading..
230 |
231 |
232 |
233 | {!objectsForSelectedGroup}
234 |
235 |
236 |
237 |
238 | Group: {!selectedGroup}
239 | Hold down Ctrl/Cmd to Select Multiple Objects
240 |
241 |
242 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 | Loading..
257 |
258 |
259 |
260 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 | Loading..
283 |
284 |
285 |
286 | {!allFieldsForSelectedObject}
287 |
288 |
289 |
290 | Object: {!selectedSingleObject}
291 | Hold down Ctrl/Cmd to Select Multiple Fields
292 |
293 |
294 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 | Show fields in the diagram. Does not affect your field selections.
314 |
315 |
316 |
317 | (i.e. CreatedBy, Owner)
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
ERD Content
326 |
327 |
331 |
333 |
Template:
334 |
336 |
337 |
338 |
339 |
340 |
341 |
Download Template
342 |
343 |
344 |
345 |
346 |
347 |
348 | Generating..
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
--------------------------------------------------------------------------------
/src/pages/ERDGeneratorPage.page-meta.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 31.0
4 | false
5 | false
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/staticresources/DefaultDiagram.resource:
--------------------------------------------------------------------------------
1 | {"version":3,"includeFields":true,"includeStandardUserLookup":false,"includedGroups":["Sales","Service","Marketing","Common"],"groupToObjectsToFieldsMap":{"Common":{"Contact":["Jigsaw","Languages__c","FirstName","LastName"],"Account":["Site","SLAExpirationDate__c","SLASerialNumber__c","AccountNumber","CustomerPriority__c","AnnualRevenue"]},"Service":{"CaseSolution":["CaseId","SolutionId"],"Solution":["Status","SolutionName","IsHtml","IsPublished","SolutionNumber","TimesUsed"],"CaseComment":["CommentBody","IsPublished"],"Case":["Status","IsClosed","Description","AccountId","Subject","Type","ContactId"]},"Sales":{"Opportunity":["Description","Amount","CloseDate"],"OpportunityLineItem":["ListPrice","Quantity","PricebookEntryId","TotalPrice","UnitPrice","Product2Id"]},"Marketing":{"CampaignMember":["CampaignId","Status","HasResponded","LeadId","FirstRespondedDate","ContactId"],"Lead":["Jigsaw","FirstName","LastName","Company"],"Campaign":["Name","BudgetedCost","ExpectedResponse","AmountWonOpportunities","AmountAllOpportunities","NumberOfLeads","ExpectedRevenue","ActualCost","NumberOfContacts"]}},"allSelectedObjects":["Campaign","CampaignMember","Opportunity","Contact","Case","Account","CaseComment","Solution","CaseSolution","Lead","OpportunityLineItem"]}
--------------------------------------------------------------------------------
/src/staticresources/DefaultDiagram.resource-meta.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Private
4 | application/octet-stream
5 |
6 |
--------------------------------------------------------------------------------
/src/staticresources/DefaultTemplate.resource:
--------------------------------------------------------------------------------
1 | ========== MAIN
2 | digraph G {
3 | graph [rankdir=LR,nodesep=1.0];
4 | node [shape=plaintext,fontsize=14];
5 | edge [arrowhead=crow];
6 | {{content}}
7 | }
8 | ========== CLUSTER
9 |
10 | subgraph cluster_{{sequence}} { label = "{{name}}";
11 | style="rounded, filled";
12 | fillcolor={{color}};
13 | node [style=filled,color=white];
14 |
15 | {{content}}
16 | }
17 |
18 | ========== ENTITY
19 |
20 | {{name}} [label=<
21 | {{name}} |
22 | {{fields}}
23 |
>]
24 |
25 | ========== MD_RELATIONSHIP
26 | edge [style=solid]
27 | {{from}} -> {{to}}
28 |
29 | ========== LOOKUP_RELATIONSHIP
30 | edge [style=dashed]
31 | {{from}} -> {{to}}
32 |
33 | ========== FIELD
34 | {{name}} | {{fieldType}} |
35 |
--------------------------------------------------------------------------------
/src/staticresources/DefaultTemplate.resource-meta.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Private
4 | text/plain
5 | #graphviztemplate
6 | The default ERD template
7 |
8 |
--------------------------------------------------------------------------------
/src/staticresources/ERDGeneratorJS.resource:
--------------------------------------------------------------------------------
1 | (function () {
2 |
3 | var button = Dropbox.createChooseButton({
4 | success: function(files) {
5 | var file = files[0].link;
6 | $c(globals.fields.fileURL).val(file);
7 | $110('#dropboxFileSelected').text(file);
8 | },
9 | linkType: 'direct',
10 | multiselect: false,
11 | extensions: ['.gv']});
12 |
13 | document.getElementById("pickDropboxContainer").appendChild(button);
14 |
15 | templateChanged();
16 |
17 | $110("#oauth").on("click", function(e) {
18 | e.preventDefault();
19 | var url = $110(this).attr("href");
20 | window.open(url, "oauth", "width=600,height=400");
21 | });
22 |
23 | }());
24 |
25 | function setDropboxToken(token) {
26 | $c(globals.fields.token).val(token);
27 | $110("#oauth").css("display", "none");
28 | $110("#oauthComplete").css("display", "inline-block");
29 | }
30 |
31 | function updateObjectsTab() {
32 | $c(globals.fields.fieldSelectorContainer).css("display", "none");
33 | refreshTab3();
34 | }
35 |
36 | function templateChanged() {
37 | adjustGeneratorButtons();
38 | setDownloadURL();
39 | }
40 |
41 | function setDownloadURL() {
42 | var templateSelected = $c(globals.fields.template).val();
43 | $110("#download").attr("href", globals.templates[templateSelected]);
44 | }
45 |
46 | function adjustGeneratorButtons() {
47 | if ($c(globals.fields.template).val() == 'CalloutTemplate') {
48 | setTemplateMode('external');
49 | } else {
50 | setTemplateMode('resource');
51 | }
52 | }
53 |
54 | function setTemplateMode(mode) {
55 | $110.each(['#dropboxFileSelected','#pickDropboxContainer'], function(i, s) {
56 | $110(s).css('display',mode == 'resource'?'none':'inline-block');
57 | });
58 | }
59 |
60 | //workaround the fact that jquery doesn't like the : characters in visualforce component ids
61 | function $c(componentId) {
62 | return $110(document.getElementById(componentId));
63 | }
64 |
65 | /*********************Javascripts to put Graphviz to web**********************/
66 | function inspect(s) {
67 | return "" + s.replace(//g, ">").replace(/\"/g, """) + "
"
68 | }
69 |
70 | function convertERDContentToMarkup(content, format, engine) {
71 | var result;
72 | try {
73 | result = Viz(content, format, engine);
74 | if (format === "svg")
75 | return result;
76 | else
77 | return inspect(result);
78 | } catch(e) {
79 | return inspect(e.toString());
80 | }
81 | }
82 |
83 | function generateERDToWeb(content)
84 | {
85 | var erdMarkup = convertERDContentToMarkup(content,"svg");
86 | $c(globals.fields.downloadFile).css("display", "block");
87 | document.getElementById("diagramContainer").innerHTML = erdMarkup;
88 | }
89 |
90 |
--------------------------------------------------------------------------------
/src/staticresources/ERDGeneratorJS.resource-meta.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Private
4 | text/javascript
5 | All the javascript for the ERD Generator page
6 |
7 |
--------------------------------------------------------------------------------
/src/staticresources/VizJS.resource-meta.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Private
4 | text/javascript
5 | Javascript library for Graphviz
6 |
7 |
--------------------------------------------------------------------------------
/src/staticresources/WorkingImage.resource:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stevebuik/GraphVizForce/95095cc8d768d57838df22fb89967948f48427f1/src/staticresources/WorkingImage.resource
--------------------------------------------------------------------------------
/src/staticresources/WorkingImage.resource-meta.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Private
4 | image/gif
5 | The animated gif displayed while waiting for an operation to complete
6 |
7 |
--------------------------------------------------------------------------------
/src/tabs/ERD_Generator.tab:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | false
5 | Custom19: Wrench
6 | ERDGeneratorPage
7 |
8 |
--------------------------------------------------------------------------------