Hi Felix,
        Thanks for response.

        When I use the remote repository to get the session it is giving
RemoteSession, and the remoteSession doesn't have any method to get the
ValueFactory.

Thanks,
Anil k.

-----Original Message-----
From: Felix Meschberger [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 23, 2008 1:58 PM
To: [email protected]
Subject: Re: Remote Repository and InputStream

Hi Anil,

You get the ValueFactory from the session: Session.getValueFactory().
But you may also set the property using the InputStream directly using
Node.setProperty(String name, InputStream stream).

Regards
Felix

Am Mittwoch, den 23.01.2008, 10:10 +0530 schrieb Anil K. Kotha:
> Hi All,
> 
>                 I am using JackRabbit with Jboss server. Now I would
> like to save the Inputstream to the Repository.
> 
>  
> 
>                 I am getting RemoteRepository by using the following
> code.
> 
>  
> 
>                 Hashtable<String, String> env = new Hashtable<String,
> String>();
> 
>       env.put(Context.INITIAL_CONTEXT_FACTORY,
> 
>  
>
"org.apache.jackrabbit.core.jndi.provider.DummyInitialContextFactory");
> 
>       env.put(Context.PROVIDER_URL, "localhost:1099");
> 
>  
>
env.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");
> 
>       InitialContext ctx;
> 
>       RemoteSession session = null;
> 
>  
> 
>       try {
> 
>             ctx = new InitialContext(env);
> 
>             RemoteRepository repository = (RemoteRepository) ctx
> 
>                         .lookup("jnp://localhost:1099/jcrServer");
> 
>             session = repository.login();
> 
>             System.out.println("Logged in successfully");
> 
>             
> 
>       } catch (NamingException e) {
> 
>             e.printStackTrace();
> 
>       } catch (RemoteException e) {
> 
>             e.printStackTrace();
> 
>       } catch (RepositoryException e) {
> 
>             e.printStackTrace();
> 
>       }
> 
>  
> 
> 
> 
>                 Now the problem is I am not able to save the input
> stream to the RemoteNode.
> 
>  
> 
>                 The RemoteNode has the method setProperty(String
> name,Value value);
> 
>                 Here I am not able to instantiate the Value object,as
of
> my knowledge we can get the Value object from ValueFactory but I am
not
> able to get the ValueFactory from RemoteRepository.
> 
>  
> 
>                 Please help me to solve this.
> 
>  
> 
>                 Thanks in Advance for your help.
> 
>  
> 
> 
> 
> Anil K.
> 

Reply via email to