This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 21879 - The "View" action should show the URL of the actual file if possible
Summary: The "View" action should show the URL of the actual file if possible
Status: RESOLVED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Code (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: _ lkramolis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-03-26 14:21 UTC by Asgeir Asgeirsson
Modified: 2007-09-25 01:31 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Asgeir Asgeirsson 2002-03-26 14:21:30 UTC
I often write XML files using the "xml-stylesheet" 
processing instruction where the stylesheet is located at 
my local drive relative to the location of the XML file.  
I'm also using DTD which is relative to it's location.

When I open the XML file using Microsoft Internet Explorer 
as external browser, the MSXML rendering engine in IE 
doesn't find the relative resources (XSL and DDT) when the 
file's URL points to internal netbeans web server.

I thus suggest that an XML file in a LocalFilesystem will 
be displayed with the actual file URL insted of the local 
web servers URL.

The following changes in the view() method of 
org.netbeans.modules.xml.core.XMLDataObject.ViewSupport
will do the trick:

        public void view () {
            try {
                org.openide.filesystems.FileSystem 
fileSystem = primary.getFile().getFileSystem();
                if (fileSystem instanceof 
org.openide.filesystems.LocalFileSystem) {
                    File file = 
((org.openide.filesystems.LocalFileSystem)
fileSystem).getRootDirectory();
                    StringTokenizer strTok = new 
StringTokenizer(primary.getFile().toString(), "/");
                    while(strTok.hasMoreTokens()) {
                        file = new File(file, 
strTok.nextToken());
                    }
                    TopManager.getDefault ().showUrl 
(file.toURL());
                } else {
                   TopManager.getDefault ().showUrl 
(primary.getFile().getURL());
                }
            } catch (Exception e) {
            }
        }
Comment 1 _ pkuzel 2002-06-03 12:26:34 UTC
Let these are considered while planning next release.
Comment 2 Marek Grummich 2002-07-19 21:02:59 UTC
Target milestone was changed from 'not determined' to TBD.
Comment 3 _ lkramolis 2002-10-01 10:30:04 UTC
I think it works now -- it was implemented at Open API side.
Comment 4 _ pkuzel 2003-02-06 10:38:36 UTC
This functionality is targeted to  be a part of NetBeans 3.5 standard release.
At this moment it is necessary to stabilize it fully, pass I18N checks, pass
A11Y checks, pass UI checks and properly document it.