Re: Support for log4j?

2008-07-25 Thread Evgeny Shepelyuk

Hello Aaron.
Thnx for examples
One small note. I will be very appreciated if u also post ur log4j config.
For access logs only :)

24.07.08 в 19:36 Aaron Crow в своём письме писал(а):


Hi Evgeny,

Sure, I will. First though, I'd like to say that I don't consider it the  
ideal solution. In my case I just want the Restlet's access logs, and if  
I can emulate those myself with my own logging statements, I'll be  
happier. That being said, here's what I did to redirect Restlet's JDK  
logging to slf4j and then log4j:


1) Read http://www.slf4j.org/legacy.html

2) Added the following to my pom (**verbosity warning!**):

dependency
groupIdorg.slf4j/groupId
artifactIdslf4j-api/artifactId
version1.4.3/version
exclusions
  !-- needed to avoid endless recursion, per:
   http://www.slf4j.org/legacy.html
  --
  exclusion
groupIdorg.slf4j/groupId
artifactIdslf4j-jdk14/artifactId
  /exclusion
/exclusions
/dependency
dependency
groupIdorg.slf4j/groupId
artifactIdslf4j-log4j12/artifactId
version1.5.2/version
/dependency
dependency
groupIdorg.slf4j/groupId
artifactIdjul-to-slf4j/artifactId
version1.5.2/version
/dependency
dependency
  groupIdlog4j/groupId
  artifactIdlog4j/artifactId
  version1.2.12/version
/dependency

3) Added the following to my app's main method:
  // needs: import org.slf4j.bridge.SLF4JBridgeHandler;
  SLF4JBridgeHandler.install();

