RE: Restlet 1.2 -- Filter

2009-04-13 Thread Jerome Louvel
Lars,

Good point, I've just updated Filter#setNext() and similar method to work
with ServerResource subclasses as well.
 
Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com
 

-Message d'origine-
De : Lars Heuer [mailto:he...@semagia.com] 
Envoyé : vendredi 10 avril 2009 12:26
À : discuss@restlet.tigris.org
Objet : Restlet 1.2 -- Filter

Hi all,

I ran against a problem with the 1.2 Filter. The filter does not let me
specify that 'next' is a ServerResource.

I propose to change Filter as follows:

- Add method setNext(Class? extends UniformResource targetClass)
  or setNext(Class? targetClass)
- Remove setNext(Class? extends Resource targetClass)
- Add a constructor that takes either Class? or Class? extends
  UniformResource) just to be consistent (since it has already a
  constructor Filter(Context context, Restlet next))



Best regards,
Lars
--
http://www.semagia.com

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=16283
27

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1687946


RE: Comments against Restlet 1.2M2

2009-04-13 Thread Jerome Louvel
Hi Lars,

I just changed it in SVN trunk as suggested. Hope you feel better now ;-) 
 
Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com


-Message d'origine-
De : Lars Heuer [mailto:he...@semagia.com] 
Envoyé : jeudi 9 avril 2009 14:01
À : discuss@restlet.tigris.org
Objet : Re: Comments against Restlet 1.2M2

Hi all,

[...]
 Some comments against that release:
[...]

I like to add another point: Rename ServerResource#isExists to isExisting().
isExists hurts me. ;) It would make sense to rename
setExists(boolean) as well.

Best regards,
Lars
--
http://www.semagia.com

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=16176
53

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1687750


Scripted Restlet - Demo Distribution

2009-04-13 Thread Tal Liron




Hello
Restleteers,


The
scripted edition of Restlet is ready for demoing and testing. I'm
including a link to download a distribution that
should run immediately on any Java 5 compatible machine. I hope you'd give it a spin!


Scripted
Restlet is development platform that lets you use _javascript_, PHP,
Python, Ruby and/or Groovy to write REST resources and serve textual
representations (HTML, XML, etc.) without writing a single line of Java
code. Behind the scenes, you get the advantages of Restlet, the Java
platform, and scalable network servers (Jetty, Grizzly), while still
staying in the dynamic language you are invested in, including the
wealth of 3rd party libraries for that language. Compilation (for
scripting languages that support it) happens on the fly (within
controllable limits), allowing for a rapid development/testing cycle.


The
textual environment is designed to be very familiar to people who have
used PHP, JSP or ASP, by letting you embed "scriptlets" of code into
your HTML or other text. It includes powerful facilities beyond what
you'd find in those environments, leveraging features of Restlet and
Scripturian: script-controlled caching and streaming, control of HTTP
headers, and seamless mixing of scripting/templating languages within a
single page.


 
The
scripts are heavily documented (you can even view the sources from the
running demo) and demonstrate some of these features.
I hope it's enough to give a head start for script hackers. Beyond
that, there's quite a bit of documentation for the Java side of things:
the demo site itself, the Restlet wiki, and the Java API documentation
for the Restlet script extension and the Scripturian library. But, I
don't expect script hackers to delve into the Java implementation
issues, and hope to shield them from scary Java as much as possible!



Without
further ado, the temporary download link: (16mb)



http://dl.getdropbox.com/u/122806/scripted-restlet-distribution.zip


Please
read the included readme.txt to start!



Comments
and caveats:



1.
It's meant for experimentation only, building up to the final release
of Restlet 1.2, which will include a special scripted edition (see
issue #415 on Tigris).



2.
Python notes: I have not included the Jepp libraries in this
distribution, because they are a bit of a pain to install. However, if
you manage to install Jepp, the Jepp demos should work just fine. Also
note that I'm using the stable 2.2 release of Jython. You can install
the 2.5 beta if you need newer Python linguistics. Final note: do not
rename the jython.jar! I've found out the hard way that it breaks its
ability to find Python libraries.


3. This
distribution is a bit big, because it includes all scripting
languages. It can be much smaller if you remove languages you
don't need. To keep it lean, I've also not added Jetty or Grizzly, so
it uses Restlet's default network connector. Definitely add those if
you want to test performance/scalability!

4. To keep things simple, the demo is started via a batch file. This is
a terrible way to run a reliable application! In a serious environment,
you should run it as a controlled and monitored Unix/Linux daemon or
Windows service, via either YAJSW or Tanuki's Java Service Wrapper. The
final Scripted Restlet edition might include those.

5. Similarly, I haven't configured logging. Right now all logs just go
straight to the console. The final release will be pre-configured for
logging, including a nice Apache-compatible web.log.

6. I'm using a Subversion snapshot build of the Restlet libraries,
including the Restlet script extension. A lot has changed since the
milestone release.

Have fun scripting!

-Tal






Scripted Restlet - Demo Distribution

2009-04-13 Thread Tal Liron




Hello
Restleteers,


The
scripted edition of Restlet is ready for demoing and testing. I'm
including a link to download a distribution that
should run immediately on any Java 5 compatible machine. I hope you'd give it a spin!


Scripted
Restlet is development platform that lets you use _javascript_, PHP,
Python, Ruby and/or Groovy to write REST resources and serve textual
representations (HTML, XML, etc.) without writing a single line of Java
code. Behind the scenes, you get the advantages of Restlet, the Java
platform, and scalable network servers (Jetty, Grizzly), while still
staying in the dynamic language you are invested in, including the
wealth of 3rd party libraries for that language. Compilation (for
scripting languages that support it) happens on the fly (within
controllable limits), allowing for a rapid development/testing cycle.


The
textual environment is designed to be very familiar to people who have
used PHP, JSP or ASP, by letting you embed "scriptlets" of code into
your HTML or other text. It includes powerful facilities beyond what
you'd find in those environments, leveraging features of Restlet and
Scripturian: script-controlled caching and streaming, control of HTTP
headers, and seamless mixing of scripting/templating languages within a
single page.


 
The
scripts are heavily documented (you can even view the sources from the
running demo) and demonstrate some of these features.
I hope it's enough to give a head start for script hackers. Beyond
that, there's quite a bit of documentation for the Java side of things:
the demo site itself, the Restlet wiki, and the Java API documentation
for the Restlet script extension and the Scripturian library. But, I
don't expect script hackers to delve into the Java implementation
issues, and hope to shield them from scary Java as much as possible!



Without
further ado, the temporary download link: (16mb)



http://dl.getdropbox.com/u/122806/scripted-restlet-distribution.zip


Please
read the included readme.txt to start!





Comments
and caveats:








1.
It's meant for experimentation only, building up to the final release
of Restlet 1.2, which will include a special scripted edition (see
issue #415 on Tigris).



2.
Python notes: I have not included the Jepp libraries in this
distribution, because they are a bit of a pain to install. However, if
you manage to install Jepp, the Jepp demos should work just fine. Also
note that I'm using the stable 2.2 release of Jython. You can install
the 2.5 beta if you need newer Python linguistics. Final note: do not
rename the jython.jar! I've found out the hard way that it breaks its
ability to find Python libraries.





3. This
distribution is a bit big, because it includes all scripting
languages. It can be much smaller if you remove languages you
don't need. To keep it lean, I've also not added Jetty or Grizzly, so
it uses Restlet's default network connector. Definitely add those if
you want to test performance/scalability!

4. To keep things simple, the demo is started via a batch file. This is
a terrible way to run a reliable application! In a serious environment,
you should run it as a controlled and monitored Unix/Linux daemon or
Windows service, via either YAJSW or Tanuki's Java Service Wrapper. The
final Scripted Restlet edition might include those.

5. Similarly, I haven't configured logging. Right now all logs just go
straight to the console. The final release will be pre-configured for
logging, including a nice Apache-compatible web.log.

6. I'm using a Subversion snapshot build of the Restlet libraries,
including the Restlet script extension. A lot has changed since the
milestone release.

Have fun scripting!

-Tal









Re: Serving static content with the CLAP connector

2009-04-13 Thread Jim Alateras
Hey Jerome,

I've put it on the backlog for the moment. It maybe related to the  
version i am using, which is 1.1-M4. Looking to upgrade to 1.1.4 and  
will try again.


On 08/04/2009, at 2:25 AM, Jerome Louvel wrote:

 Hi Jim,

 Do you still have the issue? From what I see, it should work.

 The easiest way for us to debug this is to try your application.  
 Could you
 send us some code to reproduce the issue?

 Best regards,
 Jerome Louvel
 --
 Restlet ~ Founder and Lead developer ~ http://www.restlet.org
 Noelios Technologies ~ Co-founder ~ http://www.noelios.com


 -Message d'origine-
 De : Jim Alateras [mailto:j...@comware.com.au]
 Envoyé : jeudi 2 avril 2009 00:07
 À : discuss@restlet.tigris.org
 Objet : Re: Serving static content with the CLAP connector

 I have also tried adding the following context parameter to my  
 web.xml but
 am still getting '404'

 context-param
 param-nameorg.restlet.clients/param-name
 param-valueHTTP HTTPS CLAP FILE/param-value
   /context-param


 On 02/04/2009, at 7:32 AM, Jim Alateras wrote:

 Abit more information. When I start the restlet application in my
 Jetty container I see the following

 Apr 2, 2009 7:27:53 AM org.restlet.Connector init
 WARNING: The connector has been instantiated without any protocol.

 When I add the following code to my Application


 getConnectorService().getClientProtocols().add(Protocol.HTTP);

 getConnectorService().getClientProtocols().add(Protocol.CLAP);

 restart the server and attempt to access a URL i get a HTTP '500'
 response and I see the following

 Apr 2, 2009 7:29:36 AM org.restlet.Connector init
 WARNING: The connector has been instantiated without any protocol.
 Apr 2, 2009 7:29:37 AM com.noelios.restlet.component.ComponentHelper
 checkVirtualHost
 SEVERE: Unable to start the application null. Client connector for
 protocol HTTP is missing.
 Apr 2, 2009 7:29:37 AM com.noelios.restlet.component.ComponentHelper
 checkVirtualHost
 SEVERE: Unable to start the application null. Client connector for
 protocol CLAP is missing.
 Apr 2, 2009 7:29:37 AM com.noelios.restlet.ChainHelper handle




 On 01/04/2009, at 9:36 PM, Jim Alateras wrote:

 I am using 1.1.3 and am having an issue using the CLAP connector to
 serve static content in the classpath. Here is what I have

 web.xml
 ===
 context-param
   param-nameorg.restlet.application/param-name
   param-
 valueau.com.observant.ringocore.application.RingoCoreApplication/
 param-value
 /context-param
 context-param
   param-namelog4jConfigLocation/param-name
   param-value/WEB-INF/classes/log4j.properties/param-value
 /context-param
 context-param
   param-namelog4jRefreshInterval/param-name
   param-value1000/param-value
 /context-param
 context-param
param-nameorg.restlet.clients/param-name
param-valueHTTP HTTPS CLAP FILE/param-value
  /context-param


 listener
   listener-classorg.springframework.web.util.Log4jConfigListener/
 listener-class
 /listener

 servlet
   servlet-nameringo/servlet-name
   servlet-classcom.noelios.restlet.ext.servlet.ServerServlet/
 servlet-class
   init-param
 param-nameringo.app.context/param-name
 param-value${ringocore.app.context}/param-value
   /init-param
   load-on-startup0/load-on-startup
 /servlet

   !-- Syslog Servlet Mapping --
 servlet-mapping
   servlet-nameringo/servlet-name
   url-pattern/*/url-pattern
 /servlet-mapping
 /web-app


 RingoCoreApplication
 ==
 In here i attach the following route to the router

 Directory directory = new Directory(getContext(),
 clap://thread/
 au/ com/observant/ringocore/);
 directory.setNegotiateContent(false);
 directory.setListingAllowed(true);
 directory.setIndexName(index);
 router.attach(/gviz, directory);

 I suspect that the url /gviz/blah maps to the resource classapth:/u/
 com/observant/ringocore/blah. Is that correct? when I attempt to
 access any resource (http://localhost:9080/ringo/gviz/) i get a  
 '404'

 When I debug the application i notice that
 RingoCoreApplication.connectorService.clientProtocols is an empty
 array, which i suspect is the root cause of the problem.

 Any advice would be much appreciated?


 cheers
 /jima

 --
 http://restlet.tigris.org/ds/viewMessage.do? 
 dsForumId=4447dsMessageI
 d=1505695


 cheers
 /jima

 --
 http://restlet.tigris.org/ds/viewMessage.do? 
 dsForumId=4447dsMessageId
 =1510490


 cheers
 /jima

 --
 http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=15111
 99

 --
 http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1579526


cheers
/jima

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1699176


SpringBeanRouter

2009-04-13 Thread Jim Alateras
I am currently using s custom class to attach routes to  a router but  
am now looking at using the SpringBeanRouter but have a couple of  
questions.

1.  In the example below if i also want to support the a query string  
would i change the bean name to  /studies?{query}

2. How do i specify a default route for the router.



beans .. 
   bean name=router class=org.restlet.ext.spring.BeanNameRouter/
   bean name=/studies id=studiesResource autowire=byName  
scope=prototype class=edu.northwestern.myapp.StudiesResource 
/beans

cheers
/jima

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1699583


Re: SpringBeanRouter

2009-04-13 Thread Rhett Sutphin
Hi Jim,

On Apr 13, 2009, at 7:56 PM, Jim Alateras wrote:

 I am currently using s custom class to attach routes to  a router but
 am now looking at using the SpringBeanRouter but have a couple of
 questions.

 1.  In the example below if i also want to support the a query string
 would i change the bean name to  /studies?{query}

You should set the bean name to whatever you were formerly passing to  
Router#attach.

 2. How do i specify a default route for the router.

This isn't directly supported at the moment.  The easiest thing to do  
right now is to subclass SpringBeanRouter and override  
postProcessBeanFactory something like this:

@Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory  
factory) {
   super.postProcessBeanFactory(factory);
   this.attachDefault(createFinder(theDefaultResourceBeanName))
}

Rhett

 beans .. 
   bean name=router class=org.restlet.ext.spring.BeanNameRouter/
   bean name=/studies id=studiesResource autowire=byName
 scope=prototype class=edu.northwestern.myapp.StudiesResource 
 /beans

 cheers
 /jima

 --
 http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1699583

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1702638