MetaCase Homepage
Forum Home Forum Home > > MetaEdit+
  New Posts New Posts RSS Feed - Opening and selecting
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Opening and selecting

 Post Reply Post Reply
Author
Message
martind View Drop Down
Contributor
Contributor
Avatar

Joined: 18.Apr.2008
Location: Bremen, Germany
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote martind Quote  Post ReplyReply Direct Link To This Post Topic: Opening and selecting
    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 this topic . I also know how to open MetaEdit from the command line (I didn't get the currentDir-option working but that's no problem because I can cd to the working directory before executing the mep45.exe). With the help of the command line options loginDB:user:password and  setProject:  I might  also be able to achieve point 3.  But how can I present the user the available projects and repositories. Maybe someone can point me in the right direction. Also for point 4 where I am pretty sure that there is an API call for it...

Regards,

Martin
Back to Top
stevek View Drop Down
MetaCase
MetaCase
Avatar

Joined: 11.Mar.2008
Points: 643
Post Options Post Options   Thanks (0) Thanks(0)   Quote stevek Quote  Post ReplyReply Direct Link To This Post 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, 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.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.05
Copyright ©2001-2022 Web Wiz Ltd.

This page was generated in 0.031 seconds.