I then did what you normally do to configure log4j, and saw restlet's  
logging go to the targets I configured in my log4j.properties file. I do  
see the formatting is a little awkward, but at least it's down to one  
line. (I never made my peace w/jul's forced multi-line logging ;-)



Hope this helps!
Aaron




- Original Message - From: Evgeny Shepelyuk  
[EMAIL PROTECTED]

Newsgroups: gmane.comp.java.restlet
To: discuss@restlet.tigris.org
Sent: Thursday, July 24, 2008 12:19 AM
Subject: Re: Support for log4j?



Hello Aaron !
Would u be so kind to share how u set up slf4j to be used as a bridge  
from restlet to log4j ?


-- Best Regards
Evgeny K. Shepelyuk


Evgeny Shepelyuk [EMAIL PROTECTED] wrote in message  
news:[EMAIL PROTECTED]

Hello Aaron !
Would u be so kind to share how u set up slf4j to be used as a bridge  
from restlet to log4j ?


-- Best Regards
Evgeny K. Shepelyuk










--
Best Regards
Evgeny K. Shepelyuk



RE: SSL + Virtual Hosts and Issue #489?

2008-07-25 Thread Jerome Louvel

Hi Bruno,

Regarding the wiki, you don't seem to be registered. See the instructions
here to become an author: 
http://wiki.restlet.org/about/2-restlet.html

Best regards,
Jerome


-Message d'origine-
De : news [mailto:[EMAIL PROTECTED] De la part de Bruno Harbulot
Envoyé : vendredi 18 juillet 2008 17:48
À : discuss@restlet.tigris.org
Objet : Re: SSL + Virtual Hosts and Issue #489?



Alex Milowski wrote:
 On Wed, Jul 16, 2008 at 2:32 AM, Jerome Louvel [EMAIL PROTECTED]
wrote:
 Hi Alex,

 I have added a paragraph on Confidentiality in the Securing
applications
 page covering this topic:

http://wiki.restlet.org/docs_1.1/g1/13-restlet/29-restlet/99-restlet/46-rest
 let.html

 At some point, it might makes sense to split up this page into several
ones.
 
 Thanks.
 
 I think it would be good to have some ssl-specific information make its
 way into the connector documentation as an example.
 
 That is, there is a simple example here:
 

http://wiki.restlet.org/docs_1.1/g1/13-restlet/27-restlet/37-restlet/38-rest
let.html
 
 Maybe we could have about ssl configuration there as well.  Of course, the
 parameters are specific to the server helper...

Actually, using the SslContextFactory, the parameters can now be 
consistent across the Grizzly, Jetty and Simple HTTPS connectors. We're 
currently debating how it should be configured (see issue 489, feel free 
to join in): parameters vs. instances.

I reckon that, for the DefaultSslContextFactory, parameters would 
definitely make more sense. The current behaviour is to be able to pass 
to its init() method a series of parameters that will more or less 
follow the previous style of parameters. (It doesn't set any trust 
manager, which instead use the values set in the javax.net.ssl.* system 
properties as default).

The DefaultSslContextFactory wouldn't help choosing an alias. I guess it 
would be feasible to have a fixed alias (in a similar way as I've done 
it in jSSLutils with FixedServerAliasKeyManager -- see one of the 
previous messages in this thread), but that wouldn't really help for 
your initial problem, unless you use a different context per connector.


If you want to be able to use a single SSLContext between your two 
sockets, you're going to need a KeyManager that is able to pick the 
right alias depending on which socket is used.
In jSSLutils, the FixedServerAliasKeyManager I've implemented picks one 
by always returning the same value (the one with which it's been 
constructed). What we'd need for would be a way to configure such a 
KeyManager so that it would look like this:

   class SocketSelectorKeyManager implements X509KeyManager {
  private final SomeInformation someInformation;
  public SocketSelectorKeyManager(SomeInformation someInformation) {
 this.someInformation = someInformation;
  }
  public String chooseServerAlias(String keyType, Principal[] 
issuers, Socket socket) {
 String alias = makeSomeDecisionBasedOn(someInformation, 
socket.getLocalSocketAddress()); // (or other arguments)
 return alias;
  }
  ...
}

What SomeInformation and makeSomeDecisionBasedOn should be like 
could depend on many factors. I could try to implement one of these in 
jSSLutils, but I'm not sure how you'd like to be able to configure such 
a KeyManager. Any preferences?


Regarding the documentation, I'm planning to document the 
jSSLutils-specific settings on the jSSLutils website when I get the time 
to do so (probably next week). I'll try to document the 
DefaultSslContextFactory in the Restlet doc too (although I'm not sure I 
have access to the wiki).


Best wishes,

Bruno.



RE: Support for log4j?

2008-07-25 Thread Jerome Louvel

Hi Aron,

Note that it is totally possible to make JUL display log lines on just one 
line. It's a matter of providing a custom formatter (very easy).

For NRE, we provide our own, see:
http://www.restlet.org/documentation/snapshot/nre/com/noelios/restlet/util/AccessLogFormatter.html

We also have a more detailed page on logging in our wiki, with tips for JUL 
configuration:
http://wiki.restlet.org/docs_1.1/g1/13-restlet/29-restlet/98-restlet/101-restlet.html

Best regards,
Jerome

-Message d'origine-
De : news [mailto:[EMAIL PROTECTED] De la part de Aaron Crow
Envoyé : jeudi 24 juillet 2008 18:37
À : discuss@restlet.tigris.org
Objet : Re: Support for log4j?

Hi Evgeny,

Sure, I will. First though, I'd like to say that I don't consider it the 
ideal solution. In my case I just want the Restlet's access logs, and if I 
can emulate those myself with my own logging statements, I'll be happier. 
That being said, here's what I did to redirect Restlet's JDK logging to 
slf4j and then log4j:

1) Read http://www.slf4j.org/legacy.html

2) Added the following to my pom (**verbosity warning!**):

dependency
groupIdorg.slf4j/groupId
artifactIdslf4j-api/artifactId
version1.4.3/version
exclusions
  !-- needed to avoid endless recursion, per:
   http://www.slf4j.org/legacy.html
  --
  exclusion
groupIdorg.slf4j/groupId
artifactIdslf4j-jdk14/artifactId
  /exclusion
/exclusions
/dependency
dependency
groupIdorg.slf4j/groupId
artifactIdslf4j-log4j12/artifactId
version1.5.2/version
/dependency
dependency
groupIdorg.slf4j/groupId
artifactIdjul-to-slf4j/artifactId
version1.5.2/version
/dependency
dependency
  groupIdlog4j/groupId
  artifactIdlog4j/artifactId
  version1.2.12/version
/dependency

3) Added the following to my app's main method:
  // needs: import org.slf4j.bridge.SLF4JBridgeHandler;
  SLF4JBridgeHandler.install();

I then did what you normally do to configure log4j, and saw restlet's 
logging go to the targets I configured in my log4j.properties file. I do see 
the formatting is a little awkward, but at least it's down to one line. (I 
never made my peace w/jul's forced multi-line logging ;-)


Hope this helps!
Aaron




