Ok,
first off, thanks to everyone that has contributed to my posts, they have helped
alot... in general the list has been invaluable to getting anything up and running...
I think I have a decent grasp of things and this is my final major intake hurdle...
I have a multiple select list that ultimately will be used to fill a cross reference
table called "resource_language" describing a many-to-many relationship between the
tables "resource" and "language."
I have set in my intake.xml the field mapping to the langaugeId's as
"multiValued=true" per another post... now in my java, I try to grab the values from
my multiselect list and do something useful with them. There are a couple posts that
say something along the lines of being able to map directly to a string array - but
this isn't working. I have looked at the javadoc for intake.model.Field and I don't
see anything that supports multiValue except for the isMultiValued() method. So my
question is, how do I correctly get all my values from the multiple select list into a
useable form (like an array I can loop through or something) using intake?
Ultimately, I would like to know how I would populate the resource_language table with
the information I gather here, but maybe I can figure that out once I get something
from my multiple select list. I have been thinking about this and it seems somewhat
tricky to get the resourceId, the languageId (from the select list) and then shove all
that into a table correctly. Well, if anyone has the answer to the first part of my
post that would be great. I have pasted in some relevant code that I have and what
the output is... like this line:
logger.debug("RESOURCE LANGUAGE GROUP = " +
resourceLanguageGroup.get("LanguageId").toString());
prints out something like this in my log file:
RESOURCE LANGUAGE GROUP = [Ljava.lang.String;@54d493
if LanguageId is a String and
RESOURCE LANGUAGE GROUP = [EMAIL PROTECTED]
if LanguageId is an int (in my intake.xml)
here is the intake.xml line that defines my field
<field name="LanguageId" key="languageIdKey" type="String" mapToProperty="Languageid"
multiValued="true"></field>
Since I am trying to save id numbers, I would love it if someone suggested a way I
could directly do it with type="int" since I would just have to change the String to
an int anyways...
Thank again to everyone for the past help :)
Luke Majewski