private void processDefaultItem(Context context,
HttpServletRequest request, HttpServletResponse response,
Collection collection) throws SQLException, ServletException,
IOException, AuthorizeException
{
Item item = collection.getTemplateItem();
for (int i = 0; i < 10; i++)
{
int dcTypeID = UIUtil.getIntParameter(request, "dctype_" + i);
String value = request.getParameter("value_" + i);
String lang = request.getParameter("lang_" + i);
if ((dcTypeID != -1) && (value != null) && !value.equals(""))
{
MetadataField field = MetadataField.find(context,dcTypeID);
MetadataSchema schema = MetadataSchema.find(context,field.getSchemaID());
item.addMetadata(schema.getName(),field.getElement(), field.getQualifier(), lang, value);
}
}
item.update();
// Now work out what next page is
showNextPage(context, request, response, collection, DEFAULT_ITEM);
context.complete();