You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-user@jakarta.apache.org by Russ Leong <ru...@kikuze.com> on 2002/05/15 11:15:55 UTC
Adding folder/file to content
Hi,
The following is an extract from my domain.xml :
----------------------------------------
<definition>
<store name="memory">
<nodestore classname="slidestore.reference.JDBCDescriptorsStore">
<parameter name="driver">oracle.jdbc.driver.OracleDriver</parameter>
<parameter name="url">oracle:thin:pm2:pm2@192.168.42.8:1521:pm2</parameter>
<parameter name="user">pm2</parameter>
<parameter name="password">pm2</parameter>
</nodestore>
<securitystore>
<reference store="nodestore" />
</securitystore>
<lockstore>
<reference store="nodestore" />
</lockstore>
<revisiondescriptorsstore>
<reference store="nodestore" />
</revisiondescriptorsstore>
<revisiondescriptorstore>
<reference store="nodestore" />
</revisiondescriptorstore>
<contentstore classname="slidestore.reference.FileContentStore">
<parameter name="rootpath">C:\\project\\j2ee\\home\\filestore</parameter>
<parameter name="version">true</parameter>
</contentstore>
</store>
<scope match="/" store="memory" />
</definition>
----------------------------------------
Which I shows that I am using my local filesystem for ContentStore and the
rest goes to Oracle. Now below is the code I used to try and add a new
folder via the Slide API :
----------------------------------------
NamespaceAccessToken nat = Domain.accessNamespace(new SecurityToken(""),
"slide");
SlideToken slideToken = new SlideTokenImpl(new CredentialsToken("john"));
Structure struct = nat.getStructureHelper();
Content content = nat.getContentHelper();
nat.begin();
struct.create(slideToken, new SubjectNode(), "/slideTestFolder"); //
Create entries to the database
content.create(slideToken, "/slideTestFolder", true);
// Create the folder
nat.commit();
----------------------------------------
I noted that struct.create did create entries into the database as I
expected.
But for content.create instead of creating the folder in my filesystem, only
an entry was inserted to the database. The following row was inserted into
the table REVISIONS : URI="/slideTestFolder", ISVERSIONED="1",
INITIALREVISION="1.0".
Is my expectation of what content.create does wrong or did I miss out a
step? Since FileContentStore's rootpath was specified in my domain.xml I was
expecting the create statement to create the folder there, someone please
let me know my mistake. Thank you.
Russ
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Adding folder/file to content
Posted by charles <cp...@eself.com>.
hi
i understtod that you want to create folder
try this, and i think this will create the folder.
NamespaceAccessToken nat = Domain.accessNamespace(new SecurityToken(""),
"slide");
SlideToken slideToken = new SlideTokenImpl(new CredentialsToken("john"));
Structure struct = nat.getStructureHelper();
Content content = nat.getContentHelper();
struct.create(slideToken, new SubjectNode(), "/slideTestFolder");
NodeRevisionDescriptors revisionDescriptors = content.retrieve(slideToken,
"/slideTestFolder");
NodeRevisionDescriptor revisionDescriptor = content.retrieve(slideToken,
revisionDescriptors);
NodeRevisionContent revisionContent = content.retrieve(slideToken,
revisionDescriptors, revisionDescriptor);
content.create(slideToken, "/slideTestFolder", revisionDescriptor,
revisionContent);
charles
-----Original Message-----
From: Russ Leong [mailto:russ@kikuze.com]
Sent: Thursday, May 16, 2002 7:02 AM
To: Slide Users Mailing List
Subject: Re: Adding folder/file to content
Hi,
as I set rootpath to "C:\\project\\j2ee\\home\\filestore" in my
FileContentStore, I wanted to create the folder so that it is
"C:\\project\\j2ee\\home\\filestore\\slideTestFolder". Please guide me to
the correct approach for this. In relation to your approach, would it apply
to creating files too? Thanks a million.
Russ
----- Original Message -----
From: "charles" <cp...@eself.com>
To: "Slide Users Mailing List" <sl...@jakarta.apache.org>
Sent: Wednesday, May 15, 2002 6:46 PM
Subject: RE: Adding folder/file to content
> Hi Russ,
>
> content.create creates the new revison descriptors for that partiular uri
> and it will never create folder.
> your approach for creating the folder is not correct.
> exactly where you want to create the folder and under which directory.
> charles
>
>
> -----Original Message-----
> From: Russ Leong [mailto:russ@kikuze.com]
> Sent: Wednesday, May 15, 2002 2:46 PM
> To: Slide Users Mailing List
> Subject: Adding folder/file to content
>
>
> Hi,
> The following is an extract from my domain.xml :
> ----------------------------------------
> <definition>
> <store name="memory">
> <nodestore classname="slidestore.reference.JDBCDescriptorsStore">
> <parameter name="driver">oracle.jdbc.driver.OracleDriver</parameter>
> <parameter
name="url">oracle:thin:pm2:pm2@192.168.42.8:1521:pm2</parameter>
> <parameter name="user">pm2</parameter>
> <parameter name="password">pm2</parameter>
> </nodestore>
> <securitystore>
> <reference store="nodestore" />
> </securitystore>
> <lockstore>
> <reference store="nodestore" />
> </lockstore>
> <revisiondescriptorsstore>
> <reference store="nodestore" />
> </revisiondescriptorsstore>
> <revisiondescriptorstore>
> <reference store="nodestore" />
> </revisiondescriptorstore>
> <contentstore classname="slidestore.reference.FileContentStore">
> <parameter name="rootpath">C:\\project\\j2ee\\home\\filestore</parameter>
> <parameter name="version">true</parameter>
> </contentstore>
> </store>
> <scope match="/" store="memory" />
> </definition>
> ----------------------------------------
>
> Which I shows that I am using my local filesystem for ContentStore and the
> rest goes to Oracle. Now below is the code I used to try and add a new
> folder via the Slide API :
> ----------------------------------------
> NamespaceAccessToken nat = Domain.accessNamespace(new SecurityToken(""),
> "slide");
> SlideToken slideToken = new SlideTokenImpl(new CredentialsToken("john"));
> Structure struct = nat.getStructureHelper();
> Content content = nat.getContentHelper();
> nat.begin();
> struct.create(slideToken, new SubjectNode(), "/slideTestFolder"); //
> Create entries to the database
> content.create(slideToken, "/slideTestFolder", true);
> // Create the folder
> nat.commit();
> ----------------------------------------
>
> I noted that struct.create did create entries into the database as I
> expected.
> But for content.create instead of creating the folder in my filesystem,
only
> an entry was inserted to the database. The following row was inserted into
> the table REVISIONS : URI="/slideTestFolder", ISVERSIONED="1",
> INITIALREVISION="1.0".
>
> Is my expectation of what content.create does wrong or did I miss out a
> step? Since FileContentStore's rootpath was specified in my domain.xml I
was
> expecting the create statement to create the folder there, someone please
> let me know my mistake. Thank you.
>
> Russ
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Adding folder/file to content
Posted by Russ Leong <ru...@kikuze.com>.
Hi,
as I set rootpath to "C:\\project\\j2ee\\home\\filestore" in my
FileContentStore, I wanted to create the folder so that it is
"C:\\project\\j2ee\\home\\filestore\\slideTestFolder". Please guide me to
the correct approach for this. In relation to your approach, would it apply
to creating files too? Thanks a million.
Russ
----- Original Message -----
From: "charles" <cp...@eself.com>
To: "Slide Users Mailing List" <sl...@jakarta.apache.org>
Sent: Wednesday, May 15, 2002 6:46 PM
Subject: RE: Adding folder/file to content
> Hi Russ,
>
> content.create creates the new revison descriptors for that partiular uri
> and it will never create folder.
> your approach for creating the folder is not correct.
> exactly where you want to create the folder and under which directory.
> charles
>
>
> -----Original Message-----
> From: Russ Leong [mailto:russ@kikuze.com]
> Sent: Wednesday, May 15, 2002 2:46 PM
> To: Slide Users Mailing List
> Subject: Adding folder/file to content
>
>
> Hi,
> The following is an extract from my domain.xml :
> ----------------------------------------
> <definition>
> <store name="memory">
> <nodestore classname="slidestore.reference.JDBCDescriptorsStore">
> <parameter name="driver">oracle.jdbc.driver.OracleDriver</parameter>
> <parameter
name="url">oracle:thin:pm2:pm2@192.168.42.8:1521:pm2</parameter>
> <parameter name="user">pm2</parameter>
> <parameter name="password">pm2</parameter>
> </nodestore>
> <securitystore>
> <reference store="nodestore" />
> </securitystore>
> <lockstore>
> <reference store="nodestore" />
> </lockstore>
> <revisiondescriptorsstore>
> <reference store="nodestore" />
> </revisiondescriptorsstore>
> <revisiondescriptorstore>
> <reference store="nodestore" />
> </revisiondescriptorstore>
> <contentstore classname="slidestore.reference.FileContentStore">
> <parameter name="rootpath">C:\\project\\j2ee\\home\\filestore</parameter>
> <parameter name="version">true</parameter>
> </contentstore>
> </store>
> <scope match="/" store="memory" />
> </definition>
> ----------------------------------------
>
> Which I shows that I am using my local filesystem for ContentStore and the
> rest goes to Oracle. Now below is the code I used to try and add a new
> folder via the Slide API :
> ----------------------------------------
> NamespaceAccessToken nat = Domain.accessNamespace(new SecurityToken(""),
> "slide");
> SlideToken slideToken = new SlideTokenImpl(new CredentialsToken("john"));
> Structure struct = nat.getStructureHelper();
> Content content = nat.getContentHelper();
> nat.begin();
> struct.create(slideToken, new SubjectNode(), "/slideTestFolder"); //
> Create entries to the database
> content.create(slideToken, "/slideTestFolder", true);
> // Create the folder
> nat.commit();
> ----------------------------------------
>
> I noted that struct.create did create entries into the database as I
> expected.
> But for content.create instead of creating the folder in my filesystem,
only
> an entry was inserted to the database. The following row was inserted into
> the table REVISIONS : URI="/slideTestFolder", ISVERSIONED="1",
> INITIALREVISION="1.0".
>
> Is my expectation of what content.create does wrong or did I miss out a
> step? Since FileContentStore's rootpath was specified in my domain.xml I
was
> expecting the create statement to create the folder there, someone please
> let me know my mistake. Thank you.
>
> Russ
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Adding folder/file to content
Posted by charles <cp...@eself.com>.
Hi Russ,
content.create creates the new revison descriptors for that partiular uri
and it will never create folder.
your approach for creating the folder is not correct.
exactly where you want to create the folder and under which directory.
charles
-----Original Message-----
From: Russ Leong [mailto:russ@kikuze.com]
Sent: Wednesday, May 15, 2002 2:46 PM
To: Slide Users Mailing List
Subject: Adding folder/file to content
Hi,
The following is an extract from my domain.xml :
----------------------------------------
<definition>
<store name="memory">
<nodestore classname="slidestore.reference.JDBCDescriptorsStore">
<parameter name="driver">oracle.jdbc.driver.OracleDriver</parameter>
<parameter name="url">oracle:thin:pm2:pm2@192.168.42.8:1521:pm2</parameter>
<parameter name="user">pm2</parameter>
<parameter name="password">pm2</parameter>
</nodestore>
<securitystore>
<reference store="nodestore" />
</securitystore>
<lockstore>
<reference store="nodestore" />
</lockstore>
<revisiondescriptorsstore>
<reference store="nodestore" />
</revisiondescriptorsstore>
<revisiondescriptorstore>
<reference store="nodestore" />
</revisiondescriptorstore>
<contentstore classname="slidestore.reference.FileContentStore">
<parameter name="rootpath">C:\\project\\j2ee\\home\\filestore</parameter>
<parameter name="version">true</parameter>
</contentstore>
</store>
<scope match="/" store="memory" />
</definition>
----------------------------------------
Which I shows that I am using my local filesystem for ContentStore and the
rest goes to Oracle. Now below is the code I used to try and add a new
folder via the Slide API :
----------------------------------------
NamespaceAccessToken nat = Domain.accessNamespace(new SecurityToken(""),
"slide");
SlideToken slideToken = new SlideTokenImpl(new CredentialsToken("john"));
Structure struct = nat.getStructureHelper();
Content content = nat.getContentHelper();
nat.begin();
struct.create(slideToken, new SubjectNode(), "/slideTestFolder"); //
Create entries to the database
content.create(slideToken, "/slideTestFolder", true);
// Create the folder
nat.commit();
----------------------------------------
I noted that struct.create did create entries into the database as I
expected.
But for content.create instead of creating the folder in my filesystem, only
an entry was inserted to the database. The following row was inserted into
the table REVISIONS : URI="/slideTestFolder", ISVERSIONED="1",
INITIALREVISION="1.0".
Is my expectation of what content.create does wrong or did I miss out a
step? Since FileContentStore's rootpath was specified in my domain.xml I was
expecting the create statement to create the folder there, someone please
let me know my mistake. Thank you.
Russ
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>