- Original Message - 
From: Evgeny Shepelyuk [EMAIL PROTECTED]
Newsgroups: gmane.comp.java.restlet
To: discuss@restlet.tigris.org
Sent: Thursday, July 24, 2008 12:19 AM
Subject: Re: Support for log4j?


 Hello Aaron !
 Would u be so kind to share how u set up slf4j to be used as a bridge from 
 restlet to log4j ?

 -- 
 Best Regards
 Evgeny K. Shepelyuk


Evgeny Shepelyuk [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hello Aaron !
 Would u be so kind to share how u set up slf4j to be used as a bridge from 
 restlet to log4j ?

 -- 
 Best Regards
 Evgeny K. Shepelyuk

 




Creating directory resources

2008-07-25 Thread Marc-Elian Bégin
Hi,

Is there a simple way of letting a client create directory resource?  
I'm not clear as how that maps to HTTP and REST.
But is there a way to get the Directory Finder to do that?  
Or am I not looking at the problem from the 
wrong end.

Thanks,

Meb







RE: How to filter Log Messages ?

2008-07-25 Thread Jerome Louvel

Hi Jaime,

Please check this wiki page for JUL config tips:
http://wiki.restlet.org/docs_1.1/g1/13-restlet/29-restlet/98-restlet/101-res
tlet.html

Best regards,
Jerome


-Message d'origine-
De : news [mailto:[EMAIL PROTECTED] De la part de Jaime Santana
Envoye : jeudi 24 juillet 2008 19:58
A : discuss@restlet.tigris.org
Objet : How to filter Log Messages ?

Hi,

I've been trying several way to filter the messages I get in my tomcat
console..
message like these:

Jul 24, 2008 12:41:46 PM com.noelios.restlet.LogFilter afterHandle
INFO: 2008-07-2412:41:4610.99.17.114-   10.99.17.114
80  GET
/webportal/rest/users/9725552109/ping   -   200 4   -   0
http://10.99.17.114 test-

I've tried several ways, so far without success..
My latest attempt was what is described in this link:
http://www.naviquan.com/blog/restlet-cookbook-log

seems very simple, but I am not sure I am getting to the proper Logger.

In my Application constructor I added these lines

org.restlet.Component component = new org.restlet.Component();
org.restlet.service.LogService logService = component.getLogService();
logService.setEnabled(true);
logService.setLoggerName(company.LoggerService);

Logger restLogger = Logger.getLogger(company.LoggerService);
if(restLogger!=null) {
restLogger.setFilter(new RestLogFilter(restLogger.getName()));

The RestLogFilter is a subclass java.util.logging.Filter in which I override
the
isLoggable method.. in this I am supposed to catch every log is done by the
application.. but none of the logged statements (afterHandle, etc) pass
trough
here..

Any idea of what is the problem in my code ?
or how can I filter some of the log messages ?

Thanks,
Jaime



unsubscribe from mailing list

2008-07-25 Thread Bao,Sam
I would like to unsubscribe from the mailing list.  How can I do that?

--
CONFIDENTIALITY NOTICE This message and any included attachments are from 
Cerner Corporation and are intended only for the addressee. The information 
contained in this message is confidential and may constitute inside or 
non-public information under international, federal, or state securities laws. 
Unauthorized forwarding, printing, copying, distribution, or use of such 
information is strictly prohibited and may be unlawful. If you are not the 
addressee, please promptly delete this message and notify the sender of the 
delivery error by e-mail or you may call Cerner's corporate offices in Kansas 
City, Missouri, U.S.A at (+1) (816)221-1024.

RE: unsubscribe from mailing list

2008-07-25 Thread Jerome Louvel
Hi Sam,
 
Check this page:
http://www.restlet.org/community/lists
 
You probably need to unsubscribe via Tigris.org. You can also stay connected
with the less intrusive Gmane NNTP gateway.
Best regards,
Jerome

  _  

De : Bao,Sam [mailto:[EMAIL PROTECTED] 
Envoye : vendredi 25 juillet 2008 16:03
A : discuss@restlet.tigris.org
Objet : unsubscribe from mailing list



I would like to unsubscribe from the mailing list.  How can I do that?

  _  

CONFIDENTIALITY NOTICE This message and any included attachments are from
Cerner Corporation and are intended only for the addressee. The information
contained in this message is confidential and may constitute inside or
non-public information under international, federal, or state securities
laws. Unauthorized forwarding, printing, copying, distribution, or use of
such information is strictly prohibited and may be unlawful. If you are not
the addressee, please promptly delete this message and notify the sender of
the delivery error by e-mail or you may call Cerner's corporate offices in
Kansas City, Missouri, U.S.A at (+1) (816)221-1024.



RE: Routing problem

2008-07-25 Thread Jerome Louvel

FYI, I've entered a RFE to keep track of this:

Improve matching of directory URIs 
http://restlet.tigris.org/issues/show_bug.cgi?id=532

Best regards,
Jerome


-Message d'origine-
De : Jerome Louvel [mailto:[EMAIL PROTECTED] 
Envoyé : mardi 22 juillet 2008 14:31
À : discuss@restlet.tigris.org
Objet : RE: Routing problem


One correction, in all my previous examples, you should replace the '/bar'
characters by just 'bar' as the slash is always consumed by the parent foo
router.

Best regards,
Jerome


-Message d'origine-
De : Jerome Louvel [mailto:[EMAIL PROTECTED] 
Envoyé : mardi 22 juillet 2008 14:27
À : discuss@restlet.tigris.org
Objet : RE: Routing problem


Hi all,

The current workaround it to do something like:

Router rootRouter = new Router(getContext());
Router fooRouter = new Router(getContext());
Router barRouter = new Router(getContext());

rootRouter.attach(, rootResource.class)
.setRoutingMode(Template.MODE_EQUALS);
rootRouter.attach(/foo, new Redirector(getContext(), {rb}/)
.setRoutingMode(Template.MODE_EQUALS);
rootRouter.attach(/foo/, fooRouter);

fooRouter.attach(, fooResource.class);
.setRoutingMode(Template.MODE_EQUALS);
fooRouter.attach(/bar, new Redirector(getContext(), {rb}/)
.setRoutingMode(Template.MODE_EQUALS);
fooRouter.attach(/bar/, barRouter);

barRouter.attach(, barResource.class);
... and so on... 

Note that {rb} is an implicit variable for the request.resourceRef.baseRef
property. See Resolver class for details on all variables supported.


SOLUTION 1
--

Now, we could indeed simplify this by adding a directoryRedirect boolean
property on Router and Route. Then, the code would become:

Router rootRouter = new Router(getContext());
Router fooRouter = new Router(getContext());
Router barRouter = new Router(getContext());

rootRouter.attach(, rootResource.class)
.setRoutingMode(Template.MODE_EQUALS);
rootRouter.attach(/foo/, fooRouter).setDirectoryRedirect(true);

fooRouter.attach(, fooResource.class);
.setRoutingMode(Template.MODE_EQUALS);
fooRouter.attach(/bar/, barRouter).setDirectoryRedirect(true);

barRouter.attach(, barResource.class);
... and so on... 


SOLUTION 2
--

Another way would be to have a directory boolean property that would 
change both the routing mode (to STARTS_WITH) and do the redirect:

Router rootRouter = new Router(getContext(), Template.MODE_EQUALS);
Router fooRouter = new Router(getContext(), Template.MODE_EQUALS);
Router barRouter = new Router(getContext(), Template.MODE_EQUALS);

rootRouter.attach(, rootResource.class);
rootRouter.attach(/foo/, fooRouter).setDirectory(true);

fooRouter.attach(, fooResource.class);
fooRouter.attach(/bar/, barRouter).setDirectory(true);

barRouter.attach(, barResource.class);
... and so on... 


SOLUTION 3
--

Another way would be to have a Template.MODE_DIRECTORY that would do the
redirect and match like STARTS_WITH.

Router rootRouter = new Router(getContext());
Router fooRouter = new Router(getContext());
Router barRouter = new Router(getContext());

rootRouter.attach(, rootResource.class)
.setRoutingMode(Template.MODE_EQUALS);
rootRouter.attach(/foo/, fooRouter)
.setRoutingMode(Template.MODE_DIRECTORY);

fooRouter.attach(, fooResource.class);
.setRoutingMode(Template.MODE_EQUALS);
fooRouter.attach(/bar/, barRouter)
.setRoutingMode(Template.MODE_DIRECTORY);

barRouter.attach(, barResource.class);
... and so on... 

My concern is that we would mix two aspects: URI matching and automatic
redirection which I find confusing.

---

My preference goes for solution 1, maybe with a combination with solution 2
(supporting both directoryRedirect and directory properties).

What do you think?

Best regards,
Jerome


-Message d'origine-
De : Ralf Bommersbach [mailto:[EMAIL PROTECTED] 
Envoyé : jeudi 17 juillet 2008 18:11
À : discuss@restlet.tigris.org
Objet : Re: Routing problem

Okay thanks for all the answers.  I see I'm not the only one with this 
problem.

[EMAIL PROTECTED] schrieb:
  using MODE_EQUALS on both, though, because when I use MODE_STARTS_WITH,
  the user can pass, /bar/this_is_nonsensical_garbage and it matches

Exactly

Bruno Harbulot schrieb:
To solve this at the moment, I make sure the
 users start using the system via a correct URI; all the subsequent URIs 
 they get have the appropriate trailing slashes, since the representation 
 that lead them to these other resources have been generated accordingly.

If the user just follows the links I provide him in the representations, 
I'm fine yes.
But this doesn't help if the user decides to alter the URI manually 
(e.g. in the adress bar of the browser)

At the moment I have only the option between allowing the strangest uris 
to match or practically crippling my application to the point where its 
not usable anymore.

Anyway, thanks for the helpful suggestions. Perhaps someone will have a 
glorious idea for how to solve this! 

Re: Creating directory resources

2008-07-25 Thread Thierry Boileau

Hello Marc-Elian,

The Directory Restlet supports the creation of resources via a PUT 
request. This leads to wonder: is it possible to make a PUT on a 
directory with an empty representation (i.e. what is the representation 
of directory?)? Well, as we decided to forbid such request, the first 
answer could be : no it is not possible.
But, as far as I can see in the code, It seems that a PUT to such URI 
http://myserver/mydirectory/; with a *trailing /*  was designed to be 
allowed. In this case, the entity is totaly ignored.

Bad news, it fails. But, we will fix it quickly.
Havind said that,  there is another question: what if the directory 
defines an index name? In this case, http://myserver/mydirectory/; is 
equivalent to http://myserver/mydirectory/index;. Thus, the PUT request 
intends to create (or update if it exists) the index resource... What do 
think about this behaviour?


Lastly, if you make a PUT to a resource with parent directories that do 
not exist yet, they are all created (this is the current behaviour).


best regards,
Thierry Boileau

Hi,

Is there a simple way of letting a client create directory resource?  
I'm not clear as how that maps to HTTP and REST.
But is there a way to get the Directory Finder to do that?  
Or am I not looking at the problem from the 
wrong end.


Thanks,

Meb






  


Re: Support for log4j?

2008-07-25 Thread Aaron Crow

Hi Evgeny,

I think you may be asking the wrong question, or I'm misunderstanding what 
you're asking for. I use a very vanilla log4j configuration, and there is 
good documentation all over the web. First, the official log4j documentation 
is well above-average:


http://logging.apache.org/log4j/1.2/manual.html

And also, for example:

http://www.devdaily.com/blog/post/java/simple-log4j-example/
http://www.mobilefish.com/developer/log4j/log4j_quickguide_examples.html

Please let me know if you had a more specific question, and my apologies if 
I misunderstood your question...


Best wishes,
Aaron


Evgeny Shepelyuk [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]

Hello Aaron.
Thnx for examples
One small note. I will be very appreciated if u also post ur log4j config.
For access logs only :)

24.07.08 в 19:36 Aaron Crow в своём письме писал(а):


Hi Evgeny,

Sure, I will. First though, I'd like to say that I don't consider it the 
ideal solution. In my case I just want the Restlet's access logs, and if 
I can emulate those myself with my own logging statements, I'll be 
happier. That being said, here's what I did to redirect Restlet's JDK 
logging to slf4j and then log4j:


1) Read http://www.slf4j.org/legacy.html

2) Added the following to my pom (**verbosity warning!**):

dependency
groupIdorg.slf4j/groupId
artifactIdslf4j-api/artifactId
version1.4.3/version
exclusions
  !-- needed to avoid endless recursion, per:
   http://www.slf4j.org/legacy.html
  --
  exclusion
groupIdorg.slf4j/groupId
artifactIdslf4j-jdk14/artifactId
  /exclusion
/exclusions
/dependency
dependency
groupIdorg.slf4j/groupId
artifactIdslf4j-log4j12/artifactId
version1.5.2/version
/dependency
dependency
groupIdorg.slf4j/groupId
artifactIdjul-to-slf4j/artifactId
version1.5.2/version
/dependency
dependency
  groupIdlog4j/groupId
  artifactIdlog4j/artifactId
  version1.2.12/version
/dependency

3) Added the following to my app's main method:
  // needs: import org.slf4j.bridge.SLF4JBridgeHandler;
  SLF4JBridgeHandler.install();

I then did what you normally do to configure log4j, and saw restlet's 
logging go to the targets I configured in my log4j.properties file. I do 
see the formatting is a little awkward, but at least it's down to one 
line. (I never made my peace w/jul's forced multi-line logging ;-)



Hope this helps!
Aaron




- Original Message - From: Evgeny Shepelyuk 
[EMAIL PROTECTED]

Newsgroups: gmane.comp.java.restlet
To: discuss@restlet.tigris.org
Sent: Thursday, July 24, 2008 12:19 AM
Subject: Re: Support for log4j?



Hello Aaron !
Would u be so kind to share how u set up slf4j to be used as a bridge 
from restlet to log4j ?


-- Best Regards
Evgeny K. Shepelyuk


Evgeny Shepelyuk [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]

Hello Aaron !
Would u be so kind to share how u set up slf4j to be used as a bridge 
from restlet to log4j ?


-- Best Regards
Evgeny K. Shepelyuk










--
Best Regards
Evgeny K. Shepelyuk







Re: Support for log4j?

2008-07-25 Thread Aaron Crow
Thanks for this Jerome. The wiki link is great info, it was my mistake for 
not finding that earlier. Thanks!


Aaron



Jerome Louvel [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]


Hi Aron,

Note that it is totally possible to make JUL display log lines on just one 
line. It's a matter of providing a custom formatter (very easy).


For NRE, we provide our own, see:
http://www.restlet.org/documentation/snapshot/nre/com/noelios/restlet/util/AccessLogFormatter.html

We also have a more detailed page on logging in our wiki, with tips for JUL 
configuration:

http://wiki.restlet.org/docs_1.1/g1/13-restlet/29-restlet/98-restlet/101-restlet.html

Best regards,
Jerome

-Message d'origine-
De : news [mailto:[EMAIL PROTECTED] De la part de Aaron Crow
Envoyé : jeudi 24 juillet 2008 18:37
À : discuss@restlet.tigris.org
Objet : Re: Support for log4j?

Hi Evgeny,

Sure, I will. First though, I'd like to say that I don't consider it the
ideal solution. In my case I just want the Restlet's access logs, and if I
can emulate those myself with my own logging statements, I'll be happier.
That being said, here's what I did to redirect Restlet's JDK logging to
slf4j and then log4j:

1) Read http://www.slf4j.org/legacy.html

2) Added the following to my pom (**verbosity warning!**):

   dependency
   groupIdorg.slf4j/groupId
   artifactIdslf4j-api/artifactId
   version1.4.3/version
   exclusions
 !-- needed to avoid endless recursion, per:
  http://www.slf4j.org/legacy.html
 --
 exclusion
   groupIdorg.slf4j/groupId
   artifactIdslf4j-jdk14/artifactId
 /exclusion
   /exclusions
   /dependency
   dependency
   groupIdorg.slf4j/groupId
   artifactIdslf4j-log4j12/artifactId
   version1.5.2/version
   /dependency
   dependency
   groupIdorg.slf4j/groupId
   artifactIdjul-to-slf4j/artifactId
   version1.5.2/version
   /dependency
   dependency
 groupIdlog4j/groupId
 artifactIdlog4j/artifactId
 version1.2.12/version
   /dependency

3) Added the following to my app's main method:
 // needs: import org.slf4j.bridge.SLF4JBridgeHandler;
 SLF4JBridgeHandler.install();

I then did what you normally do to configure log4j, and saw restlet's
logging go to the targets I configured in my log4j.properties file. I do see
the formatting is a little awkward, but at least it's down to one line. (I
never made my peace w/jul's forced multi-line logging ;-)


Hope this helps!
Aaron




- Original Message - 
From: Evgeny Shepelyuk [EMAIL PROTECTED]

Newsgroups: gmane.comp.java.restlet
To: discuss@restlet.tigris.org
Sent: Thursday, July 24, 2008 12:19 AM
Subject: Re: Support for log4j?



Hello Aaron !
Would u be so kind to share how u set up slf4j to be used as a bridge from
restlet to log4j ?

--
Best Regards
Evgeny K. Shepelyuk



Evgeny Shepelyuk [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

Hello Aaron !
Would u be so kind to share how u set up slf4j to be used as a bridge from
restlet to log4j ?

--
Best Regards
Evgeny K. Shepelyuk









Re: Creating directory resources

2008-07-25 Thread Duong BaTien
Hi:
 I am a starter and wish to use Restlet at both server, and client side
with GWT. I have 2 questions and hope some one can point me to the right
direction:

1) About Directory Restlet, i am able to create a directory of GWT
compiled modular output such as http://server.com/wikiweb/ in a Restlet
Application that is started by a main component to connect the web
server and client file protocol. The wikiweb is GWT compiled module with
index.html as the entry point. Without the file protocol, the Restlet
Application that activating through
com.noelios.restlet.ext.servlet.ServerServlet does not work. How can i
make it work through an outside servlet engine such as Tomcat or
GlassFish v3?

2) I saw some activities in Restlet GWT ext at the client side. I want
to put my hand in it for whatever available time. What is the best way
to start and if there is any documentation especially the roadmap and
what one can expect soon?

Thanks for the good works.

BaTien
DBGROUPS and BudhNet


On Fri, 2008-07-25 at 18:44 +0200, Thierry Boileau wrote:
 Hello Marc-Elian,
 
 The Directory Restlet supports the creation of resources via a PUT 
 request. This leads to wonder: is it possible to make a PUT on a 
 directory with an empty representation (i.e. what is the representation 
 of directory?)? Well, as we decided to forbid such request, the first 
 answer could be : no it is not possible.
 But, as far as I can see in the code, It seems that a PUT to such URI 
 http://myserver/mydirectory/; with a *trailing /*  was designed to be 
 allowed. In this case, the entity is totaly ignored.
 Bad news, it fails. But, we will fix it quickly.
 Havind said that,  there is another question: what if the directory 
 defines an index name? In this case, http://myserver/mydirectory/; is 
 equivalent to http://myserver/mydirectory/index;. Thus, the PUT request 
 intends to create (or update if it exists) the index resource... What do 
 think about this behaviour?
 
 Lastly, if you make a PUT to a resource with parent directories that do 
 not exist yet, they are all created (this is the current behaviour).
 
 best regards,
 Thierry Boileau
  Hi,
 
  Is there a simple way of letting a client create directory resource?  
  I'm not clear as how that maps to HTTP and REST.
  But is there a way to get the Directory Finder to do that?  
  Or am I not looking at the problem from the 
  wrong end.
 
  Thanks,
 
  Meb
 
 
 
 
 
 




Re: Creating directory resources

2008-07-25 Thread Rob Heittman
Hi BaTien, great timing!   Jerome just posted snapshots of the GWT Extension
(server integration) and brand-new GWT Restlet API (client integration).
The whole mix is now suitable for experimentation ... we are busily writing
unit tests, and could use more  :-)  See Jerome's blog post here:

http://blog.noelios.com/2008/07/25/restlet-ported-to-gwt/

Some new Wiki content about it is here:

http://wiki.restlet.org/docs_1.1/g1/43-restlet/144-restlet.html

To add custom protocols (e.g. File protocol, HTTPClient, etc), specify a
custom component when configuring the GwtShellServletWrapper (hosted mode)
or ServerServlet (J2EE deployment):

servlet
servlet-nameadapter/servlet-name

servlet-classcom.noelios.restlet.ext.gwt.GwtShellServletWrapper/servlet-class
!-- or ServerServlet, if not GWT hosted mode --
init-param
  param-nameorg.restlet.application/param-name
  param-valueyour.Application/param-value
/init-param
init-param
  param-nameorg.restlet.component/param-name
  param-valueyour.Component/param-value
/init-param
init-param
  param-namemodule/param-name
  param-valueyour.Module/param-value
/init-param
/servlet

In your custom Component constructor or another convenient place:

getClients().add(Protocol.FILE);

I should caveat: you must be using a Restlet 1.1 milestone or snapshot to
get the ability to set a custom Component.  But you should be using a
Restlet 1.1 snapshot anyway  :-)

- Rob


Re: Creating directory resources

2008-07-25 Thread Duong BaTien
Wow. It is right time for Restlet-GWT and i will definitely have my hand
wet. Thanks.

1) The discussion in wiki 144-restlet.html may be more complete with
suggested best practice for Restlet-GWT client - Gears - Restlet
server, and how Restlet-GWT handle GWT standard pages such as
http://budhnet.com/index.html#Home, index.html#About where index.html is
the entry point of GWT module. Under Restlet Directory it will become
http://budhnet.com/wikiweb/#Home and http://budhnet.com/wikiweb/#About 

