Not much to help, but I see BMC does exactly the same with the Calendar module.

The only difference is that they are using the HTML writer class to
print the html code.

--------------------

   private void insertScriptingSupport(Map map, HTMLWriter htmlwriter)
   {
       htmlwriter.openTag("script");
       htmlwriter.attr("type", "text/javascript");
       String s = (String)map.get(ModelKeys.CONTEXT_PATH);
       BrowserType browsertype = (BrowserType)map.get(ModelKeys.BROWSER_TYPE);
       StringBuffer stringbuffer = new StringBuffer(s);
       stringbuffer.append("/resources/javascript/");
       stringbuffer.append(browsertype.getAbbrev());
       stringbuffer.append("/date-picker/DatePicker.js");
       htmlwriter.attr("src", stringbuffer.toString());
       htmlwriter.endTag();
       htmlwriter.closeTag("script");
       htmlwriter.openTag("script");
       htmlwriter.attr("type", "text/javascript");
       htmlwriter.endTag();
       insertLocalizedMonthNames(map, htmlwriter);
       String s1 = getCurrentPickerDateAsJS(map);
       htmlwriter.append("var datePickerCal = new Calendar(");
       htmlwriter.append(s1);
       htmlwriter.append(", new MonthLabeler());\n");
       htmlwriter.closeTag("script");
   }
--------------------------

--
Jarl

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

 __20060125_______________________This posting was
submitted with HTML in it___

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

Reply via email to