Document Links

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Document Links

jovche.mitrejchevski
Hello Guys,

I have a configuration document that contains inside a hippo:mirror field. I want to link another document type inside. That is fine, I am selecting another type of document, but inside the bean where I`m getting the properties, all the properties are fine instead of the hippo:mirror.

For example, my path in the configuration is: "linkeddocument"

Now in the bean I`m doing like this:
String s = getProperty("linkeddocument");

The string prints some strange data, but not the path of the document that I`m linking
(for example: /content/myapp/so/on/document).

Is it possible to get the linked bean, or at least the path where the document is?

Thank you!
Reply | Threaded
Open this post in threaded view
|

Re: Document Links

William Borg Barthet
Hi Jovche,

in the bean you should be able to call a method getLinkedBean("yourprojectnamespace:linkeddocument"); That will return the bean that is pointed to by the hippo:mirror, rather than the hippo:mirror itself. I hope that helps you solve your problem.


William


On 7 February 2013 12:47, jovche.mitrejchevski <[hidden email]> wrote:
Hello Guys,

I have a configuration document that contains inside a hippo:mirror field. I
want to link another document type inside. That is fine, I am selecting
another type of document, but inside the bean where I`m getting the
properties, all the properties are fine instead of the hippo:mirror.

For example, my path in the configuration is: "linkeddocument"

Now in the bean I`m doing like this:
String s = getProperty("linkeddocument");

The string prints some strange data, but not the path of the document that
I`m linking
(for example: /content/myapp/so/on/document).

Is it possible to get the linked bean, or at least the path where the
document is?

Thank you!



--
View this message in context: http://hippo.2275632.n2.nabble.com/Document-Links-tp7580371.html
Sent from the Hippo CMS 7 mailing list archive at Nabble.com.
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html



--
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
Boston - 1 Broadway, Cambridge, MA 02142

US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
www.onehippo.com

_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html
Reply | Threaded
Open this post in threaded view
|

Re: Document Links

Bert Leunis
Your bean should extend org.hippoecm.hst.content.beans.standard.HippoDocument, that extends HippoItem. Then you can use all of these kind of handy methods like getChildBean(), getHippoHtml(), etc etc.

With kind regards/Met vriendelijke groet,
Bert Leunis

Amsterdam - Oosteinde 11, 1017 WT Amsterdam
Boston - 1 Broadway, Cambridge, MA 02142

US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
www.onehippo.com


On Thu, Feb 7, 2013 at 12:55 PM, William Borg Barthet <[hidden email]> wrote:
Hi Jovche,

in the bean you should be able to call a method getLinkedBean("yourprojectnamespace:linkeddocument"); That will return the bean that is pointed to by the hippo:mirror, rather than the hippo:mirror itself. I hope that helps you solve your problem.


William


On 7 February 2013 12:47, jovche.mitrejchevski <[hidden email]> wrote:
Hello Guys,

I have a configuration document that contains inside a hippo:mirror field. I
want to link another document type inside. That is fine, I am selecting
another type of document, but inside the bean where I`m getting the
properties, all the properties are fine instead of the hippo:mirror.

For example, my path in the configuration is: "linkeddocument"

Now in the bean I`m doing like this:
String s = getProperty("linkeddocument");

The string prints some strange data, but not the path of the document that
I`m linking
(for example: /content/myapp/so/on/document).

Is it possible to get the linked bean, or at least the path where the
document is?

Thank you!



--
View this message in context: http://hippo.2275632.n2.nabble.com/Document-Links-tp7580371.html
Sent from the Hippo CMS 7 mailing list archive at Nabble.com.
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html



--
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
Boston - 1 Broadway, Cambridge, MA 02142

US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
www.onehippo.com

_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html


_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html
Reply | Threaded
Open this post in threaded view
|

Re: Document Links

Laurens Leeuwis
In reply to this post by jovche.mitrejchevski
you can use getLinkedBean("path to my linked bean", MyLinkedBeanClass.class)

________________________________________
Van: [hidden email] [[hidden email]] namens jovche.mitrejchevski [[hidden email]]
Verzonden: donderdag 7 februari 2013 12:47
To: [hidden email]
Onderwerp: [Hippo-cms7-user] Document Links

Hello Guys,

I have a configuration document that contains inside a hippo:mirror field. I
want to link another document type inside. That is fine, I am selecting
another type of document, but inside the bean where I`m getting the
properties, all the properties are fine instead of the hippo:mirror.

