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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

File references and relative paths

JeffStevenson
12-Amethyst

File references and relative paths

Hello everyone,
I searched the forums for this, but couldn't find anything that answered it.

I'm wondering if there is a way to use a relative path when inserting a file reference? We're using a constant folder structure that ideally can be zipped up an transported between machines. The problem is when we put on other clients, the links to the references are breaking depending on where the folders are being saved. If I use a text editor and replace the paths with relative paths, Editor pulls them in just fine. However, this is counterproductive to be replacing file paths.

Does anyone know how to use relative paths when using Insert->File Reference?
We're using Editor 5.4 M080. Any help is much appreciated!
9 REPLIES 9

Details in this area have changed over releases,
and it depends on exactly what you mean by
relative (e.g., relative but with leading path
segments or pathless?), but try setting your
graphicspath (see help topics 495, 425, 171 and
others) to point to the directory holding your
graphics. If you do that, I believe your graphic
filerefs should be pathless which might be what
you want.

There is also a graphic_relative_path ACL function
(help topic 1571) if you find you need to do some
ACL programming to get what you want.

paul

When I tried setting graphicpath in 5.4, it appeared to have no effect. Before the final print of any book, I have to do a search and replace as our entity refs will span the entire gamut of possibilities:

\servername\path\to\file.xml
X:\book\file.xml
File.xml

Never did find a solution that worked to keep that from happening.

John T. Jarrett CDT
Senior Tech Writer, Integrated Logistics Support,Land & Armaments/Global Tactical Systems

T832.673.2147 | M 832.363.7234 | F 832.673.2376| x1147 | -
BAE Systems, 5000 I-10 West, Sealy, Texas USA 77474
www.baesystems.com

I don't know where you have tried setting your graphics path, but sometimes if it is set in a file that is read too early in the Editor startup sequence, it will be over-ridden by a setting in a file that is read later. For instance, the epic.wcf file (at least that's what it is named in 5.2) can have an <option name="graphicpath" value="\\whatever\"/> in it, which may override other values set in other files.
I'm not that familiar with 5.4 but I think it probably works the same way.

I don't think setting the graphics path for file refs would be useful. We're talking about 2 different types of data (XML vs. images) that are often stored in different locations.


In our situation, we have books or book segments that have a mapper.xml file that pulls in other authored XML files via the file ref. The folder structure is self-contained aside from the file refs that are coding the path all the way back to the drive letter.


For instance, say the mapper.xml is stored in "/ourbook/master/" with "ourbook" being the root folder. What I'm looking to do is use "../ourbook/otherstuff/ref.xml" versus "C:/Users/random/random/ourbook/otherstuff/ref.xml".


Since Editor honors the relative paths when I put them in via a text editor, I would think authors could use them when in Editor itself. If not, that would be a nice feature. Thanks, everyone for your comments!

Hi Jeff-



You could certainly write some ACL code to do this, i.e. write your own
insert_file_reference() function that uses relative paths, and
substitute it for the standard insert file reference command.



--Clay


I'm trying to copy an existing doc type to a new doc type. I've got everything working (finally) except when I try to print it says the doc type isn't installed on the PE {A20448] ...Check the server's catalog path setting.

I can't edit the existing catalog in the custom\doctype\catalog (IT's got it locked down) so I put a new one in the new doctype subdirectory, which, according to Help, will automatically be found as long as it is only one subdirectory deep.

OLD [works]:

Catalog entry: PUBLIC "-//BAE//DTD 2361 Production//EN" "production\production.dtd" (catalog is in custom\doctypes\

DTD definition:

Hi John-



Try taking the path info out of your system ID in your new catalog. In
other words, make your new catalog look like this:



PUBLIC "-//BAE//DTD 2361 BAE_Production//EN" "BAE_production.dtd"



Because your catalog file is in the same directory as the DTD itself in
this case, you don't want to include the path.



HTH



--Clay


Oh lord...thanks Clay...bet I could have beat my head against that for another hour before I noticed...

John T. Jarrett CDT

Where do the files actually live in relation to PE? Are they on the same
machine? I tried to manage my DTDs for editor and PE all together and it
didn't work. PE was more restrictive and the catalog path didn't seem to
work as cleanly for PE as it does the editor.

My original environment wasn't using PE so the DTDs got setup in a shared
location on a different machine. When we got PE configured, I had to move
the DTDs to the PE server and change my editor environment. I beleive
catalog path worked once it was on the same machine. Seems to me there
might have been another environment variable as well.

There was one of the server reports that would show which DTDs were
recognzed. I don't remember which one it was, but that was useful for
trying to understand what was being found and where.

..dan

> I'm trying to copy an existing doc type to a new doc type. I've got
> everything working (finally) except when I try to print it says the doc
> type isn't installed on the PE {A20448] ...Check the server's catalog path
> setting.
>
> I can't edit the existing catalog in the custom\doctype\catalog (IT's got
> it locked down) so I put a new one in the new doctype subdirectory, which,
> according to Help, will automatically be found as long as it is only one
> subdirectory deep.
>
> OLD [works]:
>
> Catalog entry: PUBLIC "-//BAE//DTD 2361 Production//EN"
> "production\production.dtd" (catalog is in custom\doctypes\
>
> DTD definition:
Announcements

Top Tags