Hi all,
I have a component in which will be used to set custom Metadata tags using a String Datum which will be replicatable. This component has a Java external which needs to access one to many of these metadata values due to the datum being replicatable.
[HTML]
<meta property="test" content="test" />
<meta property="test2" content="test2" />
com.mycomponents.Header
doMetaHeader
[/HTML]
In the Java external I need to put these values into the Page scope to be inserted into the generated HTML HEAD section of the .page files that this component will be placed on.
public class Header {
public Document doMetaHeader(RequestContext
context)
{
ArrayList selectedProperties = (ArrayList) context.getParameters().get("Meta");
printArray(selectedProperties, context);
return null;
}
public void printArray(ArrayList selectedProperties, RequestContext context){
String selectedValues = "";
Iterator propertiesIterator = selectedProperties.iterator();
while (propertiesIterator.hasNext())
{
selectedValues += propertiesIterator.next();
}
context.getPageScopeData().put(RuntimePage.PAGESCOPE_HEAD_INJECTION, selectedValues);
}
}
I can only get this to work when using a single Datum and context.getParameterString("Meta"). Could anyone tell me where I am going wrong when using Replicatable Datums please?
Thanks & Regards,
Adrian.