For example, my path in the configuration is: "linkeddocument"

Now in the bean I`m doing like this:
String s = getProperty("linkeddocument");

The string prints some strange data, but not the path of the document that
I`m linking
(for example: /content/myapp/so/on/document).

Is it possible to get the linked bean, or at least the path where the
document is?

Thank you!



--
View this message in context: http://hippo.2275632.n2.nabble.com/Document-Links-tp7580371.html
Sent from the Hippo CMS 7 mailing list archive at Nabble.com.
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.

_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html
Reply | Threaded
Open this post in threaded view
|

Re: Document Links

jovche.mitrejchevski
That is the point that I dunno the path. That`s why I`m using the link.
I`ll select the document (that I want to link) and then I want to be able to get his path, or the document itself.

Also I do extend the HippoDocument. I can call the methods like:
getProperty(string);
getLinkedBean(String path, Class<T>);

 
Reply | Threaded
Open this post in threaded view
|

Re: Document Links

jovche.mitrejchevski
Seems like the method getLinkedBean("namespace:path", Class<T>); works :D

Thank you very much!!!

Regards
Reply | Threaded
Open this post in threaded view
|

Re: Document Links

William Borg Barthet
In reply to this post by jovche.mitrejchevski
Hey Jovche,

the path in this case is not the path to the docment you have linked to, but the jcr path to the childnode of that document node. Every property and child node you added to your document has a path (yourprojectnamespace:title for the title, etc). The child node you are using for the link also has this. You should be able to see what this is called by looking at the nodes in the console, you should see something like:

/
- content
- - documents
- - - example
- - - - folder
- - - - - document
- - - - - - example:linkeddocument

whatever the name of the childnode should be the path you need to pass to the getLinkedBean(s) method.

William


On 7 February 2013 13:08, jovche.mitrejchevski <[hidden email]> wrote:
That is the point that I dunno the path. That`s why I`m using the link.
I`ll select the document (that I want to link) and then I want to be able to
get his path, or the document itself.

Also I do extend the HippoDocument. I can call the methods like:
getProperty(string);
getLinkedBean(String path, Class<T>);





--
View this message in context: http://hippo.2275632.n2.nabble.com/Document-Links-tp7580371p7580375.html
Sent from the Hippo CMS 7 mailing list archive at Nabble.com.
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html



--
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
Boston - 1 Broadway, Cambridge, MA 02142

US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
www.onehippo.com

_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html
Reply | Threaded
Open this post in threaded view
|

Re: Document Links

Laurens Leeuwis
In reply to this post by jovche.mitrejchevski
the path we mentioned is the path to your 'document link'. So say your link is stored in  mynamespace:linkeddocument, then we can retrieve the linked document by using getLinkedBean("mynamespace:linkeddocument")

________________________________________
Van: [hidden email] [[hidden email]] namens jovche.mitrejchevski [[hidden email]]
Verzonden: donderdag 7 februari 2013 13:08
To: [hidden email]
Onderwerp: Re: [Hippo-cms7-user] Document Links

That is the point that I dunno the path. That`s why I`m using the link.
I`ll select the document (that I want to link) and then I want to be able to
get his path, or the document itself.

Also I do extend the HippoDocument. I can call the methods like:
getProperty(string);
getLinkedBean(String path, Class<T>);





--
View this message in context: http://hippo.2275632.n2.nabble.com/Document-Links-tp7580371p7580375.html
Sent from the Hippo CMS 7 mailing list archive at Nabble.com.
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.

_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html