2) Back to Restlet Directory, the above URIs are what i can do using
Restlet server component and main entry point to start the Restlet
Application with FILE client protocol.

I follow the instruction for under web.xml

context-param
  param-nameorg.restlet.application/param-name
  param-valuecom.dbgroups.psi.privacy.Psi/param-value
/context-param
context-param
   param-nameorg.restlet.clients/param-name
   param-valueFILE/param-value
/context-param

servlet
  servlet-nameRestletServlet/servlet-name
  servlet-class
com.noelios.restlet.ext.servlet.ServerServlet
  /servlet-class
/servlet

 servlet-mapping
  servlet-nameRestletServlet/servlet-name
  url-pattern/*/url-pattern
/servlet-mapping

Other URIs  under router attach are working as expected, except the
directory attached. The same directory structures work under Restlet
component server. According to the attached log, the file absolute paths
are right. /wikiweb/ and /budhnet/ are directory targets to GWT mudule
with index.html are entry points. Env: jdk1.6 (U3), tomcat 6.0.14, linux
CentOS (clone of RedHat enterprise).

FINE: New base URI: http://localhost:8080 - This REST URI works
Jul 25, 2008 9:07:55 PM org.restlet.Route beforeHandle
FINE: New remaining part: /
Jul 25, 2008 9:07:55 PM org.restlet.Route beforeHandle
FINE: Delegating the call to the target Restlet
Jul 25, 2008 9:07:56 PM com.noelios.restlet.LogFilter afterHandle
INFO: 2008-07-2521:07:56127.0.0.1   -   127.0.0.1   
8080GET /   -   200 349 -
131 http://localhost:8080   Mozilla/5.0 (X11; U; Linux i686; en-US;
rv:1.8.0.12) Gecko/20080327 CentOS/1.5.0.12-0.14.el4.centos
Firefox/1.5.0.12 pango-text -
-
Jul 25, 2008 9:08:15 PM org.restlet.Route beforeHandle
FINE: New base URI: http://localhost:8080/wikiweb/ - This is pointed to
a file directory. It works under Restlet component server but not under
tomcat
Jul 25, 2008 9:08:15 PM org.restlet.Route beforeHandle
FINE: New remaining part: 
Jul 25, 2008 9:08:15 PM org.restlet.Route beforeHandle
FINE: Delegating the call to the target Restlet
Jul 25, 2008 9:08:15 PM
com.noelios.restlet.application.ApplicationClientDispatcher doHandle
FINE: The protocol used by this request is not declared in the
application's connector service. Please update the list of client
connectors used by your application and restart it.
Jul 25, 2008 9:08:15 PM
com.noelios.restlet.application.ApplicationClientDispatcher doHandle
FINE: The protocol used by this request is not declared in the
application's connector service. Please update the list of client
connectors used by your application and restart it.
Jul 25, 2008 9:08:15 PM
com.noelios.restlet.application.ApplicationClientDispatcher doHandle
FINE: The protocol used by this request is not declared in the
application's connector service. Please update the list of client
connectors used by your application and restart it.
Jul 25, 2008 9:08:15 PM com.noelios.restlet.local.DirectoryResource
getVariants
INFO: Getting variants for :
file:///data/PSI/psi/target/psi-08/wikiweb/index
Jul 25, 2008 9:08:15 PM com.noelios.restlet.local.DirectoryResource
init
INFO: Converted target URI:
file:///data/PSI/psi/target/psi-08/wikiweb/index - The absolute file
directory is correct

Jul 25, 2008 9:08:15 PM com.noelios.restlet.local.DirectoryResource
init
INFO: Converted base name : index
Jul 25, 2008 9:08:15 PM com.noelios.restlet.LogFilter afterHandle
INFO: 2008-07-2521:08:15127.0.0.1   -   127.0.0.1   
8080GET /wikiweb/   -   404
330 -   230 http://localhost:8080   Mozilla/5.0 (X11; U; Linux 
i686; en-US;
rv:1.8.0.12) Gecko/20080327 CentOS/1.5.0.12-0.14.el4.centos
Firefox/1.5.0.12 pango-text -
Jul 25, 2008 9:10:13 PM org.restlet.Route beforeHandle
FINE: New base URI: http://localhost:8080/budhnet/ - Here is another
directory to GWT compiled module
Jul 25, 2008 9:10:13 PM org.restlet.Route beforeHandle
FINE: New remaining part: 
Jul 25, 2008 9:10:13 PM org.restlet.Route beforeHandle
FINE: Delegating the call to the target Restlet
Jul 25, 2008 9:10:13 PM
com.noelios.restlet.application.ApplicationClientDispatcher doHandle
FINE: The protocol used by this request is not declared in the
application's connector service. Please update the list of client
connectors used by your application and restart it.
Jul 25, 2008 9:10:13 PM