See comments below.

On 11/24/06, Carey Matthew Black <[EMAIL PROTECTED]> wrote:

Axton,

Yea, the approach that the DFV example plugin took is one approach.
However I would think that externalizing (to the jar file) the images
would be a wiser approach anyway. Let's face it, web servers are
really good at pushing image files down to a browser. (And a DVF
content is really just a browser.)


One of the things I want to accomplish with the DV plugins is a simple
installation process.  Consider these alternatives:
- Import an arx record with a jar (use classloader/is/reader/writer)
- Asking people to add files to their web server with either (1) an explicit
path or (2) to configure the paths of each files; and import an arx

IMHO, I would think that an "easier" approach would be to publish the
images on your Mid-Tier web server and skip A LOT of fairly complex
Java code too. It would also allow the Java developer to focus on
issues like how to let an end installer/user do customizations or
other "feature" based things too.  Sure it complicates the install a
bit, but that is a one time cost too.


I am hoping that if 1 framework is written to serve files (for example, from
a folder name WebContent) from within the jar, that it would be easy to use
and reusable (copyright/license).

Or you could opt to create an ARS form that the user can search and
pull the data out of the ARS API. (But that seems overly complicated
to me to.)


The Data Visualization Definition form exists for this reason (via the
Definition* interfaces), though some of the JS tools I am looking to use
contain dozens of files.

I guess you might even be able to embed images in an application
object's resources and "simply" point that the right Mid-Tier URL for
those resources to.

--
Carey Matthew Black
Remedy Skilled Professional (RSP)
ARS = Action Request System(Remedy)

Love, then teach
Solution = People + Process + Tools
Fast, Accurate, Cheap.... Pick two.


On 11/24/06, Axton <[EMAIL PROTECTED]> wrote:
> ** I found I have to use ClassLoader and create an input stream to the
> desired file.  From there I can attach a reader, then use a writer to
send
> the contents to the response object.  Makes a framework for common
tasks,
> like accessing resource files, necessary.  Unfortunately BMC has slapped
> copyrights with the labels 'proprietary' and 'confidential' on their
'free'
> source code, meaning I will have to reinvent the wheel to write any
'free'
> software.  It would have been logical to include this specific framework
> (resource file handling) in the dv plugin architecture; maybe in the
next
> version.
>
> Axton Grams

<snip>

> > On 11/22/06, Axton <[EMAIL PROTECTED]> wrote:
> > > ** I'm trying to write a dv plugin that contains resource files such
as
> > > images, js, etc.  I am unable to access the resources contained
withing
> the
> > > dv plugin jar.  I've played with the PluginExample, but I can't find
> what
> > > I'm missing.  The layout of the jar file is this:
> > >
> > >      0 Tue Nov 21 19:17:10 EST 2006 META-INF/
> > >     71 Tue Nov 21 19:17:10 EST 2006 META-INF/MANIFEST.MF
> > >      0 Tue Nov 21 19:15:52 EST 2006 com/*
> > >      0 Tue Nov 21 19:15:52 EST 2006 org/*
> > > ...
> > >      0 Tue Nov 21 19:16:36 EST 2006 resources/abc.js
> > > ...
> > >
> > > In the dv plugin, I attempt to access the resources using the
following:
> > >
> > >
> > > public class BasePlugin implements Plugin {
> > >
> > >     public void init(PluginConfig config) {
> > >     }
> > >
> > >     public void processRequest (PluginContext pc) throws
IOException,
> > > NoPermissionException {
> > >         HttpServletResponse response = pc.getResponse();
> > >         response.setContentType("text/html");
> > >         response.setCharacterEncoding("UTF-8");
> > >         PrintWriter writer = response.getWriter ();
> > >         writer.println("<html><head>");
> > >         writer.println("<script src=\""    +
> > > pc.getPageService().getPluginContextURL() + "/resources/abc.js\"
> > > type=\"text/javascript\"></script>");
> > >         writer.println("<script>");
> > >         writer.println("function onLoad() {");
> > > ...
> > >         writer.println("</script>");
> > >         writer.println ("</head>");
> > >         writer.println("<body onload=\"onLoad();\"
> > > onresize=\"onResize();\">");
> > > ...
> > >         writer.println("</body></html>");
> > >         }
> > > ...
> > > }
> > >
> > > No such luck.  With the PluginExample, after starting a mid-tier
> session, I
> > > am able to access the resource files contained within the plugin
using
> this
> > > url structure:
> > >
> > >
> http://localhost/arsys/plugins/PluginExample/resources/images/funny.gif
> > >
> > > When I try to do the same with my plugin, I get an ARERR3600.
> > >
> > > The app server logs show the following:
> > >
> > > Nov 22, 2006 4:29:20 PM - SEVERE ( com.remedy.log.DVMODULE) :
(Thread
> 15)
> > > Exception while processing
> > > requestjava.lang.NullPointerException
> > >     at
> > >
> org.arswiki.dvplugin.timeline.BasePlugin.processRequest(BasePlugin.java
:64)
> > >     at
> > >
> com.remedy.arsys.plugincontainer.impl.PluginServlet.postPluginInfo
> > > (Unknown Source)
> > >     at
> > >
> com.remedy.arsys.plugincontainer.impl.PluginContainer.doRequest(Unknown
> > > Source)
> > >     at
> > >
> com.remedy.arsys.stubs.GoatHttpServlet.postInternal(Unknown
> > > Source)
> > >     at com.remedy.arsys.stubs.GoatHttpServlet.doGet
> > > (Unknown Source)
> > >     at
> > >
> javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
> > >     at
> > >
> javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> > >     at
> > >
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> > > (ApplicationFilterChain.java:252)
> > >     at
> > >
> org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:173)
> > >     at
> > > org.apache.catalina.core.StandardWrapperValve.invoke
> (StandardWrapperValve.java
> > > :213)
> > >     at
> > >
> org.apache.catalina.core.StandardContextValve.invoke(
StandardContextValve.java:178)
> > >     at
> > > org.apache.catalina.core.StandardHostValve.invoke(
> StandardHostValve.java:126)
> > >     at
> org.apache.catalina.valves.ErrorReportValve.invoke
> > > (ErrorReportValve.java:105)
> > >     at
> > >
> org.apache.catalina.core.StandardEngineValve.invoke(
StandardEngineValve.java
> :107)
> > >     at
> > >
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java
:148)
> > >     at org.apache.coyote.http11.Http11Processor.process
> > > (Http11Processor.java:869)
> > >     at
> > >
>
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
(Http11BaseProtocol.java:664)
> > >     at
> > >
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(
PoolTcpEndpoint.java
> > > :527)
> > >     at
> > >
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
LeaderFollowerWorkerThread.java:80)
> > >     at
> > >
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
ThreadPool.java
> :684)
> > >     at java.lang.Thread.run (Unknown Source)
> > >
> > > Nov 22, 2006 4:29:20 PM - FINE (com.remedy.log.INTERNAL) : (Thread
15)
> Throw
> > > Error - 3600
> > >
> > >
> > > Any insight is appreciated.
> > >
> > > Thanks,
> > > Axton Grams


_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:"Where
the Answers Are"


_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:"Where the Answers 
Are"

Reply via email to