You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Michael Wechner <mi...@wyona.com> on 2005/07/21 17:03:20 UTC
Resource exists within Blog
Hi
Is it possible that the following method returns false within the Blog
publication, because no node is being added when a Blog entry is being
created?
public boolean exists() {
try {
return this.node.exists();
} catch (TransactionException e) {
throw new RuntimeException(e);
}
Thanks
Michi
--
Michael Wechner
Wyona - Open Source Content Management - Apache Lenya
http://www.wyona.com http://lenya.apache.org
michael.wechner@wyona.com michi@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: Resource exists within Blog
Posted by Michael Wechner <mi...@wyona.com>.
Andreas Hartmann wrote:
> Michael Wechner wrote:
>
>> Hi
>>
>> Is it possible that the following method returns false within the Blog
>> publication, because no node is being added when a Blog entry is
>> being created?
>>
>> public boolean exists() {
>> try {
>> return this.node.exists();
>> } catch (TransactionException e) {
>> throw new RuntimeException(e);
>> }
>
>
> Actually a node should be created ...
you mean when a blog entry is being created? How can I check on this?
>
> Would you mind filing a bug with a description how to reproduce it?
sure
Michi
>
> -- Andreas
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
> For additional commands, e-mail: dev-help@lenya.apache.org
>
>
--
Michael Wechner
Wyona - Open Source Content Management - Apache Lenya
http://www.wyona.com http://lenya.apache.org
michael.wechner@wyona.com michi@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: Resource exists within Blog
Posted by Michael Wechner <mi...@wyona.com>.
Andreas Hartmann wrote:
> Michael Wechner wrote:
>
>> Hi
>>
>> Is it possible that the following method returns false within the Blog
>> publication, because no node is being added when a Blog entry is
>> being created?
>>
>> public boolean exists() {
>> try {
>> return this.node.exists();
>> } catch (TransactionException e) {
>> throw new RuntimeException(e);
>> }
>
>
> Actually a node should be created ...
>
> Would you mind filing a bug with a description how to reproduce it?
the problem was that node.exists() is coupled to the fact that there
is some data attached. I have started to implement the traversable interface
and updated the following files:
M src/java/org/apache/lenya/cms/repository/Node.java
M src/java/org/apache/lenya/cms/repository/SourceNode.java
M src/java/org/apache/lenya/cms/cocoon/source/RepositorySource.java
M src/webapp/lenya/pubs/blog/sitemap.xmap
One change to discuss and further consider is
if (source.exists() && !source.isCollection()) {
within
src/java/org/apache/lenya/cms/repository/SourceNode.java
because this seems to me rather FS specifc.
In the case of JCR every node can be a "collection" and arbitrary
properties can be attached to a node, where one property could for instance
be the content of a document. To know what property is the content one
uses nodetypes and property names.
I had to get used to this, but I have to admit that it makes a lot of sense
and it seems to me that it would be good if Lenya could reflect that.
But please don't worry, I won't sneak in JCR, but just try to finish
the lightweight "repository" layer such that it can be used generally
within Lenya.
Michi
>
> -- Andreas
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
> For additional commands, e-mail: dev-help@lenya.apache.org
>
>
--
Michael Wechner
Wyona - Open Source Content Management - Apache Lenya
http://www.wyona.com http://lenya.apache.org
michael.wechner@wyona.com michi@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: Resource exists within Blog
Posted by Andreas Hartmann <an...@apache.org>.
Michael Wechner wrote:
> Hi
>
> Is it possible that the following method returns false within the Blog
> publication, because no node is being added when a Blog entry is being
> created?
>
> public boolean exists() {
> try {
> return this.node.exists();
> } catch (TransactionException e) {
> throw new RuntimeException(e);
> }
Actually a node should be created ...
Would you mind filing a bug with a description how to reproduce it?
-- Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: Resource exists within Blog
Posted by Hubertus Groepper <hu...@groepper.com>.
Am 21.07.2005 um 17:03 schrieb Michael Wechner:
> Hi
>
> Is it possible that the following method returns false within the Blog
> publication, because no node is being added when a Blog entry is
> being created?
>
> public boolean exists() {
> try {
> return this.node.exists();
> } catch (TransactionException e) {
> throw new RuntimeException(e);
> }
>
> Thanks
>
> Michi
No idea if related (wild guess), but this was my first lenya bug
entry long long ago:
http://issues.apache.org/bugzilla/show_bug.cgi?id=29921
Basically, there is no check if a blog entry already exists, so it's
possible to overwrite existing entries without warning,
hubertus
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org