This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Batch creating or updating properties. | |
| // | |
| // (c) 2020 David Sara | |
| var key = window.prompt("Please enter the property key", ""); | |
| var value = window.prompt("Please enter the property value", ""); | |
| $(selection).each(function (obj) { | |
| obj.prop(key, value); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Copy the selected elements to another model | |
| // | |
| // https://gist.github.com/eduardobbs/e39b00f45d12f43a55c31823facf0926 | |
| // Requires jArchi - https://www.archimatetool.com/plugins/ | |
| // | |
| // (c) 2020 Eduardo Cuccolotto Sequinel | |
| var msg = "Which model is the destination one (enter its index)?"; | |
| var modelList = $.model.getLoadedModels(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Set the name prefix for selected elements | |
| * | |
| * Requires jArchi - https://www.archimatetool.com | |
| * | |
| * This script adds given text + collon before the object name. | |
| * If prefix with collon already existed it is replace by new one. | |
| * In case of wrong selection effect can be reversed with crt-z (command-z on Mac) | |
| * | |
| * Script will prompt you: for the text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Import Elements from CSV | |
| * | |
| * Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/ | |
| * Requires PapaParse - https://www.papaparse.com/ | |
| * | |
| * This script imports CSV containg followin structure: | |
| * * Name | |
| * * Documentation | |
| * * Type (element type) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Sync Model from CSV.ajs | |
| // | |
| // Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/ | |
| // | |
| // This script allows easy integration of data coming from other systems through CSV files. | |
| // Each CSV file is described through a configuration object that you can later load and sync. | |
| // Most of the mapping informations (Id, Name, Documentation, Properties...) can be expressed through | |
| // the name of a column from the CSV file or through a function (which allows more advanced computation). | |
| // | |
| // Dataset used as example comes from https://datahub.io/core/country-codes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Verify if the values in the first column of a CSV file are used as names | |
| * in the selection | |
| * | |
| * This work is derived from: | |
| * - smileham/Import from CSV.ajs | |
| * - smileham/Export to CSV.ajs | |
| * | |
| * Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/ | |
| * Requires PapaParse - https://www.papaparse.com/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //@ts-check | |
| /** | |
| * Test of a dialog box in jarchi, SWT style | |
| */ | |
| /** | |
| * @typedef {any} JavaClass | |
| * @typedef {Object<string, function>} JavaObject | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Check the name of all concept and shows only if found more than once | |
| */ | |
| var debug = true; | |
| debug ? console.show():true; | |
| debug ? console.clear():true; | |
| console.log("Show all duplications:"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Resize objects in selected view | |
| // | |
| // Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/ | |
| // | |
| // This script resizes visual objects in the selected view | |
| // | |
| // (c) 2020 Jean-Baptiste Sarrodie | |
| var factor = window.prompt("Resize factor for objects?", 2); | |
| if (!factor) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Merge multiple concepts (and delete others) | |
| // | |
| // Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/ | |
| // | |
| // This script merges multiple concepts (and delete others) | |
| // | |
| // Version 1.1 (2020/01/20) Add an option to keep only the content of the "target" concept | |
| // Version 1.0 (2019/11/12) First version published | |
| // | |
| // Known limitation: works only on elements, not relationships |