Sign in

E-mail *, (xx@domain.com)
Password *

Register | Forgot password

test

The "WCB: Java development" forum contains threads on issues that are related to Java while programming a WCB (WebManager Component Bundle). If you have questions that have impact on Java code, post them in this forum. Some example topics: authorization, the different component types, setting up component dependencies, data access, and so forth.

Answered
Not marked as answered yet

Forums  >  WCB: Java development  >  test


Author test
ronaldz


Posts: 11

Posted: 28-06-2010 10:45

First of all: I'm sorry for the confusing title, but this forum seems to give me a very hard time when creating topics (already reported this...)

Hi all,

I'd like to know if there is a proper way to add a link to an article using the GX Content API. So far
I've found the LinkManagementService which seems to be the class that can help me out with this. Unfortunately, I've had
no success with it. The API describes that the createRelatedExternalLink method on this class is 'deprecated' and has been replaced
by the 'createRelatedLink' method. However, as I'm stuck with GX 9.11.2 for this specific project, it seems I'll have to
use the deprecated method as the new one doesn't seem to be included in this version of WM.

So, I'm doing this:

RelatedExternalLink link = linkManagement . createRelatedExternalLink(mv.getElementHolder(), url);

java. lang. reflect. InvocationTargetException
Caused by: java. lang . UnsupportedOperationException: Invalid elementholder

The name of the error worries me: if this operation is not supported by the platform I'll have serious problem in
the wish of importing articles with links included..

Does anyone know how to create a related link through the contentapi in WM 9.11.2? Or can anyone tell me if the newer
version of WM (9.12.x) does provide proper methods to create a link through the GX Content API?

Thanks!

PeterK



Posts: 9

Posted: 05-07-2010 13:04

The createRelatedExternalLink method throws an UnsupportedOperationException if the elementHolder isn't an instance of MediaItemArticleVersion (or PageModel or PageVersion).
It seems that your "mv" object doesn't meet this requirement.

Back to top

New message: "test"
Message:
bold boitalicd underline url quote code smile cool eek grin mad razz sad wink
 
© 2012 GX Software B.V.

Disclaimer

This website (Connect.gxsoftware.com) may discuss or contain opinions, (sample) coding, software or other information that does not include GX official interfaces, instructions or guidelines and therefore is not supported by GX. Changes made based on this information are not supported.  GX will not be held liable for any damages caused by using or misusing the information, software, instructions, code or methods suggested on this website, and anyone using these methods does so at his/her own risk. GX offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this website, including any liability resulting from incompatibility between the content of this website and the materials and services offered by GX. By using this website you will not hold, or seek to hold, GX responsible or liable with respect to the content of this website.