You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Sascha <dg...@fishtown-team.de> on 2005/06/23 12:33:51 UTC

portlet url?

Hello.

I think it's a simple question: how do I get the URL of my selfwritten
portlet? (i did "view source" but didn't find it - must be something
like http://localhost:8080/jetspeed/portal/...)

Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


communication problem

Posted by Sascha <dg...@fishtown-team.de>.
Hello.

I've still a problem with the communication between javascript(in a SVG
file) and my portlet.

With 'RenderResponse.encodeURL(RenderRequest.getContextPath());' I got
the URL of my portlet. It's 'http://localhost:8080/HelloWorld'. I call
this URL in javascript:
'getURL("http://localhost:8080/HelloWorld?par=dummy",
callbackFunction);' but the java code 'if
(RenderRequest.getParameter("par") != null)' is never called.

I tried this with a normal java applet and there is no problem. Maybe
there is still a problem with the URL or is there anything I must know
about portlets that might help me? 

Any help is very apprechiated!


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Error from PortletPreferences

Posted by David Pankros <dp...@miragy.com>.
Can anyone confirm this?  I'm setting a couple parameters from within
processAction and then when I store them I get the following:

12:19:46,687 INFO  [STDOUT]
[org.apache.ojb.broker.core.PersistenceBrokerImpl] WARN:
12:19:46,687 INFO  [STDOUT] No running tx found, please only store in
context of an PB-transaction, to avoid side-effects - e.g. when rollback
of complex objects

This is jetspeed2-m4dev from SVN last night (an old m3dev snapshot also
did the same thing too).  It's running on JBoss 4.0.1 SP-1. Any
thoughts?  

Dave

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.8.0/27 - Release Date: 6/23/2005
 


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


RE: again SVG

Posted by David Pankros <dp...@miragy.com>.
> ...
> function onclickFunction(evt)
> {
>   getURL("http://localhost:8080/HelloWorld?par=dummy",
> callbackFunction);
> }
> 
I'm not sure exactly what you're trying to do. Or maybe I don't
understand your approach.  I feel like I am missing SOMETHING.

That URL you're using, isn't a portal URL and so, HelloWorld will
probably be called as a standard servlet, outside the context of the
portal server.  That is fine for displaying images or for referencing an
external resource, such as your SVG, but most certainly NOT OK if you're
trying to submit a form to, perform an action on, or request a refresh
of a portlet, as your reference to doView suggests.  In my experience,
for a Portal URL (RenderURL or ActionURL), you can't just append "GET"
parameters to the URL as a string as you could with a traditional
servlet and expect it to work.  

I suggest you obtain the JSR168 spec from here:
http://www.jcp.org/en/jsr/detail?id=168

Read the section on portal URLs and how to set parameters (PLT.7).  I
think understanding the spec a little more will help you more in the
long-run than just fixing each problem as they arise.  

As an alternative, you can always create a form with an actionURL and a
hidden input.  Your SVG can set the value of the hidden input and submit
the form.  THEN you'd be able to get the values, if not in doView
certainly in processAction.

Dave

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.8.0/27 - Release Date: 6/23/2005
 


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


again SVG

Posted by Sascha <dg...@fishtown-team.de>.
Hello.

Again a little SVG problem. I hope someone can help me. I want to pass a
parameter from javascript function 'onclickFunction' in the SVG code to
my portlet. I doesn't work. It displays the SVG the right way but when I
click the SVG circle it doesn't display the '<br>i got the
parameter!'...


Here is the Java code:

public void doView(RenderRequest request, RenderResponse response)
            throws PortletException, IOException {
  response.setContentType("text/html");
  PrintWriter writer = response.getWriter();
  if (request.getParameter("par") != null) {
    writer.println("<br>i got the parameter!");
  } else {
    writer
      .println("<p align=\"center\">Hello World</p>"
      + "<embed src=\""
      + response.encodeURL(request.getContextPath())
      + "/Test.svg\" type=\"image/svg-xml\" width=\"100px\"
height=\"100px\"/>");
  }
}


And here is the SVG code:

...
function onclickFunction(evt)
{
  getURL("http://localhost:8080/HelloWorld?par=dummy",
callbackFunction);
}
     
function callbackFunction(urlRequestStatus)
{
}
...
<circle id="id-01" cx="50" cy="50" r="20" onclick
="onclickFunction(evt)"   style="fill:green">
</circle>


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: portlet url?

Posted by James Liao <ji...@gmail.com>.
Hi,
Try this:
call the following code in your portlet:
String url = renderResponse.encodeURL(renderRequest.getContextPath());

- James Liao

On 6/23/05, Sascha <dg...@fishtown-team.de> wrote:
> Hello.
> 
> I think it's a simple question: how do I get the URL of my selfwritten
> portlet? (i did "view source" but didn't find it - must be something
> like http://localhost:8080/jetspeed/portal/...)
> 
> Thank you.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org