Contentlet Null Category

31 views
Skip to first unread message

Jay Hodges

unread,
Nov 12, 2013, 11:41:58 AM11/12/13
to dot...@googlegroups.com
OSGI, using contentlet.getStringProperty(categoryVariableName) and it always comes back null, even when there should be data in the field.

Any ideas of what I am missing?

Thanks,
Jay

Jason Tesser

unread,
Nov 12, 2013, 11:44:07 AM11/12/13
to dot...@googlegroups.com
that is not how you load categories for content
use the catAPI


--
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.
To post to this group, send email to dot...@googlegroups.com.
Visit this group at http://groups.google.com/group/dotcms.
For more options, visit https://groups.google.com/groups/opt_out.

Jay Hodges

unread,
Nov 12, 2013, 12:13:25 PM11/12/13
to dot...@googlegroups.com
Well, I am confused because this is how it being done for the rest api in the source code, for pulling the names of categories prior to using the category api to find them.

Thanks,
Jay

Jason Tesser

unread,
Nov 12, 2013, 12:20:52 PM11/12/13
to dot...@googlegroups.com
Right under the covers it calls the catAPI. I was trying to get you closer and eleminate something else happening. Maybe category permissions. That is possible 
--

Jay Hodges

unread,
Nov 12, 2013, 12:32:41 PM11/12/13
to dot...@googlegroups.com
Thanks Jason, the trouble I am running into is the contentlet is available (workflow) from processor.getContentlet() , all the other fields are populated, and my background is using the webapi where the categories come out as a comma delimited list, then the category api is used to look them up and add them to the list of categories when a new contentlet is saved.  I can't seem to get past step 1, the list of comma delimited and selected categories in the first contentlet.

Jay
--
Thanks,
Jay

Jason Tesser

unread,
Nov 12, 2013, 1:15:27 PM11/12/13
to dot...@googlegroups.com
ok the if I understand where you are at the coma separated is the Category Inodes. You need to pull them from the CategoryAPI as I mentioned

On Tue, Nov 12, 2013 at 12:32 PM, Jay Hodges <j...@backalley.net> wrote:
all the other fields are populated, and my background is using the webapi where the categories come out as a comma delimited list, then the category api is used to look them up and add them to



Thanks,
Jason S. Tesser
Director, Product Development, Lead Engineer  
dotcms, Inc.
T: 305.858.1422 x7003
http://twitter.com/dotCMS
www.dotcms.com

Jay Hodges

unread,
Nov 12, 2013, 2:31:02 PM11/12/13
to dot...@googlegroups.com
Okay, I get a NoClassDefFoundError on the CategoryAPI, but not the others (UserAPI, ContentletAPI).

This error is during run-time only, not compile time.  This seems odd because the java class paths should be the same.

Thanks,
Jay



--
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.
To post to this group, send email to dot...@googlegroups.com.
Visit this group at http://groups.google.com/group/dotcms.
For more options, visit https://groups.google.com/groups/opt_out.



--
Thanks,
Jay

Jason Tesser

unread,
Nov 12, 2013, 2:33:39 PM11/12/13
to dot...@googlegroups.com
that is because it is probably not in the Exported Extra Packages for dotcms.  You can add them in the UI of the OSGi Manager. 

Jay Hodges

unread,
Nov 12, 2013, 2:50:27 PM11/12/13
to dot...@googlegroups.com
Thank you Jason!
Jay

Jason Tesser

unread,
Nov 12, 2013, 2:54:44 PM11/12/13
to dot...@googlegroups.com
also remember that once you add it there you also need to import it in the Manifest of your OSGi Bundle to use it in a Java Class

Thanks,
Jason S. Tesser
Director, Product Development, Lead Engineer  
dotcms, Inc.
T: 305.858.1422 x7003
http://twitter.com/dotCMS
www.dotcms.com


Jay Hodges

unread,
Nov 12, 2013, 3:42:31 PM11/12/13
to dot...@googlegroups.com
So, using the Category API, I can use getParents, but it only returns 2 out of 3 categories in one field, and zero of one categories in the second field.  In the first field, the missing category is that the same level as the two displaying.

In the second field, any categories returned are siblings in a different category.

Any suggestions for hunting down these missing categories in the contentlet?

Thanks,
Jay

Jason Tesser

unread,
Nov 12, 2013, 3:49:40 PM11/12/13
to dot...@googlegroups.com
not without being in you data. This is something the help desk could help with

My suggestion is to checkout your permissions and such 

Jay Hodges

unread,
Nov 15, 2013, 12:11:44 PM11/15/13
to dot...@googlegroups.com
Thank you for pointing me in the right direction Jason, it turns out the events not being included were marked not active, so by changing the getParents call to include them , they all starting coming up.



On Tuesday, November 12, 2013 10:41:58 AM UTC-6, Jay Hodges wrote:

Jason Tesser

unread,
Nov 15, 2013, 12:12:45 PM11/15/13
to dot...@googlegroups.com
well there you go :-) 


--

KaRtHiK sHyAm

unread,
Aug 23, 2017, 10:01:44 AM8/23/17
to dotCMS User Group
Hi Jay 

i'm also trying to get selected category names through plugin. but it rendering null values. 

Did you find any solution for this? 

if yes, please guide me to render the selected category values.

Thank you
Karthik
Reply all
Reply to author
Forward
0 new messages