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 27661 - Eliminate manditory dependency on HttpServer$Impl
Summary: Eliminate manditory dependency on HttpServer$Impl
Status: NEW
Alias: None
Product: xml
Classification: Unclassified
Component: XSL (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@xml
URL:
Keywords:
Depends on:
Blocks: 28009
  Show dependency tree
 
Reported: 2002-09-27 20:07 UTC by _ briansmith
Modified: 2007-09-25 01:34 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 _ briansmith 2002-09-27 20:07:07 UTC
I would like to be able to use the XSL module
without having any HTTP server available.
Currently, this is imppossible because the module
declares a mandatory dependency on HttpServer$Impl.

The only direct dependency seems to be in
TransformServlet (sp?). In turn, I see that some
basic functionality seems to be implemented in
terms of the servlet. However, I think that this
dependency is too "heavy" because it seems to be
purely an implementation detail, as opposed to
user-visible cross-module functionality. I think
that any functionality that requires
HTTPServer$Impl inside the XSL modules should be
moved into a bridge module that bridges XSL and
HttpServer. Tbat way, the functionality is
automatically enabled if (and only if) an
HTTPServer$Impl implementation is found and the
XSL module is enabled.

However, I don't think that the "preview
transformation" feature should be disabled even if
there is no HTTPServer$Impl. I think there are
other ways of implementing it besides using a
servlet (e.g. generating a temporary file and then
giving the web browser a file:// URL).
Comment 1 _ pkuzel 2002-10-01 17:00:47 UTC
What about following implementation:

private static boolean isServletEngineProvided() {
  Collection instances = Lookup.lookup(
      new Lookup.Template(ModuleInfo.class)).allInstances();
  Iterator it = instances.iterator();
  ModuleInfo next;
  while (it.hasNext()) {
     next = it.next();
     String provides[] = next.getProvides();
     for (int i = 0; i<provides.length; i++) {
        if ("org.openide.util.HttpServer$Impl".equals(provides[i])) {
           return true;
        }
     }
  }
  return false;
}

then you can construct UI dynamically (removing
preview option if necessary). 
Comment 2 _ briansmith 2002-10-04 04:57:51 UTC
Petr, that kind of change seems only helpful if the intention is to
disable the preview feature when no HTTP server is found. But, without
the preview feature the XSL module is much less useful (since the user
has to use another tool to do the preview).

I can look into re-implementing the preview feature to generate a
temporary file and sending file:// URLs to the web browser.