Print Page | Close Window

Opening and selecting

Printed From: MetaCase
Category:
Forum Name: MetaEdit+
Forum Description: All topics relating to MetaEdit+ or DSM
URL: https://www.metacase.com/forums/forum_posts.asp?TID=29
Printed Date: 27.Mar.2026 at 02:14
Software Version: Web Wiz Forums 12.05 - http://www.webwizforums.com


Topic: Opening and selecting
Posted By: martind
Subject: Opening and selecting
Date Posted: 28.Apr.2008 at 17:56
I know that steve might have an answer for this one...

I want to do the following from an external java application:

1. open MetaEdit+
2. let the user select a repository and a project
3. log in to the chosen project
4. let the user select a graph
5. run a generator for the selected graph


the last question has already been discussed in http://www.metacase.com/forums/forum_posts.asp?TID=26 -



Replies:
Posted By: stevek
Date Posted: 29.Apr.2008 at 11:45
With the API, command-line operations and MERL internal..execute you can call existing MetaEdit+ functions from outside MetaEdit+. With MERL external..execute you can call existing external programs from inside MetaEdit+. In your case, you know there is no single existing program or function that performs that series of actions, so you're correctly writing your own.
 
When you write your own program, you can write it in whatever language you choose, and use the MetaEdit+ API from that language. You can call the available API functions as you need, and for the rest you simply program them in that language - Java in your case. If you want to let the user choose from a list, then get the list elements from MetaEdit+ or wherever, then simply open a Java list dialog.
 
For step 2, you could use a Java file search in the MetaEdit+ working directory for all subdirectories containing a file manager.ab. Note that users can also add their own manual entries to other non-child directories into the Repositories list; the list is stored in artbase.roo, a binary file and so not really parseable. The projects in a repository can be found from its manager.ab, which is parseable (note the line break character is CR).
 
Once logged in and with the project(s) opened, you can get a list of all graphs (filtered by type or name as desired) as detailed in the MWB manual Section 8.3, http://www.metacase.com/support/45/manuals/mwb/Mw-8_3.html - Getting started with your own application .
 
Are you sure you want your program to do things this way, though? MetaEdit+ already has the interface for showing all available repositories and projects, allowing the user to log in, showing all available graphs, and allowing the user to run a generator on one of them. At each stage of your proposed program you're allowing the user the same free choices, so at least to me as an outsider it looks like you're not really automating much of the process or providing new functionality, which is what most people use the API for. The API of course exists precisely because we at MetaCase know that there will always be ingenious ways of using MetaEdit+ that we haven't thought of, and both the API and us are here to help you do that - I'm certainly not saying that what you want to do is "wrong". Maybe if you post or email some background on what you're trying to accomplish, we'll be able to offer advice, or then extend the API in future versions.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.05 - http://www.webwizforums.com
Copyright ©2001-2022 Web Wiz Ltd. - https://www.webwiz.net