cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

DOM and instance.js with various doctypes...

ptc-1972683
1-Newbie

DOM and instance.js with various doctypes...

Hello,

I am having a problem managaing the DOM for seperate doctypes. We are using instance.js files that launch with the documents, but it seems as though the document instance I open last overrides whatever document is open. To clarify, if I open a file that is associated with a.dtd, the instance file launches and the auto-number works fine.

But if I open another document at the same time that references b.dtd, that instance launches and takes over. Now if I switch back to the first document,the instance.js fromthe second document tries to insert variables that are not included in b.dtd. Has anyone else had this problem?

18 REPLIES 18

Do you launch with the "-newinstance" flag? See Help 5717 (in Epic 5.2)


Sorry for the newbie question, but how do I access that particular help document?



Thanks for the help,

Jack







In Reply to:

Do you launch with the "-newinstance" flag? See Help 5717 (in Epic 5.2)


I figured out how to find the help file, but I don't think that is the problem I am having. Each .xml file always opens in a new window. Its just the instance.js that is launched last overrides the existing instance.js.



Does anyone have a sample .js they use to auto-generate attributes with?



Thanks Again,

Jack

Yes, Jack, they would open in separate windows either way, but using -newinstance has implications for all the 'behind-the-scenes' "stuff". Try it, you'll probably like it. 🙂

Steve Thompson
TAD Technical
Boeing-IDS Technical Publications
(316)977-0515
MC K83-08
The truth is the truth even if nobody believes it, and a lie is a lie even if everyone believes it.

NOTICE: This communication may contain proprietary or other confidential information. If you are not the intended recipient, or believe that you have received this communication in error, please do not print, copy, retransmit, disseminate, or otherwise use the information. Also, please indicate to the sender that you have received this e-mail in error, and delete the copy you received. Any and all views expressed are the current understanding of the sender and should not be interpreted as an expression of official Boeing Company policy or position.

Les renseignements contenus dans ce message peuvent être confidentiels. Si vous n'êtes pas le destinataire visé ou une personne autorisée à lui remettre ce courriel, vous êtes par la présente avisé qu'il est strictement interdit d'utiliser, de copier ou de distribuer ce courriel, de dévoiler la teneur de ce message ou de prendre quelque mesure fondée sur l'information contenue. Vous êtes donc prié d'aviser immédiatement l'expéditeur de cette erreur et de détruire ce message sans garder de copie.

Where exactly would I add -newinstance? Would I need to create a shortcut to epic.exe and run it with -newinstance?

A batch file should work well. Something like "START /[path to
Arbortext Editor bin folder]/epic.exe -newinstance" You could set up
any required environment variables in preceding lines with "SET
APTGRPATH="[path to folder containing graphics]" and so forth for other
environment variables.


OTOH, copying your existing shortcut (created during the install, and
assuming you're working in Winblows) and adding '-newinstance' to its
Target: line (right click + Properties) will do the trick. That makes my
Target: look like this (yes, it includes the quotes):

"C:\Program Files\Arbortext\Editor\bin\epic.exe" -newinstance

Hope that helps,
Steve Thompson
(316)977-0515



Oops, I forgot that you are opening multiple documents and leaving them
open simultaneously. You will need to launch Arbortext Editor each time
with the document filename and the -newinstance flag. So a batch file
wouldn't work for that. You need to launch it from some sort of an
application in which you can define the filename to be opened. Or a DOS
command prompt window.
byork
17-Peridot
(To:ptc-1972683)

If anyone is interested I have a startup script written in Perl. You
will need to customize it for your needs.


I wrote a batch file that looks like this:

@echo off

ftype xmlfile = "C:\Program Files\Arbortext\Editor\bin\epic.exe" -newinstance "%%1"



Everything works perfect now. Thanks for your help.

That's pretty cool. Changing the Windows file association for xml
files. I like it.


Nice. Didn't know about ftype and it's cousin, assoc. Now whenever a Windows
update steals the XML extension, running a batch file with:

assoc .xml=xmlfile
ftype xmlfile= my epic startup cmd goes here

Will return my system to normal.

Or, I could even be brutish and add this to my existing startup commands and
who cares about Windows updates.

I'm feelin' brutish.


Yeah, I really didn't have a choice. I am working client side here, and I have no write access to anything but the actual xml. We're using a few different DTD's and w/o -newinstance it was a mess. It's really hard trying to get past this stuff when I don't have write access to the xsl, dtd, or any of the startup files...like working with my hands tied. Haha, good thing I can implement ACL client side!

In Reply to:
That's pretty cool. Changing the Windows file association for xml
files. I like it.


Well, the batch file works fine when you open a file by double clicking, but when I choose File->Open, the xml loads inside the window.



Anyone have any insight? I tried unaliasing FileOpen and making an alias to a shell command, but that didn't work too well. Any ideas?

We have an application that requires that each XML file is opened in a
separate Arbortext instance. So we have disabled the File-Open menu
selection and the hotkeys, so that the user must use the application to
open XML files. All I can suggest is that you do something similar.


What I've done for a client who wanted to execute DTD-specific code on
any file as soon
as it is opened, is to create a Configuration() function in ACL that
checks the
doc_type() of the doc being opened and then branches into the
appropriate code for that
document type. To get the Configuration() function to fire, I simply
attached it to the
editfilehook by adding this line:
add_hook('editfilehook', 'env::Configuration');

to an Init() function that is called from an ACL file in the init
subfolder of APTCUSTOM.

The result is that every time you open a file in the Epic session, the
Configuration
method is called and your code can execute based on the doc_type of
the newly opened
document.

Hopefully that will do what you need.

Cheers,

Dugald

Quoting Jack McCoy <mccoyj@ius.edu>:

> Well, the batch file works fine when you open a file by double
> clicking, but when I choose File->Open, the xml loads inside the
> window.
>
> Anyone have any insight? I tried unaliasing FileOpen and making an
> alias to a shell command, but that didn't work too well. Any ideas?
>
>

Okay, I figured I would respond back and describe how I remedied the problem.



First, I created a .bat file (attached)to associate all .xml files with a new instance of Epic.

- Thatallowed a newinstance to be launched whenever a file was double-clicked. However,ifa user was to try to open a file within a certain instance (File->Open), thatfile would be opened in the current windowand the instance.js file was not evoked.



Next, I wrote an .acl file (attached) to replace the alias of File->Open. The file unalias-es FileOpen, and creates a new alias that uses the sh command to open a new instance of Epic. Note the use of the execute command to ensure the variables are not set until the alias is called. This .acl file works properly, and would replace the FileOpen alias when placed inArbortext-path\custom\initfolder. Also I added set filelist = " to the .acl to ensure the user can't open files that way.

- Unfortunately, I cannot access that folder, as I don't have permission on my workstation. Instead, I took theFileOpen alias from the .acl file, and replaced the FileOpen alias inArbortext-path\packages\commands.acl. Because of my limited permissions, I copied my commands.acl and replaced the file on all of the users computers.

It seems to me that I should have permissions to the folder; but our admins like their jobs, and they feel very threatened by a young person who is fairly knowledgeable. We sent them this problem over two weeks ago, and they weren't able to come up with anything. Oh well, I found a work-around...haha!



Whoops, I just realized I posted the wrong .acl. FileOpen should be:



unalias FileOpen;

alias FileOpen {

execute {$files = "XML Files|*.xml|All Files|*.*";}

execute {$result = file_selector(doc_path(), "xml", $files, "Open Document");}

if($result != ") {

exec {sh epic.exe -newinstance "$result" &;}

} else {

message "No Document Opened";}

}

set filelist = ";

Announcements