adding a generic "node" document

18 views
Skip to first unread message

Lukas Kahwe Smith

unread,
Jul 11, 2011, 2:24:58 PM7/11/11
to symfony-...@googlegroups.com
Hi,

I find myself frequently needing nodes for structuring purposes for which I dont really need a document aside from the fact that it would make some things easier, like being able to access children.

For example structuring articles by date:

/2011/07/11/foo
/2011/07/11/bar

It could be convenient to just fetch "/2011/07/11" and get all the child nodes via PHPCR ODM

For this purpose I found myself implementing a "Subnode" Document in my code, but I wonder if we shouldnt ship such a Document with PHPCR ODM and optionally "cast" any node that wasn't requested with a specific document name and also didnt have a document name stored to this type?

regards,
Lukas Kahwe Smith
m...@pooteeweet.org

David Buchmann

unread,
Jul 14, 2011, 1:12:22 PM7/14/11
to symfony-...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

+1

- --
Liip AG // Agile Web Development // T +41 26 422 25 11
CH-1700 Fribourg // PGP 0xA581808B // www.liip.ch
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk4fI20ACgkQqBnXnqWBgIsx0QCbBUKpa2+TjlCKY8y5C6G54AwB
DzcAn001HOgTwCQ8OQqUMfTCgs3ArI6o
=Ziu3
-----END PGP SIGNATURE-----

Uwe Jäger

unread,
Jul 14, 2011, 3:03:29 PM7/14/11
to symfony-...@googlegroups.com
Hi,

while for your use case you could use the already existing "Folder"
document, this makes sense for me too as this will allow the odm to
read any nodes ... so
+1

Ciao
Uwe

2011/7/11 Lukas Kahwe Smith <m...@pooteeweet.org>:

Lukas Kahwe Smith

unread,
Jul 19, 2011, 9:53:32 AM7/19/11
to symfony-...@googlegroups.com

On 14.07.2011, at 21:03, Uwe Jäger wrote:

> Hi,
>
> while for your use case you could use the already existing "Folder"
> document, this makes sense for me too as this will allow the odm to
> read any nodes ... so
> +1


yeah .. i guess we should then also call the document "Folder".

Uwe Jäger

unread,
Jul 19, 2011, 10:07:17 AM7/19/11
to symfony-...@googlegroups.com
Hi,

well, no, Folder has a jcr node type nt:folder ...


Kind regards
Uwe

2011/7/19 Lukas Kahwe Smith <m...@pooteeweet.org>:

Lukas Kahwe Smith

unread,
Jul 19, 2011, 10:10:04 AM7/19/11
to symfony-...@googlegroups.com

On 19.07.2011, at 16:07, Uwe Jäger wrote:

> Hi,
>
> well, no, Folder has a jcr node type nt:folder ...
>
>
> Kind regards
> Uwe
>
> 2011/7/19 Lukas Kahwe Smith <m...@pooteeweet.org>:
>>
>> On 14.07.2011, at 21:03, Uwe Jäger wrote:
>>
>>> Hi,
>>>
>>> while for your use case you could use the already existing "Folder"
>>> document, this makes sense for me too as this will allow the odm to
>>> read any nodes ... so
>>> +1
>>
>>
>> yeah .. i guess we should then also call the document "Folder".

err .. got confused there. so there already is a Folder document, so there is nothing to add?

regards,
Lukas Kahwe Smith
sm...@pooteeweet.org

David Buchmann

unread,
Jul 19, 2011, 10:36:41 AM7/19/11
to symfony-...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

there is a Folder document that maps the nt:folder node type, which is a
special type that can only contain nt:resource nodes (or nt:file?).

the generic document would map any jcr node type. but essentually have
the same functionality: mapping the child nodes.

cheers,david

Am 19.07.2011 16:10, schrieb Lukas Kahwe Smith:


>
> On 19.07.2011, at 16:07, Uwe J�ger wrote:
>
>> Hi,
>>
>> well, no, Folder has a jcr node type nt:folder ...
>>
>>
>> Kind regards
>> Uwe
>>
>> 2011/7/19 Lukas Kahwe Smith <m...@pooteeweet.org>:
>>>

>>> On 14.07.2011, at 21:03, Uwe J�ger wrote:
>>>
>>>> Hi,
>>>>
>>>> while for your use case you could use the already existing "Folder"
>>>> document, this makes sense for me too as this will allow the odm to
>>>> read any nodes ... so
>>>> +1
>>>
>>>
>>> yeah .. i guess we should then also call the document "Folder".
>
> err .. got confused there. so there already is a Folder document, so there is nothing to add?
>
> regards,
> Lukas Kahwe Smith
> sm...@pooteeweet.org
>
>
>

- --

Liip AG // Agile Web Development // T +41 26 422 25 11
CH-1700 Fribourg // PGP 0xA581808B // www.liip.ch
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk4llnkACgkQqBnXnqWBgIsQhwCghaeyDIdswsRzmfFSobTLdlif
RBwAn1i4TF8fPjj2oe0vj4UIC5GXn7ZU
=2MdJ
-----END PGP SIGNATURE-----

David Buchmann

unread,
Oct 22, 2011, 9:16:16 AM10/22/11
to symfony-...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

bumping this old thread: there is now one for this, which is used if no
mapping is found instead of throwing an exception. it just maps parent
and children.

see https://github.com/doctrine/phpcr-odm/pull/66

cheers,
david

iEYEARECAAYFAk6iwhwACgkQqBnXnqWBgIsoGQCgrWnPaUfjR09oG/QzcRA4VSfO
Cb0An3GUqfCnaWCXClmpadyexJQtx3Es
=Guhv
-----END PGP SIGNATURE-----

Reply all
Reply to author
Forward
0 new messages