Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/Eclipse-Formatter-Profile-Clarin.xml
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/Eclipse-Formatter-Profile-Clarin.xml	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/Eclipse-Formatter-Profile-Clarin.xml	(revision 5623)
@@ -0,0 +1,269 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<profiles version="11">
+<profile kind="CodeFormatterProfile" name="Clarin" version="11">
+<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
+<setting id="org.eclipse.jdt.core.compiler.source" value="1.5"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="80"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
+<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
+<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
+<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.5"/>
+<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/>
+<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.5"/>
+<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
+</profile>
+</profiles>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/doc/LICENSE-glyphicons.txt
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/doc/LICENSE-glyphicons.txt	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/doc/LICENSE-glyphicons.txt	(revision 5623)
@@ -0,0 +1,319 @@
+Creative Commons Legal Code
+
+Attribution 3.0 Unported
+
+    CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
+    LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN
+    ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
+    INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
+    REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR
+    DAMAGES RESULTING FROM ITS USE.
+
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE
+COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY
+COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS
+AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE
+TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY
+BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS
+CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND
+CONDITIONS.
+
+1. Definitions
+
+ a. "Adaptation" means a work based upon the Work, or upon the Work and
+    other pre-existing works, such as a translation, adaptation,
+    derivative work, arrangement of music or other alterations of a
+    literary or artistic work, or phonogram or performance and includes
+    cinematographic adaptations or any other form in which the Work may be
+    recast, transformed, or adapted including in any form recognizably
+    derived from the original, except that a work that constitutes a
+    Collection will not be considered an Adaptation for the purpose of
+    this License. For the avoidance of doubt, where the Work is a musical
+    work, performance or phonogram, the synchronization of the Work in
+    timed-relation with a moving image ("synching") will be considered an
+    Adaptation for the purpose of this License.
+ b. "Collection" means a collection of literary or artistic works, such as
+    encyclopedias and anthologies, or performances, phonograms or
+    broadcasts, or other works or subject matter other than works listed
+    in Section 1(f) below, which, by reason of the selection and
+    arrangement of their contents, constitute intellectual creations, in
+    which the Work is included in its entirety in unmodified form along
+    with one or more other contributions, each constituting separate and
+    independent works in themselves, which together are assembled into a
+    collective whole. A work that constitutes a Collection will not be
+    considered an Adaptation (as defined above) for the purposes of this
+    License.
+ c. "Distribute" means to make available to the public the original and
+    copies of the Work or Adaptation, as appropriate, through sale or
+    other transfer of ownership.
+ d. "Licensor" means the individual, individuals, entity or entities that
+    offer(s) the Work under the terms of this License.
+ e. "Original Author" means, in the case of a literary or artistic work,
+    the individual, individuals, entity or entities who created the Work
+    or if no individual or entity can be identified, the publisher; and in
+    addition (i) in the case of a performance the actors, singers,
+    musicians, dancers, and other persons who act, sing, deliver, declaim,
+    play in, interpret or otherwise perform literary or artistic works or
+    expressions of folklore; (ii) in the case of a phonogram the producer
+    being the person or legal entity who first fixes the sounds of a
+    performance or other sounds; and, (iii) in the case of broadcasts, the
+    organization that transmits the broadcast.
+ f. "Work" means the literary and/or artistic work offered under the terms
+    of this License including without limitation any production in the
+    literary, scientific and artistic domain, whatever may be the mode or
+    form of its expression including digital form, such as a book,
+    pamphlet and other writing; a lecture, address, sermon or other work
+    of the same nature; a dramatic or dramatico-musical work; a
+    choreographic work or entertainment in dumb show; a musical
+    composition with or without words; a cinematographic work to which are
+    assimilated works expressed by a process analogous to cinematography;
+    a work of drawing, painting, architecture, sculpture, engraving or
+    lithography; a photographic work to which are assimilated works
+    expressed by a process analogous to photography; a work of applied
+    art; an illustration, map, plan, sketch or three-dimensional work
+    relative to geography, topography, architecture or science; a
+    performance; a broadcast; a phonogram; a compilation of data to the
+    extent it is protected as a copyrightable work; or a work performed by
+    a variety or circus performer to the extent it is not otherwise
+    considered a literary or artistic work.
+ g. "You" means an individual or entity exercising rights under this
+    License who has not previously violated the terms of this License with
+    respect to the Work, or who has received express permission from the
+    Licensor to exercise rights under this License despite a previous
+    violation.
+ h. "Publicly Perform" means to perform public recitations of the Work and
+    to communicate to the public those public recitations, by any means or
+    process, including by wire or wireless means or public digital
+    performances; to make available to the public Works in such a way that
+    members of the public may access these Works from a place and at a
+    place individually chosen by them; to perform the Work to the public
+    by any means or process and the communication to the public of the
+    performances of the Work, including by public digital performance; to
+    broadcast and rebroadcast the Work by any means including signs,
+    sounds or images.
+ i. "Reproduce" means to make copies of the Work by any means including
+    without limitation by sound or visual recordings and the right of
+    fixation and reproducing fixations of the Work, including storage of a
+    protected performance or phonogram in digital form or other electronic
+    medium.
+
+2. Fair Dealing Rights. Nothing in this License is intended to reduce,
+limit, or restrict any uses free from copyright or rights arising from
+limitations or exceptions that are provided for in connection with the
+copyright protection under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License,
+Licensor hereby grants You a worldwide, royalty-free, non-exclusive,
+perpetual (for the duration of the applicable copyright) license to
+exercise the rights in the Work as stated below:
+
+ a. to Reproduce the Work, to incorporate the Work into one or more
+    Collections, and to Reproduce the Work as incorporated in the
+    Collections;
+ b. to create and Reproduce Adaptations provided that any such Adaptation,
+    including any translation in any medium, takes reasonable steps to
+    clearly label, demarcate or otherwise identify that changes were made
+    to the original Work. For example, a translation could be marked "The
+    original work was translated from English to Spanish," or a
+    modification could indicate "The original work has been modified.";
+ c. to Distribute and Publicly Perform the Work including as incorporated
+    in Collections; and,
+ d. to Distribute and Publicly Perform Adaptations.
+ e. For the avoidance of doubt:
+
+     i. Non-waivable Compulsory License Schemes. In those jurisdictions in
+        which the right to collect royalties through any statutory or
+        compulsory licensing scheme cannot be waived, the Licensor
+        reserves the exclusive right to collect such royalties for any
+        exercise by You of the rights granted under this License;
+    ii. Waivable Compulsory License Schemes. In those jurisdictions in
+        which the right to collect royalties through any statutory or
+        compulsory licensing scheme can be waived, the Licensor waives the
+        exclusive right to collect such royalties for any exercise by You
+        of the rights granted under this License; and,
+   iii. Voluntary License Schemes. The Licensor waives the right to
+        collect royalties, whether individually or, in the event that the
+        Licensor is a member of a collecting society that administers
+        voluntary licensing schemes, via that society, from any exercise
+        by You of the rights granted under this License.
+
+The above rights may be exercised in all media and formats whether now
+known or hereafter devised. The above rights include the right to make
+such modifications as are technically necessary to exercise the rights in
+other media and formats. Subject to Section 8(f), all rights not expressly
+granted by Licensor are hereby reserved.
+
+4. Restrictions. The license granted in Section 3 above is expressly made
+subject to and limited by the following restrictions:
+
+ a. You may Distribute or Publicly Perform the Work only under the terms
+    of this License. You must include a copy of, or the Uniform Resource
+    Identifier (URI) for, this License with every copy of the Work You
+    Distribute or Publicly Perform. You may not offer or impose any terms
+    on the Work that restrict the terms of this License or the ability of
+    the recipient of the Work to exercise the rights granted to that
+    recipient under the terms of the License. You may not sublicense the
+    Work. You must keep intact all notices that refer to this License and
+    to the disclaimer of warranties with every copy of the Work You
+    Distribute or Publicly Perform. When You Distribute or Publicly
+    Perform the Work, You may not impose any effective technological
+    measures on the Work that restrict the ability of a recipient of the
+    Work from You to exercise the rights granted to that recipient under
+    the terms of the License. This Section 4(a) applies to the Work as
+    incorporated in a Collection, but this does not require the Collection
+    apart from the Work itself to be made subject to the terms of this
+    License. If You create a Collection, upon notice from any Licensor You
+    must, to the extent practicable, remove from the Collection any credit
+    as required by Section 4(b), as requested. If You create an
+    Adaptation, upon notice from any Licensor You must, to the extent
+    practicable, remove from the Adaptation any credit as required by
+    Section 4(b), as requested.
+ b. If You Distribute, or Publicly Perform the Work or any Adaptations or
+    Collections, You must, unless a request has been made pursuant to
+    Section 4(a), keep intact all copyright notices for the Work and
+    provide, reasonable to the medium or means You are utilizing: (i) the
+    name of the Original Author (or pseudonym, if applicable) if supplied,
+    and/or if the Original Author and/or Licensor designate another party
+    or parties (e.g., a sponsor institute, publishing entity, journal) for
+    attribution ("Attribution Parties") in Licensor's copyright notice,
+    terms of service or by other reasonable means, the name of such party
+    or parties; (ii) the title of the Work if supplied; (iii) to the
+    extent reasonably practicable, the URI, if any, that Licensor
+    specifies to be associated with the Work, unless such URI does not
+    refer to the copyright notice or licensing information for the Work;
+    and (iv) , consistent with Section 3(b), in the case of an Adaptation,
+    a credit identifying the use of the Work in the Adaptation (e.g.,
+    "French translation of the Work by Original Author," or "Screenplay
+    based on original Work by Original Author"). The credit required by
+    this Section 4 (b) may be implemented in any reasonable manner;
+    provided, however, that in the case of a Adaptation or Collection, at
+    a minimum such credit will appear, if a credit for all contributing
+    authors of the Adaptation or Collection appears, then as part of these
+    credits and in a manner at least as prominent as the credits for the
+    other contributing authors. For the avoidance of doubt, You may only
+    use the credit required by this Section for the purpose of attribution
+    in the manner set out above and, by exercising Your rights under this
+    License, You may not implicitly or explicitly assert or imply any
+    connection with, sponsorship or endorsement by the Original Author,
+    Licensor and/or Attribution Parties, as appropriate, of You or Your
+    use of the Work, without the separate, express prior written
+    permission of the Original Author, Licensor and/or Attribution
+    Parties.
+ c. Except as otherwise agreed in writing by the Licensor or as may be
+    otherwise permitted by applicable law, if You Reproduce, Distribute or
+    Publicly Perform the Work either by itself or as part of any
+    Adaptations or Collections, You must not distort, mutilate, modify or
+    take other derogatory action in relation to the Work which would be
+    prejudicial to the Original Author's honor or reputation. Licensor
+    agrees that in those jurisdictions (e.g. Japan), in which any exercise
+    of the right granted in Section 3(b) of this License (the right to
+    make Adaptations) would be deemed to be a distortion, mutilation,
+    modification or other derogatory action prejudicial to the Original
+    Author's honor and reputation, the Licensor will waive or not assert,
+    as appropriate, this Section, to the fullest extent permitted by the
+    applicable national law, to enable You to reasonably exercise Your
+    right under Section 3(b) of this License (right to make Adaptations)
+    but not otherwise.
+
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR
+OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY
+KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE,
+INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY,
+FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF
+LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS,
+WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION
+OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE
+LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR
+ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES
+ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+ a. This License and the rights granted hereunder will terminate
+    automatically upon any breach by You of the terms of this License.
+    Individuals or entities who have received Adaptations or Collections
+    from You under this License, however, will not have their licenses
+    terminated provided such individuals or entities remain in full
+    compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will
+    survive any termination of this License.
+ b. Subject to the above terms and conditions, the license granted here is
+    perpetual (for the duration of the applicable copyright in the Work).
+    Notwithstanding the above, Licensor reserves the right to release the
+    Work under different license terms or to stop distributing the Work at
+    any time; provided, however that any such election will not serve to
+    withdraw this License (or any other license that has been, or is
+    required to be, granted under the terms of this License), and this
+    License will continue in full force and effect unless terminated as
+    stated above.
+
+8. Miscellaneous
+
+ a. Each time You Distribute or Publicly Perform the Work or a Collection,
+    the Licensor offers to the recipient a license to the Work on the same
+    terms and conditions as the license granted to You under this License.
+ b. Each time You Distribute or Publicly Perform an Adaptation, Licensor
+    offers to the recipient a license to the original Work on the same
+    terms and conditions as the license granted to You under this License.
+ c. If any provision of this License is invalid or unenforceable under
+    applicable law, it shall not affect the validity or enforceability of
+    the remainder of the terms of this License, and without further action
+    by the parties to this agreement, such provision shall be reformed to
+    the minimum extent necessary to make such provision valid and
+    enforceable.
+ d. No term or provision of this License shall be deemed waived and no
+    breach consented to unless such waiver or consent shall be in writing
+    and signed by the party to be charged with such waiver or consent.
+ e. This License constitutes the entire agreement between the parties with
+    respect to the Work licensed here. There are no understandings,
+    agreements or representations with respect to the Work not specified
+    here. Licensor shall not be bound by any additional provisions that
+    may appear in any communication from You. This License may not be
+    modified without the mutual written agreement of the Licensor and You.
+ f. The rights granted under, and the subject matter referenced, in this
+    License were drafted utilizing the terminology of the Berne Convention
+    for the Protection of Literary and Artistic Works (as amended on
+    September 28, 1979), the Rome Convention of 1961, the WIPO Copyright
+    Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996
+    and the Universal Copyright Convention (as revised on July 24, 1971).
+    These rights and subject matter take effect in the relevant
+    jurisdiction in which the License terms are sought to be enforced
+    according to the corresponding provisions of the implementation of
+    those treaty provisions in the applicable national law. If the
+    standard suite of rights granted under applicable copyright law
+    includes additional rights not granted under this License, such
+    additional rights are deemed to be included in the License; this
+    License is not intended to restrict the license of any rights under
+    applicable law.
+
+
+Creative Commons Notice
+
+    Creative Commons is not a party to this License, and makes no warranty
+    whatsoever in connection with the Work. Creative Commons will not be
+    liable to You or any party on any legal theory for any damages
+    whatsoever, including without limitation any general, special,
+    incidental or consequential damages arising in connection to this
+    license. Notwithstanding the foregoing two (2) sentences, if Creative
+    Commons has expressly identified itself as the Licensor hereunder, it
+    shall have all rights and obligations of Licensor.
+
+    Except for the limited purpose of indicating to the public that the
+    Work is licensed under the CCPL, Creative Commons does not authorize
+    the use by either party of the trademark "Creative Commons" or any
+    related trademark or logo of Creative Commons without the prior
+    written consent of Creative Commons. Any permitted use will be in
+    compliance with Creative Commons' then-current trademark usage
+    guidelines, as may be published on its website or otherwise made
+    available upon request from time to time. For the avoidance of doubt,
+    this trademark restriction does not form part of this License.
+
+    Creative Commons may be contacted at http://creativecommons.org/.
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/doc/LICENSE-qtip.txt
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/doc/LICENSE-qtip.txt	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/doc/LICENSE-qtip.txt	(revision 5623)
@@ -0,0 +1,7 @@
+Copyright Â© 2009 Craig Thompson
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/doc/LICENSE.txt
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/doc/LICENSE.txt	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/doc/LICENSE.txt	(revision 5623)
@@ -0,0 +1,674 @@
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                       TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+  1. Source Code.
+
+  The "source code" for a work means the preferred form of the work
+for making modifications to it.  "Object code" means any non-source
+form of a work.
+
+  A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+  2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+  4. Conveying Verbatim Copies.
+
+  You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+  5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+  6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+  7. Additional Terms.
+
+  "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+  8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+  9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+  10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+  11. Patents.
+
+  A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+  12. No Surrender of Others' Freedom.
+
+  If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+  13. Use with the GNU Affero General Public License.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+  Each version is given a distinguishing version number.  If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+  15. Disclaimer of Warranty.
+
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+  17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+    <program>  Copyright (C) <year>  <name of author>
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+  The GNU General Public License does not permit incorporating your program
+into proprietary programs.  If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.  But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/doc/Protocol.txt
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/doc/Protocol.txt	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/doc/Protocol.txt	(revision 5623)
@@ -0,0 +1,198 @@
+Virtual Collection Registry RESTful web service
+===============================================
+
+The Virtual Collection Registry (VCR) provides a RESTful web service for
+working with the registry.
+
+
+1. Prerequisite
+
+    a) Internal XML format for virtual collections:
+       A virtual collection is represented in an internal XML format, which is
+       defined by the W3C XML schema "VirtualCollection.xsd" found in the
+       "src/resources/META-INF" directory.
+       
+    b) The VCR relies on various HTTP headers:
+        - "Content-Type" must be set for POST and PUT requests. Accepted
+          values are "text/xml", "application/xml" or "application/json".
+        - "Accept" can be used all requests. Accepted values are "text/xml",
+          "application/xml" or "application/json". If the header is not set,
+          the VCR assumes "application/xml" as default. An exception is the retrieval
+          of individual collections (2d). This call also accepts "application/x-cmdi+xml"
+          and "text/html" and defaults to the former of these two.
+        - Headers for HTTP Basic Auth need to be set on POST, PUT and DELETE
+          requests.      
+          
+	Note that, as an alternative to the usage of the HTTP "Accept" header, the respons 
+	type can be controlled by providing one of the following suffixes to the service
+	URL: ".xml", ".json", ".cmdi", ".html". Not all operations will accept all of
+	these types.
+
+
+2. RESTful web service operations
+
+    The following describes the RESTful web service operations. The URIs are
+    relative to a base URI ($BASE), which depends on the machine, where the
+    VCR is installed.
+
+    a) Create a virtual collection (POST) 
+                 description: A virtual collection will be created based on the
+                              representation of the virtual collection sent in
+                              the request body. ID and state, if provided, will be 
+                              ignored so this will always result in a private collection
+                              with a new identifier.
+                 HTTP method: POST
+                         URI: $BASE/service/virtualcollections
+         URI path parameters: none
+            query parameters: none 
+                HTTP headers: Content-Type (required), Accept (optional)
+              authentication: required
+                request body: Depending on Content-Type header either a valid
+                              XML instance or the JSON representation of a
+                              virtual collection conforming to the above
+                              mentioned XML schema. The root element is expected
+                              to be "VirtualCollection"
+                 result body: Depending on Accept header either an XML instance
+                              or the JSON representation of the outcome of the
+                              request. If successful, the result will contain
+                              the ID of the created virtual collection
+
+    b) Update a virtual collection (PUT)
+                 description: The virtual collection identified by the URI will
+                              be updated, actually replaced, with the
+                              representation of the virtual collection sent in
+                              the request body.
+                 HTTP method: PUT
+                         URI: $BASE/service/virtualcollections/$id
+         URI path parameters: $id := (required) is the ID of the virtual
+                                     collection, which is to be changed 
+            query parameters: none 
+                HTTP headers: Content-Type (required), Accept (optional)
+              authentication: required
+                request body: Depending on Content-Type header either a valid
+                              XML instance or the JSON representation of a
+                              virtual collection conforming to the above
+                              mentioned XML schema. The root element is expected
+                              to be "VirtualCollection"
+                 result body: Depending on Accept header either an XML instance
+                              or the JSON representation of the outcome of the
+                              request.
+
+    c) Delete a virtual collection (DELETE)
+                 description: The virtual collection referenced by the URI will
+                              be deleted.
+                 HTTP method: DELETE
+                         URI: $BASE/service/virtualcollections/$id
+         URI path parameters: $id := (required) is the ID of the virtual
+                                     collection, which is to be deleted  
+            query parameters: none
+                HTTP headers: Accept (optional)
+              authentication: required
+                request body: none
+                 result body: depending on Accept header either an XML instance
+                              or the JSON representation of the outcome of the
+                              request.
+
+    d) Retrieve a virtual collection (GET)
+                 description: The virtual collection referenced by the URI will
+                              be retrieved.
+                 HTTP method: GET
+                         URI: $BASE/service/virtualcollections/$id
+         URI path parameters: $id := (required) is the ID of the virtual
+                                     collection, which is to be retrieved
+            query parameters: none
+                HTTP headers: Accept (optional)
+              authentication: not required
+                request body: none
+                 result body: Depending on Accept header either a CMDI, XML or
+                              JSON representation of the virtual collection, or a redirect
+                              to the collection's detail view in the user interface in 
+                              case HTML is requested. If the virtual collection is not 
+                              found the appropriate HTTP status code is issued and an 
+                              error message is returned.
+                              By default, it returns the CMDI representation for published
+                              collections. If the collection is not published, the
+                              service will respond with another accepted representation.
+                              If only CMDI is represented, it responds with code 406
+                              (Not Acceptable).
+
+    e) Retrieve all / search virtual collections (GET)
+                 description: All virtual collections will be retrieved; if a
+                              query expression is used, only the virtual
+                              collections satisfying the query will be
+                              retrieved. 
+                 HTTP method: GET
+                         URI: $BASE/service/virtualcollections
+         URI path parameters: none
+            query parameters: q      := (optional) URL-encoded query
+                                        expression (see below)
+                              offset := (optional) start of result list at
+                                        a given position (default: 0)
+                              count  := (optional) limit the result list to
+                                        a number of entries (default: unlimited)
+                HTTP headers: Accept (optional)
+              authentication: not required
+                request body: none
+                 result body: Depending on Accept header either an XML instance
+                              or the JSON representation of the virtual
+                              collection. If no virtual collection are found
+                              an empty list will be returned.
+
+    f) Retrieve all / search virtual collection owned by the user (GET)
+                 description: All virtual collections owned by the authenticated
+                              user will be retrieved; if a query expression is
+                              used, only the virtual collections satisfying the
+                              query will be retrieved.
+                 HTTP method: GET
+                         URI: $BASE/service/my-virtualcollections
+         URI path parameters: none
+            query parameters: q      := (optional) URL-encoded query
+                                        expression (see below)
+                              offset := (optional) start of result list at
+                                        a given position (default: 0)
+                              count  := (optional) limit the result list to
+                                        a number of entries (default: unlimited)
+                HTTP headers: Accept (optional)
+              authentication: required
+                request body: none
+                 result body: Depending on Accept header either an XML instance
+                              or the JSON representation of the virtual
+                              collection. If no virtual collection are found
+                              an empty list will be returned.
+
+TODO: Add {id}/state
+
+
+3. Virtual Collection Query language (VCRQL)
+     query            = expression
+                      | expression 'and' expression
+                      | expression 'or' expression
+                      | '(' expression ')'
+
+     expression       = 'name'         ( '=' | '<>' ) value
+                      | 'description'  ( '=' | '<>' ) value
+                      | 'creator'      ( '=' | '<>' ) value
+                      | 'email'        ( '=' | '<>' ) value
+                      | 'organization' ( '=' | '<>' ) value
+                      | 'state'        ( '=' | '<>' )
+                                       ( 'public' | 'private' | 'deleted' )
+                      | 'created'      ( '<' | '<=' | '=' | '<>' | '>=' | '>' )
+                                       iso-date
+                      | 'modified'     ( '<' | '<=' | '=' | '<>' | '>=' | '>' )
+                                       iso-date
+
+     value            = double quoted string value, use backslash
+                        for escaping double quotes, use "*" and "?" for
+                        wildcards.
+     iso-date         = full ISO 8601 date: YYYY-MM-DD-T-HH:MM:SSZ
+                        where YYYY := year
+                                MM := month
+                                DD := day
+                                HH := hour
+                                 T := time designator (literal)
+                                MM := minute
+                                SS := second
+                                Z  := UTC indicator (literal) 
+
+   (see "src/main/jjtree/eu/clarin/cmdi/virtualcollectionregistry/query/QueryParser.jjt"
+    and "src/main/main/eu/clarin/cmdi/virtualcollectionregistry/query/*.java")
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/doc/README.txt
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/doc/README.txt	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/doc/README.txt	(revision 5623)
@@ -0,0 +1,124 @@
+CLARIN Virtual Collection Registry
+----------------------------------
+
+* DATABASE CONNECTION *
+
+The connection to the database is configured using JNDI using the
+name "jdbc/VirtualCollectionStore".
+When using Apache Tomcat add the following to the context configuration
+of the web application (by either modifying "server.xml" or providing an
+appropiate context configuration, e.g. like
+  "$CATALINA_HOME/conf/Catalina/localhost/VirtualCollectionRegistry.xml";
+if in doubt, please check the Apache Tomcat documentation):
+
+  <Resource name="jdbc/VirtualCollectionStore" auth="Container"
+            type="javax.sql.DataSource"
+            maxActive="8" maxIdle="4" maxWait="10000"
+            removeAbandoned="true"
+            defaultAutoCommit="false"
+            driverClassName="com.mysql.jdbc.Driver"
+            validationQuery="SELECT 1"
+            username="$dbuser"
+            password="$dbpass"
+            url="jdbc:mysql://127.0.0.1:3306/$dbname" />
+
+  This will configure a DBCP data source for the virtual collection registry.
+  Customize $dbuser, $dbpass and $dbname to match your local settings.
+  NOTE: currently only MySQL is supported.
+
+* CONTEXT PARAMETERS *
+
+PUBLIC APPLICATION URL:
+
+Add the following context parameter (typically to the global context.xml file)
+and substitute the value with the correct *public* base location of the VCR:
+
+  <Parameter name="eu.clarin.cmdi.virtualcollectionregistry.base_uri"
+             value="http://my/server/VirtualCollectionRegistry"
+             override="false"/>
+
+Add no trailing slash. You can verify this by checking the service links in the
+help page of the running application.
+
+ADMINISTRATOR USERS:
+
+Add the following context parameter:
+
+<Parameter
+	   name="eu.clarin.cmdi.virtualcollectionregistry.admindb"
+	   value="/path/to/vcr-admin.conf" />
+
+Add the username of each user that should get administrator rights to the 
+referenced file, one username per line.
+
+* PID PROVIDER *
+
+  You need to choose, which persistent identifier provider you want to use.
+  You can either use a dummy provider or the GWDG handle provider.
+  a) For using the dummy provider add the following:
+  <Parameter name="spring.profiles.active"
+             value="vcr.pid.dummy"
+             override="false"/>   
+
+  b) For using the GWDG handle provider add following and customize the
+     base URI for the virtual collection registry and the values for
+     $gwdg_user and $gwdg_password:
+
+  <Parameter name="spring.profiles.active"
+             value="vcr.pid.gwdg"
+             override="false"/>   
+  <Parameter name="pid_provider.username" value="$gwdg_user" override="false"/>
+  <Parameter name="pid_provider.password" value="$gwdg_password" override="false"/>
+
+  c) For using the EPIC API v2 handle provider add following and customize the
+     base URI for the virtual collection registry andâŠ TODO
+
+  <Parameter name="spring.profiles.active"
+             value="vcr.pid.epicâ
+             override="false"/>   
+
+* AUTHENTICATION *
+
+The application has two alternative authentication configuration represented by two
+versions of the web.xml file. The default web.xml assumes Tomcat UserDatabaseRealm,
+which is useful for testing purposes.
+
+To shibbolize this application, the following steps are required:
+
+1. Use the shibboleth version of web.xml called 'web-shib.xml' instead of
+the default one by renaming it to and overwriting web.xml (you can make a
+backup of the original web.xml). If the package was built for a production
+environment, it should already have the right web.xml in place.
+
+2. Add the following to the relevant Apache configuration:
+
+        <Location /vcr>
+            ProxyPass ajp://localhost:8009/vcr
+            AuthType            shibboleth
+            ShibRequireSession  Off
+            ShibUseHeaders      On
+            Satisfy             All
+            Require             shibboleth
+        </Location>
+
+        <Location /vcr/service/submit>
+            ShibRequireSession  On
+        </Location>
+
+Adjust locations to the desired and relevant local alternatives. The second
+block is required to make the virtual collection form submit service work
+with POSTs (current versions of SHHAA do not support this).
+
+* OAI PROVIDER *
+
+Collection display name:
+
+Add the following to the Tomcat context.xml file to set a custom collection display name 
+(MdCollectionDisplayName header element) for the CMDI representations provided by the 
+built-in OAI provider:
+
+<Parameter name="eu.clarin.cmdi.virtualcollectionregistry.collectiondisplayname
+           value="CLARIN Virtual Collection Registry" />
+
+Change the value of the 'value' attribute if desired. If this parameter is not set,
+the default value "CLARIN Virtual Collection Registry" will be used as a collection name.
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/pom.xml
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/pom.xml	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/pom.xml	(revision 5623)
@@ -0,0 +1,726 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>eu.clarin.cmdi</groupId>
+    <artifactId>VirtualCollectionRegistry</artifactId>
+    <packaging>war</packaging>
+    <name>CLARIN Virtual Collection Registry</name>
+    <version>1.0-beta</version>
+
+    <organization>
+        <name>CLARIN</name>
+        <url>http://www.clarin.eu/</url>
+    </organization>
+    
+    <developers>
+        <developer>
+            <name>Oliver Schonefeld</name>
+            <organization>Institut fÃŒr Deutsche Sprache</organization>
+            <url>http://www.ids-mannheim.de/</url>
+        </developer>
+        <developer>
+            <name>Twan Goosen</name>
+            <organization>CLARIN</organization>
+            <url>http://www.clarin.eu/</url>
+        </developer>
+    </developers>
+    
+    <licenses>
+        <license>
+            <name>GNU General Public License Version 3 (GPLv3)</name>
+            <url>http://www.gnu.org/licenses/gpl-3.0.txt</url>
+        </license>
+    </licenses>
+
+    <properties>
+        <!-- project settings -->
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <!-- plug-in settings -->
+        <maven.compiler.source>1.7</maven.compiler.source>
+        <maven.compiler.target>1.7</maven.compiler.target>
+        <!-- dependency versions -->
+        <slf4j.version>1.7.7</slf4j.version>
+        <hibernate.version>3.6.10.Final</hibernate.version>
+        <hibernate.jpaVersion>1.0.0.Final</hibernate.jpaVersion>
+        <jersey.version>1.18.1</jersey.version>
+        <jackson.version>1.6.1</jackson.version>
+        <wicket.version>1.4.23</wicket.version>
+        <spring.version>4.0.6.RELEASE</spring.version>
+        
+        <!-- Production settings below -->
+        <log4j.appender>File</log4j.appender>
+        <war.webxml>src/main/webapp/WEB-INF/web-shib.xml</war.webxml>
+        
+        <!-- Tell Netbeans to insert the right license header -->
+        <netbeans.hint.license>gpl30</netbeans.hint.license> 
+    </properties>
+    
+    <profiles>
+        <profile>
+            <!-- Development profile -->
+            <id>development</id>
+            <properties>
+                <!-- Log to console -->
+                <log4j.appender>Console</log4j.appender>     
+                <!-- Use the user database realm version of web.xml -->           
+                <war.webxml>src/main/webapp/WEB-INF/web-dev.xml</war.webxml>
+            </properties>
+        </profile>
+    </profiles>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <version>${slf4j.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+            <version>3.3.2</version>
+        </dependency>
+
+        <dependency>
+            <groupId>commons-codec</groupId>
+            <artifactId>commons-codec</artifactId>
+            <type>jar</type>
+        </dependency>
+
+        <dependency>
+            <groupId>org.codehaus.woodstox</groupId>
+            <artifactId>woodstox-core-asl</artifactId>
+            <version>4.0.8</version>
+            <type>jar</type>
+            <scope>compile</scope>
+            <exclusions>
+                <!-- StaX is part of JRE 1.5 and newer -->
+                <exclusion>
+                    <artifactId>stax-api</artifactId>
+                    <groupId>javax.xml.stream</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>net.java.dev.msv</groupId>
+            <artifactId>msv-core</artifactId>
+            <version>2009.1</version>
+            <type>jar</type>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.hibernate.javax.persistence</groupId>
+            <artifactId>hibernate-jpa-2.1-api</artifactId>
+            <version>${hibernate.jpaVersion}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.hibernate</groupId>
+            <artifactId>hibernate-entitymanager</artifactId>
+            <version>${hibernate.version}</version>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+            <version>2.5</version>
+            <type>jar</type>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>javax.ws.rs</groupId>
+            <artifactId>jsr311-api</artifactId>
+            <version>1.1.1</version>
+            <type>jar</type>
+        </dependency>
+
+        <dependency>
+            <groupId>com.sun.jersey</groupId>
+            <artifactId>jersey-servlet</artifactId>
+            <version>${jersey.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.sun.jersey</groupId>
+            <artifactId>jersey-json</artifactId>
+            <version>${jersey.version}</version>
+            <exclusions>
+                <!-- StaX is part of JRE 1.5 and newer -->
+                <exclusion>
+                    <groupId>stax</groupId>
+                    <artifactId>stax-api</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>com.sun.xml.bind</groupId>
+                    <artifactId>jaxb-impl</artifactId>
+                </exclusion>
+                <exclusion>
+                    <artifactId>jackson-mapper-asl</artifactId>
+                    <groupId>org.codehaus.jackson</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+
+        <dependency>
+            <groupId>org.codehaus.jettison</groupId>
+            <artifactId>jettison</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>stax</groupId>
+                    <artifactId>stax-api</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        
+        <dependency>
+            <groupId>de.uni_leipzig.asv</groupId>
+            <artifactId>clarin.webservices.pidservices2</artifactId>
+            <version>2.1.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+            <version>4.3.4</version>
+            <type>jar</type>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.wicket</groupId>
+            <artifactId>wicket</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.wicket</groupId>
+            <artifactId>wicket-auth-roles</artifactId>
+            <version>${wicket.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.wicket</groupId>
+            <artifactId>wicket-datetime</artifactId>
+            <version>${wicket.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.wicket</groupId>
+            <artifactId>wicket-extensions</artifactId>
+            <version>${wicket.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.wicket</groupId>
+            <artifactId>wicket-spring</artifactId>
+            <version>${wicket.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.odlabs.wiquery</groupId>
+            <artifactId>wiquery</artifactId>
+            <version>1.2.3</version>
+            <exclusions>
+                <exclusion>
+                    <artifactId>log4j</artifactId>
+                    <groupId>log4j</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <!--
+                <dependency>
+                    <groupId>net.java.dev.javacc</groupId>
+                    <artifactId>javacc</artifactId>
+                    <version>5.0</version>
+                    <type>jar</type>
+                    <scope>provided</scope>
+                </dependency>
+        -->
+
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <version>5.1.13</version>
+            <type>jar</type>
+        </dependency>
+        
+        <dependency>
+            <groupId>de.mpg.mpgaai</groupId>
+            <artifactId>mpgaai-shhaa</artifactId>
+            <version>1.0.5</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-web</artifactId>
+            <version>${spring.version}</version>
+            <type>jar</type>
+        </dependency>
+
+        <dependency>
+            <groupId>com.sun.jersey.contribs</groupId>
+            <artifactId>jersey-spring</artifactId>
+            <version>${jersey.version}</version>
+            <exclusions>
+                <exclusion>
+                    <artifactId>spring-aop</artifactId>
+                    <groupId>org.springframework</groupId>
+                </exclusion>
+                <exclusion>
+                    <artifactId>spring-asm</artifactId>
+                    <groupId>org.springframework</groupId>
+                </exclusion>
+                <exclusion>
+                    <artifactId>spring-beans</artifactId>
+                    <groupId>org.springframework</groupId>
+                </exclusion>
+                <exclusion>
+                    <artifactId>spring-context</artifactId>
+                    <groupId>org.springframework</groupId>
+                </exclusion>
+                <exclusion>
+                    <artifactId>spring-core</artifactId>
+                    <groupId>org.springframework</groupId>
+                </exclusion>
+                <exclusion>
+                    <artifactId>spring-web</artifactId>
+                    <groupId>org.springframework</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>net.sf.saxon</groupId>
+            <artifactId>Saxon-HE</artifactId>
+            <version>9.5.1-5</version>
+            <scope>runtime</scope>
+            <classifier>compressed</classifier>
+        </dependency>
+
+        <dependency>
+            <groupId>eu.clarin.cmdi</groupId>
+            <artifactId>OAIProvider</artifactId>
+            <version>0.0.2</version>
+            <exclusions>
+                <exclusion>
+                    <artifactId>slf4j-jdk14</artifactId>
+                    <groupId>org.slf4j</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <!-- testing dependencies -->
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.11</version>
+            <type>jar</type>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.hsqldb</groupId>
+            <artifactId>hsqldb</artifactId>
+            <version>2.0.0</version>
+            <type>jar</type>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>xmlunit</groupId>
+            <artifactId>xmlunit</artifactId>
+            <version>1.5</version>
+            <scope>test</scope>
+            <type>jar</type>
+        </dependency>
+
+        <dependency>
+            <groupId>org.jmock</groupId>
+            <artifactId>jmock-junit4</artifactId>
+            <version>2.6.0</version>
+            <scope>test</scope>
+        </dependency>
+
+        <!-- JavaMelody for application monitoring -->
+        <dependency>
+            <groupId>net.bull.javamelody</groupId>
+            <artifactId>javamelody-core</artifactId>
+            <version>1.51.0</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springframework</groupId>
+                    <artifactId>spring-aop</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.springframework</groupId>
+                    <artifactId>spring-context</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+    </dependencies>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.slf4j</groupId>
+                <artifactId>slf4j-api</artifactId>
+                <version>${slf4j.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>commons-codec</groupId>
+                <artifactId>commons-codec</artifactId>
+                <version>1.4</version>
+            </dependency>
+
+            <dependency>
+                <groupId>commons-logging</groupId>
+                <artifactId>commons-logging</artifactId>
+                <version>1.1.3</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.codehaus.jettison</groupId>
+                <artifactId>jettison</artifactId>
+                <version>1.2</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.apache.wicket</groupId>
+                <artifactId>wicket</artifactId>
+                <version>${wicket.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.codehaus.jackson</groupId>
+                <artifactId>jackson-core-asl</artifactId>
+                <version>${jackson.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.codehaus.jackson</groupId>
+                <artifactId>jackson-mapper-asl</artifactId>
+                <version>${jackson.version}</version>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <build>
+        <resources>
+            <resource>
+                <filtering>true</filtering>
+                <directory>src/main/resources</directory>
+            </resource>
+            <resource>
+                <filtering>true</filtering>
+                <directory>src/main/java</directory>
+                <includes>
+                    <include>**/BasePage.html</include>
+                </includes>
+            </resource>
+            <resource>
+                <filtering>false</filtering>
+                <directory>src/main/java</directory>
+                <includes>
+                    <include>**/*.html</include>
+                    <include>**/*.css</include>
+                    <include>**/*.js</include>
+                    <include>**/*.properties</include>
+                </includes>
+            </resource>
+        </resources>
+
+        <testResources>
+            <testResource>
+                <directory>src/test/resources</directory>
+            </testResource>
+        </testResources>
+
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>javacc-maven-plugin</artifactId>
+                <version>2.6</version>
+                <executions>
+                    <execution>
+                        <id>javacc</id>
+                        <goals>
+                            <goal>jjtree-javacc</goal>
+                        </goals>
+                        <phase>generate-sources</phase>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <plugin>
+                <groupId>org.bsc.maven</groupId>
+                <artifactId>maven-processor-plugin</artifactId>
+                <version>2.0.0</version>
+                <executions>
+                    <execution>
+                        <id>process</id>
+                        <goals>
+                            <goal>process</goal>
+                        </goals>
+                        <phase>generate-sources</phase>
+                        <configuration>
+                            <processors>
+                                <processor>org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor</processor>
+                            </processors>
+                            <sourceDirectory>${basedir}/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/model</sourceDirectory>
+                            <outputDirectory>${project.build.directory}/generated-sources/metamodel</outputDirectory>
+                        </configuration>
+                    </execution>
+                </executions>
+                <dependencies>
+                    <dependency>
+                        <groupId>org.hibernate</groupId>
+                        <artifactId>hibernate-jpamodelgen</artifactId>
+                        <version>${hibernate.jpaVersion}</version>
+                        <scope>compile</scope>
+                    </dependency>
+                </dependencies>
+            </plugin>
+
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>jaxb2-maven-plugin</artifactId>
+                <version>1.6</version>
+                <executions>
+                    <execution>
+                        <id>xjc</id>
+                        <goals>
+                            <goal>xjc</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <packageName>eu.clarin.cmdi.virtualcollectionregistry.model.cmdi</packageName> <!-- The name of your generated source package -->
+                </configuration>
+            </plugin>
+
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <version>1.3</version>
+                <executions>
+                    <execution>
+                        <id>add-source</id>
+                        <goals>
+                            <goal>add-source</goal>
+                        </goals>
+                        <phase>generate-sources</phase>
+                        <configuration>
+                            <sources>
+                                <source>${project.build.directory}/generated-sources/metamodel</source>
+                                <source>${project.build.directory}/generated-sources/javacc</source>
+                                <source>${project.build.directory}/generated-sources/jjtree</source>
+                                <source>${project.build.directory}/generated-sources/jaxb</source>
+                            </sources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>2.3.2</version>
+                <configuration>
+                    <source>${maven.compiler.source}</source>
+                    <target>${maven.compiler.target}</target>
+                    <compilerArgument>-proc:none</compilerArgument>
+                </configuration>
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-war-plugin</artifactId>
+                <version>2.4</version>
+                <configuration>
+                    <failOnMissingWebXml>true</failOnMissingWebXml>
+                    <webXml>${war.webxml}</webXml>
+                    <webResources>
+                        <!-- additional web resources: also copy schemas to web-app -->
+                        <resource>
+                            <directory>src/main/resources/META-INF</directory>
+                            <targetPath>schema</targetPath>
+                            <includes>
+                                <include>*.xsd</include>
+                            </includes>
+                        </resource>
+                        <!-- Make documentation available -->
+                        <resource>
+                            <directory>doc</directory>
+                        </resource>
+                    </webResources>
+                </configuration>
+            </plugin>
+            
+            <plugin>
+                <groupId>org.jasig.maven</groupId>
+                <artifactId>sass-maven-plugin</artifactId>
+                <version>1.1.1</version>
+                <executions>
+                    <execution>
+                        <phase>generate-resources</phase>
+                        <goals>
+                            <goal>update-stylesheets</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            
+            <plugin>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <version>2.4.1</version>
+                <executions>
+                    <execution>
+                        <id>make-assembly</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <descriptors>
+                        <descriptor>src/assembly/distribution.xml</descriptor>
+                    </descriptors>
+                </configuration>
+            </plugin>
+        </plugins>
+
+        <pluginManagement>
+            <plugins>
+                <!-- This plugin's configuration is used to store Eclipse m2e settings 
+                only. It has no influence on the Maven build itself. -->
+                <plugin>
+                    <groupId>org.eclipse.m2e</groupId>
+                    <artifactId>lifecycle-mapping</artifactId>
+                    <version>1.0.0</version>
+                    <configuration>
+                        <lifecycleMappingMetadata>
+                            <pluginExecutions>
+                                <pluginExecution>
+                                    <pluginExecutionFilter>
+                                        <groupId>org.codehaus.mojo</groupId>
+                                        <artifactId>javacc-maven-plugin</artifactId>
+                                        <versionRange>[2.6,)</versionRange>
+                                        <goals>
+                                            <goal>jjtree-javacc</goal>
+                                        </goals>
+                                    </pluginExecutionFilter>
+                                    <action>
+                                        <execute />
+                                    </action>
+                                </pluginExecution>
+                                <pluginExecution>
+                                    <pluginExecutionFilter>
+                                        <groupId>org.bsc.maven</groupId>
+                                        <artifactId>maven-processor-plugin</artifactId>
+                                        <versionRange>[2.0.0,)</versionRange>
+                                        <goals>
+                                            <goal>process</goal>
+                                        </goals>
+                                    </pluginExecutionFilter>
+                                    <action>
+                                        <execute />
+                                    </action>
+                                </pluginExecution>
+                                <pluginExecution>
+                                    <pluginExecutionFilter>
+                                        <groupId>org.codehaus.mojo</groupId>
+                                        <artifactId>jaxb2-maven-plugin</artifactId>
+                                        <versionRange>[1.6,)</versionRange>
+                                        <goals>
+                                            <goal>xjc</goal>
+                                        </goals>
+                                    </pluginExecutionFilter>
+                                    <action>
+                                        <execute />
+                                    </action>
+                                </pluginExecution>
+                            </pluginExecutions>
+                        </lifecycleMappingMetadata>
+                    </configuration>
+                </plugin>
+                <!-- JAX-B If we e.g. execute on JDK 1.7, we should compile for
+                                Java 7 to get the same (or higher) JAXB API version as
+                used during the xjc execution. -->
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-compiler-plugin</artifactId>
+                    <configuration>
+                        <source>${maven.compiler.source}</source>
+                        <target>${maven.compiler.source}</target>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+    </build>
+
+    <reporting>
+        <plugins>
+            <!-- NCSS plugin has issues with Java 7 at the moment, check back later -->
+            <!--
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>javancss-maven-plugin</artifactId>
+                <version>2.0-beta-2</version>
+            </plugin>
+            -->
+        </plugins>
+    </reporting>
+
+    <repositories>
+        <repository>
+            <id>jboss</id>
+            <name>JBoss Public Maven Repository Group</name>
+            <url>https://repository.jboss.org/nexus/content/repositories/releases/</url>
+            <layout>default</layout>
+        </repository>
+
+        <repository>
+            <id>java-net-maven-2</id>
+            <name>Java.net Repository</name>
+            <url>http://download.java.net/maven/2/</url>
+            <layout>default</layout>
+        </repository>
+
+        <repository>
+            <id>wiquery</id>
+            <name>wiQuery repository</name>
+            <url>http://wiquery.googlecode.com/svn/repo/</url>
+            <layout>default</layout>
+        </repository>
+
+        <repository>
+            <id>clarin</id>
+            <name>CLARIN Repository</name>
+            <url>http://catalog.clarin.eu/ds/nexus/content/groups/public/</url>
+            <layout>default</layout>
+        </repository>
+    </repositories>
+
+    <pluginRepositories>
+        <pluginRepository>
+            <id>jboss</id>
+            <name>JBoss Public Maven Repository Group</name>
+            <url>https://repository.jboss.org/nexus/content/repositories/releases/</url>
+            <layout>default</layout>
+        </pluginRepository>
+    </pluginRepositories>
+
+</project>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/assembly/distribution.xml
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/assembly/distribution.xml	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/assembly/distribution.xml	(revision 5623)
@@ -0,0 +1,26 @@
+<!-- based on the 'bin' descriptor -->
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" 
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+    <id>distribution</id>
+    <formats>
+        <format>tar.gz</format>
+    </formats>
+    <fileSets>
+        <fileSet>
+            <directory>${project.basedir}/doc</directory>
+            <outputDirectory>/doc</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>${project.build.directory}</directory>
+            <outputDirectory>/war</outputDirectory>
+            <includes>
+                <include>*.war</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>${project.build.directory}/site</directory>
+            <outputDirectory>docs</outputDirectory>
+        </fileSet>
+    </fileSets>
+</assembly>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/AdminUsersService.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/AdminUsersService.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/AdminUsersService.java	(revision 5623)
@@ -0,0 +1,11 @@
+package eu.clarin.cmdi.virtualcollectionregistry;
+
+/**
+ *
+ * @author twagoo
+ */
+public interface AdminUsersService {
+
+    boolean isAdmin(String user);
+    
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/AdminUsersServiceImpl.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/AdminUsersServiceImpl.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/AdminUsersServiceImpl.java	(revision 5623)
@@ -0,0 +1,66 @@
+package eu.clarin.cmdi.virtualcollectionregistry;
+
+import java.io.BufferedReader;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.HashSet;
+import java.util.Set;
+import javax.annotation.PostConstruct;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+/**
+ *
+ * @author twagoo
+ */
+@Component
+public class AdminUsersServiceImpl implements AdminUsersService {
+
+    private final static Logger logger = LoggerFactory.getLogger(AdminUsersServiceImpl.class);
+    private final Set<String> adminUsers = new HashSet<>();
+
+    @Value("${eu.clarin.cmdi.virtualcollectionregistry.admindb:}")
+    private String adminDb;
+
+    @Override
+    public final boolean isAdmin(String user) {
+        logger.debug("Checking admin rights of {}", user);
+        return adminUsers.contains(user);
+    }
+
+    @PostConstruct
+    protected final void init() {
+        if (adminDb != null && !adminDb.isEmpty()) {
+            logger.info("Reading admin user database");
+            try {
+                loadAdminDatabase(adminDb);
+            } catch (IOException e) {
+                throw new RuntimeException("Could not load admin user database", e);
+            }
+        }
+        if (adminUsers.isEmpty()) {
+            logger.warn("No admin users have been defined");
+        } else {
+            logger.debug("Admin users: {}", adminUsers);
+        }
+    }
+
+    private void loadAdminDatabase(String filename) throws IOException {
+        adminUsers.clear();
+        try (BufferedReader reader = new BufferedReader(new InputStreamReader(
+                new FileInputStream(filename)))) {
+            String line;
+            while ((line = reader.readLine()) != null) {
+                line = line.trim();
+                if (line.isEmpty() || line.startsWith("#")) {
+                    continue;
+                }
+                adminUsers.add(line);
+            } // while
+        }
+    }
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/DataStore.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/DataStore.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/DataStore.java	(revision 5623)
@@ -0,0 +1,85 @@
+package eu.clarin.cmdi.virtualcollectionregistry;
+
+import java.util.Map;
+import javax.persistence.EntityManager;
+import javax.persistence.EntityManagerFactory;
+import javax.persistence.EntityTransaction;
+import javax.persistence.Persistence;
+import javax.servlet.ServletContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.DisposableBean;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public class DataStore implements DisposableBean {
+
+    private static final Logger logger = LoggerFactory.getLogger(DataStore.class);
+    private final EntityManagerFactory emf;
+    private final ThreadLocal<EntityManager> em;
+
+    @Autowired
+    public DataStore(ServletContext servletContext) throws VirtualCollectionRegistryException {
+        this(ServletUtils.createParameterMap(servletContext));
+    }
+
+    public DataStore(Map<String, String> config)
+            throws VirtualCollectionRegistryException {
+        try {
+            emf = Persistence.createEntityManagerFactory(
+                    "VirtualCollectionStore", config);
+            em = new ThreadLocal<EntityManager>() {
+                @Override
+                protected EntityManager initialValue() {
+                    if (emf == null) {
+                        throw new InternalError(
+                                "JPA not initalizied correctly");
+                    }
+                    if (logger.isDebugEnabled()) {
+                        logger.trace("Creating new thread local entity manager in thread {}", Thread.currentThread().getName());
+                    }
+                    return emf.createEntityManager();
+                }
+            };
+        } catch (Exception e) {
+            logger.error("error initializing data store", e);
+            throw new VirtualCollectionRegistryException(
+                    "error initializing", e);
+        }
+        logger.trace("data store was successfully initialized");
+    }
+
+    @Override
+    public void destroy() throws VirtualCollectionRegistryException {
+        if (emf != null) {
+            logger.info("Closing entity manager factory");
+            emf.close();
+        }
+    }
+
+    public EntityManager getEntityManager() {
+        logger.trace("Entity manager requested in thread");
+        final EntityManager manager = em.get();
+        if (logger.isTraceEnabled()) {
+            logger.trace("Returning entity manager {} (isOpen = {})", manager, manager.isOpen());
+        }
+        return manager;
+    }
+
+    public void closeEntityManager() {
+        logger.trace("Closing of entity manager requested");
+        EntityManager manager = em.get();
+        if (manager != null) {
+            em.remove();
+            EntityTransaction tx = manager.getTransaction();
+            if (tx.isActive()) {
+                logger.debug("Entity manager has active transaction, rolling back");
+                tx.rollback();
+            }
+            logger.trace("Closing entity manager");
+            manager.close();
+        }
+    }
+
+} // class DataStore
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/QueryOptions.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/QueryOptions.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/QueryOptions.java	(revision 5623)
@@ -0,0 +1,547 @@
+package eu.clarin.cmdi.virtualcollectionregistry;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Expression;
+import javax.persistence.criteria.Order;
+import javax.persistence.criteria.Predicate;
+import javax.persistence.criteria.Root;
+
+import eu.clarin.cmdi.virtualcollectionregistry.model.User_;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection_;
+
+@SuppressWarnings("serial")
+public class QueryOptions implements Serializable {
+    public enum Property {
+        VC_OWNER,
+        VC_NAME,
+        VC_TYPE,
+        VC_STATE,
+        VC_DESCRIPTION,
+        VC_CREATION_DATE
+    } // enum QueryOptions.Property
+
+    public enum Relation {
+        EQ, NE, LT, LE, GT, GE;
+
+        private byte getCode() {
+            switch (this) {
+            case EQ:
+                return RELATION_EQ;
+            case NE:
+                return RELATION_NE;
+            case LT:
+                return RELATION_LT;
+            case LE:
+                return RELATION_LE;
+            case GT:
+                return RELATION_GT;
+            case GE:
+                return RELATION_GE;
+            }
+            return -1;
+        }
+    } // enum QueryOptions.Relation
+
+
+    private static final byte RELATION_EQ = 0x01;
+    private static final byte RELATION_NE = 0x02;
+    private static final byte RELATION_LT = 0x04;
+    private static final byte RELATION_LE = 0x08;
+    private static final byte RELATION_GT = 0x10;
+    private static final byte RELATION_GE = 0x20;
+    private static final byte RELATIONS_EQ_NE = RELATION_EQ | RELATION_NE;
+    private static final byte RELATIONS_ALL   = RELATION_EQ | RELATION_NE |
+                                                RELATION_LT | RELATION_LE |
+                                                RELATION_GT | RELATION_GE;
+    public static final List<AbstractPropertyImpl> PROPERTIES =
+        Arrays.asList(
+                new PropertyImplOwner(),
+                new PropertyImplName(),
+                new PropertyImplType(),
+                new PropertyImplState(),
+                new PropertyImplDescription(),
+                new PropertyImplCreationDate()
+        );
+    private Filter filter;
+    private List<OrderBy> orderByItems;
+
+
+    public QueryOptions() {
+        super();
+    }
+
+    public Filter getFilter() {
+        return filter;
+    }
+
+    public void setFilter(Filter filter) {
+        this.filter = filter;
+    }
+
+    public boolean addSortProperty(Property property, boolean asc) {
+        if (property == null) {
+            throw new IllegalArgumentException("property == null");
+        }
+        final AbstractPropertyImpl impl = getPropertyImpl(property);
+        if (orderByItems == null) {
+            orderByItems = new ArrayList<OrderBy>();
+        } else {
+            for (OrderBy item : orderByItems) {
+                if (item.getProperty().equals(impl)) {
+                    return false;
+                }
+            }
+        }
+        orderByItems.add(new OrderBy(impl, asc));
+        return true;
+    }
+
+    public Filter and() {
+        return new AndFilter();
+    }
+
+    public Filter or() {
+        return new OrFilter();
+    }
+
+    public Filter expr(Property property, Relation relation, Object value) {
+        if (property == null) {
+            throw new IllegalArgumentException("property == null");
+        }
+        if (relation == null) {
+            throw new IllegalArgumentException("relation == null");
+        }
+        if (value == null) {
+            throw new IllegalArgumentException("value == null");
+        }
+        final AbstractPropertyImpl impl = getPropertyImpl(property);
+        if (!impl.isValidRelation(relation)) {
+            throw new IllegalArgumentException("invalid relation");
+        }
+        return new ExpressionFilter(impl, relation.getCode(), value);
+    }
+
+    Predicate getWhere(CriteriaBuilder cb, CriteriaQuery<?> cq,
+            Root<VirtualCollection> root) {
+        if (filter != null) {
+            return filter.makePredicate(cb, cq, root);
+        }
+        return null;
+    }
+
+    Order[] getOrderBy(CriteriaBuilder cb, Root<VirtualCollection> root) {
+        Order[] order = null;
+        if (orderByItems != null) {
+            order = new Order[orderByItems.size()];
+            int i = 0;
+            for (OrderBy item : orderByItems) {
+                order[i++] = item.makeOrder(cb, root);
+            }
+        }
+        return order;
+    }
+
+    private static AbstractPropertyImpl getPropertyImpl(Property property) {
+        for (AbstractPropertyImpl predicate : PROPERTIES) {
+            if (predicate.matchProperty(property)) {
+                return predicate;
+            }
+        }
+        return null;
+    }
+
+
+    public abstract class Filter implements Serializable {
+        public final Filter add(Property property, Relation relation,
+                Object value) {
+            if (property == null) {
+                throw new IllegalArgumentException("property == null");
+            }
+            if (relation == null) {
+                throw new IllegalArgumentException("relation == null");
+            }
+            if (value == null) {
+                throw new IllegalArgumentException("value == null");
+            }
+            final AbstractPropertyImpl impl = getPropertyImpl(property);
+            if (!impl.isValidRelation(relation)) {
+                throw new IllegalArgumentException("invalid relation");
+            }
+            doAdd(new ExpressionFilter(impl, relation.getCode(), value));
+            return this;
+        }
+
+        public abstract Filter add(Filter filter);
+
+        protected abstract void doAdd(ExpressionFilter filter);
+
+        protected abstract Predicate makePredicate(CriteriaBuilder cb,
+                CriteriaQuery<?> cq, Root<VirtualCollection> root);
+    } // QueryOptions.Filter
+
+
+    public final class AndFilter extends Filter {
+        private final List<Filter> items = new ArrayList<Filter>();
+
+        private AndFilter() {
+        }
+
+        @Override
+        public Filter add(Filter filter) {
+            if (filter == null) {
+                throw new IllegalArgumentException("filter == null");
+            }
+            if (filter == this) {
+                throw new IllegalArgumentException("filter == this");
+            }
+            items.add(filter);
+            return this;
+        }
+
+        @Override
+        protected void doAdd(ExpressionFilter filter) {
+            items.add(filter);
+        }
+
+        @Override
+        protected Predicate makePredicate(CriteriaBuilder cb,
+                CriteriaQuery<?> cq, Root<VirtualCollection> root) {
+            Predicate[] preds = new Predicate[items.size()];
+            int i = 0;
+            for (Filter filter : items) {
+                preds[i++] = filter.makePredicate(cb, cq, root);
+            }
+            return cb.and(preds);
+        }
+    } // QueryOptions.AndFilter
+
+
+    public final class OrFilter extends Filter {
+        private final List<Filter> items = new ArrayList<Filter>();
+
+        private OrFilter() {
+        }
+
+        @Override
+        public Filter add(Filter filter) {
+            if (filter == null) {
+                throw new IllegalArgumentException("filter == null");
+            }
+            if (filter == this) {
+                throw new IllegalArgumentException("filter == this");
+            }
+            items.add(filter);
+            return this;
+        }
+
+        @Override
+        protected void doAdd(ExpressionFilter filter) {
+            items.add(filter);
+        }
+
+        @Override
+        protected Predicate makePredicate(CriteriaBuilder cb,
+                CriteriaQuery<?> cq, Root<VirtualCollection> root) {
+            Predicate[] preds = new Predicate[items.size()];
+            int i = 0;
+            for (Filter filter : items) {
+                preds[i++] = filter.makePredicate(cb, cq, root);
+            }
+            return cb.or(preds);
+        }
+    } // QueryOptions.OrFilter
+
+
+    private final class ExpressionFilter extends Filter {
+        private final AbstractPropertyImpl property;
+        private final byte relation;
+        private final Object value;
+
+        private ExpressionFilter(AbstractPropertyImpl property, byte relation,
+                Object value) {
+            this.property = property;
+            this.relation = relation;
+            this.value = value;
+        }
+
+        @Override
+        public Filter add(Filter filter) {
+            throw new RuntimeException("not permitted");
+        }
+
+        @Override
+        protected void doAdd(ExpressionFilter filter) {
+            throw new RuntimeException("not permitted");
+        }
+
+        @Override
+        public Predicate makePredicate(CriteriaBuilder cb, CriteriaQuery<?> cq,
+                Root<VirtualCollection> root) {
+            return property.getPredicate(cb, cq, root, relation, value);
+        }
+    } // QueryOptions.PropertyFilter
+
+
+    private static final class OrderBy implements Serializable {
+        private final AbstractPropertyImpl property;
+        private final boolean asc;
+
+        public OrderBy(AbstractPropertyImpl property, boolean asc) {
+            this.property = property;
+            this.asc = asc;
+        }
+
+        public AbstractPropertyImpl getProperty() {
+            return property;
+        }
+
+        public Order makeOrder(CriteriaBuilder cb, Root<VirtualCollection> root) {
+            if (asc) {
+                return cb.asc(property.getExpression(root));
+            } else {
+                return cb.desc(property.getExpression(root));
+            }
+        }
+    } // class QueryOptions.OrderBy
+
+    private static abstract class AbstractPropertyImpl {
+        public abstract Property getProperty();
+
+        public abstract byte getValidRelationMask();
+
+        public abstract Expression<?> getExpression(
+                Root<VirtualCollection> root);
+
+        public abstract Predicate getPredicate(CriteriaBuilder cb,
+                CriteriaQuery<?> cq, Root<VirtualCollection> root,
+                byte relation, Object value);
+
+        public final boolean matchProperty(Property property) {
+            return getProperty() == property;
+        }
+
+        public final boolean isValidRelation(Relation relation) {
+            return (getValidRelationMask() & relation.getCode()) > 0;
+        }
+
+        protected static final Predicate makePredicate(
+                CriteriaBuilder cb, Expression<?> expr, byte relation,
+                Object value) {
+            switch (relation) {
+            case RELATION_EQ:
+                return cb.equal(expr, value);
+            case RELATION_NE:
+                return cb.notEqual(expr, value);
+            default:
+                throw new InternalError("bad relation");
+            } // switch
+        }
+
+        protected static final Predicate makeDatePredicate(
+                CriteriaBuilder cb, Expression<Date> expr, byte relation,
+                Date value) {
+            switch (relation) {
+            case RELATION_EQ:
+                return cb.equal(expr, value);
+            case RELATION_NE:
+                return cb.notEqual(expr, value);
+            case RELATION_GT:
+                return cb.greaterThan(expr, value);
+            case RELATION_GE:
+                return cb.greaterThanOrEqualTo(expr, value);
+            case RELATION_LT:
+                return cb.lessThan(expr, value);
+            case RELATION_LE:
+                return cb.lessThanOrEqualTo(expr, value);
+            default:
+                throw new InternalError("bad relation");
+            } // switch
+        }
+
+        protected static final Predicate makeStringPredicate(
+                CriteriaBuilder cb, Expression<String> expr, byte relation,
+                String value) {
+            // escape SQL specific stuff
+            value = value.replace("\\", "\\\\");
+            value = value.replace("%", "\\%");
+            value = value.replace("_", "\\_");
+            // replace query language wildcards with add SQL wildcards
+            value = value.replace("*", "%");
+
+            switch (relation) {
+            case RELATION_EQ:
+                return cb.like(expr, value);
+            case RELATION_NE:
+                return cb.notLike(expr, value);
+            default:
+                throw new InternalError("bad relation");
+            } // switch
+        }
+    } // class QueryOptions.AbstractPropertyImpl
+
+
+    private static final class PropertyImplOwner extends
+            AbstractPropertyImpl {
+        @Override
+        public Property getProperty() {
+            return Property.VC_OWNER;
+        }
+
+        @Override
+        public byte getValidRelationMask() {
+            return RELATIONS_EQ_NE;
+        }
+
+        @Override
+        public Expression<String> getExpression(Root<VirtualCollection> root) {
+            return root.get(VirtualCollection_.owner).get(User_.name);
+        }
+
+        @Override
+        public Predicate getPredicate(CriteriaBuilder cb, CriteriaQuery<?> cq,
+                Root<VirtualCollection> root, byte relation, Object value) {
+            final Expression<String> expr = getExpression(root);
+            return makeStringPredicate(cb, expr, relation, (String) value);
+        }
+    } // class QueryOptions.PropertyImplOwner
+
+
+    private static final class PropertyImplName extends
+            AbstractPropertyImpl {
+        @Override
+        public Property getProperty() {
+            return Property.VC_NAME;
+        }
+
+        @Override
+        public byte getValidRelationMask() {
+            return RELATIONS_EQ_NE;
+        }
+
+        @Override
+        public Expression<String> getExpression(Root<VirtualCollection> root) {
+            return root.get(VirtualCollection_.name);
+        }
+
+        @Override
+        public Predicate getPredicate(CriteriaBuilder cb, CriteriaQuery<?> cq,
+                Root<VirtualCollection> root, byte relation, Object value) {
+            final Expression<String> expr = getExpression(root);
+            return makeStringPredicate(cb, expr, relation, (String) value);
+        }
+    } // class QueryOptions.PropertyImplName
+
+
+    private static final class PropertyImplType extends AbstractPropertyImpl {
+        @Override
+        public Property getProperty() {
+            return Property.VC_TYPE;
+        }
+
+        @Override
+        public byte getValidRelationMask() {
+            return RELATIONS_EQ_NE;
+        }
+
+        @Override
+        public Expression<VirtualCollection.Type> getExpression(
+                Root<VirtualCollection> root) {
+            return root.get(VirtualCollection_.type);
+        }
+
+        @Override
+        public Predicate getPredicate(CriteriaBuilder cb, CriteriaQuery<?> cq,
+                Root<VirtualCollection> root, byte relation, Object value) {
+            final Expression<VirtualCollection.Type> expr =
+                getExpression(root);
+            return makePredicate(cb, expr, relation, value);
+        }
+    } // class QueryOptions.PropertyImplName
+
+
+    private static final class PropertyImplState extends AbstractPropertyImpl {
+        @Override
+        public Property getProperty() {
+            return Property.VC_STATE;
+        }
+
+        @Override
+        public byte getValidRelationMask() {
+            return RELATIONS_EQ_NE;
+        }
+
+        @Override
+        public Expression<VirtualCollection.State> getExpression(
+                Root<VirtualCollection> root) {
+            return root.get(VirtualCollection_.state);
+        }
+
+        @Override
+        public Predicate getPredicate(CriteriaBuilder cb, CriteriaQuery<?> cq,
+                Root<VirtualCollection> root, byte relation, Object value) {
+            final Expression<VirtualCollection.State> expr =
+                getExpression(root);
+            return makePredicate(cb, expr, relation, value);
+        }
+    } // class QueryOptions.PropertyImplName
+
+    private static final class PropertyImplDescription extends
+            AbstractPropertyImpl {
+        @Override
+        public Property getProperty() {
+            return Property.VC_DESCRIPTION;
+        }
+
+        @Override
+        public byte getValidRelationMask() {
+            return RELATIONS_EQ_NE;
+        }
+
+        @Override
+        public Expression<String> getExpression(Root<VirtualCollection> root) {
+            return root.get(VirtualCollection_.description);
+        }
+
+        @Override
+        public Predicate getPredicate(CriteriaBuilder cb, CriteriaQuery<?> cq,
+                Root<VirtualCollection> root, byte relation, Object value) {
+            final Expression<String> expr =
+                getExpression(root);
+            return makeStringPredicate(cb, expr, relation, (String) value);
+        }
+    }
+
+    private static final class PropertyImplCreationDate extends
+            AbstractPropertyImpl {
+        @Override
+        public Property getProperty() {
+            return Property.VC_CREATION_DATE;
+        }
+
+        @Override
+        public byte getValidRelationMask() {
+            return RELATIONS_ALL;
+        }
+
+        @Override
+        public Expression<Date> getExpression(Root<VirtualCollection> root) {
+            return root.get(VirtualCollection_.creationDate);
+        }
+
+        @Override
+        public Predicate getPredicate(CriteriaBuilder cb, CriteriaQuery<?> cq,
+                Root<VirtualCollection> root, byte relation, Object value) {
+            final Expression<Date> expr = getExpression(root);
+            return makeDatePredicate(cb, expr, relation, (Date) value);
+        }
+    }
+
+} // class QueryOptions
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/ServletUtils.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/ServletUtils.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/ServletUtils.java	(revision 5623)
@@ -0,0 +1,46 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package eu.clarin.cmdi.virtualcollectionregistry;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.ServletContext;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ *
+ * @author twagoo
+ */
+public class ServletUtils {
+
+    private final static Logger logger = LoggerFactory.getLogger(ServletUtils.class);
+
+    public static Map<String, String> createParameterMap(ServletContext servletContext) {
+        if (servletContext == null) {
+            logger.warn("Could not create parameters map, no servlet context provided");
+            return Collections.emptyMap();
+        } else {
+            @SuppressWarnings("unchecked")
+            final List<Object> params = Collections.list(servletContext.getInitParameterNames());
+            final Map<String, String> paramMap = new HashMap<String, String>(params.size());
+            for (Object param : params) {
+                final String paramName = param.toString();
+                final String paramValue = servletContext.getInitParameter(paramName);
+                if (paramValue != null) {
+                    logger.debug("Found context parameter: {} = '{}'", paramName, paramValue);
+                    paramMap.put(paramName, paramValue);
+                }
+            }
+            return paramMap;
+        }
+    }
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/VirtualCollectionNotFoundException.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/VirtualCollectionNotFoundException.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/VirtualCollectionNotFoundException.java	(revision 5623)
@@ -0,0 +1,11 @@
+package eu.clarin.cmdi.virtualcollectionregistry;
+
+public class VirtualCollectionNotFoundException extends
+        VirtualCollectionRegistryException {
+    private static final long serialVersionUID = 1L;
+
+    public VirtualCollectionNotFoundException(long id) {
+        super("virtual collection with id " + id + " was not found");
+    }
+
+} // class VirtualCollectionNotFoundException
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/VirtualCollectionRegistry.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/VirtualCollectionRegistry.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/VirtualCollectionRegistry.java	(revision 5623)
@@ -0,0 +1,707 @@
+package eu.clarin.cmdi.virtualcollectionregistry;
+
+import eu.clarin.cmdi.oai.provider.impl.OAIProvider;
+import eu.clarin.cmdi.virtualcollectionregistry.model.User;
+import eu.clarin.cmdi.virtualcollectionregistry.model.User_;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollectionList;
+import eu.clarin.cmdi.virtualcollectionregistry.pid.PersistentIdentifier;
+import eu.clarin.cmdi.virtualcollectionregistry.pid.PersistentIdentifierProvider;
+import eu.clarin.cmdi.virtualcollectionregistry.query.ParsedQuery;
+import eu.clarin.cmdi.virtualcollectionregistry.service.VirtualCollectionValidator;
+import java.security.Principal;
+import java.util.Date;
+import java.util.List;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
+import javax.persistence.EntityManager;
+import javax.persistence.EntityTransaction;
+import javax.persistence.LockModeType;
+import javax.persistence.NoResultException;
+import javax.persistence.TypedQuery;
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Order;
+import javax.persistence.criteria.Predicate;
+import javax.persistence.criteria.Root;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.DisposableBean;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Service;
+
+@Service
+public class VirtualCollectionRegistry implements InitializingBean, DisposableBean {
+
+    @Autowired
+    private DataStore datastore; //TODO: replace with Spring managed EM?
+    @Autowired
+    private PersistentIdentifierProvider pid_provider;
+    @Autowired
+    private OAIProvider oaiProvider;
+    @Autowired
+    @Qualifier("creation")
+    private VirtualCollectionValidator validator;
+    @Autowired
+    private AdminUsersService adminUsersService;
+
+    private static final Logger logger
+            = LoggerFactory.getLogger(VirtualCollectionRegistry.class);
+    private final AtomicBoolean intialized = new AtomicBoolean(false);
+    /**
+     * Scheduled executor service for the maintenance check
+     *
+     * @see #maintenance(long)
+     */
+    private final ScheduledExecutorService maintenanceExecutor
+            = createSingleThreadScheduledExecutor("VirtualCollectionRegistry-Maintenance");
+
+    @Override
+    public void afterPropertiesSet() throws VirtualCollectionRegistryException {
+        // called by Spring directly after Bean construction
+        doInitalize();
+    }
+
+    private void doInitalize() throws VirtualCollectionRegistryException {
+        if (intialized.get()) {
+            throw new VirtualCollectionRegistryException("already initialized");
+        }
+        logger.info("Initializing virtual collection registry ...");
+        try {
+            maintenanceExecutor.scheduleWithFixedDelay(new Runnable() {
+
+                @Override
+                public void run() {
+                    maintenance(new Date().getTime());
+                }
+            }, 60, 60, TimeUnit.SECONDS);
+            this.intialized.set(true);
+            logger.info("virtual collection registry successfully intialized");
+        } catch (RuntimeException e) {
+            logger.error("error initalizing virtual collection registry", e);
+            throw e;
+        }
+    }
+
+    @Override
+    public void destroy() throws VirtualCollectionRegistryException, InterruptedException {
+        logger.info("Stopping Virtual Collection Registry maintenance schedule");
+        maintenanceExecutor.shutdown();
+        if (!maintenanceExecutor.awaitTermination(60, TimeUnit.SECONDS)) {
+            logger.warn("Timeout while waiting for maintenance thread to terminate, will try to shut down");
+        }
+
+        logger.info("Shutting down OAI provider");
+        oaiProvider.shutdown();
+    }
+
+    /**
+     * Will store the specified collection; it will also set the owner according
+     * to the specified principal and set its state to
+     * {@link VirtualCollection.State#PRIVATE}
+     *
+     * @param principal owner principal
+     * @param vc collection to store
+     * @return identifier of the persisted collection
+     * @throws VirtualCollectionRegistryException
+     */
+    public long createVirtualCollection(Principal principal,
+            VirtualCollection vc) throws VirtualCollectionRegistryException {
+        if (principal == null) {
+            throw new NullPointerException("principal == null");
+        }
+        if (vc == null) {
+            throw new NullPointerException("vc == null");
+        }
+
+        logger.debug("creating virtual collection");
+
+        validator.validate(vc);
+        try {
+            EntityManager em = datastore.getEntityManager();
+            em.getTransaction().begin();
+
+            // fetch user, if user does not exist create new
+            User user = fetchUser(em, principal);
+            if (user == null) {
+                user = new User(principal.getName());
+                em.persist(user);
+            }
+            vc.setOwner(user);
+
+            // force new collection to be private
+            vc.setState(VirtualCollection.State.PRIVATE);
+
+            // store virtual collection
+            logger.debug("persisting new virtual collection", vc.getId());
+            em.persist(vc);
+            em.getTransaction().commit();
+            logger.debug("virtual collection created (id={})", vc.getId());
+            return vc.getId();
+        } catch (Exception e) {
+            logger.error("error while creating virtual collection", e);
+            throw new VirtualCollectionRegistryException(
+                    "error while creating virtual collection", e);
+        }
+    }
+
+    public long updateVirtualCollection(Principal principal, long id,
+            VirtualCollection vc) throws VirtualCollectionRegistryException {
+        if (principal == null) {
+            throw new NullPointerException("principal == null");
+        }
+        if (id <= 0) {
+            throw new IllegalArgumentException("id <= 0");
+        }
+        if (vc == null) {
+            throw new NullPointerException("vc == null");
+        }
+
+        logger.debug("updating virtual collection (id={})", id);
+
+        validator.validate(vc);
+
+        try {
+            EntityManager em = datastore.getEntityManager();
+            em.getTransaction().begin();
+            VirtualCollection c = em.find(VirtualCollection.class,
+                    Long.valueOf(id), LockModeType.PESSIMISTIC_WRITE);
+            /*
+             * Do not check for deleted state here, as we might want to
+             * resurrect deleted virtual collections.
+             */
+            if (c == null) {
+                logger.debug("virtual collection (id={}) not found", id);
+                throw new VirtualCollectionNotFoundException(id);
+            }
+            if (!isAllowedToModify(principal, c)) {
+                throw new VirtualCollectionRegistryPermissionException(
+                        "permission denied for user \""
+                        + principal.getName() + "\"");
+            }
+
+            // update virtual collection
+            c.updateFrom(vc);
+
+            validator.validate(c);
+            em.merge(c);
+            em.getTransaction().commit();
+            logger.debug("updated virtual collection (id={})", vc.getId());
+            return c.getId();
+        } catch (VirtualCollectionRegistryException e) {
+            logger.warn("failed updating virtual collecion (id={}): {}", id,
+                    e.getMessage());
+            throw e;
+        } catch (Exception e) {
+            logger.error("error while updating virtual collection", e);
+            throw new VirtualCollectionRegistryException(
+                    "error while updating virtual collection", e);
+        }
+    }
+
+    public long deleteVirtualCollection(Principal principal, long id)
+            throws VirtualCollectionRegistryException {
+        if (principal == null) {
+            throw new NullPointerException("principal == null");
+        }
+        if (id <= 0) {
+            throw new IllegalArgumentException("id <= 0");
+        }
+
+        logger.debug("deleting virtual collection (id={})", id);
+
+        try {
+            EntityManager em = datastore.getEntityManager();
+            em.getTransaction().begin();
+            VirtualCollection vc = em.find(VirtualCollection.class,
+                    Long.valueOf(id), LockModeType.PESSIMISTIC_WRITE);
+            if ((vc == null) || vc.isDeleted()) {
+                logger.debug("virtual collection (id={}) not found", id);
+                throw new VirtualCollectionNotFoundException(id);
+            }
+            if (!isAllowedToModify(principal, vc)) {
+                logger.debug("virtual collection (id={}) not owned by "
+                        + "user '{}'", id, principal.getName());
+                throw new VirtualCollectionRegistryPermissionException(
+                        "permission denied for user \""
+                        + principal.getName() + "\"");
+            }
+            if (!vc.isPrivate()) {
+                logger.debug("virtual collection (id={}) cannot be "
+                        + "deleted (invalid state)", id);
+                throw new VirtualCollectionRegistryPermissionException(
+                        "virtual collection cannot be deleted");
+            }
+            vc.setState(VirtualCollection.State.DELETED);
+            em.getTransaction().commit();
+            return vc.getId();
+        } catch (VirtualCollectionRegistryException e) {
+            logger.debug("failed deleting virtual collecion (id={}): {}", id,
+                    e.getMessage());
+            throw e;
+        } catch (Exception e) {
+            logger.error("error while deleting virtual collection", e);
+            throw new VirtualCollectionRegistryException(
+                    "error while deleting virtual collection", e);
+        }
+    }
+
+    public VirtualCollection.State getVirtualCollectionState(long id)
+            throws VirtualCollectionRegistryException {
+        if (id <= 0) {
+            throw new IllegalArgumentException("id <= 0");
+        }
+
+        logger.debug("retrieve virtual collection state (id={})", id);
+
+        try {
+            EntityManager em = datastore.getEntityManager();
+            em.getTransaction().begin();
+            VirtualCollection vc
+                    = em.find(VirtualCollection.class, Long.valueOf(id));
+            em.getTransaction().commit();
+            if ((vc == null) || vc.isDeleted()) {
+                logger.debug("virtual collection (id={}) not found", id);
+                throw new VirtualCollectionNotFoundException(id);
+            }
+            return vc.getState();
+        } catch (VirtualCollectionRegistryException e) {
+            throw e;
+        } catch (Exception e) {
+            logger.error(
+                    "error while retrieving state of virtual collection", e);
+            throw new VirtualCollectionRegistryException(
+                    "error while retrieving state of virtual collection", e);
+        }
+    }
+
+    public void setVirtualCollectionState(Principal principal, long id,
+            VirtualCollection.State state)
+            throws VirtualCollectionRegistryException {
+        if (principal == null) {
+            throw new NullPointerException("principal == null");
+        }
+        if (id <= 0) {
+            throw new IllegalArgumentException("id <= 0");
+        }
+        if (state == null) {
+            throw new NullPointerException("state == null");
+        }
+        if ((state != VirtualCollection.State.PUBLIC_PENDING)
+                && (state != VirtualCollection.State.PRIVATE)) {
+            throw new IllegalArgumentException(
+                    "only PUBLIC_PENDING or PRIVATE are allowed");
+        }
+
+        logger.debug("setting state virtual collection state (id={}) to '{}'",
+                id, state);
+
+        try {
+            EntityManager em = datastore.getEntityManager();
+            em.getTransaction().begin();
+            VirtualCollection vc = em.find(VirtualCollection.class,
+                    Long.valueOf(id), LockModeType.PESSIMISTIC_WRITE);
+            if ((vc == null) || vc.isDeleted()) {
+                logger.debug("virtual collection (id={}) not found", id);
+                throw new VirtualCollectionNotFoundException(id);
+            }
+            if (!isAllowedToModify(principal, vc)) {
+                logger.debug("virtual collection (id={}) not owned by "
+                        + "user '{}'", id, principal.getName());
+                throw new VirtualCollectionRegistryPermissionException(
+                        "permission denied for user \""
+                        + principal.getName() + "\"");
+            }
+
+            /*
+             * XXX: deny update from public to private?
+             */
+            boolean update = false;
+            switch (state) {
+                case PRIVATE:
+                    update = vc.getState() != state;
+                    break;
+                case PUBLIC_PENDING:
+                    update = vc.getState() != VirtualCollection.State.PUBLIC;
+                    break;
+                default:
+                    /* silence warning; update will stay false */
+                    break;
+            }
+            if (update) {
+                vc.setState(state);
+                em.persist(vc);
+            }
+            em.getTransaction().commit();
+        } catch (VirtualCollectionRegistryException e) {
+            throw e;
+        } catch (Exception e) {
+            logger.error(
+                    "error while setting state of virtual collection", e);
+            throw new VirtualCollectionRegistryException(
+                    "error while setting state of virtual collection", e);
+        }
+    }
+
+    /**
+     *
+     * @param id identifier of the virtual collection to retrieve
+     * @return the identified virtual collection, never null
+     * @throws VirtualCollectionRegistryException if no virtual collection with
+     * the specified identifier exists
+     */
+    public VirtualCollection retrieveVirtualCollection(long id)
+            throws VirtualCollectionRegistryException {
+        if (id <= 0) {
+            throw new IllegalArgumentException("id <= 0");
+        }
+
+        logger.debug("retrieve virtual collection (id={})", id);
+
+        try {
+            EntityManager em = datastore.getEntityManager();
+            em.getTransaction().begin();
+            VirtualCollection vc
+                    = em.find(VirtualCollection.class, Long.valueOf(id));
+            em.getTransaction().commit();
+            if ((vc == null) || vc.isDeleted()) {
+                logger.debug("virtual collection (id={}) not found", id);
+                throw new VirtualCollectionNotFoundException(id);
+            }
+            logger.debug("virtual collection retrieved (id={})", id);
+            return vc;
+        } catch (VirtualCollectionRegistryException e) {
+            throw e;
+        } catch (Exception e) {
+            logger.error("error while retrieving virtual collection", e);
+            throw new VirtualCollectionRegistryException(
+                    "error while retrieving virtual collection", e);
+        }
+    }
+
+    public VirtualCollectionList getVirtualCollections(String query,
+            int offset, int count) throws VirtualCollectionRegistryException {
+        EntityManager em = datastore.getEntityManager();
+        try {
+            em.getTransaction().begin();
+
+            // setup queries
+            TypedQuery<Long> cq = null;
+            TypedQuery<VirtualCollection> q = null;
+            if (query != null) {
+                ParsedQuery parsedQuery = ParsedQuery.parseQuery(query);
+                if (logger.isDebugEnabled()) {
+                    logger.debug(parsedQuery.getPrettyPrinted());
+                }
+                cq = parsedQuery.getCountQuery(em, null, VirtualCollection.State.PUBLIC);
+                q = parsedQuery.getQuery(em, null, VirtualCollection.State.PUBLIC);
+            } else {
+                cq = em.createNamedQuery("VirtualCollection.countAllPublic",
+                        Long.class);
+                q = em.createNamedQuery("VirtualCollection.findAllPublic",
+                        VirtualCollection.class);
+            }
+
+            // commence query ...
+            List<VirtualCollection> results = null;
+            long totalCount = cq.getSingleResult();
+
+            // optimization; don't query, if we won't get any results
+            /*
+             *  FIXME: offset == -1 is temporary hack for just fetching
+             *  total count; re-factor to have fetch-count and fetch-data
+             *  methods!
+             */
+            if ((totalCount > 0) && (offset > -1)) {
+                if (offset > 0) {
+                    q.setFirstResult(offset);
+                }
+                if (count > 0) {
+                    q.setMaxResults(count);
+                }
+                results = q.getResultList();
+            }
+            return new VirtualCollectionList(results, offset, (int) totalCount);
+        } catch (Exception e) {
+            logger.error("error while enumerating virtual collections", e);
+            throw new VirtualCollectionRegistryException(
+                    "error while enumerating virtual collections", e);
+        } finally {
+            EntityTransaction tx = em.getTransaction();
+            if ((tx != null) && !tx.getRollbackOnly()) {
+                tx.commit();
+            }
+        }
+    }
+
+    public VirtualCollectionList getVirtualCollections(Principal principal,
+            String query, int offset, int count)
+            throws VirtualCollectionRegistryException {
+        if (principal == null) {
+            throw new NullPointerException("principal == null");
+        }
+        EntityManager em = datastore.getEntityManager();
+        try {
+            List<VirtualCollection> results = null;
+            long totalCount = 0;
+
+            em.getTransaction().begin();
+
+            /*
+             * fetch user. if user is not found, he has not yet registered any
+             * virtual collections, so just return an empty list
+             */
+            User user = fetchUser(em, principal);
+            if (user != null) {
+                // setup queries
+                TypedQuery<Long> cq = null;
+                TypedQuery<VirtualCollection> q = null;
+                if (query != null) {
+                    ParsedQuery parsedQuery = ParsedQuery.parseQuery(query);
+                    if (logger.isDebugEnabled()) {
+                        logger.debug(parsedQuery.getPrettyPrinted());
+                    }
+                    cq = parsedQuery.getCountQuery(em, user, null);
+                    q = parsedQuery.getQuery(em, user, null);
+                } else {
+                    cq = em.createNamedQuery("VirtualCollection.countByOwner",
+                            Long.class);
+                    cq.setParameter("owner", user);
+                    q = em.createNamedQuery("VirtualCollection.findByOwner",
+                            VirtualCollection.class);
+                    q.setParameter("owner", user);
+                }
+
+                // commence query ...
+                totalCount = cq.getSingleResult();
+
+                // optimization; don't query, if we won't get any results
+                /*
+                 *  FIXME: offset == -1 is temporary hack for just fetching
+                 *  total count; re-factor to have fetch-count and fetch-data
+                 *  methods!
+                 */
+                if ((totalCount > 0) && (offset > -1)) {
+                    if (offset > 0) {
+                        q.setFirstResult(offset);
+                    }
+                    if (count > 0) {
+                        q.setMaxResults(count);
+                    }
+                    results = q.getResultList();
+                }
+            }
+            return new VirtualCollectionList(results, offset, (int) totalCount);
+        } catch (Exception e) {
+            logger.error("error while enumerating virtual collections", e);
+            throw new VirtualCollectionRegistryException(
+                    "error while enumerating virtual collections", e);
+        } finally {
+            EntityTransaction tx = em.getTransaction();
+            if ((tx != null) && !tx.getRollbackOnly()) {
+                tx.commit();
+            }
+        }
+    }
+
+    public int getVirtualCollectionCount(QueryOptions options)
+            throws VirtualCollectionRegistryException {
+        logger.trace("Getting virtual collection count");
+        EntityManager em = datastore.getEntityManager();
+        try {
+            CriteriaBuilder cb = em.getCriteriaBuilder();
+            CriteriaQuery<Long> cq = cb.createQuery(Long.class);
+            Root<VirtualCollection> root = cq.from(VirtualCollection.class);
+            if (options != null) {
+                Predicate where = options.getWhere(cb, cq, root);
+                if (where != null) {
+                    cq.where(where);
+                }
+            }
+            em.getTransaction().begin();
+            TypedQuery<Long> query
+                    = em.createQuery(cq.select(cb.count(root)));
+            final long count = query.getSingleResult();
+            if (count >= Integer.MAX_VALUE) {
+                throw new VirtualCollectionRegistryException(
+                        "resultset too large");
+            }
+            logger.trace("Counted {} collections", count);
+            return (int) count;
+        } catch (Exception e) {
+            logger.error("error while counting virtual collections", e);
+            throw new VirtualCollectionRegistryException(
+                    "error while counting virtual collections", e);
+        } finally {
+            EntityTransaction tx = em.getTransaction();
+            if ((tx != null) && tx.isActive() && !tx.getRollbackOnly()) {
+                tx.commit();
+            }
+        }
+    }
+
+    public List<User> getUsers() {
+        final EntityManager em = datastore.getEntityManager();
+        try {
+            final CriteriaBuilder cb = em.getCriteriaBuilder();
+            final CriteriaQuery<User> cq = cb.createQuery(User.class);
+            final Root<User> root = cq.from(User.class);
+
+            // select all users, sort by display name then name
+            cq.select(root);
+            cq.orderBy(
+                    cb.asc(root.get(User_.displayName)),
+                    cb.asc(root.get(User_.name)));
+
+            em.getTransaction().begin();
+            final TypedQuery<User> query = em.createQuery(cq);
+            return query.getResultList();
+        } finally {
+            EntityTransaction tx = em.getTransaction();
+            if ((tx != null) && tx.isActive() && !tx.getRollbackOnly()) {
+                tx.commit();
+            }
+        }
+    }
+
+    public List<VirtualCollection> getVirtualCollections(
+            int first, int count, QueryOptions options)
+            throws VirtualCollectionRegistryException {
+        EntityManager em = datastore.getEntityManager();
+        try {
+            CriteriaBuilder cb = em.getCriteriaBuilder();
+            CriteriaQuery<VirtualCollection> cq
+                    = cb.createQuery(VirtualCollection.class);
+            Root<VirtualCollection> root = cq.from(VirtualCollection.class);
+            if (options != null) {
+                final Predicate where = options.getWhere(cb, cq, root);
+                if (where != null) {
+                    cq.where(where);
+                }
+                final Order[] order = options.getOrderBy(cb, root);
+                if (order != null) {
+                    cq.orderBy(order);
+                }
+            }
+            em.getTransaction().begin();
+            TypedQuery<VirtualCollection> query
+                    = em.createQuery(cq.select(root));
+            if (first > -1) {
+                query.setFirstResult(first);
+            }
+            if (count > 0) {
+                query.setMaxResults(count);
+            }
+            return query.getResultList();
+        } catch (Exception e) {
+            logger.error("error while fetching virtual collections", e);
+            throw new VirtualCollectionRegistryException(
+                    "error while fetching virtual collections", e);
+        } finally {
+            EntityTransaction tx = em.getTransaction();
+            if ((tx != null) && tx.isActive() && !tx.getRollbackOnly()) {
+                tx.commit();
+            }
+        }
+    }
+
+    private void maintenance(long now) {
+        logger.debug("Maintenance check");
+        // allocate persistent identifier roughly after 30 seconds
+        final Date nowDateAlloc = new Date(now - 30 * 1000);
+        // (for now) purge deleted collection roughly after 30 seconds
+        final Date nowDatePurge = new Date(now - 30 * 1000);
+
+        EntityManager em = datastore.getEntityManager();
+        try {
+            /*
+             * delayed allocation of persistent identifier
+             */
+            em.getTransaction().begin();
+            TypedQuery<VirtualCollection> q
+                    = em.createNamedQuery("VirtualCollection.findAllByState",
+                            VirtualCollection.class);
+            q.setParameter("state", VirtualCollection.State.PUBLIC_PENDING);
+            q.setParameter("date", nowDateAlloc);
+            q.setLockMode(LockModeType.PESSIMISTIC_WRITE);
+            for (VirtualCollection vc : q.getResultList()) {
+                if (vc.getPersistentIdentifier() == null) {
+                    PersistentIdentifier pid = pid_provider.createIdentifier(vc);
+                    vc.setPersistentIdentifier(pid);
+                }
+                vc.setState(VirtualCollection.State.PUBLIC);
+                em.persist(vc);
+                logger.info("assigned pid (identifer='{}') to virtual"
+                        + "collection (id={})",
+                        vc.getPersistentIdentifier().getIdentifier(),
+                        vc.getId());
+            }
+            em.getTransaction().commit();
+
+            /*
+             * delayed purging of deleted virtual collections
+             */
+            em.getTransaction().begin();
+            q.setParameter("state", VirtualCollection.State.DELETED);
+            q.setParameter("date", nowDatePurge);
+            q.setLockMode(LockModeType.PESSIMISTIC_WRITE);
+            for (VirtualCollection vc : q.getResultList()) {
+                vc.setState(VirtualCollection.State.DEAD);
+                em.remove(vc);
+                logger.debug("purged virtual collection (id={})", vc.getId());
+            }
+            em.getTransaction().commit();
+        } catch (VirtualCollectionRegistryException e) {
+            logger.error("error while doing maintenance", e);
+        } finally {
+            datastore.closeEntityManager();
+        }
+    }
+
+    private static User fetchUser(EntityManager em, Principal principal) {
+        User user = null;
+        try {
+            TypedQuery<User> q
+                    = em.createNamedQuery("User.findByName", User.class);
+            q.setParameter("name", principal.getName());
+            user = q.getSingleResult();
+        } catch (NoResultException e) {
+            /* IGNORE */
+        }
+        return user;
+    }
+
+    /**
+     * Creates a single thread scheduled executor with the specified thread name
+     *
+     * @param threadName name for new executor threads
+     * @return
+     */
+    private static ScheduledExecutorService createSingleThreadScheduledExecutor(final String threadName) {
+        return Executors.newSingleThreadScheduledExecutor(new ThreadFactory() {
+            // decorate default thread factory so that we can provide a 
+            // custom thread name
+            final AtomicInteger i = new AtomicInteger(0);
+
+            @Override
+            public Thread newThread(Runnable r) {
+                final Thread thread = Executors.defaultThreadFactory().newThread(r);
+                thread.setName(threadName + "-" + i.addAndGet(1));
+                return thread;
+            }
+        });
+    }
+
+    private boolean isAllowedToModify(Principal principal, VirtualCollection c) {
+        // admin and owner are allowed to modify collections
+        return adminUsersService.isAdmin(principal.getName())
+                || c.getOwner().equalsPrincipal(principal);
+    }
+
+} // class VirtualCollectionRegistry
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/VirtualCollectionRegistryException.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/VirtualCollectionRegistryException.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/VirtualCollectionRegistryException.java	(revision 5623)
@@ -0,0 +1,14 @@
+package eu.clarin.cmdi.virtualcollectionregistry;
+
+public class VirtualCollectionRegistryException extends Exception {
+    private static final long serialVersionUID = 1L;
+
+    public VirtualCollectionRegistryException(String msg) {
+        this(msg, null);
+    }
+
+    public VirtualCollectionRegistryException(String msg, Throwable cause) {
+        super(msg, cause);
+    }
+
+} // class VirtualCollectionRegistryException
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/VirtualCollectionRegistryPermissionException.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/VirtualCollectionRegistryPermissionException.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/VirtualCollectionRegistryPermissionException.java	(revision 5623)
@@ -0,0 +1,11 @@
+package eu.clarin.cmdi.virtualcollectionregistry;
+
+public class VirtualCollectionRegistryPermissionException extends
+        VirtualCollectionRegistryException {
+    private static final long serialVersionUID = 1L;
+
+    public VirtualCollectionRegistryPermissionException(String msg) {
+        super(msg);
+    }
+
+} // class VirtualCollectionRegistryPermissionException
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/VirtualCollectionRegistryUsageException.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/VirtualCollectionRegistryUsageException.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/VirtualCollectionRegistryUsageException.java	(revision 5623)
@@ -0,0 +1,45 @@
+package eu.clarin.cmdi.virtualcollectionregistry;
+
+import java.util.Collections;
+import java.util.List;
+
+public class VirtualCollectionRegistryUsageException extends
+        VirtualCollectionRegistryException {
+
+    private static final long serialVersionUID = 1L;
+
+    private final List<String> validationErrors;
+
+    public VirtualCollectionRegistryUsageException(String msg) {
+        this(msg, null, null);
+    }
+
+    public VirtualCollectionRegistryUsageException(String msg,
+            Throwable cause) {
+        this(msg, cause, null);
+    }
+
+    public VirtualCollectionRegistryUsageException(String msg,
+            List<String> validationErrors) {
+        this(msg, null, validationErrors);
+    }
+
+    public VirtualCollectionRegistryUsageException(String msg,
+            Throwable cause, List<String> validationErrors) {
+        super(msg, cause);
+        this.validationErrors = validationErrors;
+    }
+
+    /**
+     *
+     * @return list of validation errors (never null)
+     */
+    public List<String> getValidationErrors() {
+        if (validationErrors == null) {
+            return Collections.emptyList();
+        } else {
+            return validationErrors;
+        }
+    }
+
+} // class VirtualCollectionUsageException
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/Application.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/Application.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/Application.java	(revision 5623)
@@ -0,0 +1,134 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui;
+
+import eu.clarin.cmdi.virtualcollectionregistry.AdminUsersService;
+import eu.clarin.cmdi.virtualcollectionregistry.DataStore;
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistry;
+import eu.clarin.cmdi.virtualcollectionregistry.gui.pages.AboutPage;
+import eu.clarin.cmdi.virtualcollectionregistry.gui.pages.AdminPage;
+import eu.clarin.cmdi.virtualcollectionregistry.gui.pages.BrowsePrivateCollectionsPage;
+import eu.clarin.cmdi.virtualcollectionregistry.gui.pages.BrowsePublicCollectionsPage;
+import eu.clarin.cmdi.virtualcollectionregistry.gui.pages.CreateVirtualCollectionPage;
+import eu.clarin.cmdi.virtualcollectionregistry.gui.pages.EditVirtualCollectionPage;
+import eu.clarin.cmdi.virtualcollectionregistry.gui.pages.HelpPage;
+import eu.clarin.cmdi.virtualcollectionregistry.gui.pages.LoginPage;
+import eu.clarin.cmdi.virtualcollectionregistry.gui.pages.VirtualCollectionDetailsPage;
+import org.apache.wicket.Page;
+import org.apache.wicket.authentication.AuthenticatedWebApplication;
+import org.apache.wicket.authentication.AuthenticatedWebSession;
+import org.apache.wicket.authorization.strategies.role.Roles;
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.protocol.http.WebApplication;
+import org.apache.wicket.request.target.coding.MixedParamHybridUrlCodingStrategy;
+import org.apache.wicket.session.pagemap.LeastRecentlyAccessedEvictionStrategy;
+import org.apache.wicket.spring.injection.annot.SpringComponentInjector;
+import org.odlabs.wiquery.core.commons.IWiQuerySettings;
+import org.odlabs.wiquery.core.commons.WiQuerySettings;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class Application extends AuthenticatedWebApplication implements IWiQuerySettings {
+
+    private final static Logger logger = LoggerFactory.getLogger(Application.class);
+
+    @Autowired
+    private VirtualCollectionRegistry registry;
+    @Autowired
+    private DataStore dataStore;
+    @Autowired
+    private AdminUsersService adminUsersService;
+
+    @Override
+    protected void init() {
+        super.init();
+        logger.info("Initialising VCR web application");
+        addComponentInstantiationListener(new SpringComponentInjector(this));
+
+        getMarkupSettings().setDefaultMarkupEncoding("utf-8");
+        getRequestCycleSettings().setResponseRequestEncoding("utf-8");
+        getSessionSettings().setMaxPageMaps(3);
+        getSessionSettings().setPageMapEvictionStrategy(
+                new LeastRecentlyAccessedEvictionStrategy(3));
+        if (!DEPLOYMENT.equals(getConfigurationType())) {
+            logger.warn("Web application configured for development");
+            getMarkupSettings().setStripWicketTags(true);
+            getMarkupSettings().setStripComments(true);
+        }
+
+        mountBookmarkablePage("/login",
+                LoginPage.class);
+        mountBookmarkablePage("/public",
+                BrowsePublicCollectionsPage.class);
+        mountBookmarkablePage("/private",
+                BrowsePrivateCollectionsPage.class);
+        mountBookmarkablePage("/create", CreateVirtualCollectionPage.class);
+        mountBookmarkablePage("/about", AboutPage.class);
+        mountBookmarkablePage("/help", HelpPage.class);
+        mountBookmarkablePage("/admin", AdminPage.class);
+
+        // details of an existing collection by ID, e.g. /details/123
+        mount(new MixedParamHybridUrlCodingStrategy("/details",
+                VirtualCollectionDetailsPage.class, new String[]{VirtualCollectionDetailsPage.PARAM_VC_ID}));
+        // editing an existing collection by ID, e.g. /edit/123
+        mount(new MixedParamHybridUrlCodingStrategy("/edit",
+                EditVirtualCollectionPage.class, new String[]{"id"}));
+    }
+
+    @Override
+    public Class<? extends Page> getHomePage() {
+        return BrowsePublicCollectionsPage.class;
+    }
+
+    @Override
+    protected Class<? extends WebPage> getSignInPageClass() {
+        return LoginPage.class;
+    }
+
+    @Override
+    protected Class<? extends AuthenticatedWebSession> getWebSessionClass() {
+        return ApplicationSession.class;
+    }
+
+    public boolean hasAnyRole(String[] roles) {
+        if (roles != null) {
+            final Roles sessionRoles = AuthenticatedWebSession.get().getRoles();
+            if (sessionRoles != null) {
+                for (String role : roles) {
+                    if (sessionRoles.hasRole(role)) {
+                        return true;
+                    }
+                }
+            }
+        }
+        return false;
+    }
+
+    boolean isAdmin(String user) {
+        return adminUsersService.isAdmin(user);
+    }
+
+    public VirtualCollectionRegistry getRegistry() {
+        return registry;
+    }
+
+    public DataStore getDataStore() {
+        return dataStore;
+    }
+
+    public static Application get() {
+        return (Application) WebApplication.get();
+    }
+
+    @Override
+    public WiQuerySettings getWiQuerySettings() {
+        final WiQuerySettings settings = new WiQuerySettings();
+        // WiQuery should not import the jQuery library because it is already
+        // provided in the template as a dependency of Bootstrap
+        settings.setAutoImportJQueryResource(false);
+        settings.setAutoImportJQueryUIResource(false);
+        return settings;
+    }
+
+} // class Application
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/Application.properties
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/Application.properties	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/Application.properties	(revision 5623)
@@ -0,0 +1,32 @@
+State.PUBLIC: public
+State.PUBLIC_PENDING: publishing
+State.PRIVATE: private
+State.DELETED: deleted
+State.DEAD: dead
+Type.EXTENSIONAL: extensional
+Type.INTENSIONAL: intensional
+Purpose.RESEARCH: research
+Purpose.REFERENCE: reference
+Purpose.SAMPLE: sample
+Purpose.FUTURE_USE: future-use
+Reproducibility.INTENDED: intended
+Reproducibility.FLUCTUATING: fluctuating
+Reproducibility.UNTENDED: untended
+Type.METADATA: Metadata
+Type.RESOURCE: Resource
+collections.publishconfirm: Do you really want to publish "${name}"?\nThe \
+  virtual collection will then be publicly available and you will not be able \
+  to delete the collection. Users may expect the collection to be stable even \
+  though you will be able to make changes after publication.
+collections.deleteconfirm: Do you really want to delete "${name}"?\nThis \
+  operation is permanent and cannot be undone.
+collections.editpublishedconfirm: Do you really want to edit the PUBLISHED \
+  collection "${name}"?\n\
+  Any changes will be made public immediately after editing and cannot be \
+  undone. Be aware that other users may not expect a published collection to \
+  change!
+collections.publishwarningsconfirm: WARNING: The collection "${name}" does not \
+  meet all recommended criteria for published collection!\n\n\
+  The following warning(s) apply:\n{0}\n\
+  Publication of the collection in its current state is not recommended. Would \
+  you still like to publish the collection?
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/ApplicationSession.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/ApplicationSession.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/ApplicationSession.java	(revision 5623)
@@ -0,0 +1,136 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui;
+
+import de.mpg.aai.shhaa.model.AuthAttribute;
+import de.mpg.aai.shhaa.model.AuthPrincipal;
+import eu.clarin.cmdi.virtualcollectionregistry.model.User;
+import java.security.Principal;
+import java.util.regex.Pattern;
+import javax.servlet.http.HttpServletRequest;
+import org.apache.wicket.Request;
+import org.apache.wicket.RequestCycle;
+import org.apache.wicket.authentication.AuthenticatedWebSession;
+import org.apache.wicket.authorization.strategies.role.Roles;
+import org.apache.wicket.protocol.http.servlet.ServletWebRequest;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("serial")
+public class ApplicationSession extends AuthenticatedWebSession {
+
+    private final static Logger logger = LoggerFactory.getLogger(ApplicationSession.class);
+
+    private static final String[] ATTRIBUTE_NAMES_NAME
+            = {"cn", "commonName", "displayName"};
+    private static final Pattern PERSITENT_ID_REGEX
+            = Pattern.compile("^[^!]+![^!]+![^!]+$");
+    private static final Roles ROLES_USER
+            = new Roles(Roles.USER);
+    private static final Roles ROLES_ADMIN
+            = new Roles(new String[]{Roles.USER, Roles.ADMIN});
+    private String user;
+    private boolean isAdmin;
+    private String userDisplay;
+
+    public ApplicationSession(Request request) {
+        super(request);
+    }
+
+    public boolean signIn(Principal principal) {
+        logger.trace("Signing in principal {}", principal);
+        boolean result = false;
+        if (principal != null) {
+            result = signIn(principal.getName(), null);
+            if (result) {
+                user = principal.getName();
+                isAdmin = ((Application) getApplication()).isAdmin(user);
+                userDisplay = findDisplayName(principal);
+                logger.debug("Principal is signed in [user = {}, display name = {}, isAdmin = {}]", user, userDisplay, isAdmin);
+            }
+        }
+        return result;
+    }
+
+    @Override
+    public boolean authenticate(String username, String password) {
+        return username != null;
+    }
+
+    @Override
+    public Roles getRoles() {
+        if (isSignedIn()) {
+            return isAdmin ? ROLES_ADMIN : ROLES_USER;
+        }
+        return null;
+    }
+
+    public Principal getPrincipal() {
+        ServletWebRequest servletWebRequest = (ServletWebRequest) RequestCycle.get().getRequest();
+        HttpServletRequest request = servletWebRequest.getHttpServletRequest();
+        return request.getUserPrincipal();
+    }
+
+    /**
+     *
+     * @param user user to check for
+     * @return whether the specified user is the user currently signed in (false
+     * if {@link #isSignedIn() } returns false)
+     */
+    public boolean isCurrentUser(User user) {
+        return isSignedIn() && getUser().equals(user.getName());
+    }
+
+    public String getUser() {
+        return user;
+    }
+
+    public String getUserDisplay() {
+        if (userDisplay != null) {
+            return userDisplay;
+        }
+        if (PERSITENT_ID_REGEX.matcher(user).matches()) {
+            return "Authenticated via Shibboleth";
+        }
+        return user;
+    }
+
+    public static ApplicationSession get() {
+        return (ApplicationSession) AuthenticatedWebSession.get();
+    }
+
+    private static String findDisplayName(Principal p) {
+        logger.trace("Looking for display name for principal {}", p);
+        if (p instanceof AuthPrincipal) {
+            final AuthPrincipal principal = (AuthPrincipal) p;
+            for (String attr : ATTRIBUTE_NAMES_NAME) {
+                final String name = getAttribute(principal, attr);
+                if (name != null) {
+                    logger.debug("Display name found for principal: {}", name);
+                    return name;
+                }
+            }
+            String givenName = getAttribute(principal, "givenName");
+            String surname = getAttribute(principal, "surname");
+            if ((givenName != null) && (surname != null)) {
+                final String name = givenName + " " + surname;
+                logger.debug("Display name found for principal: {}", name);
+                return name;
+            }
+        }
+        logger.debug("No display name found for principal");
+        return null;
+    }
+
+    private static String getAttribute(final AuthPrincipal principal, String attr) {
+        logger.trace("Looking for attribute {}", attr);
+        final AuthAttribute<?> attribute = principal.getAttribues().get(attr);
+        if (attribute != null) {
+            final Object value = attribute.getValue();
+            if (value != null) {
+                logger.trace("Found attribute value: {} = {}", attr, value);
+                return value.toString();
+            }
+        }
+        return null;
+    }
+
+} // class ApplicationSession
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/CharacterEncodingFilter.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/CharacterEncodingFilter.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/CharacterEncodingFilter.java	(revision 5623)
@@ -0,0 +1,32 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui;
+
+import java.io.IOException;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+
+public class CharacterEncodingFilter implements Filter {
+    private static final String DEFAULT_ENCODING = "UTF-8";
+
+    @Override
+    public void init(FilterConfig config) throws ServletException {
+    }
+
+    @Override
+    public void destroy() {
+    }
+
+    @Override
+    public void doFilter(ServletRequest request, ServletResponse response,
+            FilterChain chain) throws IOException, ServletException {
+        if (request.getCharacterEncoding() == null) {
+            request.setCharacterEncoding(DEFAULT_ENCODING);
+        }
+        chain.doFilter(request, response);
+    }
+
+} // class CharacterEncodingFilter
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/DateConverter.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/DateConverter.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/DateConverter.java	(revision 5623)
@@ -0,0 +1,41 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package eu.clarin.cmdi.virtualcollectionregistry.gui;
+
+import java.sql.Date;
+import java.text.ParseException;
+import java.util.Locale;
+
+import org.apache.commons.lang3.time.FastDateFormat;
+import org.apache.wicket.util.convert.IConverter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ *
+ * @author twagoo
+ */
+@SuppressWarnings("serial")
+public class DateConverter implements IConverter {
+
+    private final static Logger logger = LoggerFactory.getLogger(DateConverter.class);
+    private static final FastDateFormat DF = FastDateFormat.getInstance("yyyy-MM-dd");
+
+    @Override
+    public String convertToString(Object o, Locale locale) {
+        return DF.format((Date) o);
+    }
+
+    @Override
+    public Object convertToObject(String s, Locale locale) {
+        try {
+            return DF.parse(s);
+        } catch (ParseException ex) {
+            logger.error("Could not parse date {}", s, ex);
+            return null;
+        }
+    }
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/DetachableVirtualCollectionModel.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/DetachableVirtualCollectionModel.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/DetachableVirtualCollectionModel.java	(revision 5623)
@@ -0,0 +1,37 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui;
+
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistry;
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryException;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+import org.apache.wicket.model.LoadableDetachableModel;
+
+@SuppressWarnings("serial")
+public class DetachableVirtualCollectionModel
+        extends LoadableDetachableModel<VirtualCollection> {
+
+    private long id;
+
+    public DetachableVirtualCollectionModel(VirtualCollection vc) {
+        super(vc);
+        if (vc == null) {
+            throw new IllegalArgumentException("vc == null");
+        }
+        this.id = vc.getId();
+    }
+
+    public DetachableVirtualCollectionModel(long id) {
+        this.id = id;
+    }
+
+    @Override
+    protected VirtualCollection load() {
+        try {
+            VirtualCollectionRegistry vcr
+                    = Application.get().getRegistry();
+            return vcr.retrieveVirtualCollection(this.id);
+        } catch (VirtualCollectionRegistryException e) {
+            return null;
+        }
+    }
+
+} // class DetachableVirtualCollectionModel
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/DynamicProxyModel.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/DynamicProxyModel.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/DynamicProxyModel.java	(revision 5623)
@@ -0,0 +1,39 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui;
+
+import org.apache.wicket.model.IModel;
+
+/**
+ * Abstract model that dynamically wraps another model. Can be used to share a
+ * model with a component that changes its model during its life cycle (such as
+ * a form that gets reused).
+ *
+ * @author twagoo
+ * @param <T> type of model object
+ */
+public abstract class DynamicProxyModel<T> implements IModel<T> {
+
+    /**
+     * This is called from all methods in this class to obtain the wrapped
+     * model; the result is never stored internally, and the model to wrap gets
+     * evaluated on each call through this method.
+     *
+     * @return the model that needs to be wrapped
+     */
+    protected abstract IModel<T> getWrappedModel();
+
+    @Override
+    public T getObject() {
+        return getWrappedModel().getObject();
+    }
+
+    @Override
+    public void setObject(T object) {
+        getWrappedModel().setObject(object);
+    }
+
+    @Override
+    public void detach() {
+        getWrappedModel().detach();
+    }
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/HandleLinkModel.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/HandleLinkModel.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/HandleLinkModel.java	(revision 5623)
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2014 CLARIN
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package eu.clarin.cmdi.virtualcollectionregistry.gui;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import org.apache.wicket.model.IModel;
+
+/**
+ * Model that takes a link from an inner model and in case of a handle (any link
+ * starting with "hdl:"), will replace the scheme with the handle proxy base URL
+ *
+ * @author twagoo
+ */
+public class HandleLinkModel implements IModel<String> {
+
+    private final IModel<String> linkModel;
+    public static final Pattern HANDLE_PATTERN = Pattern.compile("^(hdl|doi):(.*)$", Pattern.CASE_INSENSITIVE);
+    public static final String HANDLE_PROXY = "http://hdl.handle.net/";
+    public static final String URN_NBN_PREFIX = "urn:nbn";
+    public static final String URN_NBN_RESOLVER_URL = "http://www.nbn-resolving.org/redirect/";
+    private static final int HANDLE_ID_GROUP = 2;
+
+    public HandleLinkModel(IModel<String> linkModel) {
+        this.linkModel = linkModel;
+    }
+
+    @Override
+    public String getObject() {
+        final String link = linkModel.getObject();
+        if (link != null) {
+            final Matcher handleMatcher = HANDLE_PATTERN.matcher(link);
+            if (handleMatcher.matches()) {
+                return HANDLE_PROXY + handleMatcher.group(HANDLE_ID_GROUP);
+            }
+            if (link.toLowerCase().startsWith(URN_NBN_PREFIX)) {
+                return URN_NBN_RESOLVER_URL + link;
+            }
+        }
+        return link;
+    }
+
+    @Override
+    public void setObject(String object) {
+        linkModel.setObject(object);
+    }
+
+    @Override
+    public void detach() {
+        linkModel.detach();
+    }
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/TooltipBehavior.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/TooltipBehavior.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/TooltipBehavior.java	(revision 5623)
@@ -0,0 +1,95 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui;
+
+import org.apache.wicket.ResourceReference;
+import org.apache.wicket.markup.html.resources.JavascriptResourceReference;
+import org.apache.wicket.model.IModel;
+import org.odlabs.wiquery.core.behavior.WiQueryAbstractBehavior;
+import org.odlabs.wiquery.core.commons.WiQueryResourceManager;
+import org.odlabs.wiquery.core.javascript.JsQuery;
+import org.odlabs.wiquery.core.javascript.JsStatement;
+import org.odlabs.wiquery.core.options.DefaultOptionsRenderer;
+import org.odlabs.wiquery.core.options.IOptionsRenderer;
+import org.odlabs.wiquery.core.options.Options;
+
+/**
+ *
+ * @author twagoo
+ */
+public class TooltipBehavior extends WiQueryAbstractBehavior {
+
+    public static final ResourceReference QTIP_JAVASCRIPT_RESOURCE
+            = new JavascriptResourceReference(TooltipBehavior.class, "jquery.qtip-1.0.0-rc3.min.js");
+
+    private final IModel<String> tooltipModel;
+
+    public TooltipBehavior(IModel<String> tooltipModel) {
+        this.tooltipModel = tooltipModel;
+    }
+
+    @Override
+    public void contribute(WiQueryResourceManager wiQueryResourceManager) {
+        wiQueryResourceManager.addJavaScriptResource(QTIP_JAVASCRIPT_RESOURCE);
+    }
+
+    @Override
+    public JsStatement statement() {
+        return new JsQuery(getComponent()).$().chain("qtip", getOptions().getJavaScriptOptions());
+    }
+
+    public Options getOptions() {
+        final Options options = new Options();
+        options.setRenderer(optionsRenderer);
+        options.putString("content", tooltipModel);
+        options.put("show", getShowEvent());
+        options.put("hide", getHideEvent());
+        return options;
+    }
+
+    public String getShowEvent() {
+        return "mouseover";
+    }
+
+    public String getHideEvent() {
+        return "mouseout";
+    }
+
+    private final IOptionsRenderer optionsRenderer = new IOptionsRenderer() {
+
+        @Override
+        public void renderBefore(StringBuilder stringBuilder) {
+            DefaultOptionsRenderer.get().renderBefore(stringBuilder);
+        }
+
+        @Override
+        public CharSequence renderOption(String name, Object value, boolean isLast) {
+            final Object newValue;
+            if (value instanceof CharSequence) {
+                newValue = String.format("'%s'", value);
+            } else {
+                newValue = value;
+            }
+            return DefaultOptionsRenderer.get().renderOption(name, newValue, isLast);
+        }
+
+        @Override
+        public void renderAfter(StringBuilder stringBuilder) {
+            DefaultOptionsRenderer.get().renderAfter(stringBuilder);
+        }
+    };
+//
+//    private static class StringQuoteModel extends AbstractReadOnlyModel<String> {
+//
+//        private final IModel<String> wrappedModel;
+//
+//        public StringQuoteModel(IModel<String> wrappedModel) {
+//            this.wrappedModel = wrappedModel;
+//        }
+//
+//        @Override
+//        public String getObject() {
+//            return String.format("'%s'", wrappedModel.getObject());
+//        }
+//
+//    }
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/VolatileEntityModel.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/VolatileEntityModel.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/VolatileEntityModel.java	(revision 5623)
@@ -0,0 +1,65 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui;
+
+import eu.clarin.cmdi.virtualcollectionregistry.model.IdentifiedEntity;
+import java.io.Serializable;
+import javax.persistence.EntityManager;
+import org.apache.wicket.model.IModel;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Model for volatile entity objects: objects that are managed by a persistence
+ * context but do not get persisted before the end of the request cycle and
+ * therefore lose their connection to the context. This model merges the model
+ * object with the persistence context on the first call of {@link #getObject()
+ * } after {@link #detach() }.
+ *
+ * @author twagoo
+ * @see EntityManager#merge(java.lang.Object)
+ */
+public class VolatileEntityModel<T extends IdentifiedEntity & Serializable> implements IModel<T> {
+
+    private final static Logger logger = LoggerFactory.getLogger(VolatileEntityModel.class);
+    private T object;
+    private boolean attached;
+
+    public VolatileEntityModel(T object) {
+        this.object = object;
+        attached = true;
+    }
+
+    /**
+     *
+     * @return the previously stored object or a merged copy of it if the model
+     * was detached
+     */
+    @Override
+    public T getObject() {
+        if (!attached) {
+            attach();
+        }
+        return object;
+    }
+
+    private void attach() {
+        logger.trace("Merging volatile object ({}) into persistence context", object);
+        if (object != null && object.getId() != null) {
+            final EntityManager em = Application.get().getDataStore().getEntityManager();
+            object = em.merge(object);
+        }
+        attached = true;
+    }
+
+    @Override
+    public void setObject(T object) {
+        this.object = object;
+    }
+
+    @Override
+    public void detach() {
+        logger.trace("Detaching volatile object ({})", object);
+        // set flag so that on next call to getObject() object will be merged
+        attached = false;
+    }
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/border/AjaxToggleBorder.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/border/AjaxToggleBorder.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/border/AjaxToggleBorder.html	(revision 5623)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:wicket="http://wicket.apache.org/">
+<head />
+<body>
+<wicket:border>
+  <div wicket:id="border" class="toggleBorder">
+    <div wicket:id="header" class="toggleBorderHeader">
+	  <span wicket:id="title">Title</span>
+	</div>
+	<div wicket:id="content" class="toggleBorderContent">
+      <wicket:body />
+	</div>
+  </div>
+</wicket:border>
+</body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/border/AjaxToggleBorder.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/border/AjaxToggleBorder.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/border/AjaxToggleBorder.java	(revision 5623)
@@ -0,0 +1,68 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.border;
+
+import org.apache.wicket.ResourceReference;
+import org.apache.wicket.behavior.AttributeAppender;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.border.Border;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.odlabs.wiquery.core.commons.IWiQueryPlugin;
+import org.odlabs.wiquery.core.commons.WiQueryResourceManager;
+import org.odlabs.wiquery.core.javascript.JsStatement;
+
+@SuppressWarnings("serial")
+public class AjaxToggleBorder extends Border implements IWiQueryPlugin {
+    private static final ResourceReference JAVASCRIPT_RESOURCE =
+        new ResourceReference(AjaxToggleBorder.class, "AjaxToggleBorder.js");
+    private final WebMarkupContainer border;
+
+    public AjaxToggleBorder(String id, IModel<String> title,
+            boolean expanded, String cssClass) {
+        super(id);
+        setRenderBodyOnly(true);
+
+        border = new WebMarkupContainer("border");
+        border.setOutputMarkupId(true);
+
+        final WebMarkupContainer header = new WebMarkupContainer("header");
+        header.add(new Label("title", title));
+        border.add(header);
+
+        final WebMarkupContainer content = new WebMarkupContainer("content");
+        content.setOutputMarkupId(true);
+        content.add(getBodyContainer());
+        border.add(content);
+        add(border);
+
+        if (!expanded) {
+            header.add(new AttributeAppender("class",
+                    new Model<String>("collapsed"), " "));
+            content.add(new AttributeAppender("style",
+                    new Model<String>("display:none"), ";"));
+        }
+        if (cssClass != null) {
+            content.add(new AttributeAppender("class",
+                    new Model<String>(cssClass), " "));
+        }
+    }
+
+    public AjaxToggleBorder(String id, IModel<String> title, String cssClass) {
+        this(id, title, true, cssClass);
+    }
+
+    public AjaxToggleBorder(String id, IModel<String> title) {
+        this(id, title, true, null);
+    }
+
+    @Override
+    public void contribute(WiQueryResourceManager manager) {
+        manager.addJavaScriptResource(JAVASCRIPT_RESOURCE);
+    }
+
+    @Override
+    public JsStatement statement() {
+        return new JsStatement().$(border).append(".ajaxToggleBorder()");
+    }
+
+} // class AjaxToggleBorder
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/border/AjaxToggleBorder.js
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/border/AjaxToggleBorder.js	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/border/AjaxToggleBorder.js	(revision 5623)
@@ -0,0 +1,17 @@
+(function($) {
+	$.extend($.fn, {
+		ajaxToggleBorder : function() {
+			var o = {
+				speed: 250
+			};
+			var header = $(this).children('div.toggleBorderHeader');
+			var content = $(this).children('div.toggleBorderContent');
+			header.bind('click.ajaxToggleBorder', function() {
+				content.slideToggle(o.speed, function() {
+					header.toggleClass('collapsed');
+				});
+			});
+			return $(this);
+		}
+	});
+})(jQuery);
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/dialog/ConfirmationDialog$ButtonBar.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/dialog/ConfirmationDialog$ButtonBar.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/dialog/ConfirmationDialog$ButtonBar.html	(revision 5623)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org/">
+<head />
+<body>
+<wicket:panel>
+  <form wicket:id="buttonsForm">
+    <div>
+      <input wicket:id="yesButton"
+             type="submit" class="button yesButton" value="Yes" />
+      <input wicket:id="noButton"
+             type="submit"  class="button noButton" value="No" />
+    </div>         
+  </form>
+</wicket:panel>
+</body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/dialog/ConfirmationDialog$Content.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/dialog/ConfirmationDialog$Content.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/dialog/ConfirmationDialog$Content.html	(revision 5623)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org/">
+<head />
+<body>
+<wicket:panel>
+<span wicket:id="message">Message</span>
+</wicket:panel>
+</body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/dialog/ConfirmationDialog.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/dialog/ConfirmationDialog.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/dialog/ConfirmationDialog.java	(revision 5623)
@@ -0,0 +1,125 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.dialog;
+
+import org.apache.wicket.Component;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.behavior.AttributeAppender;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.basic.MultiLineLabel;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+
+@SuppressWarnings("serial")
+public abstract class ConfirmationDialog extends ModalDialogBase {
+    private final class ButtonBar extends Panel {
+        public ButtonBar(String id) {
+            super(id);
+            final Form<Void> form = new Form<Void>("buttonsForm");
+            final AjaxButton yesButton =
+                new AjaxButton("yesButton", new Model<String>("Yes"), form) {
+                @Override
+                protected void onSubmit(AjaxRequestTarget target,
+                        Form<?> form) {
+                    answer = true;
+                    ConfirmationDialog.this.close(target);
+                }
+            };
+            yesButton.setDefaultFormProcessing(false);
+            form.add(yesButton);
+            final AjaxButton noButton =
+                new AjaxButton("noButton", new Model<String>("No"), form) {
+                @Override
+                protected void onSubmit(AjaxRequestTarget target,
+                        Form<?> form) {
+                    answer = false;
+                    ConfirmationDialog.this.close(target);
+                }
+            };
+            noButton.setDefaultFormProcessing(false);
+            form.add(noButton);
+            add(form);
+        }
+    } // class ConfirmationDialog.ButtonBar
+
+    private final class Content extends Panel {
+        private Content(String id) {
+            super(id);
+            messageLabel = new MultiLineLabel("message");
+            add(messageLabel);
+        }
+    } // class ConfirmationDialog.Content
+
+    private boolean answer;
+    private MultiLineLabel messageLabel;
+
+    public ConfirmationDialog(String id, IModel<String> message,
+            final Component updateComponent) {
+        super(id, new Model<String>("Please confirm"));
+        setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
+            @Override
+            public void onClose(AjaxRequestTarget target) {
+                if (answer) {
+                    onConfirm(target);
+                    if (updateComponent != null) {
+                        target.addComponent(updateComponent);
+                    }
+                } else {
+                    onCancel(target);
+                }
+            }
+        });
+        if (message != null) {
+            setMessage(message);
+        }
+    }
+
+    public ConfirmationDialog(String id, final Component updateComponent) {
+        this(id, null, updateComponent);
+    }
+
+    public ConfirmationDialog(String id) {
+        this(id, null, null);
+    }
+
+    @Override
+    protected Panel createButtonBar(String id) {
+        return new ButtonBar(id);
+    }
+
+    @Override
+    protected Panel createContent(String id) {
+        Content content = new Content(id);
+        content.add(new AttributeAppender("class", getCssClass(), " "));
+        return content;
+    }
+
+    protected Model<String> getCssClass() {
+        return Model.of("confirmationDialog");
+    }
+
+    @Override
+    public void show(AjaxRequestTarget target) {
+        answer = false; /* set save default value */
+        super.show(target);
+    }
+
+    public void show(AjaxRequestTarget target, IModel<String> message) {
+        setMessage(message);
+        this.show(target);
+    }
+
+    public void setMessage(IModel<String> message) {
+        if (message == null) {
+            throw new NullPointerException("message == null");
+        }
+        messageLabel.setDefaultModel(message);
+    }
+
+    public abstract void onConfirm(AjaxRequestTarget target);
+
+    public void onCancel(AjaxRequestTarget target) {
+    }
+
+} // abstract class ConfirmationDialog
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/dialog/ModalDialogBase$Content.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/dialog/ModalDialogBase$Content.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/dialog/ModalDialogBase$Content.html	(revision 5623)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org/">
+<head />
+<body>
+<wicket:panel>
+<div class="modalDialog">
+  <div wicket:id="dialogContent" class="modalDialogContent"></div>
+  <div wicket:id="dialogButtons" class="modalDialogButtons"></div>
+</div>
+</wicket:panel>
+</body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/dialog/ModalDialogBase.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/dialog/ModalDialogBase.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/dialog/ModalDialogBase.java	(revision 5623)
@@ -0,0 +1,42 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.dialog;
+
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.IModel;
+
+@SuppressWarnings("serial")
+public abstract class ModalDialogBase extends ModalWindow {
+    private final class Content extends Panel {
+        public Content(String id) {
+            super(id);
+            setOutputMarkupId(true);
+            Panel content = createContent("dialogContent");
+            if (content == null) {
+                throw new NullPointerException("createContent() == null");
+            }
+            add(content);
+            Panel buttons = createButtonBar("dialogButtons");
+            if (buttons == null) {
+                throw new NullPointerException("createButtonBar() == null");
+            }
+            add(buttons);
+        }
+    } // class ModalDialogBase.Content
+
+    public ModalDialogBase(String id, IModel<String> title) {
+        super(id);
+        if (title == null) {
+            throw new NullPointerException("title == null");
+        }
+        setOutputMarkupId(true);
+        setInitialWidth(350);
+        setUseInitialHeight(false);
+        setTitle(title);
+        setContent(new Content(this.getContentId()));
+    }
+
+    protected abstract Panel createButtonBar(String id);
+
+    protected abstract Panel createContent(String id);
+
+} // class ModalDialogBase;
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/dialog/ModalEditDialogBase$ButtonBar.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/dialog/ModalEditDialogBase$ButtonBar.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/dialog/ModalEditDialogBase$ButtonBar.html	(revision 5623)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org/">
+<head />
+<body>
+<wicket:panel>
+  <input wicket:id="addButton"
+         type="submit" class="button yesButton" value="Add" />
+  <input wicket:id="modifyButton"
+         type="submit" class="button yesButton" value="Modify" />
+  <input wicket:id="cancelButton"
+         type="submit"  class="button noButton" value="Cancel" />
+</wicket:panel>
+</body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/dialog/ModalEditDialogBase.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/dialog/ModalEditDialogBase.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/dialog/ModalEditDialogBase.java	(revision 5623)
@@ -0,0 +1,157 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.dialog;
+
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.behavior.AttributeAppender;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.panel.FeedbackPanel;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.AbstractReadOnlyModel;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+
+@SuppressWarnings("serial")
+public abstract class ModalEditDialogBase<T> extends ModalDialogBase {
+    public abstract class ContentPanel extends Panel {
+        protected ContentPanel(String id) {
+            super(id);
+        }
+
+        public abstract Form<T> getForm();
+
+        public abstract FeedbackPanel getFeedbackPanel();
+    } // class ModalEditDialogBase.ContentPanel
+
+    private final class ButtonBar extends Panel {
+        public ButtonBar(String id, Form<?> form) {
+            super(id);
+            addButton = new AjaxButton("addButton",
+                    new Model<String>("Add"), form) {
+                @Override
+                protected void onError(AjaxRequestTarget target, Form<?> form) {
+                    target.addComponent(contentPanel.getFeedbackPanel());
+                    super.onError(target, form);
+                }
+
+                @SuppressWarnings("unchecked")
+                @Override
+                protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+                    ModalEditDialogBase.this.doSubmit(target, (Form<T>) form);
+                }
+            };
+            add(addButton);
+            modifyButton = new AjaxButton("modifyButton",
+                    new Model<String>("Modify"), form) {
+                @Override
+                protected void onError(AjaxRequestTarget target, Form<?> form) {
+                    target.addComponent(contentPanel.getFeedbackPanel());
+                    super.onError(target, form);
+                }
+
+                @SuppressWarnings("unchecked")
+                @Override
+                protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+                    ModalEditDialogBase.this.doSubmit(target, (Form<T>) form);
+                }
+            };
+            add(modifyButton);
+            final AjaxButton cancelButton =
+                new AjaxButton("cancelButton",
+                        new Model<String>("Cancel"), form) {
+                @SuppressWarnings("unchecked")
+                @Override
+                protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+                    ModalEditDialogBase.this.doCancel(target, (Form<T>) form);
+                }
+            };
+            cancelButton.setDefaultFormProcessing(false);
+            add(cancelButton);
+        }
+    } // class EditCreatorDialog.ButtonBar
+
+    private ContentPanel contentPanel;
+    private AjaxButton addButton;
+    private AjaxButton modifyButton;
+
+    protected ModalEditDialogBase(String id, IModel<String> title) {
+        super(id, title);
+    }
+
+    @Override
+    protected final Panel createContent(String id) {
+        final IModel<T> model = newInstanceModel();
+        contentPanel = createContentPanel(id, model);
+        contentPanel.add(new AttributeAppender("class",
+                new AbstractReadOnlyModel<String>() {
+                    @Override
+                    public String getObject() {
+                        final String clazz = getCssClass();
+                        if ((clazz != null) && !clazz.isEmpty()) {
+                            StringBuilder sb = new StringBuilder("editDialog");
+                            sb.append(' ');
+                            sb.append(clazz);
+                            return sb.toString();
+                        } else {
+                            return "editDialog";
+                        }
+                    }
+                }, " "));
+        contentPanel.getForm().removePersistentFormComponentValues(true);
+        contentPanel.getFeedbackPanel().setOutputMarkupId(true);
+        return contentPanel;
+    }
+
+    @Override
+    protected final Panel createButtonBar(String id) {
+        return new ButtonBar(id, contentPanel.getForm());
+    }
+
+    @Override
+    public final void show(AjaxRequestTarget target) {
+        this.show(target, null);
+    }
+    
+    public final void show(AjaxRequestTarget target, IModel<T> model) {
+        if (model == null) {
+            model = newInstanceModel();
+            addButton.setVisible(true);
+            modifyButton.setVisible(false);
+        } else {
+            addButton.setVisible(false);
+            modifyButton.setVisible(true);
+        }
+        contentPanel.getForm().setModel(new CompoundPropertyModel<T>(model));
+        target.appendJavascript("activeTooltips()");
+        super.show(target);
+    }
+
+    private final void doSubmit(AjaxRequestTarget target, Form<T> form) {
+        close(target);
+        final T object = form.getModelObject();
+        onSubmit(target, object);
+    }
+
+    private final void doCancel(AjaxRequestTarget target, Form<T> form) {
+        close(target);
+        final T object = form.getModelObject();
+        onCancel(target, object);
+    }
+
+    protected String getCssClass() {
+        return null;
+    }
+
+    protected abstract IModel<T> newInstanceModel();
+
+    protected abstract IModel<T> createEmptyModel();
+
+    protected abstract ContentPanel createContentPanel(String id,
+            IModel<T> model);
+
+    public abstract void onSubmit(AjaxRequestTarget target, T object);
+
+    public void onCancel(AjaxRequestTarget target, T object) {
+    }
+
+} // class ModalEditDialog
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/jquery.qtip-1.0.0-rc3.min.js
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/jquery.qtip-1.0.0-rc3.min.js	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/jquery.qtip-1.0.0-rc3.min.js	(revision 5623)
@@ -0,0 +1,21 @@
+/*
+ * jquery.qtip. The jQuery tooltip plugin
+ *
+ * Copyright (c) 2009 Craig Thompson
+ * http://craigsworks.com
+ *
+ * Licensed under MIT
+ * http://www.opensource.org/licenses/mit-license.php
+ *
+ * Launch  : February 2009
+ * Version : 1.0.0-rc3
+ * Released: Tuesday 12th May, 2009 - 00:00
+ * Debug: jquery.qtip.debug.js
+ */
+(function(f){f.fn.qtip=function(B,u){var y,t,A,s,x,w,v,z;if(typeof B=="string"){if(typeof f(this).data("qtip")!=="object"){f.fn.qtip.log.error.call(self,1,f.fn.qtip.constants.NO_TOOLTIP_PRESENT,false)}if(B=="api"){return f(this).data("qtip").interfaces[f(this).data("qtip").current]}else{if(B=="interfaces"){return f(this).data("qtip").interfaces}}}else{if(!B){B={}}if(typeof B.content!=="object"||(B.content.jquery&&B.content.length>0)){B.content={text:B.content}}if(typeof B.content.title!=="object"){B.content.title={text:B.content.title}}if(typeof B.position!=="object"){B.position={corner:B.position}}if(typeof B.position.corner!=="object"){B.position.corner={target:B.position.corner,tooltip:B.position.corner}}if(typeof B.show!=="object"){B.show={when:B.show}}if(typeof B.show.when!=="object"){B.show.when={event:B.show.when}}if(typeof B.show.effect!=="object"){B.show.effect={type:B.show.effect}}if(typeof B.hide!=="object"){B.hide={when:B.hide}}if(typeof B.hide.when!=="object"){B.hide.when={event:B.hide.when}}if(typeof B.hide.effect!=="object"){B.hide.effect={type:B.hide.effect}}if(typeof B.style!=="object"){B.style={name:B.style}}B.style=c(B.style);s=f.extend(true,{},f.fn.qtip.defaults,B);s.style=a.call({options:s},s.style);s.user=f.extend(true,{},B)}return f(this).each(function(){if(typeof B=="string"){w=B.toLowerCase();A=f(this).qtip("interfaces");if(typeof A=="object"){if(u===true&&w=="destroy"){while(A.length>0){A[A.length-1].destroy()}}else{if(u!==true){A=[f(this).qtip("api")]}for(y=0;y<A.length;y++){if(w=="destroy"){A[y].destroy()}else{if(A[y].status.rendered===true){if(w=="show"){A[y].show()}else{if(w=="hide"){A[y].hide()}else{if(w=="focus"){A[y].focus()}else{if(w=="disable"){A[y].disable(true)}else{if(w=="enable"){A[y].disable(false)}}}}}}}}}}}else{v=f.extend(true,{},s);v.hide.effect.length=s.hide.effect.length;v.show.effect.length=s.show.effect.length;if(v.position.container===false){v.position.container=f(document.body)}if(v.position.target===false){v.position.target=f(this)}if(v.show.when.target===false){v.show.when.target=f(this)}if(v.hide.when.target===false){v.hide.when.target=f(this)}t=f.fn.qtip.interfaces.length;for(y=0;y<t;y++){if(typeof f.fn.qtip.interfaces[y]=="undefined"){t=y;break}}x=new d(f(this),v,t);f.fn.qtip.interfaces[t]=x;if(typeof f(this).data("qtip")=="object"){if(typeof f(this).attr("qtip")==="undefined"){f(this).data("qtip").current=f(this).data("qtip").interfaces.length}f(this).data("qtip").interfaces.push(x)}else{f(this).data("qtip",{current:0,interfaces:[x]})}if(v.content.prerender===false&&v.show.when.event!==false&&v.show.ready!==true){v.show.when.target.bind(v.show.when.event+".qtip-"+t+"-create",{qtip:t},function(C){z=f.fn.qtip.interfaces[C.data.qtip];z.options.show.when.target.unbind(z.options.show.when.event+".qtip-"+C.data.qtip+"-create");z.cache.mouse={x:C.pageX,y:C.pageY};p.call(z);z.options.show.when.target.trigger(z.options.show.when.event)})}else{x.cache.mouse={x:v.show.when.target.offset().left,y:v.show.when.target.offset().top};p.call(x)}}})};function d(u,t,v){var s=this;s.id=v;s.options=t;s.status={animated:false,rendered:false,disabled:false,focused:false};s.elements={target:u.addClass(s.options.style.classes.target),tooltip:null,wrapper:null,content:null,contentWrapper:null,title:null,button:null,tip:null,bgiframe:null};s.cache={mouse:{},position:{},toggle:0};s.timers={};f.extend(s,s.options.api,{show:function(y){var x,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"show")}if(s.elements.tooltip.css("display")!=="none"){return s}s.elements.tooltip.stop(true,false);x=s.beforeShow.call(s,y);if(x===false){return s}function w(){if(s.options.position.type!=="static"){s.focus()}s.onShow.call(s,y);if(f.browser.msie){s.elements.tooltip.get(0).style.removeAttribute("filter")}}s.cache.toggle=1;if(s.options.position.type!=="static"){s.updatePosition(y,(s.options.show.effect.length>0))}if(typeof s.options.show.solo=="object"){z=f(s.options.show.solo)}else{if(s.options.show.solo===true){z=f("div.qtip").not(s.elements.tooltip)}}if(z){z.each(function(){if(f(this).qtip("api").status.rendered===true){f(this).qtip("api").hide()}})}if(typeof s.options.show.effect.type=="function"){s.options.show.effect.type.call(s.elements.tooltip,s.options.show.effect.length);s.elements.tooltip.queue(function(){w();f(this).dequeue()})}else{switch(s.options.show.effect.type.toLowerCase()){case"fade":s.elements.tooltip.fadeIn(s.options.show.effect.length,w);break;case"slide":s.elements.tooltip.slideDown(s.options.show.effect.length,function(){w();if(s.options.position.type!=="static"){s.updatePosition(y,true)}});break;case"grow":s.elements.tooltip.show(s.options.show.effect.length,w);break;default:s.elements.tooltip.show(null,w);break}s.elements.tooltip.addClass(s.options.style.classes.active)}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_SHOWN,"show")},hide:function(y){var x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"hide")}else{if(s.elements.tooltip.css("display")==="none"){return s}}clearTimeout(s.timers.show);s.elements.tooltip.stop(true,false);x=s.beforeHide.call(s,y);if(x===false){return s}function w(){s.onHide.call(s,y)}s.cache.toggle=0;if(typeof s.options.hide.effect.type=="function"){s.options.hide.effect.type.call(s.elements.tooltip,s.options.hide.effect.length);s.elements.tooltip.queue(function(){w();f(this).dequeue()})}else{switch(s.options.hide.effect.type.toLowerCase()){case"fade":s.elements.tooltip.fadeOut(s.options.hide.effect.length,w);break;case"slide":s.elements.tooltip.slideUp(s.options.hide.effect.length,w);break;case"grow":s.elements.tooltip.hide(s.options.hide.effect.length,w);break;default:s.elements.tooltip.hide(null,w);break}s.elements.tooltip.removeClass(s.options.style.classes.active)}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_HIDDEN,"hide")},updatePosition:function(w,x){var C,G,L,J,H,E,y,I,B,D,K,A,F,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updatePosition")}else{if(s.options.position.type=="static"){return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.CANNOT_POSITION_STATIC,"updatePosition")}}G={position:{left:0,top:0},dimensions:{height:0,width:0},corner:s.options.position.corner.target};L={position:s.getPosition(),dimensions:s.getDimensions(),corner:s.options.position.corner.tooltip};if(s.options.position.target!=="mouse"){if(s.options.position.target.get(0).nodeName.toLowerCase()=="area"){J=s.options.position.target.attr("coords").split(",");for(C=0;C<J.length;C++){J[C]=parseInt(J[C])}H=s.options.position.target.parent("map").attr("name");E=f('img[usemap="#'+H+'"]:first').offset();G.position={left:Math.floor(E.left+J[0]),top:Math.floor(E.top+J[1])};switch(s.options.position.target.attr("shape").toLowerCase()){case"rect":G.dimensions={width:Math.ceil(Math.abs(J[2]-J[0])),height:Math.ceil(Math.abs(J[3]-J[1]))};break;case"circle":G.dimensions={width:J[2]+1,height:J[2]+1};break;case"poly":G.dimensions={width:J[0],height:J[1]};for(C=0;C<J.length;C++){if(C%2==0){if(J[C]>G.dimensions.width){G.dimensions.width=J[C]}if(J[C]<J[0]){G.position.left=Math.floor(E.left+J[C])}}else{if(J[C]>G.dimensions.height){G.dimensions.height=J[C]}if(J[C]<J[1]){G.position.top=Math.floor(E.top+J[C])}}}G.dimensions.width=G.dimensions.width-(G.position.left-E.left);G.dimensions.height=G.dimensions.height-(G.position.top-E.top);break;default:return f.fn.qtip.log.error.call(s,4,f.fn.qtip.constants.INVALID_AREA_SHAPE,"updatePosition");break}G.dimensions.width-=2;G.dimensions.height-=2}else{if(s.options.position.target.add(document.body).length===1){G.position={left:f(document).scrollLeft(),top:f(document).scrollTop()};G.dimensions={height:f(window).height(),width:f(window).width()}}else{if(typeof s.options.position.target.attr("qtip")!=="undefined"){G.position=s.options.position.target.qtip("api").cache.position}else{G.position=s.options.position.target.offset()}G.dimensions={height:s.options.position.target.outerHeight(),width:s.options.position.target.outerWidth()}}}y=f.extend({},G.position);if(G.corner.search(/right/i)!==-1){y.left+=G.dimensions.width}if(G.corner.search(/bottom/i)!==-1){y.top+=G.dimensions.height}if(G.corner.search(/((top|bottom)Middle)|center/)!==-1){y.left+=(G.dimensions.width/2)}if(G.corner.search(/((left|right)Middle)|center/)!==-1){y.top+=(G.dimensions.height/2)}}else{G.position=y={left:s.cache.mouse.x,top:s.cache.mouse.y};G.dimensions={height:1,width:1}}if(L.corner.search(/right/i)!==-1){y.left-=L.dimensions.width}if(L.corner.search(/bottom/i)!==-1){y.top-=L.dimensions.height}if(L.corner.search(/((top|bottom)Middle)|center/)!==-1){y.left-=(L.dimensions.width/2)}if(L.corner.search(/((left|right)Middle)|center/)!==-1){y.top-=(L.dimensions.height/2)}I=(f.browser.msie)?1:0;B=(f.browser.msie&&parseInt(f.browser.version.charAt(0))===6)?1:0;if(s.options.style.border.radius>0){if(L.corner.search(/Left/)!==-1){y.left-=s.options.style.border.radius}else{if(L.corner.search(/Right/)!==-1){y.left+=s.options.style.border.radius}}if(L.corner.search(/Top/)!==-1){y.top-=s.options.style.border.radius}else{if(L.corner.search(/Bottom/)!==-1){y.top+=s.options.style.border.radius}}}if(I){if(L.corner.search(/top/)!==-1){y.top-=I}else{if(L.corner.search(/bottom/)!==-1){y.top+=I}}if(L.corner.search(/left/)!==-1){y.left-=I}else{if(L.corner.search(/right/)!==-1){y.left+=I}}if(L.corner.search(/leftMiddle|rightMiddle/)!==-1){y.top-=1}}if(s.options.position.adjust.screen===true){y=o.call(s,y,G,L)}if(s.options.position.target==="mouse"&&s.options.position.adjust.mouse===true){if(s.options.position.adjust.screen===true&&s.elements.tip){K=s.elements.tip.attr("rel")}else{K=s.options.position.corner.tooltip}y.left+=(K.search(/right/i)!==-1)?-6:6;y.top+=(K.search(/bottom/i)!==-1)?-6:6}if(!s.elements.bgiframe&&f.browser.msie&&parseInt(f.browser.version.charAt(0))==6){f("select, object").each(function(){A=f(this).offset();A.bottom=A.top+f(this).height();A.right=A.left+f(this).width();if(y.top+L.dimensions.height>=A.top&&y.left+L.dimensions.width>=A.left){k.call(s)}})}y.left+=s.options.position.adjust.x;y.top+=s.options.position.adjust.y;F=s.getPosition();if(y.left!=F.left||y.top!=F.top){z=s.beforePositionUpdate.call(s,w);if(z===false){return s}s.cache.position=y;if(x===true){s.status.animated=true;s.elements.tooltip.animate(y,200,"swing",function(){s.status.animated=false})}else{s.elements.tooltip.css(y)}s.onPositionUpdate.call(s,w);if(typeof w!=="undefined"&&w.type&&w.type!=="mousemove"){f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_POSITION_UPDATED,"updatePosition")}}return s},updateWidth:function(w){var x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateWidth")}else{if(w&&typeof w!=="number"){return f.fn.qtip.log.error.call(s,2,"newWidth must be of type number","updateWidth")}}x=s.elements.contentWrapper.siblings().add(s.elements.tip).add(s.elements.button);if(!w){if(typeof s.options.style.width.value=="number"){w=s.options.style.width.value}else{s.elements.tooltip.css({width:"auto"});x.hide();if(f.browser.msie){s.elements.wrapper.add(s.elements.contentWrapper.children()).css({zoom:"normal"})}w=s.getDimensions().width+1;if(!s.options.style.width.value){if(w>s.options.style.width.max){w=s.options.style.width.max}if(w<s.options.style.width.min){w=s.options.style.width.min}}}}if(w%2!==0){w-=1}s.elements.tooltip.width(w);x.show();if(s.options.style.border.radius){s.elements.tooltip.find(".qtip-betweenCorners").each(function(y){f(this).width(w-(s.options.style.border.radius*2))})}if(f.browser.msie){s.elements.wrapper.add(s.elements.contentWrapper.children()).css({zoom:"1"});s.elements.wrapper.width(w);if(s.elements.bgiframe){s.elements.bgiframe.width(w).height(s.getDimensions.height)}}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_WIDTH_UPDATED,"updateWidth")},updateStyle:function(w){var z,A,x,y,B;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateStyle")}else{if(typeof w!=="string"||!f.fn.qtip.styles[w]){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.STYLE_NOT_DEFINED,"updateStyle")}}s.options.style=a.call(s,f.fn.qtip.styles[w],s.options.user.style);s.elements.content.css(q(s.options.style));if(s.options.content.title.text!==false){s.elements.title.css(q(s.options.style.title,true))}s.elements.contentWrapper.css({borderColor:s.options.style.border.color});if(s.options.style.tip.corner!==false){if(f("<canvas>").get(0).getContext){z=s.elements.tooltip.find(".qtip-tip canvas:first");x=z.get(0).getContext("2d");x.clearRect(0,0,300,300);y=z.parent("div[rel]:first").attr("rel");B=b(y,s.options.style.tip.size.width,s.options.style.tip.size.height);h.call(s,z,B,s.options.style.tip.color||s.options.style.border.color)}else{if(f.browser.msie){z=s.elements.tooltip.find('.qtip-tip [nodeName="shape"]');z.attr("fillcolor",s.options.style.tip.color||s.options.style.border.color)}}}if(s.options.style.border.radius>0){s.elements.tooltip.find(".qtip-betweenCorners").css({backgroundColor:s.options.style.border.color});if(f("<canvas>").get(0).getContext){A=g(s.options.style.border.radius);s.elements.tooltip.find(".qtip-wrapper canvas").each(function(){x=f(this).get(0).getContext("2d");x.clearRect(0,0,300,300);y=f(this).parent("div[rel]:first").attr("rel");r.call(s,f(this),A[y],s.options.style.border.radius,s.options.style.border.color)})}else{if(f.browser.msie){s.elements.tooltip.find('.qtip-wrapper [nodeName="arc"]').each(function(){f(this).attr("fillcolor",s.options.style.border.color)})}}}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_STYLE_UPDATED,"updateStyle")},updateContent:function(A,y){var z,x,w;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateContent")}else{if(!A){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateContent")}}z=s.beforeContentUpdate.call(s,A);if(typeof z=="string"){A=z}else{if(z===false){return}}if(f.browser.msie){s.elements.contentWrapper.children().css({zoom:"normal"})}if(A.jquery&&A.length>0){A.clone(true).appendTo(s.elements.content).show()}else{s.elements.content.html(A)}x=s.elements.content.find("img[complete=false]");if(x.length>0){w=0;x.each(function(C){f('<img src="'+f(this).attr("src")+'" />').load(function(){if(++w==x.length){B()}})})}else{B()}function B(){s.updateWidth();if(y!==false){if(s.options.position.type!=="static"){s.updatePosition(s.elements.tooltip.is(":visible"),true)}if(s.options.style.tip.corner!==false){n.call(s)}}}s.onContentUpdate.call(s);return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_CONTENT_UPDATED,"loadContent")},loadContent:function(w,z,A){var y;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"loadContent")}y=s.beforeContentLoad.call(s);if(y===false){return s}if(A=="post"){f.post(w,z,x)}else{f.get(w,z,x)}function x(B){s.onContentLoad.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_CONTENT_LOADED,"loadContent");s.updateContent(B)}return s},updateTitle:function(w){if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateTitle")}else{if(!w){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateTitle")}}returned=s.beforeTitleUpdate.call(s);if(returned===false){return s}if(s.elements.button){s.elements.button=s.elements.button.clone(true)}s.elements.title.html(w);if(s.elements.button){s.elements.title.prepend(s.elements.button)}s.onTitleUpdate.call(s);return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_TITLE_UPDATED,"updateTitle")},focus:function(A){var y,x,w,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"focus")}else{if(s.options.position.type=="static"){return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.CANNOT_FOCUS_STATIC,"focus")}}y=parseInt(s.elements.tooltip.css("z-index"));x=6000+f("div.qtip[qtip]").length-1;if(!s.status.focused&&y!==x){z=s.beforeFocus.call(s,A);if(z===false){return s}f("div.qtip[qtip]").not(s.elements.tooltip).each(function(){if(f(this).qtip("api").status.rendered===true){w=parseInt(f(this).css("z-index"));if(typeof w=="number"&&w>-1){f(this).css({zIndex:parseInt(f(this).css("z-index"))-1})}f(this).qtip("api").status.focused=false}});s.elements.tooltip.css({zIndex:x});s.status.focused=true;s.onFocus.call(s,A);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_FOCUSED,"focus")}return s},disable:function(w){if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"disable")}if(w){if(!s.status.disabled){s.status.disabled=true;f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_DISABLED,"disable")}else{f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.TOOLTIP_ALREADY_DISABLED,"disable")}}else{if(s.status.disabled){s.status.disabled=false;f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_ENABLED,"disable")}else{f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.TOOLTIP_ALREADY_ENABLED,"disable")}}return s},destroy:function(){var w,x,y;x=s.beforeDestroy.call(s);if(x===false){return s}if(s.status.rendered){s.options.show.when.target.unbind("mousemove.qtip",s.updatePosition);s.options.show.when.target.unbind("mouseout.qtip",s.hide);s.options.show.when.target.unbind(s.options.show.when.event+".qtip");s.options.hide.when.target.unbind(s.options.hide.when.event+".qtip");s.elements.tooltip.unbind(s.options.hide.when.event+".qtip");s.elements.tooltip.unbind("mouseover.qtip",s.focus);s.elements.tooltip.remove()}else{s.options.show.when.target.unbind(s.options.show.when.event+".qtip-create")}if(typeof s.elements.target.data("qtip")=="object"){y=s.elements.target.data("qtip").interfaces;if(typeof y=="object"&&y.length>0){for(w=0;w<y.length-1;w++){if(y[w].id==s.id){y.splice(w,1)}}}}delete f.fn.qtip.interfaces[s.id];if(typeof y=="object"&&y.length>0){s.elements.target.data("qtip").current=y.length-1}else{s.elements.target.removeData("qtip")}s.onDestroy.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_DESTROYED,"destroy");return s.elements.target},getPosition:function(){var w,x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getPosition")}w=(s.elements.tooltip.css("display")!=="none")?false:true;if(w){s.elements.tooltip.css({visiblity:"hidden"}).show()}x=s.elements.tooltip.offset();if(w){s.elements.tooltip.css({visiblity:"visible"}).hide()}return x},getDimensions:function(){var w,x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getDimensions")}w=(!s.elements.tooltip.is(":visible"))?true:false;if(w){s.elements.tooltip.css({visiblity:"hidden"}).show()}x={height:s.elements.tooltip.outerHeight(),width:s.elements.tooltip.outerWidth()};if(w){s.elements.tooltip.css({visiblity:"visible"}).hide()}return x}})}function p(){var s,w,u,t,v,y,x;s=this;s.beforeRender.call(s);s.status.rendered=true;s.elements.tooltip='<div qtip="'+s.id+'" class="qtip '+(s.options.style.classes.tooltip||s.options.style)+'"style="display:none; -moz-border-radius:0; -webkit-border-radius:0; border-radius:0;position:'+s.options.position.type+';">  <div class="qtip-wrapper" style="position:relative; overflow:hidden; text-align:left;">    <div class="qtip-contentWrapper" style="overflow:hidden;">       <div class="qtip-content '+s.options.style.classes.content+'"></div></div></div></div>';s.elements.tooltip=f(s.elements.tooltip);s.elements.tooltip.appendTo(s.options.position.container);s.elements.tooltip.data("qtip",{current:0,interfaces:[s]});s.elements.wrapper=s.elements.tooltip.children("div:first");s.elements.contentWrapper=s.elements.wrapper.children("div:first").css({background:s.options.style.background});s.elements.content=s.elements.contentWrapper.children("div:first").css(q(s.options.style));if(f.browser.msie){s.elements.wrapper.add(s.elements.content).css({zoom:1})}if(s.options.hide.when.event=="unfocus"){s.elements.tooltip.attr("unfocus",true)}if(typeof s.options.style.width.value=="number"){s.updateWidth()}if(f("<canvas>").get(0).getContext||f.browser.msie){if(s.options.style.border.radius>0){m.call(s)}else{s.elements.contentWrapper.css({border:s.options.style.border.width+"px solid "+s.options.style.border.color})}if(s.options.style.tip.corner!==false){e.call(s)}}else{s.elements.contentWrapper.css({border:s.options.style.border.width+"px solid "+s.options.style.border.color});s.options.style.border.radius=0;s.options.style.tip.corner=false;f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.CANVAS_VML_NOT_SUPPORTED,"render")}if((typeof s.options.content.text=="string"&&s.options.content.text.length>0)||(s.options.content.text.jquery&&s.options.content.text.length>0)){u=s.options.content.text}else{if(typeof s.elements.target.attr("title")=="string"&&s.elements.target.attr("title").length>0){u=s.elements.target.attr("title").replace("\\n","<br />");s.elements.target.attr("title","")}else{if(typeof s.elements.target.attr("alt")=="string"&&s.elements.target.attr("alt").length>0){u=s.elements.target.attr("alt").replace("\\n","<br />");s.elements.target.attr("alt","")}else{u=" ";f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.NO_VALID_CONTENT,"render")}}}if(s.options.content.title.text!==false){j.call(s)}s.updateContent(u);l.call(s);if(s.options.show.ready===true){s.show()}if(s.options.content.url!==false){t=s.options.content.url;v=s.options.content.data;y=s.options.content.method||"get";s.loadContent(t,v,y)}s.onRender.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_RENDERED,"render")}function m(){var F,z,t,B,x,E,u,G,D,y,w,C,A,s,v;F=this;F.elements.wrapper.find(".qtip-borderBottom, .qtip-borderTop").remove();t=F.options.style.border.width;B=F.options.style.border.radius;x=F.options.style.border.color||F.options.style.tip.color;E=g(B);u={};for(z in E){u[z]='<div rel="'+z+'" style="'+((z.search(/Left/)!==-1)?"left":"right")+":0; position:absolute; height:"+B+"px; width:"+B+'px; overflow:hidden; line-height:0.1px; font-size:1px">';if(f("<canvas>").get(0).getContext){u[z]+='<canvas height="'+B+'" width="'+B+'" style="vertical-align: top"></canvas>'}else{if(f.browser.msie){G=B*2+3;u[z]+='<v:arc stroked="false" fillcolor="'+x+'" startangle="'+E[z][0]+'" endangle="'+E[z][1]+'" style="width:'+G+"px; height:"+G+"px; margin-top:"+((z.search(/bottom/)!==-1)?-2:-1)+"px; margin-left:"+((z.search(/Right/)!==-1)?E[z][2]-3.5:-1)+'px; vertical-align:top; display:inline-block; behavior:url(#default#VML)"></v:arc>'}}u[z]+="</div>"}D=F.getDimensions().width-(Math.max(t,B)*2);y='<div class="qtip-betweenCorners" style="height:'+B+"px; width:"+D+"px; overflow:hidden; background-color:"+x+'; line-height:0.1px; font-size:1px;">';w='<div class="qtip-borderTop" dir="ltr" style="height:'+B+"px; margin-left:"+B+'px; line-height:0.1px; font-size:1px; padding:0;">'+u.topLeft+u.topRight+y;F.elements.wrapper.prepend(w);C='<div class="qtip-borderBottom" dir="ltr" style="height:'+B+"px; margin-left:"+B+'px; line-height:0.1px; font-size:1px; padding:0;">'+u.bottomLeft+u.bottomRight+y;F.elements.wrapper.append(C);if(f("<canvas>").get(0).getContext){F.elements.wrapper.find("canvas").each(function(){A=E[f(this).parent("[rel]:first").attr("rel")];r.call(F,f(this),A,B,x)})}else{if(f.browser.msie){F.elements.tooltip.append('<v:image style="behavior:url(#default#VML);"></v:image>')}}s=Math.max(B,(B+(t-B)));v=Math.max(t-B,0);F.elements.contentWrapper.css({border:"0px solid "+x,borderWidth:v+"px "+s+"px"})}function r(u,w,s,t){var v=u.get(0).getContext("2d");v.fillStyle=t;v.beginPath();v.arc(w[0],w[1],s,0,Math.PI*2,false);v.fill()}function e(v){var t,s,x,u,w;t=this;if(t.elements.tip!==null){t.elements.tip.remove()}s=t.options.style.tip.color||t.options.style.border.color;if(t.options.style.tip.corner===false){return}else{if(!v){v=t.options.style.tip.corner}}x=b(v,t.options.style.tip.size.width,t.options.style.tip.size.height);t.elements.tip='<div class="'+t.options.style.classes.tip+'" dir="ltr" rel="'+v+'" style="position:absolute; height:'+t.options.style.tip.size.height+"px; width:"+t.options.style.tip.size.width+'px; margin:0 auto; line-height:0.1px; font-size:1px;">';if(f("<canvas>").get(0).getContext){t.elements.tip+='<canvas height="'+t.options.style.tip.size.height+'" width="'+t.options.style.tip.size.width+'"></canvas>'}else{if(f.browser.msie){u=t.options.style.tip.size.width+","+t.options.style.tip.size.height;w="m"+x[0][0]+","+x[0][1];w+=" l"+x[1][0]+","+x[1][1];w+=" "+x[2][0]+","+x[2][1];w+=" xe";t.elements.tip+='<v:shape fillcolor="'+s+'" stroked="false" filled="true" path="'+w+'" coordsize="'+u+'" style="width:'+t.options.style.tip.size.width+"px; height:"+t.options.style.tip.size.height+"px; line-height:0.1px; display:inline-block; behavior:url(#default#VML); vertical-align:"+((v.search(/top/)!==-1)?"bottom":"top")+'"></v:shape>';t.elements.tip+='<v:image style="behavior:url(#default#VML);"></v:image>';t.elements.contentWrapper.css("position","relative")}}t.elements.tooltip.prepend(t.elements.tip+"</div>");t.elements.tip=t.elements.tooltip.find("."+t.options.style.classes.tip).eq(0);if(f("<canvas>").get(0).getContext){h.call(t,t.elements.tip.find("canvas:first"),x,s)}if(v.search(/top/)!==-1&&f.browser.msie&&parseInt(f.browser.version.charAt(0))===6){t.elements.tip.css({marginTop:-4})}n.call(t,v)}function h(t,v,s){var u=t.get(0).getContext("2d");u.fillStyle=s;u.beginPath();u.moveTo(v[0][0],v[0][1]);u.lineTo(v[1][0],v[1][1]);u.lineTo(v[2][0],v[2][1]);u.fill()}function n(u){var t,w,s,x,v;t=this;if(t.options.style.tip.corner===false||!t.elements.tip){return}if(!u){u=t.elements.tip.attr("rel")}w=positionAdjust=(f.browser.msie)?1:0;t.elements.tip.css(u.match(/left|right|top|bottom/)[0],0);if(u.search(/top|bottom/)!==-1){if(f.browser.msie){if(parseInt(f.browser.version.charAt(0))===6){positionAdjust=(u.search(/top/)!==-1)?-3:1}else{positionAdjust=(u.search(/top/)!==-1)?1:2}}if(u.search(/Middle/)!==-1){t.elements.tip.css({left:"50%",marginLeft:-(t.options.style.tip.size.width/2)})}else{if(u.search(/Left/)!==-1){t.elements.tip.css({left:t.options.style.border.radius-w})}else{if(u.search(/Right/)!==-1){t.elements.tip.css({right:t.options.style.border.radius+w})}}}if(u.search(/top/)!==-1){t.elements.tip.css({top:-positionAdjust})}else{t.elements.tip.css({bottom:positionAdjust})}}else{if(u.search(/left|right/)!==-1){if(f.browser.msie){positionAdjust=(parseInt(f.browser.version.charAt(0))===6)?1:((u.search(/left/)!==-1)?1:2)}if(u.search(/Middle/)!==-1){t.elements.tip.css({top:"50%",marginTop:-(t.options.style.tip.size.height/2)})}else{if(u.search(/Top/)!==-1){t.elements.tip.css({top:t.options.style.border.radius-w})}else{if(u.search(/Bottom/)!==-1){t.elements.tip.css({bottom:t.options.style.border.radius+w})}}}if(u.search(/left/)!==-1){t.elements.tip.css({left:-positionAdjust})}else{t.elements.tip.css({right:positionAdjust})}}}s="padding-"+u.match(/left|right|top|bottom/)[0];x=t.options.style.tip.size[(s.search(/left|right/)!==-1)?"width":"height"];t.elements.tooltip.css("padding",0);t.elements.tooltip.css(s,x);if(f.browser.msie&&parseInt(f.browser.version.charAt(0))==6){v=parseInt(t.elements.tip.css("margin-top"))||0;v+=parseInt(t.elements.content.css("margin-top"))||0;t.elements.tip.css({marginTop:v})}}function j(){var s=this;if(s.elements.title!==null){s.elements.title.remove()}s.elements.title=f('<div class="'+s.options.style.classes.title+'">').css(q(s.options.style.title,true)).css({zoom:(f.browser.msie)?1:0}).prependTo(s.elements.contentWrapper);if(s.options.content.title.text){s.updateTitle.call(s,s.options.content.title.text)}if(s.options.content.title.button!==false&&typeof s.options.content.title.button=="string"){s.elements.button=f('<a class="'+s.options.style.classes.button+'" style="float:right; position: relative"></a>').css(q(s.options.style.button,true)).html(s.options.content.title.button).prependTo(s.elements.title).click(function(t){if(!s.status.disabled){s.hide(t)}})}}function l(){var t,v,u,s;t=this;v=t.options.show.when.target;u=t.options.hide.when.target;if(t.options.hide.fixed){u=u.add(t.elements.tooltip)}if(t.options.hide.when.event=="inactive"){s=["click","dblclick","mousedown","mouseup","mousemove","mouseout","mouseenter","mouseleave","mouseover"];function y(z){if(t.status.disabled===true){return}clearTimeout(t.timers.inactive);t.timers.inactive=setTimeout(function(){f(s).each(function(){u.unbind(this+".qtip-inactive");t.elements.content.unbind(this+".qtip-inactive")});t.hide(z)},t.options.hide.delay)}}else{if(t.options.hide.fixed===true){t.elements.tooltip.bind("mouseover.qtip",function(){if(t.status.disabled===true){return}clearTimeout(t.timers.hide)})}}function x(z){if(t.status.disabled===true){return}if(t.options.hide.when.event=="inactive"){f(s).each(function(){u.bind(this+".qtip-inactive",y);t.elements.content.bind(this+".qtip-inactive",y)});y()}clearTimeout(t.timers.show);clearTimeout(t.timers.hide);t.timers.show=setTimeout(function(){t.show(z)},t.options.show.delay)}function w(z){if(t.status.disabled===true){return}if(t.options.hide.fixed===true&&t.options.hide.when.event.search(/mouse(out|leave)/i)!==-1&&f(z.relatedTarget).parents("div.qtip[qtip]").length>0){z.stopPropagation();z.preventDefault();clearTimeout(t.timers.hide);return false}clearTimeout(t.timers.show);clearTimeout(t.timers.hide);t.elements.tooltip.stop(true,true);t.timers.hide=setTimeout(function(){t.hide(z)},t.options.hide.delay)}if((t.options.show.when.target.add(t.options.hide.when.target).length===1&&t.options.show.when.event==t.options.hide.when.event&&t.options.hide.when.event!=="inactive")||t.options.hide.when.event=="unfocus"){t.cache.toggle=0;v.bind(t.options.show.when.event+".qtip",function(z){if(t.cache.toggle==0){x(z)}else{w(z)}})}else{v.bind(t.options.show.when.event+".qtip",x);if(t.options.hide.when.event!=="inactive"){u.bind(t.options.hide.when.event+".qtip",w)}}if(t.options.position.type.search(/(fixed|absolute)/)!==-1){t.elements.tooltip.bind("mouseover.qtip",t.focus)}if(t.options.position.target==="mouse"&&t.options.position.type!=="static"){v.bind("mousemove.qtip",function(z){t.cache.mouse={x:z.pageX,y:z.pageY};if(t.status.disabled===false&&t.options.position.adjust.mouse===true&&t.options.position.type!=="static"&&t.elements.tooltip.css("display")!=="none"){t.updatePosition(z)}})}}function o(u,v,A){var z,s,x,y,t,w;z=this;if(A.corner=="center"){return v.position}s=f.extend({},u);y={x:false,y:false};t={left:(s.left<f.fn.qtip.cache.screen.scroll.left),right:(s.left+A.dimensions.width+2>=f.fn.qtip.cache.screen.width+f.fn.qtip.cache.screen.scroll.left),top:(s.top<f.fn.qtip.cache.screen.scroll.top),bottom:(s.top+A.dimensions.height+2>=f.fn.qtip.cache.screen.height+f.fn.qtip.cache.screen.scroll.top)};x={left:(t.left&&(A.corner.search(/right/i)!=-1||(A.corner.search(/right/i)==-1&&!t.right))),right:(t.right&&(A.corner.search(/left/i)!=-1||(A.corner.search(/left/i)==-1&&!t.left))),top:(t.top&&A.corner.search(/top/i)==-1),bottom:(t.bottom&&A.corner.search(/bottom/i)==-1)};if(x.left){if(z.options.position.target!=="mouse"){s.left=v.position.left+v.dimensions.width}else{s.left=z.cache.mouse.x}y.x="Left"}else{if(x.right){if(z.options.position.target!=="mouse"){s.left=v.position.left-A.dimensions.width}else{s.left=z.cache.mouse.x-A.dimensions.width}y.x="Right"}}if(x.top){if(z.options.position.target!=="mouse"){s.top=v.position.top+v.dimensions.height}else{s.top=z.cache.mouse.y}y.y="top"}else{if(x.bottom){if(z.options.position.target!=="mouse"){s.top=v.position.top-A.dimensions.height}else{s.top=z.cache.mouse.y-A.dimensions.height}y.y="bottom"}}if(s.left<0){s.left=u.left;y.x=false}if(s.top<0){s.top=u.top;y.y=false}if(z.options.style.tip.corner!==false){s.corner=new String(A.corner);if(y.x!==false){s.corner=s.corner.replace(/Left|Right|Middle/,y.x)}if(y.y!==false){s.corner=s.corner.replace(/top|bottom/,y.y)}if(s.corner!==z.elements.tip.attr("rel")){e.call(z,s.corner)}}return s}function q(u,t){var v,s;v=f.extend(true,{},u);for(s in v){if(t===true&&s.search(/(tip|classes)/i)!==-1){delete v[s]}else{if(!t&&s.search(/(width|border|tip|title|classes|user)/i)!==-1){delete v[s]}}}return v}function c(s){if(typeof s.tip!=="object"){s.tip={corner:s.tip}}if(typeof s.tip.size!=="object"){s.tip.size={width:s.tip.size,height:s.tip.size}}if(typeof s.border!=="object"){s.border={width:s.border}}if(typeof s.width!=="object"){s.width={value:s.width}}if(typeof s.width.max=="string"){s.width.max=parseInt(s.width.max.replace(/([0-9]+)/i,"$1"))}if(typeof s.width.min=="string"){s.width.min=parseInt(s.width.min.replace(/([0-9]+)/i,"$1"))}if(typeof s.tip.size.x=="number"){s.tip.size.width=s.tip.size.x;delete s.tip.size.x}if(typeof s.tip.size.y=="number"){s.tip.size.height=s.tip.size.y;delete s.tip.size.y}return s}function a(){var s,t,u,x,v,w;s=this;u=[true,{}];for(t=0;t<arguments.length;t++){u.push(arguments[t])}x=[f.extend.apply(f,u)];while(typeof x[0].name=="string"){x.unshift(c(f.fn.qtip.styles[x[0].name]))}x.unshift(true,{classes:{tooltip:"qtip-"+(arguments[0].name||"defaults")}},f.fn.qtip.styles.defaults);v=f.extend.apply(f,x);w=(f.browser.msie)?1:0;v.tip.size.width+=w;v.tip.size.height+=w;if(v.tip.size.width%2>0){v.tip.size.width+=1}if(v.tip.size.height%2>0){v.tip.size.height+=1}if(v.tip.corner===true){v.tip.corner=(s.options.position.corner.tooltip==="center")?false:s.options.position.corner.tooltip}return v}function b(v,u,t){var s={bottomRight:[[0,0],[u,t],[u,0]],bottomLeft:[[0,0],[u,0],[0,t]],topRight:[[0,t],[u,0],[u,t]],topLeft:[[0,0],[0,t],[u,t]],topMiddle:[[0,t],[u/2,0],[u,t]],bottomMiddle:[[0,0],[u,0],[u/2,t]],rightMiddle:[[0,0],[u,t/2],[0,t]],leftMiddle:[[u,0],[u,t],[0,t/2]]};s.leftTop=s.bottomRight;s.rightTop=s.bottomLeft;s.leftBottom=s.topRight;s.rightBottom=s.topLeft;return s[v]}function g(s){var t;if(f("<canvas>").get(0).getContext){t={topLeft:[s,s],topRight:[0,s],bottomLeft:[s,0],bottomRight:[0,0]}}else{if(f.browser.msie){t={topLeft:[-90,90,0],topRight:[-90,90,-s],bottomLeft:[90,270,0],bottomRight:[90,270,-s]}}}return t}function k(){var s,t,u;s=this;u=s.getDimensions();t='<iframe class="qtip-bgiframe" frameborder="0" tabindex="-1" src="javascript:false" style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=\'0\'); border: 1px solid red; height:'+u.height+"px; width:"+u.width+'px" />';s.elements.bgiframe=s.elements.wrapper.prepend(t).children(".qtip-bgiframe:first")}f(document).ready(function(){f.fn.qtip.cache={screen:{scroll:{left:f(window).scrollLeft(),top:f(window).scrollTop()},width:f(window).width(),height:f(window).height()}};var s;f(window).bind("resize scroll",function(t){clearTimeout(s);s=setTimeout(function(){if(t.type==="scroll"){f.fn.qtip.cache.screen.scroll={left:f(window).scrollLeft(),top:f(window).scrollTop()}}else{f.fn.qtip.cache.screen.width=f(window).width();f.fn.qtip.cache.screen.height=f(window).height()}for(i=0;i<f.fn.qtip.interfaces.length;i++){var u=f.fn.qtip.interfaces[i];if(u.status.rendered===true&&(u.options.position.type!=="static"||u.options.position.adjust.scroll&&t.type==="scroll"||u.options.position.adjust.resize&&t.type==="resize")){u.updatePosition(t,true)}}},100)});f(document).bind("mousedown.qtip",function(t){if(f(t.target).parents("div.qtip").length===0){f(".qtip[unfocus]").each(function(){var u=f(this).qtip("api");if(f(this).is(":visible")&&!u.status.disabled&&f(t.target).add(u.elements.target).length>1){u.hide(t)}})}})});f.fn.qtip.interfaces=[];f.fn.qtip.log={error:function(){return this}};f.fn.qtip.constants={};f.fn.qtip.defaults={content:{prerender:false,text:false,url:false,data:null,title:{text:false,button:false}},position:{target:false,corner:{target:"bottomRight",tooltip:"topLeft"},adjust:{x:0,y:0,mouse:true,screen:false,scroll:true,resize:true},type:"absolute",container:false},show:{when:{target:false,event:"mouseover"},effect:{type:"fade",length:100},delay:140,solo:false,ready:false},hide:{when:{target:false,event:"mouseout"},effect:{type:"fade",length:100},delay:0,fixed:false},api:{beforeRender:function(){},onRender:function(){},beforePositionUpdate:function(){},onPositionUpdate:function(){},beforeShow:function(){},onShow:function(){},beforeHide:function(){},onHide:function(){},beforeContentUpdate:function(){},onContentUpdate:function(){},beforeContentLoad:function(){},onContentLoad:function(){},beforeTitleUpdate:function(){},onTitleUpdate:function(){},beforeDestroy:function(){},onDestroy:function(){},beforeFocus:function(){},onFocus:function(){}}};f.fn.qtip.styles={defaults:{background:"white",color:"#111",overflow:"hidden",textAlign:"left",width:{min:0,max:250},padding:"5px 9px",border:{width:1,radius:0,color:"#d3d3d3"},tip:{corner:false,color:false,size:{width:13,height:13},opacity:1},title:{background:"#e1e1e1",fontWeight:"bold",padding:"7px 12px"},button:{cursor:"pointer"},classes:{target:"",tip:"qtip-tip",title:"qtip-title",button:"qtip-button",content:"qtip-content",active:"qtip-active"}},cream:{border:{width:3,radius:0,color:"#F9E98E"},title:{background:"#F0DE7D",color:"#A27D35"},background:"#FBF7AA",color:"#A27D35",classes:{tooltip:"qtip-cream"}},light:{border:{width:3,radius:0,color:"#E2E2E2"},title:{background:"#f1f1f1",color:"#454545"},background:"white",color:"#454545",classes:{tooltip:"qtip-light"}},dark:{border:{width:3,radius:0,color:"#303030"},title:{background:"#404040",color:"#f3f3f3"},background:"#505050",color:"#f3f3f3",classes:{tooltip:"qtip-dark"}},red:{border:{width:3,radius:0,color:"#CE6F6F"},title:{background:"#f28279",color:"#9C2F2F"},background:"#F79992",color:"#9C2F2F",classes:{tooltip:"qtip-red"}},green:{border:{width:3,radius:0,color:"#A9DB66"},title:{background:"#b9db8c",color:"#58792E"},background:"#CDE6AC",color:"#58792E",classes:{tooltip:"qtip-green"}},blue:{border:{width:3,radius:0,color:"#ADD9ED"},title:{background:"#D0E9F5",color:"#5E99BD"},background:"#E5F6FE",color:"#4D9FBF",classes:{tooltip:"qtip-blue"}}}})(jQuery);
+
+
+
+
+
+
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/menu/AjaxLinkMenuItem.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/menu/AjaxLinkMenuItem.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/menu/AjaxLinkMenuItem.java	(revision 5623)
@@ -0,0 +1,86 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.menu;
+
+import java.io.Serializable;
+
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.markup.html.link.AbstractLink;
+import org.apache.wicket.model.IModel;
+
+@SuppressWarnings("serial")
+public class AjaxLinkMenuItem<T> implements Serializable, MenuItem {
+    private final IModel<String> label;
+    private final IModel<T> model;
+    private final String cssClass;
+    private boolean visible = true;
+    private boolean enabled = true;
+
+    public AjaxLinkMenuItem(IModel<String> label, IModel<T> model,
+            String cssClass) {
+        this.label = label;
+        this.model = model;
+        this.cssClass = cssClass;
+    }
+
+    public AjaxLinkMenuItem(IModel<String> label, IModel<T> model) {
+        this(label, model, null);
+    }
+
+    public AjaxLinkMenuItem(IModel<String> label, String cssClass) {
+        this(label, null, cssClass);
+    }
+
+    public AjaxLinkMenuItem(IModel<String> label) {
+        this(label, null, null);
+    }
+
+    @Override
+    public IModel<String> getLabel() {
+        return label;
+    }
+
+    @Override
+    public String getCssClass() {
+        return cssClass;
+    }
+
+    @Override
+    public AbstractLink newLink(String componentId) {
+        return new AjaxLink<T>(componentId, model) {
+            @Override
+            public void onClick(AjaxRequestTarget target) {
+                AjaxLinkMenuItem.this.onClick(target, getModel());
+            }
+        };
+    }
+
+    protected void onClick(AjaxRequestTarget target, IModel<T> model) {
+        onClick(target);
+    }
+
+    protected void onClick(AjaxRequestTarget target) {
+    }
+
+    @Override
+    public MenuItem setVisible(boolean visible) {
+        this.visible = visible;
+        return this;
+    }
+
+    @Override
+    public boolean isVisible() {
+        return visible;
+    }
+
+    @Override
+    public MenuItem setEnabled(boolean enabled) {
+        this.enabled = enabled;
+        return this;
+    }
+
+    @Override
+    public boolean isEnabled() {
+        return enabled;
+    }
+
+} // class AjaxLinkMenuItem
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/menu/AjaxPopupMenu.css
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/menu/AjaxPopupMenu.css	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/menu/AjaxPopupMenu.css	(revision 5623)
@@ -0,0 +1,32 @@
+div.popupTrigger {
+	cursor: pointer;
+}
+
+div.popupMenu {
+    position: absolute;
+    color: #000000;
+    background-color: #ffffff;
+    padding: 2px;
+    margin: 0;
+    border: 1px solid #000000;
+    display: none;
+}
+
+div.popupMenu ul {
+    padding: 0;
+    margin: 0;
+}
+
+div.popupMenu li {
+	list-style: none;
+    padding: 0px;
+    margin: 0px;
+}
+
+div.popupMenu li a {
+    padding: 2px 2px;
+    margin: 0;
+    display: block;
+    text-decoration: none;
+    text-align: left;
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/menu/AjaxPopupMenu.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/menu/AjaxPopupMenu.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/menu/AjaxPopupMenu.html	(revision 5623)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:wicket="http://wicket.apache.org/">
+<head/>
+<body>
+<wicket:panel>
+<div wicket:id="menu" class="popupMenuWrapper">
+  <div class="popupTrigger">
+    <span wicket:id="title" class="title"></span>
+  </div>
+  <div class="popupMenu">
+    <ul>
+      <li wicket:id="items"><a wicket:id="link" href="javascript:void(0);"><span wicket:id="label"></span></a></li>
+    </ul>
+  </div>
+</div>
+</wicket:panel>
+</body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/menu/AjaxPopupMenu.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/menu/AjaxPopupMenu.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/menu/AjaxPopupMenu.java	(revision 5623)
@@ -0,0 +1,84 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.menu;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.wicket.ResourceReference;
+import org.apache.wicket.behavior.SimpleAttributeModifier;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.link.AbstractLink;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.ListView;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.IModel;
+import org.odlabs.wiquery.core.commons.IWiQueryPlugin;
+import org.odlabs.wiquery.core.commons.WiQueryResourceManager;
+import org.odlabs.wiquery.core.javascript.JsStatement;
+
+@SuppressWarnings("serial")
+public class AjaxPopupMenu extends Panel implements Serializable, IWiQueryPlugin {
+    private static final ResourceReference CSS_RESOURCE =
+        new ResourceReference(AjaxPopupMenu.class, "AjaxPopupMenu.css");
+    private static final ResourceReference JAVASCRIPT_RESOURCE =
+        new ResourceReference(AjaxPopupMenu.class, "AjaxPopupMenu.js");
+    private final WebMarkupContainer menu;
+    private List<MenuItem> items = new ArrayList<MenuItem>();
+
+    public AjaxPopupMenu(String id, IModel<String> title) {
+        super(id);
+        setRenderBodyOnly(true);
+
+        menu = new WebMarkupContainer("menu");
+        menu.setOutputMarkupId(true);
+        menu.add(new Label("title", title));
+        menu.add(new ListView<MenuItem>("items", items) {
+            @Override
+            protected void populateItem(ListItem<MenuItem> item) {
+                final MenuItem menuitem = item.getModelObject();
+                final AbstractLink link = menuitem.newLink("link");
+                link.add(new Label("label", menuitem.getLabel()));
+                String cssClass = menuitem.getCssClass();
+                if (cssClass != null) {
+                    link.add(new SimpleAttributeModifier("class", cssClass));
+                }
+                item.add(link);
+                item.setVisible(menuitem.isVisible());
+                item.setEnabled(menuitem.isEnabled());
+            }
+        });
+        add(menu);
+    }
+
+    public void add(MenuItem item) {
+        items.add(item);
+    }
+
+    @Override
+    public void contribute(WiQueryResourceManager manager) {
+        manager.addJavaScriptResource(JAVASCRIPT_RESOURCE);
+        manager.addCssResource(CSS_RESOURCE);
+    }
+
+    @Override
+    public JsStatement statement() {
+        return new JsStatement().$(menu).append(".ajaxPopupMenu()");
+    }
+
+    @Override
+    protected void onBeforeRender() {
+        super.onBeforeRender();
+        boolean anyVisible = false;
+        for (MenuItem item : items) {
+            if (item.isVisible()) {
+                anyVisible = true;
+                break;
+            }
+        }
+        if (!anyVisible) {
+            setVisible(false);
+        }
+    }
+
+} // class PopupMenu
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/menu/AjaxPopupMenu.js
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/menu/AjaxPopupMenu.js	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/menu/AjaxPopupMenu.js	(revision 5623)
@@ -0,0 +1,59 @@
+(function($) {
+	$.extend($.fn, {
+		ajaxPopupMenu: function() {
+			var o = {
+				inSpeed: 250,
+				outSpeed: 75
+			};
+			var trigger = $(this).children('div.popupTrigger');
+			var menu = $(this).children('div.popupMenu');
+			trigger.bind('click.ajaxPopupMenu', function(e) {
+				e.stopPropagation();
+
+				// hide any open context menus that may be showing
+				$('div.popupMenu').fadeOut(o.outSpeed);
+
+				// detect mouse position
+				var d = {}, x, y;
+				if (self.innerHeight) {
+					d.pageYOffset = self.pageYOffset;
+					d.pageXOffset = self.pageXOffset;
+					d.innerHeight = self.innerHeight;
+					d.innerWidth = self.innerWidth;
+				} else if (document.documentElement
+						&& document.documentElement.clientHeight) {
+					d.pageYOffset = document.documentElement.scrollTop;
+					d.pageXOffset = document.documentElement.scrollLeft;
+					d.innerHeight = document.documentElement.clientHeight;
+					d.innerWidth = document.documentElement.clientWidth;
+				} else if (document.body) {
+					d.pageYOffset = document.body.scrollTop;
+					d.pageXOffset = document.body.scrollLeft;
+					d.innerHeight = document.body.clientHeight;
+					d.innerWidth = document.body.clientWidth;
+				}
+				(e.pageX) ? x = e.pageX : x = e.clientX + d.scrollLeft;
+				(e.pageY) ? y = e.pageY : y = e.clientY + d.scrollTop;
+
+				menu.css({
+					top : y,
+					left : x
+				}).fadeIn(o.inSpeed);
+				$(document).bind('keypress.ajaxPopupMenu', function(e) {
+					if (e.keyCode == 27) {
+						$(document).trigger('click');
+					}
+				});
+				setTimeout(function() {
+					$(document).click(function() {
+						$(document).unbind('click.ajaxPopupMenu')
+							.unbind('keypress.ajaxPopupMenu');
+						menu.fadeOut(o.outSpeed);
+					});
+				}, 0);
+				return false;
+			});
+			return $(this);
+		}
+	});
+})(jQuery);
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/menu/MenuItem.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/menu/MenuItem.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/menu/MenuItem.java	(revision 5623)
@@ -0,0 +1,22 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.menu;
+
+import org.apache.wicket.markup.html.link.AbstractLink;
+import org.apache.wicket.model.IModel;
+
+public interface MenuItem {
+
+    public IModel<String> getLabel();
+
+    public String getCssClass();
+
+    public AbstractLink newLink(String componentId);
+
+    public MenuItem setVisible(boolean visible);
+
+    public boolean isVisible();
+
+    public MenuItem setEnabled(boolean enabled);
+
+    public boolean isEnabled();
+
+} // interface MenuItem
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/AboutPage.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/AboutPage.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/AboutPage.html	(revision 5623)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:wicket="http://wicket.apache.org/">
+    <head />
+    <body>
+        <wicket:extend>
+            <h1>About the Virtual Collection Registry</h1>
+            <p>
+                The Virtual Collection Registry (VCR) was developed for 
+                CLARIN at <a href="http://www.ids-mannheim.de/">The Institute 
+                    for the German Language (IDS)</a> and the 
+                <a href="http://www.clarin.eu">CLARIN 
+                    <abbr title="European Research Infrastructure Consortium">
+                        ERIC</abbr>
+                </a>.
+            </p>
+            <p>
+                The VCR was developed by:
+                <ul>
+                    <li>Oliver Schonefeld (IDS)</li>
+                    <li>Twan Goosen (CLARIN ERIC)</li>
+                </ul>
+            </p>
+            <p id="aboutlogos">
+                <a title="CLARIN ERIC" href="https://www.clarin.eu/"><img src="images/clarin-logo.png" alt="CLARIN ERIC logo"/></a>
+                <a title="IDS" href="https://www.ids-mannheim.de/"><img src="images/ids-logo.png" alt="IDS logo"/></a>
+            </p>
+            <h2>Licenses</h2>
+            <p>
+                The VCR is made available under the 
+                <a href="http://www.gnu.org/licenses/gpl-3.0.html">GPL 3.0</a>
+                license.<br />
+                For information on obtaining source files, go to
+                <a href="http://www.clarin.eu/svn">clarin.eu/svn</a>.
+            </p>
+            <p>
+                It uses the following software components:
+                <ul>
+                    <li><a href="http://wicket.apache.org">Apache Wicket</a> (<a href="http://www.apache.org/licenses/LICENSE-2.0.html">Apache License 2.0</a>)</li>
+                    <li><a href="https://jersey.java.net/">Jersey</a> (<a href="https://jersey.java.net/license.html#cddl">CCDL 1.1</a>)</li>
+                    <li><a href="http://projects.spring.io/spring-framework/">Spring Framework</a> (<a href="http://www.apache.org/licenses/LICENSE-2.0.html">Apache License 2.0</a>)</li>
+                    <li><a href="http://getbootstrap.com/">Bootstrap</a> (<a href="https://github.com/twbs/bootstrap/blob/master/LICENSE">MIT license</a>)</li>
+                    <li><a href="http://jquery.org/license/">jQuery</a> (<a href="https://jquery.org/license/">MIT license</a>)</li>
+                    <li><a href="https://code.google.com/p/wiquery/">WiQuery</a> (<a href="http://opensource.org/licenses/mit-license.php">MIT license</a>)</li>
+                    <li><a href="http://glyphicons.com/">GLYPHICONS free</a> (<a href="http://glyphicons.com/license/">CC-BY 3.0</a>)</li>
+                </ul>
+            </p>
+        </wicket:extend>
+    </body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/AboutPage.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/AboutPage.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/AboutPage.java	(revision 5623)
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2014 CLARIN
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package eu.clarin.cmdi.virtualcollectionregistry.gui.pages;
+
+/**
+ *
+ * @author twagoo
+ */
+public class AboutPage extends BasePage {
+    
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/AdminPage.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/AdminPage.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/AdminPage.html	(revision 5623)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:wicket="http://wicket.apache.org/">
+    <head />
+    <body>
+        <wicket:extend>
+            <h1>VCR administration</h1>
+            <form wicket:id="spaceSelectForm">
+                <label for="space">Collections space:</label>
+                <select id="space" wicket:id="space">
+                    <option>Public</option>
+                    <option>User 1</option>
+                    <option>User 2</option>
+                </select>
+                <input type="submit" value="Select" />
+            </form>
+            <wicket:container wicket:id="collections">[collections]</wicket:container>
+        </wicket:extend>
+    </body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/AdminPage.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/AdminPage.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/AdminPage.java	(revision 5623)
@@ -0,0 +1,93 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.pages;
+
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistry;
+import eu.clarin.cmdi.virtualcollectionregistry.gui.table.AdminCollectionsProvider;
+import eu.clarin.cmdi.virtualcollectionregistry.model.User;
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.wicket.authorization.strategies.role.Roles;
+import org.apache.wicket.authorization.strategies.role.annotations.AuthorizeAction;
+import org.apache.wicket.authorization.strategies.role.annotations.AuthorizeInstantiation;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.IChoiceRenderer;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.LoadableDetachableModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+
+/**
+ * Page that allows the admin to select a "space" (public or user private) and
+ * show all collections in that space with options to edit/delete/publish
+ *
+ * @author twagoo
+ */
+@AuthorizeInstantiation(Roles.ADMIN)
+@AuthorizeAction(action = "ENABLE", roles = {Roles.ADMIN})
+public class AdminPage extends BasePage {
+
+    @SpringBean
+    private VirtualCollectionRegistry vc;
+
+    public AdminPage() {
+        super();
+
+        // user model shared between spaces form and the table's provider
+        final IModel<User> userModel = new Model<>(null);
+
+        // create form that allows admin to select a space
+        final Form spaceSelectForm = new Form("spaceSelectForm");
+        final DropDownChoice<User> spacesDropDown = createSpacesDropDown("space", userModel);
+        spaceSelectForm.add(spacesDropDown);
+        add(spaceSelectForm);
+
+        // create table showing the collections in the space
+        final AdminCollectionsProvider provider = new AdminCollectionsProvider(userModel);
+        add(new BrowseEditableCollectionsPanel("collections", provider));
+    }
+
+    private DropDownChoice<User> createSpacesDropDown(String id, final IModel<User> userModel) {
+        final IModel<List<User>> usersModel = new LoadableDetachableModel<List<User>>() {
+
+            @Override
+            protected List<User> load() {
+                final List<User> users = vc.getUsers();
+
+                // merge with a 'null' entry to represent the public space
+                final List<User> spaces = new ArrayList<>(users.size() + 1);
+                spaces.add(null);
+                spaces.addAll(users);
+                return spaces;
+            }
+        };
+        final IChoiceRenderer<User> choiceRenderer = new IChoiceRenderer<User>() {
+
+            @Override
+            public Object getDisplayValue(User user) {
+                if (user == null) {
+                    return "Published profiles";
+                } else {
+                    final String displayName = user.getDisplayName();
+                    if (displayName == null) {
+                        return user.getName();
+                    } else {
+                        return displayName;
+                    }
+                }
+            }
+
+            @Override
+            public String getIdValue(User user, int index) {
+                if (user == null) {
+                    return "___PUBLIC___";
+                } else {
+                    return user.getName();
+                }
+            }
+        };
+        final DropDownChoice<User> spacesDropDown = new DropDownChoice<>(id, userModel, usersModel, choiceRenderer);
+        spacesDropDown.setNullValid(true);
+        return spacesDropDown;
+    }
+
+} // class AdminPage
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/AuthenticationStatePanel.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/AuthenticationStatePanel.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/AuthenticationStatePanel.html	(revision 5623)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:wicket="http://wicket.apache.org/">
+    <head />
+    <body>
+        <wicket:panel>
+            <div wicket:id="login"></div>
+            <wicket:fragment wicket:id="loginFragment">
+                <li class="unauthenticated">
+                    <a wicket:id="loginLink" id="login" class="glyphicon glyphicon-log-in" href="#">
+                        <span>LOGIN</span>
+                    </a>
+                </li>
+            </wicket:fragment>
+
+            <div wicket:id="logout"></div>
+            <wicket:fragment wicket:id="logoutFragment">
+                <li class="authenticated">
+                    <span wicket:id="username">username</span>
+                    <!--<a wicket:id="logoutLink" id="logout" class="glyphicon glyphicon-log-out" href="#"><span>LOGOUT</span></a>-->
+                </li>
+            </wicket:fragment>
+        </wicket:panel>
+    </body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/AuthenticationStatePanel.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/AuthenticationStatePanel.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/AuthenticationStatePanel.java	(revision 5623)
@@ -0,0 +1,84 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.pages;
+
+import eu.clarin.cmdi.virtualcollectionregistry.gui.ApplicationSession;
+import org.apache.wicket.authentication.AuthenticatedWebSession;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.link.Link;
+import org.apache.wicket.markup.html.panel.Fragment;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.Model;
+
+@SuppressWarnings("serial")
+public class AuthenticationStatePanel extends Panel {
+
+    public AuthenticationStatePanel(String id) {
+        super(id);
+        setRenderBodyOnly(true);
+        add(new LoginFragment("login"));
+        add(new LogoutFragment("logout"));
+    }
+
+    private class LoginFragment extends Fragment {
+
+        public LoginFragment(String id) {
+            super(id, "loginFragment", AuthenticationStatePanel.this);
+            setRenderBodyOnly(true);
+            add(new Link("loginLink") {
+
+                @Override
+                public void onClick() {
+                    setResponsePage(new DummyLoginPage(getPage().getPageReference()));
+                }
+            });
+        }
+
+        @Override
+        public boolean isVisible() {
+            return !((AuthenticatedWebSession) getSession()).isSignedIn();
+        }
+
+        @Override
+        protected boolean getStatelessHint() {
+            return true;
+        }
+    } // private class LoginFragment
+
+    private class LogoutFragment extends Fragment {
+
+        private final Label usernameLabel;
+
+        public LogoutFragment(String id) {
+            super(id, "logoutFragment", AuthenticationStatePanel.this);
+            setRenderBodyOnly(true);
+            usernameLabel = new Label("username");
+            usernameLabel.setRenderBodyOnly(true);
+            add(usernameLabel);
+//            final StatelessLink logoutLink = new StatelessLink("logoutLink") {
+//                @Override
+//                public void onClick() {
+//                }
+//            };
+//            add(logoutLink);
+        }
+
+        @Override
+        public boolean isVisible() {
+            return ((AuthenticatedWebSession) getSession()).isSignedIn();
+        }
+
+        @Override
+        protected void onBeforeRender() {
+            ApplicationSession session = (ApplicationSession) getSession();
+            final Model<String> userModel
+                    = new Model<String>(session.getUserDisplay());
+            usernameLabel.setDefaultModel(userModel);
+            super.onBeforeRender();
+        }
+    } // private class LogoutFragment
+
+    @Override
+    protected boolean getStatelessHint() {
+        return true;
+    }
+
+} // class AuthenticationStatePanel
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/BasePage.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/BasePage.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/BasePage.html	(revision 5623)
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:wicket="http://wicket.apache.org/">
+    <head>
+        <title>CLARIN Virtual Collection Registry</title>
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+        <!-- Bootstrap styles required for CLARIN style to work properly -->
+        <link rel="stylesheet" type="text/css" href="//infra.clarin.eu/content/libs/bootstrap-3.2.0-dist/css/bootstrap.min.css" />
+        <!-- CLARIN + VCR style compiled from SASS -->
+        <link rel="stylesheet" type="text/css" href="css/vcr.css" />
+
+        <!-- jQuery library for Bootstrap, WiQuery and custom use -->
+        <script type="text/javascript" src="//infra.clarin.eu/content/libs/jquery-1.11.1.min.js"></script>
+        <!-- Compatibility for WiQuery (depends on jQuery 1.5) TODO: investigate if this can be left out -->
+        <script type="text/javascript" src="//infra.clarin.eu/content/libs/jquery-migrate-1.2.1.min.js"></script> 
+        <!-- Bootstrap required for CLARIN style to work properly -->
+        <script charset="utf8" type="text/javascript" src="//infra.clarin.eu/content/libs/bootstrap-3.2.0-dist/js/bootstrap.min.js"></script>
+    </head>
+    <body>
+        <noscript>
+            <div id="noscript-warning">Virtual Collection Registry requires JavaScript to be enabled!</div>
+        </noscript>
+
+
+        <div id="body">
+            <div class="navbar navbar-default navbar-static-top" role="navigation">
+                <div id="betabadge">
+                    <span>BETA</span>
+                </div>
+                <div class="container">
+                    <div class="navbar-header">
+                        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
+                            <span class="sr-only">Toggle navigation</span>
+                            <span class="icon-bar"></span>
+                            <span class="icon-bar"></span>
+                            <span class="icon-bar"></span>
+                        </button>
+                        <a class="navbar-brand" wicket:id="homelink"><header>Virtual Collection Registry</header></a>
+                    </div>
+
+                    <div class="navbar-collapse collapse">
+                        <wicket:container wicket:id="menu"></wicket:container>
+                        <ul id="CLARIN_header_right" class="nav navbar-nav navbar-right">
+                            <li wicket:id="authstate">[auth]</li>
+                        </ul>
+                    </div>
+                </div>
+            </div>
+            <div id="push"></div>
+            <div class="container">
+                <div id="feedback" wicket:id="feedback">[Feedback]</div>
+                <wicket:child />
+            </div>
+        </div>
+
+        <div id="footer">
+            <div class="container">
+                <div id="CLARIN_footer_left">
+                    <a title="about" wicket:id="aboutlink"><span>VERSION ${pom.version} </span><span class="glyphicon glyphicon-info-sign"></span></a>
+                </div>
+                <div id="CLARIN_footer_middle">
+                    <a title="CLARIN ERIC" href="https://www.clarin.eu/"><img src="images/clarin-logo.png" alt="CLARIN ERIC logo"/></a>
+                </div>
+                <div id="CLARIN_footer_right">
+                    <a title="contact" class="glyphicon glyphicon-envelope" href="mailto:vcr@clarin.eu"><span> CONTACT</span></a>
+                </div>
+            </div>
+        </div>
+    </body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/BasePage.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/BasePage.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/BasePage.java	(revision 5623)
@@ -0,0 +1,105 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.pages;
+
+import eu.clarin.cmdi.virtualcollectionregistry.AdminUsersService;
+import eu.clarin.cmdi.virtualcollectionregistry.gui.ApplicationSession;
+import java.security.Principal;
+import javax.servlet.http.HttpServletRequest;
+import org.apache.wicket.RestartResponseException;
+import org.apache.wicket.WicketRuntimeException;
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.link.BookmarkablePageLink;
+import org.apache.wicket.markup.html.panel.FeedbackPanel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+
+public class BasePage extends WebPage {
+
+    @SpringBean
+    private AdminUsersService adminUsersService;
+
+    protected BasePage(IModel<?> model) {
+        super(model);
+        // authentication state
+        add(new AuthenticationStatePanel("authstate"));
+
+        // main navigation menu
+        final Menu menu = new Menu("menu");
+        menu.addMenuItem(new MenuItem<>(Model.of("Virtual Collections"),
+                BrowsePublicCollectionsPage.class));
+        menu.addMenuItem(new MenuItem<>(Model.of("My Virtual Collections"),
+                BrowsePrivateCollectionsPage.class));
+        menu.addMenuItem(new MenuItem<>(Model.of("Create Virtual Collection"),
+                CreateVirtualCollectionPage.class));
+        menu.addMenuItem(new MenuItem<>(Model.of("Help"),
+                HelpPage.class));        
+        menu.addMenuItem(new MenuItem<>(Model.of("Admin Page"),
+                AdminPage.class));
+        add(menu);
+
+        add(new FeedbackPanel("feedback"));
+
+        add(new BookmarkablePageLink("homelink", getApplication().getHomePage())
+                .setAutoEnable(false));
+        add(new BookmarkablePageLink("aboutlink", AboutPage.class)
+                .setAutoEnable(false));
+
+    }
+
+    protected BasePage() {
+        this(null);
+    }
+
+    @Override
+    protected void onBeforeRender() {
+        // skip lazy auto-auth for login page
+        if (!this.getClass().isInstance(LoginPage.class)) {
+            final HttpServletRequest request
+                    = getWebRequestCycle().getWebRequest().getHttpServletRequest();
+            final ApplicationSession session
+                    = (ApplicationSession) getSession();
+            if (!session.isSignedIn()) {
+                if (request.getAuthType() != null) {
+                    // FIXME: better logging
+                    System.err.println("Auth, but no authed session -> login");
+                    final Principal principal = request.getUserPrincipal();
+                    if (!session.signIn(principal)) {
+                        throw new RestartResponseException(getApplication()
+                                .getApplicationSettings()
+                                .getAccessDeniedPage());
+                    }
+                }
+            } else {
+                if (request.getAuthType() == null) {
+                    // FIXME: better logging
+                    System.err.println("Lost Session!");
+                    session.invalidate();
+                    throw new RestartResponseException(getApplication()
+                            .getApplicationSettings()
+                            .getPageExpiredErrorPage());
+                }
+            }
+        }
+        super.onBeforeRender();
+    }
+
+    protected Principal getUser() {
+        ApplicationSession session = (ApplicationSession) getSession();
+        Principal principal = session.getPrincipal();
+        if (principal == null) {
+            throw new WicketRuntimeException("principal == null");
+        }
+        return principal;
+    }
+
+    protected boolean isUserAdmin() {
+        final String userName = getUser().getName();
+        return userName != null && adminUsersService.isAdmin(userName);
+    }
+
+    @Override
+    public ApplicationSession getSession() {
+        return (ApplicationSession) super.getSession();
+    }
+
+} // class BasePage
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/BrowseEditableCollectionsPanel$ActionsColumn.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/BrowseEditableCollectionsPanel$ActionsColumn.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/BrowseEditableCollectionsPanel$ActionsColumn.html	(revision 5623)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org/">
+<head />
+<body>
+<wicket:panel>
+  <div wicket:id="menu"></div>
+</wicket:panel>
+</body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/BrowseEditableCollectionsPanel$ActionsPanel.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/BrowseEditableCollectionsPanel$ActionsPanel.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/BrowseEditableCollectionsPanel$ActionsPanel.html	(revision 5623)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org/">
+<head />
+<body>
+<wicket:panel>
+  <a wicket:id="publish" href="#" class="publish"><span>[publish]</span></a>
+  <a wicket:id="edit" href="#" class="edit"><span>[edit]</span></a>
+  <a wicket:id="delete" href="#" class="delete"><span>[delete]</span></a>
+  <a wicket:id="details" href="#" class="details"><span>[details]</span></a>
+</wicket:panel>
+</body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/BrowseEditableCollectionsPanel.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/BrowseEditableCollectionsPanel.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/BrowseEditableCollectionsPanel.html	(revision 5623)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:wicket="http://wicket.apache.org/">
+<head />
+<body>
+<wicket:panel>
+  <div style="display: none" wicket:id="publishCollectionDialog"></div>
+  <div style="display: none" wicket:id="deleteCollectionDialog"></div>
+  <div style="display: none" wicket:id="editPublishedCollectionDialog"></div>
+  <div style="display: none" wicket:id="confirmPublishCollectionDialog"></div>
+  <div wicket:id="collectionsTable"></div>
+</wicket:panel>
+</body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/BrowseEditableCollectionsPanel.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/BrowseEditableCollectionsPanel.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/BrowseEditableCollectionsPanel.java	(revision 5623)
@@ -0,0 +1,361 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.pages;
+
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistry;
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryException;
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryUsageException;
+import eu.clarin.cmdi.virtualcollectionregistry.gui.VolatileEntityModel;
+import eu.clarin.cmdi.virtualcollectionregistry.gui.dialog.ConfirmationDialog;
+import eu.clarin.cmdi.virtualcollectionregistry.gui.menu.AjaxLinkMenuItem;
+import eu.clarin.cmdi.virtualcollectionregistry.gui.menu.AjaxPopupMenu;
+import eu.clarin.cmdi.virtualcollectionregistry.gui.table.CollectionsProvider;
+import eu.clarin.cmdi.virtualcollectionregistry.gui.table.VirtualCollectionTable;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+import eu.clarin.cmdi.virtualcollectionregistry.service.VirtualCollectionValidator;
+import java.security.Principal;
+import java.util.Collections;
+import java.util.List;
+import org.apache.wicket.Component;
+import org.apache.wicket.PageParameters;
+import org.apache.wicket.Session;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.StringResourceModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Panel that shows a table with view, edit, publish, delete options for the
+ * collections from an injected provided
+ *
+ * @author twagoo
+ */
+public class BrowseEditableCollectionsPanel extends Panel {
+
+    private final static Logger logger = LoggerFactory.getLogger(BrowseEditableCollectionsPanel.class);
+
+    @SpringBean
+    private VirtualCollectionRegistry vcr;
+
+    private class ActionsColumn extends Panel {
+
+        public ActionsColumn(String id, IModel<VirtualCollection> model) {
+            super(id, model);
+            setRenderBodyOnly(true);
+
+            final AjaxPopupMenu menu
+                    = new AjaxPopupMenu("menu", new Model<String>("[actions]"));
+
+            final AjaxLinkMenuItem<VirtualCollection> publishItem
+                    = new AjaxLinkMenuItem<VirtualCollection>(
+                            new Model<String>("Publish"), model, "publish") {
+                                @Override
+                                protected void onClick(AjaxRequestTarget target,
+                                        IModel<VirtualCollection> model) {
+                                    doPublish(target, model);
+                                }
+                            };
+                    menu.add(publishItem);
+
+                    final AjaxLinkMenuItem<VirtualCollection> editItem
+                            = new AjaxLinkMenuItem<VirtualCollection>(
+                                    new Model<String>("Edit"), model, "edit") {
+                                        @Override
+                                        protected void onClick(AjaxRequestTarget target,
+                                                IModel<VirtualCollection> model) {
+                                            doEdit(target, model.getObject());
+                                        }
+                                    };
+                            menu.add(editItem);
+
+                            final AjaxLinkMenuItem<VirtualCollection> deleteItem
+                                    = new AjaxLinkMenuItem<VirtualCollection>(
+                                            new Model<String>("Delete"), model, "delete") {
+                                                @Override
+                                                protected void onClick(AjaxRequestTarget target,
+                                                        IModel<VirtualCollection> model) {
+                                                    doDelete(target, model.getObject());
+                                                }
+                                            };
+                                    menu.add(deleteItem);
+
+                                    final AjaxLinkMenuItem<VirtualCollection> detailsItem
+                                            = new AjaxLinkMenuItem<VirtualCollection>(
+                                                    new Model<String>("Details"), model, "details") {
+                                                        @Override
+                                                        protected void onClick(AjaxRequestTarget target,
+                                                                IModel<VirtualCollection> model) {
+                                                            doDetails(target, model);
+                                                        }
+                                                    };
+                                            menu.add(detailsItem);
+                                            add(menu);
+
+                                            final VirtualCollection vc = model.getObject();
+                                            if (vc.isDeleted()) {
+                                                detailsItem.setVisible(false).setEnabled(false);
+                                                editItem.setVisible(false).setEnabled(false);
+                                            }
+                                            if (!vc.isPrivate()) {
+                                                publishItem.setVisible(false).setEnabled(false);
+                                                deleteItem.setVisible(false).setEnabled(false);
+                                            }
+        }
+    }
+
+    private class ActionsPanel extends Panel {
+
+        public ActionsPanel(String id, IModel<VirtualCollection> model) {
+            super(id, model);
+            setRenderBodyOnly(true);
+
+            final AjaxLink<VirtualCollection> publishLink
+                    = new AjaxLink<VirtualCollection>("publish", model) {
+                        @Override
+                        public void onClick(AjaxRequestTarget target) {
+                            doPublish(target, getModel());
+                        }
+                    };
+            add(publishLink);
+
+            final AjaxLink<VirtualCollection> editLink
+                    = new AjaxLink<VirtualCollection>("edit", model) {
+                        @Override
+                        public void onClick(AjaxRequestTarget target) {
+                            doEdit(target, getModelObject());
+                        }
+                    };
+            add(editLink);
+
+            final AjaxLink<VirtualCollection> deleteLink
+                    = new AjaxLink<VirtualCollection>("delete", model) {
+                        @Override
+                        public void onClick(AjaxRequestTarget target) {
+                            doDelete(target, getModelObject());
+                        }
+                    };
+            add(deleteLink);
+
+            final AjaxLink<VirtualCollection> detailsLink
+                    = new AjaxLink<VirtualCollection>("details", model) {
+                        @Override
+                        public void onClick(AjaxRequestTarget target) {
+                            doDetails(target, getModel());
+                        }
+                    };
+            add(detailsLink);
+
+            final VirtualCollection vc = model.getObject();
+            if (vc.isDeleted()) {
+                detailsLink.setVisible(false).setEnabled(false);
+                editLink.setVisible(false).setEnabled(false);
+            }
+            if (!vc.isPrivate()) {
+                publishLink.setVisible(false).setEnabled(false);
+                deleteLink.setVisible(false).setEnabled(false);
+            }
+            boolean isVisible = detailsLink.isVisible()
+                    || editLink.isVisible() || publishLink.isVisible()
+                    || deleteLink.isVisible();
+            setVisible(isVisible);
+        }
+    } // class BrowsePrivateCollectionsPage.ActionsPanel
+
+    private final class PublishCollectionDialog extends ConfirmationDialog {
+
+        private IModel<VirtualCollection> vcModel;
+
+        public PublishCollectionDialog(String id,
+                final Component updateComponenet) {
+            super(id, updateComponenet);
+            setInitialWidth(400);
+        }
+
+        @Override
+        public void onConfirm(AjaxRequestTarget target) {
+            try {
+                try {
+                    prePublicationValidator.validate(vcModel.getObject());
+                    doPublish(vcModel.getObject().getId());
+                } catch (VirtualCollectionRegistryUsageException ex) {
+                    confirmPublishCollectionDialog.showDialogue(target, vcModel, ex.getValidationErrors());
+                }
+            } catch (VirtualCollectionRegistryException ex) {
+                logger.error("Could not publish collection {}, id {}", vcModel.getObject().getName(), vcModel.getObject().getId(), ex);
+                Session.get().error(ex.getMessage());
+            }
+        }
+
+        public void showDialogue(AjaxRequestTarget target, IModel<VirtualCollection> vc) {
+            this.vcModel = vc;
+            super.show(target,
+                    new StringResourceModel("collections.publishconfirm", vc));
+        }
+    } // class BrowsePrivateCollectionsPage.PublishCollectionDialog
+
+    private void doPublish(long vcId) throws VirtualCollectionRegistryException {
+        vcr.setVirtualCollectionState(getUser(), vcId,
+                VirtualCollection.State.PUBLIC_PENDING);
+    }
+
+    private final class ConfirmPublishCollectionDialog extends ConfirmationDialog {
+
+        private long vcId;
+
+        public ConfirmPublishCollectionDialog(String id,
+                final Component updateComponenet) {
+            super(id, updateComponenet);
+            setInitialWidth(400);
+        }
+
+        @Override
+        public void onConfirm(AjaxRequestTarget target) {
+            try {
+                doPublish(vcId);
+            } catch (VirtualCollectionRegistryException ex) {
+                logger.error("Could not publish collection with id {}", vcId, ex);
+                Session.get().error(ex.getMessage());
+            }
+        }
+
+        public void showDialogue(AjaxRequestTarget target, IModel<VirtualCollection> vc, List<String> warnings) {
+            this.vcId = vc.getObject().getId();
+            StringBuilder sb = new StringBuilder();
+            for (String warning : warnings) {
+                sb.append(" -").append(warning).append("\n");
+            }
+            super.show(target,
+                    new StringResourceModel("collections.publishwarningsconfirm", vc, new Object[]{sb}));
+        }
+
+        @Override
+        protected Model<String> getCssClass() {
+            return Model.of("longConfirmationDialog");
+        }
+
+    }
+
+    private final class DeleteCollectionDialog extends ConfirmationDialog {
+
+        private long vcId;
+
+        public DeleteCollectionDialog(String id,
+                final Component updateComponenet) {
+            super(id, updateComponenet);
+            setInitialWidth(400);
+        }
+
+        @Override
+        public void onConfirm(AjaxRequestTarget target) {
+            try {
+                vcr.deleteVirtualCollection(getUser(), vcId);
+            } catch (VirtualCollectionRegistryException e) {
+                e.printStackTrace();
+            }
+        }
+
+        public void show(AjaxRequestTarget target, VirtualCollection vc) {
+            this.vcId = vc.getId();
+            super.show(target,
+                    new StringResourceModel("collections.deleteconfirm",
+                            new VolatileEntityModel<VirtualCollection>(vc)));
+        }
+    } // class BrowsePrivateCollectionsPage.PublishCollectionDialog
+
+    private final class EditPublishedCollectionDialog extends ConfirmationDialog {
+
+        private long vcId;
+
+        public EditPublishedCollectionDialog(String id,
+                final Component updateComponenet) {
+            super(id, updateComponenet);
+            setInitialWidth(400);
+        }
+
+        @Override
+        public void onConfirm(AjaxRequestTarget target) {
+            setResponsePage(EditVirtualCollectionPage.class, new PageParameters(Collections.singletonMap("id", vcId)));
+        }
+
+        public void showDialogue(AjaxRequestTarget target, VirtualCollection vc) {
+            this.vcId = vc.getId();
+            super.show(target,
+                    new StringResourceModel("collections.editpublishedconfirm",
+                            new VolatileEntityModel<>(vc)));
+        }
+    }
+
+    private final PublishCollectionDialog publishDialog;
+    private final DeleteCollectionDialog deleteDialog;
+    private final EditPublishedCollectionDialog editPublishedDialog;
+    private final ConfirmPublishCollectionDialog confirmPublishCollectionDialog;
+
+    @SpringBean(name = "publication-soft")
+    private VirtualCollectionValidator prePublicationValidator;
+
+    /**
+     *
+     * @param id panel id
+     * @param provider provider for collections that should be shown
+     */
+    public BrowseEditableCollectionsPanel(String id, CollectionsProvider provider) {
+        super(id);
+        final VirtualCollectionTable table
+                = new VirtualCollectionTable("collectionsTable", provider, true) {
+                    @Override
+                    protected Panel createActionColumn(String componentId,
+                            IModel<VirtualCollection> model) {
+                        return new ActionsColumn(componentId, model);
+                    }
+
+                    @Override
+                    protected Panel createActionPanel(String componentId,
+                            IModel<VirtualCollection> model) {
+                        return new ActionsPanel(componentId, model);
+                    }
+                };
+        add(table);
+
+        publishDialog = new PublishCollectionDialog("publishCollectionDialog", table);
+        add(publishDialog);
+
+        deleteDialog = new DeleteCollectionDialog("deleteCollectionDialog", table);
+        add(deleteDialog);
+
+        editPublishedDialog = new EditPublishedCollectionDialog("editPublishedCollectionDialog", table);
+        add(editPublishedDialog);
+
+        confirmPublishCollectionDialog = new ConfirmPublishCollectionDialog("confirmPublishCollectionDialog", table);
+        add(confirmPublishCollectionDialog);
+    }
+
+    private void doEdit(AjaxRequestTarget target, VirtualCollection vc) {
+        if (vc.isPublic()) {
+            // ask for confirmation when trying to edit a published collection
+            editPublishedDialog.showDialogue(target, vc);
+        } else {
+            setResponsePage(EditVirtualCollectionPage.class, new PageParameters(Collections.singletonMap("id", vc.getId())));
+        }
+    }
+
+    private void doPublish(AjaxRequestTarget target,
+            IModel<VirtualCollection> vc) {
+        publishDialog.showDialogue(target, vc);
+    }
+
+    private void doDelete(AjaxRequestTarget target,
+            VirtualCollection vc) {
+        deleteDialog.show(target, vc);
+    }
+
+    private void doDetails(AjaxRequestTarget target, IModel<VirtualCollection> vc) {
+        setResponsePage(VirtualCollectionDetailsPage.class, VirtualCollectionDetailsPage.createPageParameters(vc.getObject(), getPage().getPageReference()));
+    }
+
+    private Principal getUser() {
+        return ((BasePage) getPage()).getUser();
+    }
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/BrowsePrivateCollectionsPage.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/BrowsePrivateCollectionsPage.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/BrowsePrivateCollectionsPage.html	(revision 5623)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:wicket="http://wicket.apache.org/">
+<head />
+<body>
+<wicket:extend>
+    <wicket:container wicket:id="collections">[collections]</wicket:container>
+</wicket:extend>
+</body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/BrowsePrivateCollectionsPage.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/BrowsePrivateCollectionsPage.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/BrowsePrivateCollectionsPage.java	(revision 5623)
@@ -0,0 +1,15 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.pages;
+
+import eu.clarin.cmdi.virtualcollectionregistry.gui.table.PrivateCollectionsProvider;
+import org.apache.wicket.authorization.strategies.role.Roles;
+import org.apache.wicket.authorization.strategies.role.annotations.AuthorizeInstantiation;
+
+@AuthorizeInstantiation(Roles.USER)
+@SuppressWarnings("serial")
+public class BrowsePrivateCollectionsPage extends BasePage {
+
+    public BrowsePrivateCollectionsPage() {
+        add(new BrowseEditableCollectionsPanel("collections", new PrivateCollectionsProvider()));
+    }
+    
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/BrowsePublicCollectionsPage$ActionsPanel.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/BrowsePublicCollectionsPage$ActionsPanel.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/BrowsePublicCollectionsPage$ActionsPanel.html	(revision 5623)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:wicket="http://wicket.apache.org/">
+<head />
+<body>
+<wicket:panel>
+  <a wicket:id="details" href="#" class="details"><span>[details]</span></a>
+</wicket:panel>
+</body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/BrowsePublicCollectionsPage.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/BrowsePublicCollectionsPage.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/BrowsePublicCollectionsPage.html	(revision 5623)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:wicket="http://wicket.apache.org/">
+<head />
+<body>
+<wicket:extend>
+  <div wicket:id="collectionsTable"></div>
+</wicket:extend>
+</body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/BrowsePublicCollectionsPage.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/BrowsePublicCollectionsPage.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/BrowsePublicCollectionsPage.java	(revision 5623)
@@ -0,0 +1,54 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.pages;
+
+import eu.clarin.cmdi.virtualcollectionregistry.gui.table.PublishedCollectionsProvider;
+import eu.clarin.cmdi.virtualcollectionregistry.gui.table.VirtualCollectionTable;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.IModel;
+
+@SuppressWarnings("serial")
+public class BrowsePublicCollectionsPage extends BasePage {
+
+    private class ActionsPanel extends Panel {
+
+        public ActionsPanel(String id, IModel<VirtualCollection> model) {
+            super(id, model);
+            setRenderBodyOnly(true);
+
+            final AjaxLink<VirtualCollection> detailsLink
+                    = new AjaxLink<VirtualCollection>("details", model) {
+                        @Override
+                        public void onClick(AjaxRequestTarget target) {
+                            doDetails(target, getModel());
+                        }
+                    };
+            add(detailsLink);
+        }
+    } // class BrowsePublicCollectionsPage.ActionsPanel
+
+    public BrowsePublicCollectionsPage() {
+        super();
+        final VirtualCollectionTable table
+                = new VirtualCollectionTable("collectionsTable", new PublishedCollectionsProvider(), false) {
+                    @Override
+                    protected Panel createActionColumn(String componentId,
+                            IModel<VirtualCollection> model) {
+                        return new ActionsPanel(componentId, model);
+                    }
+
+                    @Override
+                    protected Panel createActionPanel(String componentId,
+                            IModel<VirtualCollection> model) {
+                        return new ActionsPanel(componentId, model);
+                    }
+                };
+        add(table);
+    }
+
+    private void doDetails(AjaxRequestTarget target, IModel<VirtualCollection> vc) {
+        setResponsePage(VirtualCollectionDetailsPage.class, VirtualCollectionDetailsPage.createPageParameters(vc.getObject(), getPageReference()));
+    }
+
+} // class BrowsePublicCollectionsPage
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/CreateVirtualCollectionPage.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/CreateVirtualCollectionPage.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/CreateVirtualCollectionPage.html	(revision 5623)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:wicket="http://wicket.apache.org/">
+<head />
+<body>
+<wicket:extend>
+	<div wicket:id="wizard"></div>
+</wicket:extend>
+</body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/CreateVirtualCollectionPage.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/CreateVirtualCollectionPage.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/CreateVirtualCollectionPage.java	(revision 5623)
@@ -0,0 +1,87 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.pages;
+
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistry;
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryException;
+import eu.clarin.cmdi.virtualcollectionregistry.gui.ApplicationSession;
+import eu.clarin.cmdi.virtualcollectionregistry.gui.VolatileEntityModel;
+import eu.clarin.cmdi.virtualcollectionregistry.gui.wizard.CreateVirtualCollectionWizard;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+import java.security.Principal;
+import java.util.Date;
+import org.apache.wicket.Page;
+import org.apache.wicket.PageParameters;
+import org.apache.wicket.WicketRuntimeException;
+import org.apache.wicket.authorization.strategies.role.Roles;
+import org.apache.wicket.authorization.strategies.role.annotations.AuthorizeInstantiation;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+
+@AuthorizeInstantiation(Roles.USER)
+@SuppressWarnings("serial")
+public class CreateVirtualCollectionPage extends BasePage {
+
+    @SpringBean
+    private VirtualCollectionRegistry vcr;
+
+    // only for extensions
+    protected CreateVirtualCollectionPage() {
+    }
+
+    // used when page constructed by framework
+    public CreateVirtualCollectionPage(PageParameters params) {
+        //ignore any params
+        this(new VirtualCollection(), null);
+    }
+
+    public CreateVirtualCollectionPage(VirtualCollection vc, final Page previousPage) {
+        final CreateVirtualCollectionWizard wizard = createWizard(vc, previousPage);
+        add(wizard);
+    }
+
+    protected final CreateVirtualCollectionWizard createWizard(VirtualCollection vc, final Page previousPage) {
+        return new CreateVirtualCollectionWizard("wizard", new VolatileEntityModel(vc)) {
+
+            @Override
+            protected void onCancelWizard() {
+                // proceed to response page
+                if (previousPage != null) {
+                    setResponsePage(previousPage);
+                } else {
+                    setResponsePage(BrowsePrivateCollectionsPage.class);
+                }
+            }
+
+            @Override
+            protected void onFinishWizard(IModel<VirtualCollection> vcModel) {
+                final VirtualCollection vc = vcModel.getObject();
+                try {
+                    ApplicationSession session
+                            = (ApplicationSession) getSession();
+                    Principal principal = session.getPrincipal();
+                    if (principal == null) {
+                        // XXX: security issue?
+                        throw new WicketRuntimeException("principal == null");
+
+                    }
+                    // FIXME: get date from GUI?
+                    if (vc.getId() == null) {
+                        vc.setCreationDate(new Date());
+                        vcr.createVirtualCollection(principal, vc);
+                    } else {
+                        vcr.updateVirtualCollection(principal, vc.getId(), vc);
+                    }
+                } catch (VirtualCollectionRegistryException e) {
+                    getSession().error(e.getMessage());
+                }
+
+                // proceed to response page
+                if (previousPage != null) {
+                    setResponsePage(previousPage);
+                } else {
+                    setResponsePage(BrowsePrivateCollectionsPage.class);
+                }
+            }
+        };
+    }
+
+} // class CreateVirtualCollecionPage
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/DummyLoginPage.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/DummyLoginPage.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/DummyLoginPage.java	(revision 5623)
@@ -0,0 +1,28 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.pages;
+
+import org.apache.wicket.PageReference;
+import org.apache.wicket.RestartResponseAtInterceptPageException;
+import org.apache.wicket.authorization.strategies.role.Roles;
+import org.apache.wicket.authorization.strategies.role.annotations.AuthorizeInstantiation;
+
+/**
+ * Only serves as a target for the 'login' link of the
+ * {@link AuthenticationStatePanel}
+ *
+ * @author twagoo
+ */
+@AuthorizeInstantiation(Roles.USER)
+public class DummyLoginPage extends BasePage {
+
+    private final PageReference pageRef;
+
+    public DummyLoginPage(PageReference pageRef) {
+        this.pageRef = pageRef;
+    }
+
+    @Override
+    protected void onBeforeRender() {
+        throw new RestartResponseAtInterceptPageException(pageRef.getPage());
+    }
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/EditVirtualCollectionPage.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/EditVirtualCollectionPage.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/EditVirtualCollectionPage.java	(revision 5623)
@@ -0,0 +1,55 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.pages;
+
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistry;
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryException;
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryPermissionException;
+import eu.clarin.cmdi.virtualcollectionregistry.gui.wizard.CreateVirtualCollectionWizard;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection.State;
+import org.apache.wicket.Page;
+import org.apache.wicket.PageParameters;
+import org.apache.wicket.authorization.UnauthorizedInstantiationException;
+import org.apache.wicket.authorization.strategies.role.Roles;
+import org.apache.wicket.authorization.strategies.role.annotations.AuthorizeInstantiation;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@AuthorizeInstantiation(Roles.USER)
+public class EditVirtualCollectionPage extends CreateVirtualCollectionPage {
+
+    @SpringBean
+    private VirtualCollectionRegistry vcr;
+
+    private final static Logger logger = LoggerFactory.getLogger(EditVirtualCollectionPage.class);
+
+    public EditVirtualCollectionPage(PageParameters params) throws VirtualCollectionRegistryException {
+        final Long id = params.getAsLong("id");
+        final VirtualCollection vc;
+        if (id == null) {
+            vc = new VirtualCollection();
+        } else {
+            vc = vcr.retrieveVirtualCollection(id);
+            checkAccess(vc);
+        }
+        final CreateVirtualCollectionWizard wizard = createWizard(vc, null);
+        add(wizard);
+    }
+
+    private void checkAccess(final VirtualCollection vc) throws VirtualCollectionRegistryPermissionException {
+        // do not allow editing of VC's that are non-private or owned
+        // by someone else! (except for admin)
+        if (!isUserAdmin()
+                && ( //only allow editing of private & public
+                !(vc.getState() == State.PRIVATE || vc.getState() == State.PUBLIC)
+                // only allow editing by the owner
+                || !vc.getOwner().equalsPrincipal(getUser()))) {
+            logger.warn("User {} attempts to edit virtual collection {} with state {} owned by {}", new Object[]{getUser().getName(), vc.getId(), vc.getState(), vc.getOwner().getName()});
+            throw new UnauthorizedInstantiationException(EditVirtualCollectionPage.class);
+        }
+    }
+
+    EditVirtualCollectionPage(VirtualCollection vc, Page page) {
+        super(vc, page);
+    }
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/HelpPage.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/HelpPage.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/HelpPage.html	(revision 5623)
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:wicket="http://wicket.apache.org/">
+    <head />
+    <body>
+        <wicket:extend>
+            <div id="help">
+                <h1>Glossary</h1>
+                <h2>Collection types</h2>
+                <dl>
+                    <dt>extensional</dt>
+                    <dd>
+                        Type of virtual collection that explicitly enumerates the references to resources or metadata documents that make up the collection
+                        <dl>
+                            <dt>resources</dt>
+                            <dd>
+                                The members that make up an extensional virtual collection by means of a persistent reference.
+                                These members may be of type <em>metadata</em> for referencing metadata, or <em>resource</em> for directly referencing a resource.
+                            </dd>
+                        </dl>
+                    </dd>
+
+                    <dt>intensional</dt>
+                    <dd>
+                        Type of virtual collection that defines a query by which the items of the collection can be retrieved ad-hoc from a secondary service <em>(experimental, use at own risk!)</em>
+                        <dl>
+                            <dt>query description</dt>
+                            <dd>
+                                A prose description of the procedure by which the collection items can be retrieved from the external service.
+                            </dd>
+                            <dt>query URI</dt>
+                            <dd>
+                                The location of the service from which the items should be retrieved. This value may be a persistent identifier, but could also be a plain URI although this is advised against for published collections.
+                            </dd>
+                            <dt>query profile</dt>
+                            <dd>
+                                Identifier of the mechanism, i.e. the protocol to be used, by which the members of the virtual collection should be retrieved. A application exploiting the query can use this to use a proper driver to talk to the service. Example: In case of CLARIN-FCS access the endpoint by FCS-compatible means.
+                            </dd>
+                            <dt>query value</dt>
+                            <dd>
+                                The query that should be passed on to the service by which it can look up the items that are part of this collection. This value should be in the query language supported by the service. Example: In case of CLARIN-FCS, this value is the CQL query to be send to the endpoint.
+                            </dd>
+                        </dl>
+                    </dd>
+                </dl>
+
+                <h2>General collection properties</h2>
+                <dl>                    
+                    <dt>purpose</dt>
+                    <dd>
+                        An indication of the intended usage of the present virtual collection:
+                        <dl>
+                            <dt>research</dt>
+                            <dd>
+                                The virtual collection bundles resources that are relevant to a specific research (question).
+                            </dd>
+                            <dt>reference</dt>
+                            <dd>
+                                The virtual collection bundles resources, that are to be cited in a publication.
+                            </dd>
+                            <dt>sample</dt>
+                            <dd>
+                                This virtual collection bundles is intended to serve as an sample for research data
+                            </dd>
+                            <dt>future-use</dt>
+                            <dd>
+                                The purpose of this virtual collection is not specified yet. Used in published collection is advised against.
+                            </dd>
+                        </dl>
+                    </dd>
+
+                    <dt>reproducibility</dt>
+                    <dd>
+                        An indication of the degree to which results obtained from processing of the present collection can be expected to be stable:
+                        <dl>
+                            <dt>intended reproducibility</dt>
+                            <dd>
+                                Processing results can be expected to remain stable
+                            </dd>
+                            <dt>fluctuating reproducibility</dt>
+                            <dd>
+                                Processing results may vary
+                            </dd>
+                            <dt>untended reproducibility</dt>
+                            <dd>
+                                No claims with respect to the stability of the processing results are made
+                            </dd>
+                            <dt>reproducibility note</dt>
+                            <dd>
+                                Optional notes describing the expected reproducibility of processing results in more detail
+                            </dd>
+                        </dl>
+                    </dd>
+
+                    <dt>keyword</dt>
+                    <dd>
+                        A word or short phrase signifying a salient facet of the present virtual collection
+                    </dd>
+
+                    <dt>creators</dt>
+                    <dd>
+                        One or more persons, who created this virtual collection. 
+                    </dd>
+                </dl>
+
+                <h2>REST service</h2>
+                <p>
+                    The Virtual Collection Registry REST service is accessible
+                    at <a wicket:id="restLink"><wicket:container wicket:id="restUrl">[url]</wicket:container></a> (base URL).
+                </p>
+                <p>
+                    Documentation can be found <a href="Protocol.txt">here</a>.
+                    You can also consult the <a wicket:id="wadlLink">WADL</a> file.
+                </p>
+            </div>
+        </wicket:extend>
+    </body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/HelpPage.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/HelpPage.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/HelpPage.java	(revision 5623)
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2014 CLARIN
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package eu.clarin.cmdi.virtualcollectionregistry.gui.pages;
+
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.link.ExternalLink;
+import org.apache.wicket.protocol.http.WebApplication;
+
+/**
+ *
+ * @author twagoo
+ */
+public class HelpPage extends BasePage {
+
+    public static final String BASE_URI = "eu.clarin.cmdi.virtualcollectionregistry.base_uri";
+
+    public HelpPage() {
+        final String baseUri = WebApplication.get().getServletContext().getInitParameter(BASE_URI);
+        final String serviceBaseUri = String.format("%s/service", baseUri);
+
+        add(new ExternalLink("restLink", serviceBaseUri)
+                .add(new Label("restUrl", serviceBaseUri)));
+        add(new ExternalLink("wadlLink", String.format("%s/application.wadl", serviceBaseUri)));
+    }
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/LoginPage.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/LoginPage.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/LoginPage.html	(revision 5623)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:wicket="http://wicket.apache.org/">
+<head />
+<body>
+  <p style="font-size: 120%; text-align: center;">Login Page</p>
+</body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/LoginPage.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/LoginPage.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/LoginPage.java	(revision 5623)
@@ -0,0 +1,48 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.pages;
+
+import java.security.Principal;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.wicket.RestartResponseAtInterceptPageException;
+import org.apache.wicket.RestartResponseException;
+import org.apache.wicket.markup.html.WebPage;
+
+import eu.clarin.cmdi.virtualcollectionregistry.gui.Application;
+import eu.clarin.cmdi.virtualcollectionregistry.gui.ApplicationSession;
+
+public class LoginPage extends WebPage {
+
+    public LoginPage() {
+        super();
+        setStatelessHint(true);
+        setVersioned(false);
+    }
+
+    @Override
+    protected void onBeforeRender() {
+        final HttpServletRequest request =
+            getWebRequestCycle().getWebRequest().getHttpServletRequest();
+        final HttpServletResponse response =
+            getWebRequestCycle().getWebResponse().getHttpServletResponse();
+        if (request.getAuthType() == null) {
+            response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
+        } else {
+            final Principal principal = request.getUserPrincipal();
+            ApplicationSession session = (ApplicationSession) getSession();
+            if (session.signIn(principal)) {
+                if (!continueToOriginalDestination()) {
+                    throw new RestartResponseAtInterceptPageException(
+                            Application.get().getHomePage());
+                }
+            } else {
+                throw new RestartResponseException(
+                        Application.get().getApplicationSettings()
+                            .getAccessDeniedPage());
+            }
+        }
+        super.onBeforeRender();
+    }
+
+} // class LoginPage
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/Menu.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/Menu.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/Menu.html	(revision 5623)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:wicket="http://wicket.apache.org/">
+    <head />
+    <body>
+        <wicket:panel>
+            <ul class="nav navbar-nav">
+                <wicket:container wicket:id="menuitems">
+                    <li wicket:id="menuitem">[item]</li>
+                </wicket:container>
+            </ul>
+        </wicket:panel>
+    </body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/Menu.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/Menu.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/Menu.java	(revision 5623)
@@ -0,0 +1,34 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.pages;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.ListView;
+import org.apache.wicket.markup.html.panel.Panel;
+
+@SuppressWarnings("serial")
+public class Menu extends Panel {
+    private final List<MenuItem<? extends WebPage>> menuitems =
+        new ArrayList<MenuItem<? extends WebPage>>();
+
+    public Menu(String id) {
+        super(id);
+        setRenderBodyOnly(true);
+        add(new ListView<MenuItem<? extends WebPage>>("menuitems", menuitems) {
+            @Override
+            protected void populateItem(
+                    final ListItem<MenuItem<? extends WebPage>> listitem) {
+                final MenuItem<? extends WebPage> menuitem =
+                    listitem.getModelObject();
+                listitem.add(menuitem);
+            }
+        });
+    }
+
+    public void addMenuItem(MenuItem<? extends WebPage> item) {
+        menuitems.add(item);
+    }
+
+} // class Menu
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/MenuItem.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/MenuItem.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/MenuItem.html	(revision 5623)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:wicket="http://wicket.apache.org/">
+    <head />
+    <body>
+        <wicket:panel>
+            <a wicket:id="link" href="#"><span wicket:id="title">Title</span></a>
+        </wicket:panel>
+    </body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/MenuItem.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/MenuItem.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/MenuItem.java	(revision 5623)
@@ -0,0 +1,70 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.pages;
+
+import eu.clarin.cmdi.virtualcollectionregistry.gui.Application;
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.authorization.IAuthorizationStrategy;
+import org.apache.wicket.authorization.strategies.role.annotations.AuthorizeAction;
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.link.BookmarkablePageLink;
+import org.apache.wicket.markup.html.link.Link;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.AbstractReadOnlyModel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.util.lang.Classes;
+
+@SuppressWarnings("serial")
+public class MenuItem<T extends WebPage> extends Panel {
+
+    private static final String ENABLE = "ENABLE";
+    private final String pageClassName;
+
+    public MenuItem(final IModel<String> title, final Class<T> pageClass) {
+        super("menuitem");
+        this.pageClassName = pageClass.getName();
+        final Link<T> link = new BookmarkablePageLink<T>("link", pageClass)
+                .setAutoEnable(false);
+        link.add(new Label("title", title).setRenderBodyOnly(true));
+        add(link);
+
+        add(new AttributeModifier("class", true, new AbstractReadOnlyModel<String>() {
+            @Override
+            public String getObject() {
+                if (pageClass.equals(getPage().getClass())) {
+                    return "active";
+                } else {
+                    return null;
+                }
+            }
+        }));
+    }
+
+    @Override
+    protected void onBeforeRender() {
+        final IAuthorizationStrategy strategy
+                = getApplication().getSecuritySettings()
+                .getAuthorizationStrategy();
+        final Class<T> pageClass = getPageClass();
+        if (!strategy.isInstantiationAuthorized(pageClass)) {
+            boolean visible = true;
+            AuthorizeAction action
+                    = pageClass.getAnnotation(AuthorizeAction.class);
+            if ((action != null) && ENABLE.equalsIgnoreCase(action.action())) {
+                final Application app = (Application) getApplication();
+                if (app.hasAnyRole(action.deny())) {
+                    visible = false;
+                } else {
+                    visible = app.hasAnyRole(action.roles());
+                }
+            }
+            setVisible(visible);
+        }
+        super.onBeforeRender();
+    }
+
+    private Class<T> getPageClass() {
+        return Classes.resolveClass(pageClassName);
+    }
+
+} // class MenuItem
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/ReferenceLinkPanel.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/ReferenceLinkPanel.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/ReferenceLinkPanel.html	(revision 5623)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:wicket="http://wicket.apache.org/">
+    <wicket:panel>
+        <a target="_blank" wicket:id="reference"><span wicket:id="referenceLabel"></span></a>
+        <p wicket:id="description">[description]</p>
+    </wicket:panel>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/ReferenceLinkPanel.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/ReferenceLinkPanel.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/ReferenceLinkPanel.java	(revision 5623)
@@ -0,0 +1,82 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.pages;
+
+import eu.clarin.cmdi.virtualcollectionregistry.gui.HandleLinkModel;
+import eu.clarin.cmdi.virtualcollectionregistry.model.Resource;
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.link.ExternalLink;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.AbstractReadOnlyModel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.util.string.Strings;
+
+/**
+ *
+ * @author twagoo
+ */
+public class ReferenceLinkPanel extends Panel {
+
+    public ReferenceLinkPanel(String id, IModel<Resource> model) {
+        super(id, model);
+
+        // Shared rerence model
+        final PropertyModel<String> refModel = new PropertyModel<>(model, "ref");
+
+        // Wrapper for link model that detects handles
+        final HandleLinkModel linkModel = new HandleLinkModel(refModel);
+        final ExternalLink link = new ExternalLink("reference", linkModel);
+        link.add(new AttributeModifier("title", true, refModel));
+
+        // Set label on link
+        final ReferenceLabelModel labelModel = new ReferenceLabelModel(model);
+        link.add(new Label("referenceLabel", labelModel));
+
+        add(link);
+
+        final PropertyModel<String> descriptionModel = new PropertyModel<>(model, "description");
+        add(new Label("description", descriptionModel) {
+
+            @Override
+            protected void onConfigure() {
+                super.onConfigure();
+                setVisible(descriptionModel.getObject() != null);
+            }
+
+        });
+
+    }
+
+    /**
+     * String model that returns the label of a {@link Resource} if it is
+     * available (not null or empty), otherwise the reference URI
+     */
+    private static class ReferenceLabelModel extends AbstractReadOnlyModel<String> {
+
+        private final IModel<Resource> resourceModel;
+
+        public ReferenceLabelModel(IModel<Resource> resourceModel) {
+            this.resourceModel = resourceModel;
+        }
+
+        @Override
+        public String getObject() {
+            final Resource resource = resourceModel.getObject();
+            if (resource == null) {
+                return null;
+            } else {
+                if (!Strings.isEmpty(resource.getLabel())) {
+                    return resource.getLabel();
+                }
+                return resource.getRef();
+            }
+        }
+
+        @Override
+        public void detach() {
+            resourceModel.detach();
+        }
+
+    }
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/VirtualCollectionDetailsPage.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/VirtualCollectionDetailsPage.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/VirtualCollectionDetailsPage.html	(revision 5623)
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:wicket="http://wicket.apache.org/">
+    <head />
+    <body>
+        <wicket:extend>
+            <h2 wicket:id="name">Title</h2>
+            <div wicket:id="generalBorder">
+                <div class="property">
+                    <label>Name</label>
+                    <div wicket:id="name"></div>
+                </div>
+                <div class="property">
+                    <label>Type</label>
+                    <div wicket:id="type"></div>
+                </div>
+                <div class="property">
+                    <label>Creation Date</label>
+                    <div wicket:id="creationDate"></div>
+                </div>
+                <wicket:enclosure child="description">
+                    <div class="property">
+                        <label>Description</label>
+                        <div wicket:id="description"></div>
+                    </div>
+                </wicket:enclosure>
+                <wicket:enclosure child="purpose">
+                    <div class="property">
+                        <label>Purpose</label>
+                        <div wicket:id="purpose"></div>
+                    </div>
+                </wicket:enclosure>
+                <wicket:enclosure child="reproducibility">
+                    <div class="property">
+                        <label>Reproducibility</label>
+                        <div wicket:id="reproducibility"></div>
+                    </div>
+                </wicket:enclosure>
+                <wicket:enclosure child="reproducibilityNotice">
+                    <div class="property">
+                        <label>Reproducibility Notice</label>
+                        <div wicket:id="reproducibilityNotice"></div>
+                    </div>
+                </wicket:enclosure>
+                <wicket:enclosure child="pidLink">
+                    <div class="property">
+                        <label>Persistent identifier</label>
+                        <div>
+                            <a wicket:id="pidLink"><wicket:container wicket:id="persistentIdentifier.URI">1234/5678</wicket:container></a>
+                        </div>
+                    </div>
+                </wicket:enclosure>     
+                <wicket:enclosure child="keywords">
+                    <div class="property">
+                        <label>Keywords</label>
+                        <div>
+                            <ul class="keywords"><li wicket:id="keywords"><span wicket:id="keyword"></span></li></ul>
+                        </div>
+                    </div>
+                </wicket:enclosure>
+            </div>
+
+            <div wicket:id="creatorsBorder">
+                <ul class="creators">
+                    <li wicket:id="creators">
+                        <div class="property">
+                            <label>Person</label>
+                            <div wicket:id="person"></div>
+                        </div>
+                        <wicket:enclosure child="address">
+                            <div class="property">
+                                <label>Address</label>
+                                <div wicket:id="address"></div>
+                            </div>
+                        </wicket:enclosure>
+                        <wicket:enclosure child="email">
+                            <div class="property">
+                                <label>Email</label>
+                                <div wicket:id="email"></div>
+                            </div>
+                        </wicket:enclosure>
+                        <wicket:enclosure child="organisation">
+                            <div class="property">
+                                <label>Organisation</label>
+                                <div wicket:id="organisation"></div>
+                            </div>
+                        </wicket:enclosure>
+                        <wicket:enclosure child="telephone">
+                            <div class="property">
+                                <label>Telephone</label>
+                                <div wicket:id="telephone"></div>
+                            </div>
+                        </wicket:enclosure>
+                        <wicket:enclosure child="website">
+                            <div class="property">
+                                <label>Website</label>
+                                <div><a wicket:id="website"></a></div>
+                            </div>
+                        </wicket:enclosure>
+                        <wicket:enclosure child="role">
+                            <div class="property">
+                                <label>Role</label>
+                                <div wicket:id="role"></div>
+                            </div>
+                        </wicket:enclosure> 
+                    </li>
+                </ul>
+            </div>
+
+            <div wicket:id="resourcesBorder">
+                <table wicket:id="resourcesTable" class="display resources"></table>
+            </div>
+
+            <div wicket:id="generatedByBorder">
+                <div class="property">
+                    <label>Description</label>
+                    <div wicket:id="generatedBy.description"></div>
+                </div>
+                <wicket:enclosure child="generatedBy.uri">
+                    <div class="property">
+                        <label>URI</label>
+                        <div wicket:id="generatedBy.uri"></div>
+                    </div>
+                </wicket:enclosure>
+                <wicket:enclosure child="generatedBy.query.profile">
+                    <div class="property">
+                        <label>Profile</label>
+                        <div wicket:id="generatedBy.query.profile"></div>
+                    </div>
+                </wicket:enclosure>
+                <wicket:enclosure child="generatedBy.query.value">
+                    <div class="property">
+                        <label>Value</label>
+                        <div wicket:id="generatedBy.query.value"></div>
+                    </div>
+                </wicket:enclosure>
+            </div>
+
+            <div class="collectionDetails buttons">
+                <a wicket:id="back" href="#">[return to previous page]</a>
+            </div>
+        </wicket:extend>
+    </body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/VirtualCollectionDetailsPage.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/VirtualCollectionDetailsPage.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/VirtualCollectionDetailsPage.java	(revision 5623)
@@ -0,0 +1,382 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.pages;
+
+import eu.clarin.cmdi.virtualcollectionregistry.gui.Application;
+import eu.clarin.cmdi.virtualcollectionregistry.gui.DateConverter;
+import eu.clarin.cmdi.virtualcollectionregistry.gui.DetachableVirtualCollectionModel;
+import eu.clarin.cmdi.virtualcollectionregistry.gui.VolatileEntityModel;
+import eu.clarin.cmdi.virtualcollectionregistry.gui.border.AjaxToggleBorder;
+import eu.clarin.cmdi.virtualcollectionregistry.model.Creator;
+import eu.clarin.cmdi.virtualcollectionregistry.model.Resource;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection.Type;
+import java.sql.Date;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Locale;
+import org.apache.wicket.Component;
+import org.apache.wicket.IPageMap;
+import org.apache.wicket.Page;
+import org.apache.wicket.PageParameters;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.Session;
+import org.apache.wicket.authorization.UnauthorizedActionException;
+import org.apache.wicket.behavior.AbstractBehavior;
+import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
+import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
+import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
+import org.apache.wicket.markup.ComponentTag;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.basic.MultiLineLabel;
+import org.apache.wicket.markup.html.border.Border;
+import org.apache.wicket.markup.html.link.ExternalLink;
+import org.apache.wicket.markup.html.link.Link;
+import org.apache.wicket.markup.html.link.PopupSettings;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.ListView;
+import org.apache.wicket.markup.html.list.OddEvenListItem;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.model.ComponentPropertyModel;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.util.convert.IConverter;
+import org.apache.wicket.util.string.Strings;
+
+@SuppressWarnings("serial")
+public class VirtualCollectionDetailsPage extends BasePage {
+
+    public static final String PARAM_VC_ID = "id";
+    public static final String PARAM_BACK_PAGE_ID = "backPage";
+    public static final String PARAM_BACK_PAGE_VERSION = "backPageVersion";
+    public static final String PARAM_BACK_PAGE_PAGEMAP_NAME = "backPageMapName";
+    private static final String CSS_CLASS = "collectionDetails";
+    private static final IConverter convDate = new DateConverter();
+    private final HideIfEmptyBehavior hideIfEmpty = new HideIfEmptyBehavior();
+
+    private static final IConverter convEnum = new IConverter() {
+        @Override
+        public String convertToString(Object o, Locale locale) {
+            final Enum<?> enumObj = (Enum<?>) o;
+            final String key
+                    = enumObj.getDeclaringClass().getSimpleName() + "."
+                    + enumObj.name();
+            final String value = Application.get().getResourceSettings()
+                    .getLocalizer().getString(key, null);
+            return Strings.escapeMarkup(value).toString();
+        }
+
+        @Override
+        public Object convertToObject(String s, Locale locale) {
+            return null;
+        }
+    };
+
+    /*
+     * Actually, we really want the behavior to hide the component on
+     * the beforeRender() call, but we always get an exception from Wicket
+     * that we are not supposed to change the page hierarchy anymore. This
+     * class is a hack to avoid this exception.
+     */
+    private static final class HideIfEmptyBehavior extends AbstractBehavior {
+
+        private final List<Component> components = new LinkedList<Component>();
+
+        @Override
+        public void bind(Component component) {
+            super.bind(component);
+            components.add(component);
+        }
+
+        public void hideEmptyComponents() {
+            for (Component component : components) {
+                Object obj = component.getDefaultModelObject();
+                if (obj == null) {
+                    component.setVisible(false);
+                } else {
+                    if (obj instanceof Collection<?>) {
+                        if (((Collection<?>) obj).isEmpty()) {
+                            component.setVisible(false);
+                        }
+                    }
+                }
+            }
+        }
+
+        @Override
+        public void cleanup() {
+            super.cleanup();
+            components.clear();
+        }
+    } // class VirtualCollectionDetailsPage.HideIfEmptyBehavior
+
+    private static class CustomLabel extends Label {
+
+        public CustomLabel(String id) {
+            super(id);
+        }
+
+        @Override
+        public IConverter getConverter(Class<?> type) {
+            if (VirtualCollection.Type.class.isAssignableFrom(type)
+                    || VirtualCollection.Purpose.class.isAssignableFrom(type)
+                    || VirtualCollection.Reproducibility.class.isAssignableFrom(type)) {
+                return convEnum;
+            }
+            if (Date.class.isAssignableFrom(type)) {
+                return convDate;
+            }
+            return super.getConverter(type);
+        }
+    } // class VirtualCollectionDetailsPage.TypeLabel
+
+    public VirtualCollectionDetailsPage(PageParameters params) {
+        this(getVirtualCollectionModel(params), getPageReference(params));
+    }
+
+    public VirtualCollectionDetailsPage(final IModel<VirtualCollection> model, final PageReference previousPage) {
+        super(new CompoundPropertyModel<VirtualCollection>(model));
+        if (model == null) {
+            setResponsePage(Application.get().getHomePage());
+        } else {
+            checkAccess(model.getObject());
+        }
+
+        final Link<Void> backLink = new Link<Void>("back") {
+            @Override
+            public void onClick() {
+                if (previousPage == null) {
+                    setResponsePage(getApplication().getHomePage());
+                } else {
+                    setResponsePage(previousPage.getPage());
+                }
+            }
+        };
+        add(backLink);
+
+        add(new Label("name"));
+        
+        addGeneralProperties(model);
+        addCreators();
+        addResources(model);
+        addGeneratedBy(model);
+    }
+
+    private void addGeneralProperties(final IModel<VirtualCollection> model) {
+        final Border general = new AjaxToggleBorder("generalBorder",
+                new Model<String>("General"), CSS_CLASS);
+        add(general);
+        general.add(new Label("name"));
+        general.add(new CustomLabel("type"));
+        general.add(new CustomLabel("creationDate"));
+        general.add(new MultiLineLabel("description").add(hideIfEmpty));
+        general.add(new CustomLabel("purpose").add(hideIfEmpty));
+        general.add(new CustomLabel("reproducibility").add(hideIfEmpty));
+        general.add(new Label("reproducibilityNotice").add(hideIfEmpty));
+
+        final ExternalLink pidLink = new ExternalLink("pidLink", new PropertyModel<String>(model, "persistentIdentifier.actionableURI"));
+        pidLink.add(new Label("persistentIdentifier.URI"));
+        pidLink.add(hideIfEmpty);
+        general.add(pidLink);
+
+        addKeywords(general);
+    }
+
+    private void addKeywords(final Border general) {
+        final ListView<String> keywords = new ListView<String>("keywords") {
+            @Override
+            protected void populateItem(ListItem<String> item) {
+                item.add(new Label("keyword", item.getModelObject()));
+            }
+        };
+        keywords.add(hideIfEmpty);
+        general.add(keywords);
+    }
+
+    private void addCreators() {
+        final Border creators = new AjaxToggleBorder("creatorsBorder",
+                new Model<String>("Creators"), CSS_CLASS);
+        add(creators);
+        creators.add(new ListView<Creator>("creators") {
+            @Override
+            protected void populateItem(ListItem<Creator> item) {
+                item.add(new Label("person"));
+                item.add(new MultiLineLabel("address").add(hideIfEmpty));
+                item.add(new Label("organisation").add(hideIfEmpty));
+                item.add(new Label("email").add(hideIfEmpty));
+                item.add(new Label("telephone").add(hideIfEmpty));
+                final IModel<String> siteModel
+                        = new ComponentPropertyModel<String>("website");
+                item.add(new ExternalLink("website", siteModel, siteModel)
+                        .setPopupSettings(new PopupSettings())
+                        .add(hideIfEmpty));
+                item.add(new Label("role").add(hideIfEmpty));
+            }
+
+            @Override
+            protected IModel<Creator> getListItemModel(
+                    IModel<? extends List<Creator>> listViewModel, int index) {
+                final List<Creator> creators = listViewModel.getObject();
+                return new CompoundPropertyModel<Creator>(
+                        new VolatileEntityModel<>(creators.get(index)));
+            }
+
+            @Override
+            protected ListItem<Creator> newItem(int index) {
+                final IModel<Creator> model
+                        = getListItemModel(getModel(), index);
+                return new OddEvenListItem<Creator>(index, model) {
+                    @Override
+                    protected void onComponentTag(ComponentTag tag) {
+                        super.onComponentTag(tag);
+                        if (getIndex() == 0) {
+                            tag.append("class", "first", " ");
+                        }
+                    }
+                };
+            }
+        });
+    }
+
+    private void addResources(final IModel<VirtualCollection> model) {
+        final Border resources = new AjaxToggleBorder("resourcesBorder",
+                new Model<String>("Resources"), CSS_CLASS + " resources");
+        add(resources);
+
+        @SuppressWarnings("rawtypes")
+        final IColumn[] cols = new IColumn[2];
+        cols[1] = new PropertyColumn<Resource>(
+                Model.of("Type"), "type") {
+                    @Override
+                    public void populateItem(Item<ICellPopulator<Resource>> item,
+                            String componentId, IModel<Resource> model) {
+                        final Resource.Type type = model.getObject().getType();
+                        item.add(new Label(componentId,
+                                        convEnum.convertToString(type, getLocale())));
+                    }
+
+                    @Override
+                    public String getCssClass() {
+                        return "type";
+                    }
+                    
+                    
+                };
+        cols[0] = new AbstractColumn<Resource>(Model.of("Reference")) {
+
+            @Override
+            public void populateItem(Item<ICellPopulator<Resource>> item, String componentId, IModel<Resource> rowModel) {
+                item.add(new ReferenceLinkPanel(componentId, rowModel));
+            }
+
+            @Override
+            public String getCssClass() {
+                return "reference";
+            }
+
+        };
+
+        final SortableDataProvider<Resource> resourcesProvider = new SortableDataProvider<Resource>() {
+            @Override
+            public Iterator<? extends Resource>
+                    iterator(int first, int count) {
+                return model.getObject().getResources().listIterator(first);
+            }
+
+            @Override
+            public IModel<Resource> model(Resource resource) {
+                return new VolatileEntityModel<Resource>(resource);
+            }
+
+            @Override
+            public int size() {
+                return model.getObject().getResources().size();
+            }
+        };
+
+        final DataTable<Resource> resourcesTable
+                = new AjaxFallbackDefaultDataTable<Resource>("resourcesTable",
+                        cols, resourcesProvider, 64);
+        resources.add(resourcesTable);
+        resources.setVisible(model.getObject().getType() == Type.EXTENSIONAL);
+    }
+
+    private void addGeneratedBy(final IModel<VirtualCollection> model) {
+        final Border generated = new AjaxToggleBorder("generatedByBorder",
+                new Model<String>("Intensional Collection Query"), CSS_CLASS);
+        add(generated);
+        generated.add(new Label("generatedBy.description"));
+        generated.add(new Label("generatedBy.uri").add(hideIfEmpty));
+        generated.add(new Label("generatedBy.query.profile").add(hideIfEmpty));
+        generated.add(new Label("generatedBy.query.value").add(hideIfEmpty));
+        generated.setVisible(model.getObject().getType() == Type.INTENSIONAL);
+    }
+
+    private static IModel<VirtualCollection> getVirtualCollectionModel(PageParameters params) {
+        final Long collectionId = params.getAsLong(PARAM_VC_ID);
+        if (collectionId == null) {
+            Session.get().error("Collection could not be retrieved, id not provided");
+            return null;
+        }
+        return new DetachableVirtualCollectionModel(collectionId);
+    }
+
+    private static PageReference getPageReference(PageParameters params) {
+        final Integer pageId = params.getAsInteger(PARAM_BACK_PAGE_ID);
+        final Integer pageVersion = params.getAsInteger(PARAM_BACK_PAGE_VERSION);
+        final String pageMap = params.getString(PARAM_BACK_PAGE_PAGEMAP_NAME);
+        if (pageId != null && pageVersion != null) {
+            for (IPageMap map : Session.get().getPageMaps()) {
+                if (pageMap == null && map.getName() == null || pageMap != null && pageMap.equals(map.getName())) {
+                    final Page page = map.get(pageId, pageVersion);
+                    if (page != null) {
+                        return page.getPageReference();
+                    }
+                }
+            }
+        }
+        return null;
+    }
+
+    public static PageParameters createPageParameters(VirtualCollection vc, PageReference pageReference) {
+        final PageParameters params = new PageParameters();
+        params.put(VirtualCollectionDetailsPage.PARAM_VC_ID, vc.getId());
+
+        if (pageReference != null) {
+            params.put(VirtualCollectionDetailsPage.PARAM_BACK_PAGE_ID, pageReference.getPageNumber());
+            params.put(VirtualCollectionDetailsPage.PARAM_BACK_PAGE_VERSION, pageReference.getPageVersion());
+            if (pageReference.getPageMapName() != null) {
+                params.put(VirtualCollectionDetailsPage.PARAM_BACK_PAGE_PAGEMAP_NAME, pageReference.getPageMapName());
+            }
+        }
+        return params;
+    }
+
+    /**
+     *
+     * @param vc collection to check for
+     * @throws UnauthorizedActionException if the VC is private and the current
+     * user is not the owner
+     */
+    private void checkAccess(final VirtualCollection vc) throws UnauthorizedActionException {
+        if (vc.isPrivate()
+                && !isUserAdmin()
+                && !getSession().isCurrentUser(vc.getOwner())) {
+            // user trying to access other user's collection
+            throw new UnauthorizedActionException(this, Component.RENDER);
+        }
+    }
+
+    @Override
+    protected void onBeforeRender() {
+        super.onBeforeRender();
+        hideIfEmpty.hideEmptyComponents();
+    }
+
+} // class VirtualCollectionDetailsPage
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/AdminCollectionsProvider.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/AdminCollectionsProvider.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/AdminCollectionsProvider.java	(revision 5623)
@@ -0,0 +1,47 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.table;
+
+import eu.clarin.cmdi.virtualcollectionregistry.QueryOptions;
+import eu.clarin.cmdi.virtualcollectionregistry.model.User;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+import org.apache.wicket.model.IModel;
+
+/**
+ * Provider that dynamically switches between user or public collection spaces
+ * on basis of a provided user model.
+ * 
+ * Permission checking does not happen within this provider!
+ *
+ * @author twagoo
+ */
+public class AdminCollectionsProvider extends CollectionsProvider {
+
+    private final IModel<User> userModel;
+
+    public AdminCollectionsProvider(IModel<User> userModel) {
+        this.userModel = userModel;
+    }
+
+    @Override
+    protected void addSpaceFilter(QueryOptions.Filter filter) {
+        User user = userModel.getObject();
+        if (user == null) {
+            // select public collections
+            filter.add(QueryOptions.Property.VC_STATE,
+                    QueryOptions.Relation.EQ,
+                    VirtualCollection.State.PUBLIC);
+
+        } else {
+            // select selected user collections
+            filter.add(QueryOptions.Property.VC_OWNER,
+                    QueryOptions.Relation.EQ,
+                    user.getName());
+
+        }
+    }
+
+    @Override
+    public void detach() {
+        userModel.detach();
+    }
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/CollectionsProvider.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/CollectionsProvider.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/CollectionsProvider.java	(revision 5623)
@@ -0,0 +1,132 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.table;
+
+import eu.clarin.cmdi.virtualcollectionregistry.QueryOptions;
+import eu.clarin.cmdi.virtualcollectionregistry.QueryOptions.Property;
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistry;
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryException;
+import eu.clarin.cmdi.virtualcollectionregistry.gui.Application;
+import eu.clarin.cmdi.virtualcollectionregistry.gui.DetachableVirtualCollectionModel;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+import java.util.Iterator;
+import java.util.List;
+import org.apache.wicket.WicketRuntimeException;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.filter.IFilterStateLocator;
+import org.apache.wicket.extensions.markup.html.repeater.util.SortParam;
+import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
+import org.apache.wicket.model.IModel;
+
+@SuppressWarnings("serial")
+public abstract class CollectionsProvider extends
+        SortableDataProvider<VirtualCollection> implements
+        IFilterStateLocator<FilterState> {
+
+    private FilterState filterstate = new FilterState();
+
+    public CollectionsProvider() {
+        setSort("created", false);
+    }
+
+    @Override
+    public FilterState getFilterState() {
+        return filterstate;
+    }
+
+    @Override
+    public void setFilterState(FilterState state) {
+        this.filterstate = state;
+    }
+
+    @Override
+    public IModel<VirtualCollection> model(VirtualCollection vc) {
+        return new DetachableVirtualCollectionModel(vc);
+    }
+
+    @Override
+    public int size() {
+        try {
+            final VirtualCollectionRegistry vcr
+                    = Application.get().getRegistry();
+            return vcr.getVirtualCollectionCount(getFilter());
+        } catch (VirtualCollectionRegistryException e) {
+            throw new WicketRuntimeException(e);
+        }
+    }
+
+    @Override
+    public Iterator<? extends VirtualCollection> iterator(int first,
+            int count) {
+        try {
+            final VirtualCollectionRegistry vcr
+                    = Application.get().getRegistry();
+            final List<VirtualCollection> results
+                    = vcr.getVirtualCollections(first, count, getFilter());
+            return results.iterator();
+        } catch (VirtualCollectionRegistryException e) {
+            throw new WicketRuntimeException(e);
+        }
+    }
+
+    private QueryOptions getFilter() {
+        QueryOptions options = new QueryOptions();
+
+        QueryOptions.Filter filter = options.and();
+        // add the filter that selects the public or private space
+        addSpaceFilter(filter);
+        // apply the filter state
+        if (filterstate.hasName()) {
+            filter.add(QueryOptions.Property.VC_NAME,
+                    QueryOptions.Relation.EQ,
+                    filterstate.getNameWithWildcard());
+        }
+        if (filterstate.hasType()) {
+            filter.add(QueryOptions.Property.VC_TYPE,
+                    QueryOptions.Relation.EQ,
+                    filterstate.getType());
+        }
+        if (filterstate.hasState()) {
+            filter.add(QueryOptions.Property.VC_STATE,
+                    QueryOptions.Relation.EQ,
+                    filterstate.getState());
+        }
+        if (filterstate.hasDescription()) {
+            filter.add(QueryOptions.Property.VC_DESCRIPTION,
+                    QueryOptions.Relation.EQ,
+                    filterstate.getDescriptionWithWildcard());
+        }
+        if (filterstate.hasCreated()) {
+            filter.add(QueryOptions.Property.VC_CREATION_DATE,
+                    filterstate.getCreatedRelation(),
+                    filterstate.getCreated());
+        }
+        options.setFilter(filter);
+
+        final SortParam s = getSort();
+        if (s != null) {
+            final String p = s.getProperty();
+            Property property = null;
+            if ("name".equals(p)) {
+                property = Property.VC_NAME;
+            } else if ("type".equals(p)) {
+                property = Property.VC_TYPE;
+            } else if ("state".equals(p)) {
+                property = Property.VC_STATE;
+            } else if ("description".equals(p)) {
+                property = Property.VC_DESCRIPTION;
+            } else if ("created".equals(p)) {
+                property = Property.VC_CREATION_DATE;
+            }
+            if (property != null) {
+                options.addSortProperty(property, s.isAscending());
+            }
+        }
+        return options;
+    }
+
+    /**
+     * Adds a filter that limits the results to a specific collections space
+     * ({@lit i.e.} the public space or a user's private work space
+     * @param filter 
+     */
+    protected abstract void addSpaceFilter(QueryOptions.Filter filter);
+
+} // class VirtualCollectionProvider
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/ColumnActions.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/ColumnActions.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/ColumnActions.java	(revision 5623)
@@ -0,0 +1,30 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.table;
+
+import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.HeaderlessColumn;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.model.IModel;
+
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+
+@SuppressWarnings("serial")
+final class ColumnActions extends HeaderlessColumn<VirtualCollection> {
+    private final VirtualCollectionTable table;
+
+    public ColumnActions(VirtualCollectionTable table) {
+        super();
+        this.table = table;
+    }
+
+    @Override
+    public void populateItem(Item<ICellPopulator<VirtualCollection>> item,
+            String componentId, IModel<VirtualCollection> model) {
+        item.add(table.createActionColumn(componentId, model));
+    }
+
+    @Override
+    public String getCssClass() {
+        return "action";
+    }
+
+} // class ColumnActions
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/ColumnCreated.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/ColumnCreated.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/ColumnCreated.java	(revision 5623)
@@ -0,0 +1,46 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.table;
+
+import eu.clarin.cmdi.virtualcollectionregistry.gui.DateConverter;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+import java.util.Date;
+import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.util.convert.IConverter;
+
+@SuppressWarnings("serial")
+final class ColumnCreated extends AbstractColumn<VirtualCollection> {
+
+    private static final IConverter dateConverter = new DateConverter();
+
+    ColumnCreated(VirtualCollectionTable table) {
+        super(new ResourceModel("column.created", "Created"), "created");
+    }
+
+    @Override
+    public void populateItem(Item<ICellPopulator<VirtualCollection>> item,
+            String componentId, IModel<VirtualCollection> model) {
+        item.add(new Label(componentId,
+                new PropertyModel<Date>(model, "creationDate")) {
+
+                    @Override
+                    public IConverter getConverter(Class<?> type) {
+                        if (Date.class.isAssignableFrom(type)) {
+                            return dateConverter;
+                        }
+                        return super.getConverter(type);
+                    }
+
+                });
+    }
+
+    @Override
+    public String getCssClass() {
+        return "created";
+    }
+
+} // class ColumnCreated
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/ColumnName$ItemCell.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/ColumnName$ItemCell.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/ColumnName$ItemCell.html	(revision 5623)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org/">
+<head />
+<body>
+<wicket:panel>
+  <div wicket:id="nameColumn">
+    <div wicket:id="name" class="name"></div>
+    <div wicket:id="details" class="details">
+      <div wicket:id="desc" class="desc"></div>
+      <div class="actions">
+        <div wicket:id="actionsPanel"></div>
+      </div>
+    </div>
+  </div>
+</wicket:panel>
+</body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/ColumnName.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/ColumnName.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/ColumnName.java	(revision 5623)
@@ -0,0 +1,95 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.table;
+
+import org.apache.wicket.Component;
+import org.apache.wicket.ResourceReference;
+import org.apache.wicket.behavior.AbstractBehavior;
+import org.apache.wicket.behavior.AttributeAppender;
+import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.basic.MultiLineLabel;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.ResourceModel;
+import org.odlabs.wiquery.core.commons.IWiQueryPlugin;
+import org.odlabs.wiquery.core.commons.WiQueryResourceManager;
+import org.odlabs.wiquery.core.javascript.JsStatement;
+
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+
+@SuppressWarnings("serial")
+final class ColumnName extends AbstractColumn<VirtualCollection> {
+    private static final ResourceReference JAVASCRIPT_RESOURCE =
+        new ResourceReference(ColumnName.class, "ColumnName.js");
+    private final VirtualCollectionTable table;
+
+    private final class ItemCell extends Panel implements IWiQueryPlugin {
+        private final WebMarkupContainer nameColumn;
+
+        public ItemCell(String id, IModel<VirtualCollection> model) {
+            super(id);
+            setRenderBodyOnly(true);
+
+            nameColumn = new WebMarkupContainer("nameColumn");
+            nameColumn.setOutputMarkupId(true);
+            final VirtualCollection vc = model.getObject();
+            nameColumn.add(new Label("name", vc.getName()));
+
+            final WebMarkupContainer details =
+                new WebMarkupContainer("details");
+            final String desc = vc.getDescription();
+            final MultiLineLabel descLabel = new MultiLineLabel("desc", desc);
+            if (desc == null) {
+                descLabel.setVisible(false);
+            }
+            details.add(descLabel);
+            final Panel actionsPanel =
+                table.createActionPanel("actionsPanel", model);
+            details.add(actionsPanel);
+            details.add(new AbstractBehavior() {
+
+                @Override
+                public void bind(Component component) {
+                    component.setVisible(actionsPanel.isVisible());
+                }
+            });
+
+            // move to css?
+            details.add(new AttributeAppender("style",
+                    new Model<String>("display:none"), ";"));
+            nameColumn.add(details);
+            add(nameColumn);
+        }
+
+        @Override
+        public void contribute(WiQueryResourceManager manager) {
+            manager.addJavaScriptResource(JAVASCRIPT_RESOURCE);
+        }
+
+        @Override
+        public JsStatement statement() {
+            return new JsStatement().$(nameColumn).append(".detailsToggle()");
+        }
+
+    } // class ColumnName.ItemCell
+
+    ColumnName(VirtualCollectionTable table) {
+        super(new ResourceModel("column.name", "Name"), "name");
+        this.table = table;
+    }
+
+    @Override
+    public void populateItem(Item<ICellPopulator<VirtualCollection>> item,
+            String componentId, IModel<VirtualCollection> model) {
+        item.add(new ItemCell(componentId, model));
+    }
+
+    @Override
+    public String getCssClass() {
+        return "name";
+    }
+
+} // class ColumnName
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/ColumnName.js
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/ColumnName.js	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/ColumnName.js	(revision 5623)
@@ -0,0 +1,21 @@
+(function($) {
+	$.extend($.fn, {
+		detailsToggle : function() {
+			var o = {
+				speed: 250
+			};
+			var name = $(this).children('div.name');
+			var details = $(this).children('div.details');
+			if (details.length > 0) {
+				name.bind('click.detailsToggle', function() {
+					details.slideToggle(o.speed, function() {
+						name.toggleClass('detailsShown');
+					});
+				});
+			} else {
+				name.addClass('noDetails');
+			}
+			return $(this);
+		}
+	});
+})(jQuery);
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/ColumnState.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/ColumnState.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/ColumnState.java	(revision 5623)
@@ -0,0 +1,36 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.table;
+
+import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.EnumChoiceRenderer;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.ResourceModel;
+
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+
+@SuppressWarnings("serial")
+final class ColumnState extends AbstractColumn<VirtualCollection> {
+    private final EnumChoiceRenderer<VirtualCollection.State> renderer;
+
+    ColumnState(VirtualCollectionTable table) {
+        super(new ResourceModel("column.state", "State"), "state");
+        this.renderer = new EnumChoiceRenderer<VirtualCollection.State>(table);
+    }
+
+    @Override
+    public void populateItem(
+            Item<ICellPopulator<VirtualCollection>> item,
+            String componentId, IModel<VirtualCollection> model) {
+        final VirtualCollection.State state = model.getObject().getState();
+        final String label = renderer.getDisplayValue(state).toString();
+        item.add(new Label(componentId, label));
+    }
+
+    @Override
+    public String getCssClass() {
+        return "state";
+    }
+
+} // class ColumnState
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/ColumnType.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/ColumnType.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/ColumnType.java	(revision 5623)
@@ -0,0 +1,35 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.table;
+
+import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.EnumChoiceRenderer;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.ResourceModel;
+
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+
+@SuppressWarnings("serial")
+final class ColumnType extends AbstractColumn<VirtualCollection> {
+    private final EnumChoiceRenderer<VirtualCollection.Type> renderer;
+
+    ColumnType(VirtualCollectionTable table) {
+        super(new ResourceModel("column.type", "Type"), "type");
+        this.renderer = new EnumChoiceRenderer<VirtualCollection.Type>(table);
+    }
+
+    @Override
+    public void populateItem(Item<ICellPopulator<VirtualCollection>> item,
+            String componentId, IModel<VirtualCollection> model) {
+        final VirtualCollection.Type type = model.getObject().getType();
+        final String label = renderer.getDisplayValue(type).toString();
+        item.add(new Label(componentId, label));
+    }
+
+    @Override
+    public String getCssClass() {
+        return "type";
+    }
+
+} // class ColumnType
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/FilterForm.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/FilterForm.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/FilterForm.html	(revision 5623)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org/">
+<head />
+<body>
+<wicket:panel>
+  <form wicket:id="form" class="filterForm wizard">
+   <fieldset>
+    <div class="optional">
+      <label>Name</label>
+      <select wicket:id="nameMode"></select>
+      <input wicket:id="name" type="text" class="name"
+             size="64" maxlength="255"/>
+    </div>
+    <div class="optional">
+      <label>Description</label>
+      <select wicket:id="descriptionMode"></select>
+      <input wicket:id="description" type="text" class="desc"
+             size="64" maxlength="255"/>
+    </div>
+    <div wicket:id="state" class="optional">
+      <label>State</label>
+      <select wicket:id="state"></select>
+    </div>
+    <div class="optional">
+      <label>Type</label>
+      <select wicket:id="type"></select>
+    </div>
+    <div class="optional">
+      <label>Created</label>
+      <select wicket:id="createdRelation"></select>
+      <input wicket:id="created" type="text" class="created"
+             size="11" maxlength="11"/>
+    </div>
+    <input wicket:id="filter" type="submit" class="filter" value="filter" />
+    <input wicket:id="clear" type="submit" class="clear" value="clear" />
+    </fieldset>
+  </form>
+</wicket:panel>
+</body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/FilterForm.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/FilterForm.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/FilterForm.java	(revision 5623)
@@ -0,0 +1,118 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.table;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.extensions.markup.html.form.DateTextField;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.filter.IFilterStateLocator;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.EnumChoiceRenderer;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.panel.FeedbackPanel;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.validation.validator.StringValidator;
+
+import eu.clarin.cmdi.virtualcollectionregistry.QueryOptions;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+
+@SuppressWarnings("serial")
+public class FilterForm extends Panel {
+    private static final List<FilterState.SearchMode> MODE_VALUES =
+        Arrays.asList(FilterState.SearchMode.values());
+    private static final List<VirtualCollection.State> STATE_VALUES =
+        Arrays.asList(VirtualCollection.State.PUBLIC,
+                VirtualCollection.State.PRIVATE,
+                VirtualCollection.State.DELETED,
+                VirtualCollection.State.PUBLIC_PENDING);
+    private static final List<VirtualCollection.Type> TYPE_VALUES =
+        Arrays.asList(VirtualCollection.Type.values());
+    private static final List<QueryOptions.Relation> CREATED_RELATIONS =
+        Arrays.asList(QueryOptions.Relation.LT,
+                QueryOptions.Relation.LE,
+                QueryOptions.Relation.EQ,
+                QueryOptions.Relation.GE,
+                QueryOptions.Relation.GT);
+
+    public FilterForm(String id, IFilterStateLocator<FilterState> locator,
+            final DataTable<VirtualCollection> table, boolean privateMode) {
+        super(id);
+        setRenderBodyOnly(true);
+
+        final IModel<FilterState> model =
+            new CompoundPropertyModel<FilterState>(locator.getFilterState());
+        final Form<FilterState> form = new Form<FilterState>("form", model);
+        form.setOutputMarkupId(true);
+
+        final EnumChoiceRenderer<FilterState.SearchMode> searchModeRenderer =
+            new EnumChoiceRenderer<FilterState.SearchMode>(this);
+        form.add(new DropDownChoice<FilterState.SearchMode>("nameMode",
+                MODE_VALUES, searchModeRenderer));
+        form.add(new TextField<String>("name")
+                .add(new StringValidator.MaximumLengthValidator(255)));
+        form.add(new DropDownChoice<FilterState.SearchMode>("descriptionMode",
+                MODE_VALUES, searchModeRenderer));
+        form.add(new TextField<String>("description")
+                .add(new StringValidator.MaximumLengthValidator(255)));
+        final WebMarkupContainer state = new WebMarkupContainer("state");
+        state.add(new DropDownChoice<VirtualCollection.State>("state",
+                STATE_VALUES,
+                new EnumChoiceRenderer<VirtualCollection.State>(this)));
+        state.setVisible(privateMode);
+        form.add(state);
+        form.add(new DropDownChoice<VirtualCollection.Type>("type",
+                TYPE_VALUES,
+                new EnumChoiceRenderer<VirtualCollection.Type>(this)));
+        final DropDownChoice<QueryOptions.Relation> createdRelationChoice =
+            new DropDownChoice<QueryOptions.Relation>("createdRelation",
+                    CREATED_RELATIONS,
+                    new EnumChoiceRenderer<QueryOptions.Relation>(this));
+        createdRelationChoice.setEscapeModelStrings(false);
+        form.add(createdRelationChoice);
+        form.add(new DateTextField("created", "yyyy-MM-dd"));
+
+        final AjaxButton goButton = new AjaxButton("filter",
+                new ResourceModel("button.filter")) {
+            @Override
+            protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+                target.addComponent(form);
+                target.addComponent(table);
+            }
+
+            @Override
+            protected void onError(AjaxRequestTarget target, Form<?> form) {
+                super.onError(target, form);
+                target.addComponent(form);
+            }
+        };
+        form.add(goButton);
+        final AjaxButton clearButton = new AjaxButton("clear",
+                new ResourceModel("button.clear")) {
+            @Override
+            protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+                @SuppressWarnings("unchecked")
+                final FilterState state =
+                    ((Form<FilterState>) form).getModelObject();
+                state.clear();
+                target.addComponent(form);
+                target.addComponent(table);
+            }
+
+            @Override
+            protected void onError(AjaxRequestTarget target, Form<?> form) {
+                super.onError(target, form);
+                target.addComponent(form);
+            }
+        };
+        form.add(clearButton);
+        add(form);
+    }
+
+} // class FilterForm
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/FilterState.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/FilterState.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/FilterState.java	(revision 5623)
@@ -0,0 +1,154 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.table;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import eu.clarin.cmdi.virtualcollectionregistry.QueryOptions;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+
+@SuppressWarnings("serial")
+final class FilterState implements Serializable {
+    public enum SearchMode {
+        CONTAINS,
+        STARTS_WITH,
+        ENDS_WITH
+    } // enum FilterState.SearchMode
+    private SearchMode nameMode;
+    private String name;
+    private SearchMode descriptionMode;
+    private String description;
+    private VirtualCollection.Type type;
+    private VirtualCollection.State state;
+    private QueryOptions.Relation createdRelation;
+    private Date created;
+
+    public FilterState() {
+        clear();
+    }
+
+    public SearchMode getNameMode() {
+        return nameMode;
+    }
+
+    public void setNameMode(SearchMode nameMode) {
+        if (nameMode == null) {
+            throw new IllegalArgumentException("nameMode == null");
+        }
+        this.nameMode = nameMode;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public boolean hasName() {
+        return name != null;
+    }
+
+    public String getNameWithWildcard() {
+        return addWildcards(name, nameMode);
+    }
+
+    public SearchMode getDescriptionMode() {
+        return descriptionMode;
+    }
+
+    public void setDescriptionMode(SearchMode descriptionMode) {
+        if (descriptionMode == null) {
+            throw new IllegalArgumentException("descriptionMode == null");
+        }
+        this.descriptionMode = descriptionMode;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public VirtualCollection.Type getType() {
+        return type;
+    }
+
+    public void setType(VirtualCollection.Type type) {
+        this.type = type;
+    }
+
+    public boolean hasType() {
+        return type != null;
+    }
+
+    public VirtualCollection.State getState() {
+        return state;
+    }
+
+    public void setType(VirtualCollection.State state) {
+        this.state = state;
+    }
+
+    public boolean hasState() {
+        return state != null;
+    }
+
+    public boolean hasDescription() {
+        return description != null;
+    }
+
+    public String getDescriptionWithWildcard() {
+        return addWildcards(description, descriptionMode);
+    }
+
+    public QueryOptions.Relation getCreatedRelation() {
+        return createdRelation;
+    }
+
+    public void setCreatedRelation(QueryOptions.Relation createdRelation) {
+        if (createdRelation == null) {
+            throw new IllegalArgumentException("createdRelation == null");
+        }
+        this.createdRelation = createdRelation;
+    }
+
+    public Date getCreated() {
+        return created;
+    }
+
+    public void setCreated(Date created) {
+        this.created = created;
+    }
+
+    public boolean hasCreated() {
+        return created != null;
+    }
+
+    public void clear() {
+        nameMode = SearchMode.CONTAINS;
+        name = null;
+        descriptionMode = SearchMode.CONTAINS;
+        description = null;
+        type = null;
+        state = null;
+        createdRelation = QueryOptions.Relation.EQ;
+        created = null;
+    }
+
+    private static String addWildcards(String s, SearchMode mode) {
+        s = s.replaceAll("\\*+", "*");
+        StringBuilder sb = new StringBuilder();
+        if ((mode != SearchMode.STARTS_WITH) && !s.startsWith("*")) {
+            sb.append('*');
+        }
+        sb.append(s);
+        if ((mode != SearchMode.ENDS_WITH) && !s.endsWith("*")) {
+            sb.append('*');
+        }
+        return sb.toString();
+    }
+
+} // class FilterState
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/PrivateCollectionsProvider.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/PrivateCollectionsProvider.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/PrivateCollectionsProvider.java	(revision 5623)
@@ -0,0 +1,20 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.table;
+
+import eu.clarin.cmdi.virtualcollectionregistry.QueryOptions;
+import eu.clarin.cmdi.virtualcollectionregistry.gui.ApplicationSession;
+
+/**
+ *
+ * @author twagoo
+ */
+public class PrivateCollectionsProvider extends CollectionsProvider {
+
+    @Override
+    protected void addSpaceFilter(QueryOptions.Filter filter) {
+        ApplicationSession session = ApplicationSession.get();
+        filter.add(QueryOptions.Property.VC_OWNER,
+                QueryOptions.Relation.EQ,
+                session.getUser());
+    }
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/PublishedCollectionsProvider.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/PublishedCollectionsProvider.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/PublishedCollectionsProvider.java	(revision 5623)
@@ -0,0 +1,19 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.table;
+
+import eu.clarin.cmdi.virtualcollectionregistry.QueryOptions;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+
+/**
+ *
+ * @author twagoo
+ */
+public class PublishedCollectionsProvider extends CollectionsProvider {
+
+    @Override
+    protected void addSpaceFilter(QueryOptions.Filter filter) {
+        filter.add(QueryOptions.Property.VC_STATE,
+                QueryOptions.Relation.EQ,
+                VirtualCollection.State.PUBLIC);
+    }
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/VirtualCollectionTable.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/VirtualCollectionTable.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/VirtualCollectionTable.html	(revision 5623)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org/">
+<head />
+<body>
+<wicket:panel>
+  <div wicket:id="border">
+    <div wicket:id="filterForm"></div>
+  </div>
+  <table wicket:id="table" class="collectionsTable display"></table>
+</wicket:panel>
+</body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/VirtualCollectionTable.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/VirtualCollectionTable.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/VirtualCollectionTable.java	(revision 5623)
@@ -0,0 +1,66 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.table;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.wicket.behavior.AttributeAppender;
+import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
+import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxNavigationToolbar;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.AbstractReadOnlyModel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+
+import eu.clarin.cmdi.virtualcollectionregistry.gui.border.AjaxToggleBorder;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+
+@SuppressWarnings("serial")
+public abstract class VirtualCollectionTable extends Panel {
+
+    public VirtualCollectionTable(String id, CollectionsProvider provider, final boolean showState) {
+        super(id);
+        setOutputMarkupId(true);
+
+        // setup table provider
+        List<IColumn<VirtualCollection>> columns =
+            new ArrayList<IColumn<VirtualCollection>>();
+        columns.add(new ColumnName(this));
+        if (showState) {
+            columns.add(new ColumnState(this));
+        }
+        columns.add(new ColumnType(this));
+        columns.add(new ColumnCreated(this));
+        columns.add(new ColumnActions(this));
+
+        // setup table
+        final DataTable<VirtualCollection> table =
+            new AjaxFallbackDefaultDataTable<VirtualCollection>("table",
+                columns, provider, 30);
+        table.add(new AttributeAppender("class",
+                new AbstractReadOnlyModel<String>() {
+                    @Override
+                    public String getObject() {
+                        return showState ? "private" : "public";
+                    }
+                }, " "));
+        table.addBottomToolbar(new AjaxNavigationToolbar(table));
+
+        // setup filter
+        final AjaxToggleBorder border =
+            new AjaxToggleBorder("border", new Model<String>("Filter"));
+        final FilterForm form =
+            new FilterForm("filterForm", provider, table, showState);
+        border.add(form);
+        add(border);
+        add(table);
+    }
+
+    protected abstract Panel createActionColumn(String componentId,
+            IModel<VirtualCollection> model);
+
+    protected abstract Panel createActionPanel(String componentId,
+            IModel<VirtualCollection> model);
+
+} // class VirtualCollectionTable
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/VirtualCollectionTable.properties
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/VirtualCollectionTable.properties	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/VirtualCollectionTable.properties	(revision 5623)
@@ -0,0 +1,15 @@
+column.name: Name
+column.type: Type
+column.state: State
+column.description: Description
+column.created: Created
+Relation.LT: less-than
+Relation.LE: less-than or equals
+Relation.EQ: equals
+Relation.GE: greater-than or equals
+Relation.GT: greater-than
+SearchMode.CONTAINS: contains
+SearchMode.STARTS_WITH: starts with
+SearchMode.ENDS_WITH: ends with
+button.filter: Filter
+button.clear: Clear
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/AddKeywordDialog$Content.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/AddKeywordDialog$Content.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/AddKeywordDialog$Content.html	(revision 5623)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:wicket="http://wicket.apache.org/">
+<head />
+<body>
+<wicket:panel>
+<form wicket:id="addKeywordForm">
+  <fieldset>
+    <div class="required">
+      <label for="add_keyword_keyword">Keyword</label>
+      <input wicket:id="keyword" id="edit_keyword_keyword" type="text" />
+    </div>
+  </fieldset>
+  <div wicket:id="feedback" class="feedback"></div>
+</form>
+</wicket:panel>
+</body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/AddKeywordDialog.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/AddKeywordDialog.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/AddKeywordDialog.java	(revision 5623)
@@ -0,0 +1,79 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.wizard;
+
+import eu.clarin.cmdi.virtualcollectionregistry.gui.DynamicProxyModel;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.RequiredTextField;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.panel.FeedbackPanel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.validation.validator.StringValidator;
+
+import eu.clarin.cmdi.virtualcollectionregistry.gui.dialog.ModalEditDialogBase;
+
+@SuppressWarnings("serial")
+public abstract class AddKeywordDialog extends ModalEditDialogBase<String> {
+
+
+    private final class Content extends
+            ModalEditDialogBase<String>.ContentPanel {
+
+        private final Form<String> form;
+        private final FeedbackPanel feedbackPanel;
+
+        public Content(String id, IModel<String> model) {
+            super(id);
+            form = new Form<String>("addKeywordForm", model);
+            final TextField<String> keywordField
+                    = new RequiredTextField<String>("keyword", new DynamicProxyModel<String>() {
+
+                @Override
+                protected IModel<String> getWrappedModel() {
+                    return form.getModel();
+                }
+            });
+            keywordField.add(new StringValidator.MaximumLengthValidator(255));
+            form.add(keywordField);
+            feedbackPanel = new FeedbackPanel("feedback");
+            form.add(feedbackPanel);
+            add(form);
+        }
+
+        @Override
+        public Form<String> getForm() {
+            return form;
+        }
+
+        @Override
+        public FeedbackPanel getFeedbackPanel() {
+            return feedbackPanel;
+        }
+    } // class EditCreatorDialog.Content
+
+    public AddKeywordDialog(final String id) {
+        super(id, new Model<String>("Add Keyword"));
+        setInitialWidth(400);
+    }
+
+    @Override
+    protected ModalEditDialogBase<String>.ContentPanel
+            createContentPanel(String id, IModel<String> model) {
+        return new Content(id, model);
+    }
+
+    @Override
+    protected final IModel<String> newInstanceModel() {
+        return Model.of("");
+    }
+
+    @Override
+    protected final IModel<String> createEmptyModel() {
+        return new Model<String>();
+    }
+
+    @Override
+    protected String getCssClass() {
+        return "addKeywordDialog";
+    }
+
+} // class AddKeywordDialog
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/AddResourcesDialog$ButtonBar.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/AddResourcesDialog$ButtonBar.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/AddResourcesDialog$ButtonBar.html	(revision 5623)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org/">
+<head />
+<body>
+<wicket:panel>
+  <input wicket:id="addButton"
+         type="submit" class="button yesButton" value="Add" />
+  <input wicket:id="cancelButton"
+         type="submit"  class="button noButton" value="Cancel" />
+</wicket:panel>
+</body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/AddResourcesDialog$Content.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/AddResourcesDialog$Content.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/AddResourcesDialog$Content.html	(revision 5623)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:wicket="http://wicket.apache.org/">
+    <head />
+    <body>
+        <wicket:panel>
+            <form wicket:id="addResourcesForm">
+                <fieldset>
+                    <div class="required">
+                        <label id="typelabel" class="tooltipparent" for="add_resources_type">Type
+                            <span class="tooltipcontent">
+                                Type of reference<br /><br />
+                                Metadata: the referenced item is a CMDI metadata document that
+                                <em>describes</em> one or more resources<br /><br />
+                                Resource: the reference item is a resource that can be accessed
+                                directly through the specified URI
+                            </span>
+                        </label>
+                        <select wicket:id="type" id="add_resources_type"></select>
+                    </div>
+                    <div class="required">
+                        <label id="referenceslabel" class="tooltipparent" for="add_resources_refs">References
+                            <span class="tooltipcontent">
+                                List of references of the specified type to add.
+                                Each line should consist of one PID or URI.
+                            </span>
+                        </label>
+                        <textarea wicket:id="references"
+                                  id="add_resources_refs" rows="24" cols="30"></textarea>
+                    </div>
+                </fieldset>
+                <div wicket:id="feedback"></div>
+            </form>
+        </wicket:panel>
+    </body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/AddResourcesDialog.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/AddResourcesDialog.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/AddResourcesDialog.java	(revision 5623)
@@ -0,0 +1,185 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.wizard;
+
+import java.io.Serializable;
+import java.util.Arrays;
+
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.behavior.AttributeAppender;
+import org.apache.wicket.markup.html.form.AbstractTextComponent;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.EnumChoiceRenderer;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.panel.FeedbackPanel;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.validation.IValidatable;
+import org.apache.wicket.validation.Validatable;
+import org.apache.wicket.validation.ValidationError;
+import org.apache.wicket.validation.validator.AbstractValidator;
+
+import eu.clarin.cmdi.virtualcollectionregistry.gui.dialog.ModalDialogBase;
+import eu.clarin.cmdi.virtualcollectionregistry.model.Resource;
+import eu.clarin.cmdi.virtualcollectionregistry.service.impl.ReferenceValidator;
+
+@SuppressWarnings("serial")
+public abstract class AddResourcesDialog extends ModalDialogBase {
+    private static final class Data implements Serializable {
+        private Resource.Type type;
+        private String[] references;
+
+        public Resource[] getResources() {
+            Resource[] value = null;
+            if ((type != null) && (references != null) &&
+                    (references.length > 0)) {
+                value = new Resource[references.length];
+                int i = 0;
+                for (String ref : references) {
+                    value[i++] = new Resource(type, ref);
+                }
+            }
+            return value;
+        }
+    } // class AddResourcesDialog.Data
+
+    private static final class Content extends Panel {
+        private final Form<Data> form;
+        private final FeedbackPanel feedbackPanel;
+
+        public Content(String id) {
+            super(id);
+            add(new AttributeAppender("class",
+                    new Model<String>("editDialog addResourcesDialog"), " "));
+            form = new Form<Data>("addResourcesForm",
+                    new CompoundPropertyModel<Data>(null));
+            final DropDownChoice<Resource.Type> typeChoice =
+                new DropDownChoice<Resource.Type>("type",
+                        Arrays.asList(Resource.Type.values()),
+                        new EnumChoiceRenderer<Resource.Type>(this));
+            typeChoice.setRequired(true);
+            form.add(typeChoice);
+            final AbstractTextComponent<String[]> referencesArea =
+                new AbstractTextComponent<String[]>("references") {
+                    @Override
+                    protected void convertInput() {
+                        final String input = getRawInput();
+                        if (input != null) {
+                            final String[] refs = input.split("[,;\\s]+");
+                            setConvertedInput(refs);
+                        } else {
+                            setConvertedInput(null);
+                        }
+                    }
+                };
+            referencesArea.setRequired(true);
+            referencesArea.add(new AbstractValidator<String[]>() {
+                @Override
+                protected void onValidate(IValidatable<String[]> input) {
+                    String[] refs = input.getValue();
+                    if (refs != null) {
+                        ReferenceValidator v = new ReferenceValidator();
+                        for (String ref : refs) {
+                            if (ref.length() > 255) {
+                                ValidationError ve = new ValidationError();
+                                ve.setMessage("'" + ref +
+                                        "' is larger than 255 characters");
+                                input.error(ve);
+                                continue;
+                            }
+                            Validatable<String> w =
+                                new Validatable<String>(ref);
+                            v.validate(w);
+                            if (!w.isValid()) {
+                                ValidationError ve = new ValidationError();
+                                ve.setMessage("'" + ref +
+                                        "' is not valid uri");
+                                input.error(ve);
+                            }
+                        }
+                    }
+                }
+            });
+            form.add(referencesArea);
+            feedbackPanel = new FeedbackPanel("feedback");
+            feedbackPanel.setOutputMarkupId(true);
+            form.add(feedbackPanel);
+            add(form);
+        }
+
+        public Form<Data> getForm() {
+            return form;
+        }
+
+        public FeedbackPanel getFeedbackPanel() {
+            return feedbackPanel;
+        }
+    } // class AddResourcesDialog.Content
+
+    private final class ButtonBar extends Panel {
+        public ButtonBar(String id, Form<?> form) {
+            super(id);
+            final AjaxButton addButton = new AjaxButton("addButton",
+                    new Model<String>("Add"), form) {
+                @Override
+                protected void onError(AjaxRequestTarget target, Form<?> form) {
+                    target.addComponent(contentPanel.getFeedbackPanel());
+                    super.onError(target, form);
+                }
+
+                @Override
+                protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+                    AddResourcesDialog.this.close(target);
+                    final Data data = (Data) form.getModelObject();
+                    final Resource[] resources = data.getResources();
+                    if (resources != null) {
+                        AddResourcesDialog.this.onSubmit(target, resources);
+                    }
+                    form.setModelObject(null);
+                }
+            };
+            add(addButton);
+            final AjaxButton cancelButton =
+                new AjaxButton("cancelButton",
+                        new Model<String>("Cancel"), form) {
+                @Override
+                protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+                    AddResourcesDialog.this.close(target);
+                    form.setModelObject(null);
+                }
+            };
+            cancelButton.setDefaultFormProcessing(false);
+            add(cancelButton);
+        }
+    } // class EditCreatorDialog.ButtonBar
+
+    private Content contentPanel;
+
+    public AddResourcesDialog(final String id) {
+        super(id, new Model<String>("Add Multiple Resources"));
+        setOutputMarkupId(true);
+        setInitialWidth(600);
+    }
+
+    @Override
+    protected Panel createContent(String id) {
+        contentPanel = new Content(id);
+        contentPanel.getForm().removePersistentFormComponentValues(true);
+        return contentPanel;
+    }
+
+    @Override
+    protected Panel createButtonBar(String id) {
+        return new ButtonBar(id, contentPanel.getForm());
+    }
+
+    @Override
+    public void show(AjaxRequestTarget target) {
+        contentPanel.getForm().setModelObject(new Data());
+        super.show(target);
+    }
+
+    public abstract void onSubmit(AjaxRequestTarget target,
+            Resource[] resources);
+
+} // AddResourcesDialog
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/CreateVirtualCollectionWizard$CreatorsStep$ActionsPanel.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/CreateVirtualCollectionWizard$CreatorsStep$ActionsPanel.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/CreateVirtualCollectionWizard$CreatorsStep$ActionsPanel.html	(revision 5623)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org/">
+<head />
+<body>
+<wicket:panel>
+  <a wicket:id="edit" href="#" class="edit"><span>[edit]</span></a>
+  <a wicket:id="delete" href="#" class="delete"><span>[delete]</span></a>
+</wicket:panel>
+</body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/CreateVirtualCollectionWizard$CreatorsStep.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/CreateVirtualCollectionWizard$CreatorsStep.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/CreateVirtualCollectionWizard$CreatorsStep.html	(revision 5623)
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:wicket="http://wicket.apache.org/">
+    <head />
+    <body>
+        <wicket:panel>
+            <div style="display: none" wicket:id="editCreatorDialog"></div>
+            <div style="display: none" wicket:id="deleteCreatorDialog"></div>
+            <div id="creatorfields" class="fieldset">
+                <div class="extrainfo">
+                    <a href="#" class="extrainfotoggle"><span>[info]</span></a>
+                    <div class="notes">
+                        <h4>Add one or more creators</h4>
+                        <p>
+                            Add a creator for each person involved in the 
+                            creation of this virtual collection.
+                        </p>
+                        <p class="last">
+                            Use the 'add me' action to add a new creator with as
+                            many of your details already filled in, depending on
+                            the available information.
+                        </p>
+                    </div>
+                </div>
+                <label>Creators<br />
+                    <a id="add" href="#" wicket:id="add" class="add tooltipparent"><span>[add]</span><span class="tooltipcontent">Add a new creator</span></a><br />
+                    <a id="addme" href="#" wicket:id="addme" class="add tooltipparent"><span>[add me]</span><span class="tooltipcontent">Add a new creator with the available user details already filled in</span></a>
+                </label>
+                <table wicket:id="creatorsTable" class="creatorsTable display"></table>
+            </div>
+        </wicket:panel>
+    </body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/CreateVirtualCollectionWizard$GeneralStep.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/CreateVirtualCollectionWizard$GeneralStep.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/CreateVirtualCollectionWizard$GeneralStep.html	(revision 5623)
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org/">
+<head />
+    <body>
+        <wicket:panel>
+            <div style="display: none" wicket:id="addKeywordDialog"></div>
+            <div style="display: none" wicket:id="deleteKeywordDialog"></div>
+            <fieldset>
+                <div class="extrainfo">
+                    <a href="#" class="extrainfotoggle"><span>[info]</span></a>
+                    <div class="notes">
+                        <h4>Provide general information</h4>
+                        <p>
+                            Use the form to fill in the general information for this virtual collection.
+                            Name and type are mandatory. It is highly recommended to write a short description,
+                            add one or more keywords and select a purpose and a reproducibility indication.
+                        </p>
+                        <p class="last">
+                            Hover over the labels of the individual fields to get more information.
+                        </p>
+                    </div>
+                </div>
+                <div class="required">
+                    <label id="namelabel" class="tooltipparent" for="gen_vc_name">Name
+                        <span class="tooltipcontent">
+                            A short but descriptive name of the virtual collection for listings and views
+                        </span>
+                    </label>
+                    <input wicket:id="name"
+                           id="gen_vc_name" type="text" size="64" maxlength="255"/>
+                </div>
+                <div class="required">
+                    <label id="typelabel" class="tooltipparent" for="gen_vc_type">Type
+                        <span class="tooltipcontent">
+                            Type of Virtual Collection, either intensional or extensional<br /><br /> 
+                            <b>Extensional</b>: Type of virtual collection that explicitly enumerates the references to resources or metadata documents that make up the collection<br /><br /> 
+                            <b>Intensional</b>: Type of virtual collection that defines a query by which the items of the collection can be retrieved ad-hoc from a secondary service <em>(experimental, use at own risk!)</em>
+                        </span>
+                    </label>
+                    <select wicket:id="type" id="gen_vc_type"></select>
+                </div>
+
+                <div class="optional">
+                    <label id="descriptionlabel" class="tooltipparent" for="gen_vc_desc">Description
+                        <span class="tooltipcontent">
+                            A prose description of this virtual collection
+                        </span>
+                    </label>
+                    <textarea wicket:id="description"
+                              id="gen_vc_desc" cols="80" rows="8"></textarea>
+                </div>
+                <div class="optional">
+                    <label id="purposelabel" class="tooltipparent" for="gen_vc_purpose">Purpose
+                        <span class="tooltipcontent">
+                            An indication of the intended usage of the present virtual collection<br /><br /> 
+                            <b>Research</b>: The virtual collection bundles resources that are relevant to a specific research (question).<br /><br /> 
+                            <b>Reference</b>: The virtual collection bundles resources, that are to be cited in a publication.<br /><br /> 
+                            <b>Sample</b>: This virtual collection bundles is intended to serve as an sample for research data<br /><br /> 
+                            <b>Future-use</b>: The purpose of this virtual collection is not specified yet. Used in published collection is advised against.
+                        </span>
+                    </label>
+                    <select wicket:id="purpose" id="gen_vc_purpose"></select>
+                </div>
+                <div class="optional">
+                    <label id="reproducibilitylabel" class="tooltipparent" for="gen_vc_reproducibility">Reproducibility
+                        <span class="tooltipcontent">
+                            An indication of the degree to which results obtained from processing of the present collection can be expected to be stable<br /><br />
+                            <b>Intended</b>: Processing results can be expected to remain stable<br /><br />
+                            <b>Fluctuating</b>: Processing results may vary<br /><br />
+                            <b>Untended</b>: No claims with respect to the stability of the processing results are made
+                        </span>
+                    </label>
+                    <select wicket:id="reproducibility"
+                            id="gen_vc_reproducibility"></select>
+                </div>
+                <div class="optional">
+                    <label id="repronotelabel" class="tooltipparent" for="gen_vc_reproducibility_notice">Reproducibility Notice
+                        <span class="tooltipcontent">
+                            Optional note describing the expected reproducibility of processing results in more detail
+                        </span>
+                    </label>
+                    <textarea wicket:id="reproducibilityNotice"
+                              id="gen_vc_reproducibility_notice" cols="80" rows="5"></textarea>
+                </div>
+                <div class="optional">
+                    <label id="keywordslabel" class="tooltipparent" >Keywords<br /><a href="#"
+                                                                                      wicket:id="keywordsAdd" class="add"><span>[add]</span></a>
+                        <span class="tooltipcontent">
+                            A set of words or short phrases, each signifying a salient facet of the present virtual collection
+                        </span>
+                    </label>
+                    <div wicket:id="keywordsList" class="keywordsList">
+                        <ul>
+                            <li wicket:id="keywords">
+                                <span wicket:id="itemText">item text</span>
+                                <a wicket:id="itemRemove" href="#"><span class="delete">[delete]</span></a>
+                            </li>
+                        </ul>
+                    </div>
+                </div>
+            </fieldset>
+        </wicket:panel>
+    </body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/CreateVirtualCollectionWizard$GeneratedByStep.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/CreateVirtualCollectionWizard$GeneratedByStep.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/CreateVirtualCollectionWizard$GeneratedByStep.html	(revision 5623)
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:wicket="http://wicket.apache.org/">
+<head />
+<body>
+<wicket:panel>
+<fieldset>
+  <div class="sidenotes">
+    <h4>Note</h4>
+    <p class="last">
+        Intensional virtual collections are very experimental. 
+        <strong>Use at own risk!</strong>
+    </p>
+  </div>
+  <div class="required">
+     <label id="descriptionlabel" class="tooltipparent" for="gen_desc">Description
+         <span class="tooltipcontent">
+             A prose description of the procedure by which the collection items can be retrieved from the external service.
+         </span>
+     </label>
+     <textarea wicket:id="generatedBy.description"
+               id="gen_desc" rows="5" cols="80"></textarea>
+  </div>
+  <div class="optional">
+     <label id="urilabel" class="tooltipparent" for="gen_uri">URI
+         <span class="tooltipcontent">
+            The location of the service from which the items should be retrieved. This value may be a persistent identifier, but could also be a plain URI although this is advised against for published collections.
+         </span>
+     </label>
+     <input wicket:id="generatedBy.uri"
+            id="gen_uri" type="text" size="64" maxlength="255" />
+  </div>
+  <div class="optional">
+     <label id="profilelabel" class="tooltipparent" for="gen_query_profile">Query Profile
+         <span class="tooltipcontent">
+            Identifier of the mechanism, i.e. the protocol to be used, by which the members of the virtual collection should be retrieved. A application exploiting the query can use this to use a proper driver to talk to the service. Example: In case of CLARIN-FCS access the endpoint by FCS-compatible means.
+         </span>
+     </label>
+     <input wicket:id="generatedBy.query.profile"
+            id="gen_query_profile" type="text" size="64" maxlength="255" />
+  </div>
+  <div class="optional">
+     <label id="valuelabel" class="tooltipparent" for="gen_query_value">Query value
+         <span class="tooltipcontent">
+            The query that should be passed on to the service by which it can look up the items that are part of this collection. This value should be in the query language supported by the service. Example: In case of CLARIN-FCS, this value is the CQL query to be send to the endpoint.
+         </span>
+     </label>
+     <textarea wicket:id="generatedBy.query.value"
+               id="gen_query_value" rows="5" cols="80"></textarea>
+  </div>
+</fieldset>
+</wicket:panel>
+</body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/CreateVirtualCollectionWizard$ResourcesStep$ActionsPanel.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/CreateVirtualCollectionWizard$ResourcesStep$ActionsPanel.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/CreateVirtualCollectionWizard$ResourcesStep$ActionsPanel.html	(revision 5623)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org/">
+<head />
+<body>
+<wicket:panel>
+  <a wicket:id="edit" href="#" class="edit"><span>[edit]</span></a>
+  <a wicket:id="delete" href="#" class="delete"><span>[delete]</span></a>
+</wicket:panel>
+</body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/CreateVirtualCollectionWizard$ResourcesStep$MoveItemPanel.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/CreateVirtualCollectionWizard$ResourcesStep$MoveItemPanel.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/CreateVirtualCollectionWizard$ResourcesStep$MoveItemPanel.html	(revision 5623)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org/">
+    <head />
+    <body>
+        <wicket:panel>
+            <a wicket:id="move" href="#" class="move" title="Move reference"><span>[move]</span></a>
+            <a wicket:id="cancel" href="#" class="cancelmove" title="Cancel move"><span>[cancel]</span></a>
+            <a wicket:id="target" href="#" class="target" title="Drop reference here"><span>[insert]</span></a>
+        </wicket:panel>
+    </body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/CreateVirtualCollectionWizard$ResourcesStep.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/CreateVirtualCollectionWizard$ResourcesStep.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/CreateVirtualCollectionWizard$ResourcesStep.html	(revision 5623)
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:wicket="http://wicket.apache.org/">
+    <head />
+    <body>
+        <wicket:panel>
+            <div style="display: none" wicket:id="editResourceDialog"></div>
+            <div style="display: none" wicket:id="deleteResourceDialog"></div>
+            <div style="display: none" wicket:id="addResourcesDialog"></div>
+            <div id="resourcesfields" class="fieldset">
+                <div class="extrainfo">
+                    <a href="#" class="extrainfotoggle"><span>[info]</span></a>
+                    <div class="notes">
+                        <h4>Add resource or metadata references</h4>
+                        <p>
+                            Click <strong>add</strong> to add an individual reference of the 
+                            type 'Metadata' or 'Resource' and optionally add a 
+                            label and/or description. 
+                        </p>
+                        <p>
+                            Click <strong>add more</strong> to add multiple references (one per
+                            line) of one type without labels or resources.
+                            Individual resources can be edited at any stage.
+                        </p>
+                        <p class="last">
+                            It is recommended to only use <em>persistent 
+                            identifiers</em> as references. The following are
+                            examples of valid persistent identifiers:
+                            <ul>
+                                <li>hdl:1839/00-0000-0000-0001-305B-C</li>
+                                <li>doi:10.10.1038/nphys1170</li>
+                                <li>http://hdl.handle.net/1839/00-0000-0000-0000-0000-4</li>
+                                <li>http://dx.doi.org/10.1002/0470841559.ch1</li>
+                            </ul>
+                        </p>
+                    </div>
+                </div>
+                <div wicket:id="resourcesContainer">
+                    <label class="required">Resources<br />
+                        <a id="add" wicket:id="add" href="#" class="add tooltipparent"><span>[add]</span><span class="tooltipcontent">Add a single new resource or metadata reference with an optional label and/or description</span></a><br />
+                        <a id="addmore" wicket:id="addMore" href="#" class="addMore tooltipparent"><span>[add more]</span><span class="tooltipcontent">Add one or reference of the same type</span></a>
+                    </label>
+                    <table wicket:id="resourcesTable" class="resourcesTable display"></table>
+                </div>
+            </div>
+        </wicket:panel>
+    </body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/CreateVirtualCollectionWizard.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/CreateVirtualCollectionWizard.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/CreateVirtualCollectionWizard.java	(revision 5623)
@@ -0,0 +1,847 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.wizard;
+
+import eu.clarin.cmdi.virtualcollectionregistry.gui.ApplicationSession;
+import eu.clarin.cmdi.virtualcollectionregistry.gui.TooltipBehavior;
+import eu.clarin.cmdi.virtualcollectionregistry.gui.VolatileEntityModel;
+import eu.clarin.cmdi.virtualcollectionregistry.gui.dialog.ConfirmationDialog;
+import eu.clarin.cmdi.virtualcollectionregistry.gui.pages.ReferenceLinkPanel;
+import eu.clarin.cmdi.virtualcollectionregistry.model.Creator;
+import eu.clarin.cmdi.virtualcollectionregistry.model.Resource;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+import eu.clarin.cmdi.virtualcollectionregistry.service.CreatorProvider;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+import org.apache.wicket.Component;
+import org.apache.wicket.ResourceReference;
+import org.apache.wicket.Session;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.behavior.AttributeAppender;
+import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
+import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.HeaderlessColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
+import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
+import org.apache.wicket.extensions.wizard.dynamic.DynamicWizardModel;
+import org.apache.wicket.extensions.wizard.dynamic.DynamicWizardStep;
+import org.apache.wicket.extensions.wizard.dynamic.IDynamicWizardStep;
+import org.apache.wicket.markup.ComponentTag;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.EnumChoiceRenderer;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.FormComponent;
+import org.apache.wicket.markup.html.form.RequiredTextField;
+import org.apache.wicket.markup.html.form.TextArea;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.form.validation.AbstractFormValidator;
+import org.apache.wicket.markup.html.internal.HtmlHeaderContainer;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.ListView;
+import org.apache.wicket.markup.html.list.OddEvenListItem;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.markup.html.resources.JavascriptResourceReference;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.model.AbstractReadOnlyModel;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.StringResourceModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+import org.apache.wicket.validation.validator.StringValidator;
+import org.apache.wicket.validation.validator.UrlValidator;
+import org.odlabs.wiquery.core.commons.CoreJavaScriptResourceReference;
+
+@SuppressWarnings("serial")
+public abstract class CreateVirtualCollectionWizard extends WizardBase {
+
+    @SpringBean
+    private CreatorProvider creatorProvider;
+    
+    private final static ResourceReference TOOLTIP_JAVASCRIPT_REFERENCE = 
+            new JavascriptResourceReference(CreateVirtualCollectionWizard.class, "wizardhelp.js");
+
+    @Override
+    public void renderHead(HtmlHeaderContainer container) {
+        super.renderHead(container);
+        // Javascript dependencies for this page (jQuery tooltips)
+        container.getHeaderResponse().renderJavascriptReference(CoreJavaScriptResourceReference.get());
+        container.getHeaderResponse().renderJavascriptReference(TooltipBehavior.QTIP_JAVASCRIPT_RESOURCE);
+        container.getHeaderResponse().renderJavascriptReference(TOOLTIP_JAVASCRIPT_REFERENCE);
+    }
+    
+    private final class GeneralStep extends DynamicWizardStep {
+
+        private final class DeleteKeywordDialog extends ConfirmationDialog {
+
+            private String keyword;
+
+            public DeleteKeywordDialog(String id,
+                    final Component updateComponent) {
+                super(id, updateComponent);
+            }
+
+            @Override
+            public void onConfirm(AjaxRequestTarget target) {
+                vc.getObject().getKeywords().remove(keyword);
+            }
+
+            public void show(AjaxRequestTarget target, String keyword) {
+                this.keyword = keyword;
+                super.show(target, new StringResourceModel("keywords.deleteconfirm", null, new Object[]{keyword}));
+            }
+        } // class CreateVirtualCollectionWizard.GeneralStep.DeleteKeywordDialog
+
+        private final class KeywordsList extends WebMarkupContainer {
+
+            private final ListView<String> itemsView;
+
+            public KeywordsList(String id, final IModel<List<String>> itemsModel) {
+                super(id);
+                setOutputMarkupId(true);
+
+                itemsView = new ListView<String>("keywords", itemsModel) {
+                    @Override
+                    protected void populateItem(final ListItem<String> item) {
+                        final IModel<String> model = item.getModel();
+                        item.add(new Label("itemText", model.getObject()));
+                        item.add(new AjaxLink<String>("itemRemove") {
+                            @Override
+                            public void onClick(AjaxRequestTarget target) {
+                                deleteKeywordDialog.show(target,
+                                        model.getObject());
+                            }
+                        });
+                    }
+
+                    @Override
+                    protected ListItem<String> newItem(int index) {
+                        final IModel<String> model
+                                = getListItemModel(getModel(), index);
+                        return new OddEvenListItem<String>(index, model) {
+                            @Override
+                            protected void onComponentTag(ComponentTag tag) {
+                                super.onComponentTag(tag);
+                                if (getIndex() == 0) {
+                                    tag.append("class", "first", " ");
+                                }
+                            }
+                        };
+                    }
+                };
+                add(itemsView);
+            }
+        } // class CreateVirtualCollectionWizard.GeneralStep.KeywordsList
+
+        private final AddKeywordDialog addKeywordDialog;
+        private final DeleteKeywordDialog deleteKeywordDialog;
+
+        public GeneralStep() {
+            super(null, "General", null, vc);
+            setDefaultModel(new CompoundPropertyModel<VirtualCollection>(vc));
+            final TextField<String> nameField
+                    = new RequiredTextField<String>("name");
+            nameField.add(new StringValidator.MaximumLengthValidator(255));
+            add(nameField);
+            
+            final DropDownChoice<VirtualCollection.Type> typeChoice
+                    = new DropDownChoice<VirtualCollection.Type>("type",
+                            Arrays.asList(VirtualCollection.Type.values()),
+                            new EnumChoiceRenderer<VirtualCollection.Type>(this));
+            typeChoice.setRequired(true);
+//            typeChoice.add(new TooltipBehavior(new StringResourceModel("type.tooltip", CreateVirtualCollectionWizard.this, null)));
+            add(typeChoice);
+            
+            add(new TextArea<String>("description"));
+            final DropDownChoice<VirtualCollection.Purpose> purposeChoice
+                    = new DropDownChoice<VirtualCollection.Purpose>("purpose",
+                            Arrays.asList(VirtualCollection.Purpose.values()),
+                            new EnumChoiceRenderer<VirtualCollection.Purpose>(this));
+            add(purposeChoice);
+            final DropDownChoice<VirtualCollection.Reproducibility> reproducibilityChoice
+                    = new DropDownChoice<VirtualCollection.Reproducibility>("reproducibility",
+                            Arrays.asList(VirtualCollection.Reproducibility.values()),
+                            new EnumChoiceRenderer<VirtualCollection.Reproducibility>(this));
+            add(reproducibilityChoice);
+            final TextArea<String> reproducibilityNoticeArea
+                    = new TextArea<String>("reproducibilityNotice");
+            add(reproducibilityNoticeArea);
+
+            final KeywordsList keywordList
+                    = new KeywordsList("keywordsList",
+                            new PropertyModel<List<String>>(vc, "keywords"));
+            add(keywordList);
+            add(new AjaxLink<String>("keywordsAdd") {
+                @Override
+                public void onClick(AjaxRequestTarget target) {
+                    addKeywordDialog.show(target);
+                }
+            });
+
+            addKeywordDialog = new AddKeywordDialog("addKeywordDialog") {
+                @Override
+                public void onSubmit(AjaxRequestTarget target, String keyword) {
+                    final List<String> keywords = vc.getObject().getKeywords();
+                    if (!keywords.contains(keyword)) {
+                        keywords.add(keyword);
+                    }
+                    target.addComponent(keywordList);
+                }
+            };
+            add(addKeywordDialog);
+
+            deleteKeywordDialog
+                    = new DeleteKeywordDialog("deleteKeywordDialog", keywordList);
+            add(deleteKeywordDialog);
+        }
+
+        @Override
+        public boolean isLastStep() {
+            return false;
+        }
+
+        @Override
+        public IDynamicWizardStep next() {
+            return new CreatorsStep(this);
+        }
+
+        @Override
+        public void applyState() {
+            super.applyState();
+            switch (vc.getObject().getType()) {
+                case EXTENSIONAL:
+                    vc.getObject().setGeneratedBy(null);
+                    break;
+                case INTENSIONAL:
+                    vc.getObject().getResources().clear();
+                    break;
+            }
+        }
+    } // class CreateVirtualCollectionWizard.GeneralStep
+
+    private final class CreatorsStep extends DynamicWizardStep {
+
+        private final class ActionsPanel extends Panel {
+
+            public ActionsPanel(String id, final IModel<Creator> model) {
+                super(id, model);
+                setRenderBodyOnly(true);
+                final AjaxLink<Creator> editLink
+                        = new AjaxLink<Creator>("edit") {
+                            @Override
+                            public void onClick(AjaxRequestTarget target) {
+                                editCreatorDialog.show(target, model);
+                            }
+                        };
+                add(editLink);
+                final AjaxLink<Creator> deleteLink
+                        = new AjaxLink<Creator>("delete") {
+                            @Override
+                            public void onClick(AjaxRequestTarget target) {
+                                deleteCreatorDialog.showCreator(target, model);
+                            }
+                        };
+                add(deleteLink);
+            }
+        } // class CreateVirtualCollectionWizard.CreatorsStep.ActionsPanel
+
+        private final class DeleteCreatorDialog extends ConfirmationDialog {
+
+            private IModel<Creator> creator;
+
+            public DeleteCreatorDialog(String id,
+                    final Component updateComponent) {
+                super(id, updateComponent);
+                setInitialWidth(400);
+            }
+
+            @Override
+            public void onConfirm(AjaxRequestTarget target) {
+                if (creator != null) {
+                    vc.getObject().getCreators().remove(creator.getObject());
+                }
+            }
+
+            public void showCreator(AjaxRequestTarget target, IModel<Creator> creator) {
+                this.creator = creator;
+                super.show(target,
+                        new StringResourceModel("creators.deleteconfirm",
+                                creator));
+            }
+        } // class CreateVirtualCollectionWizard.CreatorsStep.DeleteCreatorDialog
+
+        private final EditCreatorDialog editCreatorDialog;
+        private final DeleteCreatorDialog deleteCreatorDialog;
+
+        public CreatorsStep(IDynamicWizardStep previousStep) {
+            super(previousStep, "Creators", null, vc);
+            final DataTable<Creator> creatorsTable
+                    = new AjaxFallbackDefaultDataTable<Creator>("creatorsTable",
+                            createColumns(),
+                            new SortableDataProvider<Creator>() {
+                                @Override
+                                public Iterator<? extends Creator>
+                                iterator(int first, int count) {
+                                    return vc.getObject().getCreators().listIterator(first);
+                                }
+
+                                @Override
+                                public IModel<Creator> model(Creator creator) {
+                                    return new VolatileEntityModel<Creator>(creator);
+                                }
+
+                                @Override
+                                public int size() {
+                                    return vc.getObject().getCreators().size();
+                                }
+                            },
+                            8);
+            creatorsTable.setOutputMarkupId(true);
+            add(creatorsTable);
+
+            editCreatorDialog = new EditCreatorDialog("editCreatorDialog") {
+                @Override
+                public void onSubmit(AjaxRequestTarget target, Creator creator) {
+                    // create a copy first because retrieving the creators may
+                    // reset the state of the object
+                    final Creator copy = creator.getCopy();
+                    final List<Creator> creators = vc.getObject().getCreators();
+                    if (creators.contains(creator)) {
+                        // update existig creator (needed since we're dealing with a volatile instance)
+                        creator.setValuesFrom(copy);
+                    } else {
+                        // new entry, add
+                        creators.add(creator);
+                    }
+                    target.addComponent(creatorsTable);
+                }
+            };
+            add(editCreatorDialog);
+
+            deleteCreatorDialog
+                    = new DeleteCreatorDialog("deleteCreatorDialog", creatorsTable);
+            add(deleteCreatorDialog);
+
+            add(new AjaxLink<Object>("add") {
+                @Override
+                public void onClick(AjaxRequestTarget target) {
+                    editCreatorDialog.show(target);
+                }
+            });
+            add(new AjaxLink("addme") {
+
+                @Override
+                public void onClick(AjaxRequestTarget target) {
+                    final Creator creator = creatorProvider.getCreator(ApplicationSession.get().getPrincipal());
+                    if (creator.getPerson() == null) {
+                        Session.get().error("Could not retrieve required user information");
+                        setResponsePage(getPage());
+                    } else {
+                        vc.getObject().getCreators().add(creator);
+                        target.addComponent(creatorsTable);
+                    }
+                }
+            });
+        }
+
+        @Override
+        public boolean isLastStep() {
+            return false;
+        }
+
+        @Override
+        public IDynamicWizardStep next() {
+            switch (vc.getObject().getType()) {
+                case EXTENSIONAL:
+                    return new ResourcesStep(this);
+                case INTENSIONAL:
+                    return new GeneratedByStep(this);
+                default:
+                    throw new InternalError("bad vc type");
+            } // switch
+        }
+
+        @SuppressWarnings("unchecked")
+        private IColumn<Creator>[] createColumns() {
+            final IColumn<?>[] columns = new IColumn<?>[]{
+                new PropertyColumn<Creator>(new Model<String>("Person"),
+                "person"),
+                new PropertyColumn<Creator>(new Model<String>("EMail"),
+                "email"),
+                new PropertyColumn<Creator>(new Model<String>(
+                "Organisation"), "organisation"),
+                new HeaderlessColumn<Creator>() {
+                    @Override
+                    public void populateItem(Item<ICellPopulator<Creator>> item, String compontentId, IModel<Creator> model) {
+                        item.add(new ActionsPanel(compontentId, model));
+                    }
+
+                    @Override
+                    public String getCssClass() {
+                        return "action";
+                    }
+                }
+            };
+            return (IColumn<Creator>[]) columns;
+        }
+    } // class CreateVirtualCollectionWizard.CreatorsStep
+
+    private final class ResourcesStep extends DynamicWizardStep {
+
+        private final WebMarkupContainer resourcesContainer;
+
+        private final class ActionsPanel extends Panel {
+
+            public ActionsPanel(String id, final IModel<Resource> model) {
+                super(id, model);
+                setRenderBodyOnly(true);
+                final AjaxLink<Resource> editLink
+                        = new AjaxLink<Resource>("edit") {
+                            @Override
+                            public void onClick(AjaxRequestTarget target) {
+                                editResourceDialog.show(target, model);
+                            }
+
+                            @Override
+                            protected void onConfigure() {
+                                // only allow when not moving
+                                setVisible(movingResource.getObject() == null);
+                            }
+                        };
+                add(editLink);
+                final AjaxLink<Resource> deleteLink
+                        = new AjaxLink<Resource>("delete") {
+                            @Override
+                            public void onClick(AjaxRequestTarget target) {
+                                deleteResourceDialog.showResource(target, model);
+                            }
+
+                            @Override
+                            protected void onConfigure() {
+                                // only allow when not moving
+                                setVisible(movingResource.getObject() == null);
+                            }
+                        };
+                add(deleteLink);
+            }
+
+        }
+
+        private final class MoveItemPanel extends Panel {
+
+            public MoveItemPanel(String id, final IModel<Resource> model) {
+                super(id, model);
+
+                final AjaxLink<Resource> moveLink
+                        = new AjaxLink<Resource>("move") {
+
+                            @Override
+                            public void onClick(AjaxRequestTarget target) {
+                                movingResource.setObject(model.getObject());
+                                target.addComponent(resourcesContainer);
+                            }
+
+                            @Override
+                            protected void onConfigure() {
+                                // only allow to start moving when not moving
+                                setVisible(movingResource.getObject() == null);
+                            }
+
+                        };
+                add(moveLink);
+
+                final AjaxLink<Resource> cancelLink
+                        = new AjaxLink<Resource>("cancel") {
+
+                            @Override
+                            public void onClick(AjaxRequestTarget target) {
+                                movingResource.setObject(null);
+                                target.addComponent(resourcesContainer);
+                            }
+
+                            @Override
+                            protected void onConfigure() {
+                                // only allow cancelling resource being moved
+                                setVisible(model.getObject().equals(movingResource.getObject())
+                                );
+                            }
+
+                        };
+                add(cancelLink);
+
+                final AjaxLink<Resource> targetLink
+                        = new AjaxLink<Resource>("target") {
+
+                            @Override
+                            public void onClick(AjaxRequestTarget target) {
+                                final List<Resource> resources = vc.getObject().getResources();
+                                final Resource toMove = movingResource.getObject();
+                                try {
+                                    if (resources.remove(toMove)) {
+                                        final int targetIndex = resources.indexOf(model.getObject());
+                                        if (targetIndex >= 0) {
+                                            resources.add(targetIndex, toMove);
+                                            return;
+                                        }
+                                    }
+                                    Session.get().warn("Could not move reference");
+
+                                } finally {
+                                    movingResource.setObject(null);
+                                    target.addComponent(resourcesContainer);
+                                }
+                            }
+
+                            @Override
+                            protected void onConfigure() {
+                                final Resource toMove = movingResource.getObject();
+                                // only allow to drop when moving
+                                setVisible(toMove != null
+                                        && !toMove.equals(model.getObject())
+                                );
+                            }
+
+                        };
+
+                add(targetLink);
+            }
+        } // class CreateVirtualCollectionWizard.ResourcesStep.ActionsPanel
+
+        private final class DeleteResourceDialog extends ConfirmationDialog {
+
+            private IModel<Resource> resource;
+
+            public DeleteResourceDialog(String id,
+                    final Component updateComponenet) {
+                super(id, updateComponenet);
+                setInitialWidth(400);
+            }
+
+            @Override
+            public void onConfirm(AjaxRequestTarget target) {
+                if (resource != null) {
+                    vc.getObject().getResources().remove(resource.getObject());
+                }
+            }
+
+            public void showResource(AjaxRequestTarget target, IModel<Resource> resource) {
+                this.resource = resource;
+                super.show(target,
+                        new StringResourceModel("resources.deleteconfirm",
+                                resource));
+            }
+        } // class CreateVirtualCollectionWizard.CreatorsStep.DeleteResourceDialog
+
+        private final EditResourceDialog editResourceDialog;
+        private final DeleteResourceDialog deleteResourceDialog;
+
+        private IModel<Resource> movingResource = new Model<>();
+
+        public ResourcesStep(IDynamicWizardStep previousStep) {
+            super(previousStep, "Resources", null, vc);
+            resourcesContainer = new WebMarkupContainer("resourcesContainer");
+            resourcesContainer.setOutputMarkupId(true);
+            add(resourcesContainer);
+            final DataTable<Resource> resourcesTable
+                    = new AjaxFallbackDefaultDataTable<Resource>("resourcesTable",
+                            createColumns(),
+                            new SortableDataProvider<Resource>() {
+                                @Override
+                                public Iterator<? extends Resource>
+                                iterator(int first, int count) {
+                                    return vc.getObject().getResources().listIterator(first);
+                                }
+
+                                @Override
+                                public IModel<Resource> model(Resource resource) {
+                                    return new VolatileEntityModel<Resource>(resource);
+                                }
+
+                                @Override
+                                public int size() {
+                                    return vc.getObject().getResources().size();
+                                }
+                            },
+                            64) {
+
+                        @Override
+                        protected Item<Resource> newRowItem(String id, int index, final IModel<Resource> model) {
+                            final Item<Resource> item = super.newRowItem(id, index, model);
+                            // mark the row that is being moved
+                            item.add(new AttributeAppender("class", new AbstractReadOnlyModel<String>() {
+
+                                @Override
+                                public String getObject() {
+                                    if (model.getObject().equals(movingResource.getObject())) {
+                                        return "moving";
+                                    } else {
+                                        return "";
+                                    }
+                                }
+                            }, " "));
+                            return item;
+                        }
+
+                    };
+            resourcesTable.setOutputMarkupId(true);
+
+            // add 'moving' class if table is in moving mode
+            resourcesTable.add(new AttributeAppender("class", new AbstractReadOnlyModel<String>() {
+
+                @Override
+                public String getObject() {
+                    return movingResource.getObject() == null ? "" : "moving";
+                }
+            }, " "));
+            resourcesContainer.add(resourcesTable);
+
+            editResourceDialog = new EditResourceDialog("editResourceDialog") {
+                @Override
+                public void onSubmit(AjaxRequestTarget target,
+                        Resource resource) {
+                    // create a copy first because retrieving the resources may
+                    // reset the state of the object
+                    final Resource copy = resource.getCopy();
+                    final List<Resource> resources = vc.getObject().getResources();
+                    if (resources.contains(resource)) {
+                        // update existig resource (needed since we're dealing with a volatile instance)
+                        resource.valuesFrom(copy);
+                    } else {
+                        // new entry, add
+                        resources.add(resource);
+                    }
+                    target.addComponent(resourcesTable);
+                }
+            };
+            add(editResourceDialog);
+
+            deleteResourceDialog = new DeleteResourceDialog(
+                    "deleteResourceDialog", resourcesTable);
+            add(deleteResourceDialog);
+
+            final AddResourcesDialog addResourcesDialog
+                    = new AddResourcesDialog("addResourcesDialog") {
+                        @Override
+                        public void onSubmit(AjaxRequestTarget target,
+                                Resource[] resources) {
+                            for (Resource resource : resources) {
+                                if (!vc.getObject().getResources().contains(resource)) {
+                                    vc.getObject().getResources().add(resource);
+                                }
+                            }
+                            target.addComponent(resourcesTable);
+                        }
+
+                    };
+            add(addResourcesDialog);
+
+            resourcesContainer.add(new AjaxLink<Object>("add") {
+                @Override
+                public void onClick(AjaxRequestTarget target) {
+                    editResourceDialog.show(target);
+                }
+            });
+
+            resourcesContainer.add(new AjaxLink<Object>("addMore") {
+                @Override
+                public void onClick(AjaxRequestTarget target) {
+                    addResourcesDialog.show(target);
+                }
+            });
+
+            add(new AbstractFormValidator() {
+                @Override
+                public FormComponent<?>[] getDependentFormComponents() {
+                    return null;
+                }
+
+                @Override
+                public void validate(Form<?> form) {
+                    if (vc.getObject().getResources().isEmpty()) {
+                        form.error("An extensional collection requires at "
+                                + "least one resource.");
+                    }
+                }
+            });
+        }
+
+        @Override
+        public boolean isLastStep() {
+            return true;
+        }
+
+        @Override
+        public IDynamicWizardStep next() {
+            return null;
+        }
+
+        @SuppressWarnings("unchecked")
+        private IColumn<Resource>[] createColumns() {
+            final IColumn<?>[] columns = new IColumn<?>[]{
+                new AbstractColumn<Resource>(new Model<String>("Type")) {
+                    @Override
+                    public void populateItem(
+                            Item<ICellPopulator<Resource>> item,
+                            String componentId, IModel<Resource> model) {
+                        switch (model.getObject().getType()) {
+                            case METADATA:
+                                item.add(new Label(componentId, "Metadata"));
+                                break;
+                            case RESOURCE:
+                                item.add(new Label(componentId, "Resource"));
+                                break;
+                        }
+                    }
+
+                    @Override
+                    public String getCssClass() {
+                        return "type";
+                    }
+                },
+                new PropertyColumn<Resource>(
+                new Model<String>("Reference"), "ref") {
+
+                    @Override
+                    public void populateItem(Item<ICellPopulator<Resource>> item, String componentId, IModel<Resource> rowModel) {
+                        item.add(new ReferenceLinkPanel(componentId, rowModel));
+                    }
+
+                },
+                new HeaderlessColumn<Resource>() {
+                    @Override
+                    public void populateItem(
+                            Item<ICellPopulator<Resource>> item,
+                            String compontentId, IModel<Resource> model) {
+                        item.add(new ActionsPanel(compontentId, model));
+                    }
+
+                    @Override
+                    public String getCssClass() {
+                        return "action";
+                    }
+                },
+                new HeaderlessColumn<Resource>() {
+
+                    @Override
+                    public void populateItem(Item<ICellPopulator<Resource>> item, String componentId, IModel<Resource> model) {
+                        item.add(new MoveItemPanel(componentId, model));
+                    }
+
+                    @Override
+                    public String getCssClass() {
+                        return "move";
+                    }
+
+                }
+            };
+            return (IColumn<Resource>[]) columns;
+        }
+    } // class CreateVirtualCollectionWizard.ResourcesStep
+
+    private final class GeneratedByStep extends DynamicWizardStep {
+
+        public GeneratedByStep(IDynamicWizardStep previousStep) {
+            super(previousStep, "Intensional Collection Query", null, vc);
+            setDefaultModel(new CompoundPropertyModel<VirtualCollection>(vc));
+            final TextArea<String> descriptionArea
+                    = new TextArea<String>("generatedBy.description");
+            descriptionArea.setRequired(true);
+            add(descriptionArea);
+            final TextField<String> uriField
+                    = new TextField<String>("generatedBy.uri");
+            uriField.add(new StringValidator.MaximumLengthValidator(255));
+            uriField.add(new UrlValidator(UrlValidator.NO_FRAGMENTS));
+            add(uriField);
+            final TextField<String> queryProfileField
+                    = new TextField<String>("generatedBy.query.profile");
+            add(queryProfileField);
+            final TextArea<String> queryValueArea
+                    = new TextArea<String>("generatedBy.query.value");
+            add(queryValueArea);
+
+            add(new AbstractFormValidator() {
+                @Override
+                public FormComponent<?>[] getDependentFormComponents() {
+                    return new FormComponent[]{queryProfileField,
+                        queryValueArea};
+                }
+
+                @Override
+                public void validate(Form<?> form) {
+                    final String profile = queryProfileField.getInput();
+                    final String value = queryValueArea.getInput();
+                    if (profile.isEmpty() && !value.isEmpty()) {
+                        form.error("profile is required with value");
+                        queryProfileField.invalid();
+                    }
+                    if (!profile.isEmpty() && value.isEmpty()) {
+                        form.error("value is required with profile");
+                        queryValueArea.invalid();
+                    }
+                    if (profile.isEmpty() && value.isEmpty()) {
+                        /*
+                         * XXX: clear Query object as side-effect. This is
+                         * more a hack than a clean solution.
+                         */
+                        if (vc.getObject().getGeneratedBy() != null) {
+                            vc.getObject().getGeneratedBy().setQuery(null);
+                        }
+                    }
+                }
+            });
+        }
+
+        @Override
+        public boolean isLastStep() {
+            return true;
+        }
+
+        @Override
+        public IDynamicWizardStep next() {
+            return null;
+        }
+    } // class CreateVirtualCollectionWizard.GeneratedByStep
+
+    private final IModel<VirtualCollection> vc;
+
+    public CreateVirtualCollectionWizard(String id, IModel<VirtualCollection> vc) {
+        super(id);
+        if (vc == null) {
+            throw new IllegalArgumentException("vc == null");
+        }
+        this.vc = vc;
+        setDefaultModel(new CompoundPropertyModel<VirtualCollection>(this));
+        init(new DynamicWizardModel(new GeneralStep()));
+    }
+
+    public IModel<VirtualCollection> getVirtualCollectionModel() {
+        return vc;
+    }
+
+    @Override
+    public final void onCancel() {
+        onCancelWizard();
+    }
+
+    @Override
+    public final void onFinish() {
+        onFinishWizard(vc);
+    }
+
+    @Override
+    public void detachModels() {
+        super.detachModels();
+        vc.detach();
+    }
+
+    protected abstract void onCancelWizard();
+
+    protected abstract void onFinishWizard(IModel<VirtualCollection> vc);
+
+} // class CreateVirtualCollectionWizard
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/CreateVirtualCollectionWizard.properties
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/CreateVirtualCollectionWizard.properties	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/CreateVirtualCollectionWizard.properties	(revision 5623)
@@ -0,0 +1,3 @@
+keywords.deleteconfirm: Do you really want to delete "{0}"?
+creators.deleteconfirm: Do you really want to delete "${person}"?
+resources.deleteconfirm: Do you really want to delete "${ref}"?
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/EditCreatorDialog$Content.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/EditCreatorDialog$Content.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/EditCreatorDialog$Content.html	(revision 5623)
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:wicket="http://wicket.apache.org/">
+<head />
+<body>
+<wicket:panel>
+<form wicket:id="editCreatorForm">
+  <fieldset>
+    <div class="required">
+      <label for="edit_creator_person">Person</label>
+      <input wicket:id="person"
+             id="edit_creator_person" type="text" size="32" maxlength="255" />
+    </div>
+    <div class="optional">
+      <label for="edit_creator_address">Address</label>
+      <textarea wicket:id="address"
+              id="edit_creator_address" rows="4" cols="24"></textarea>
+    </div>
+    <div class="optional">
+      <label for="edit_creator_email">E-Mail</label>
+      <input wicket:id="email"
+             id="edit_creator_email" type="text"  size="32" maxlength="255" />
+    </div>
+    <div class="optional">
+      <label for="edit_creator_org">Organisation</label>
+      <input wicket:id="organisation"
+             id="edit_creator_org" type="text" size="32" maxlength="255" />
+    </div>
+    <div class="optional">
+      <label for="edit_creator_telephone">Telephone</label>
+      <input wicket:id="telephone"
+             id="edit_creator_telephone" type="text" size="32" maxlength="255" />
+    </div>
+    <div class="optional">
+      <label for="edit_creator_website">Website</label>
+      <input wicket:id="website"
+             id="edit_creator_website" type="text" size="32" maxlength="255" />
+    </div>
+    <div class="optional">
+      <label for="edit_creator_role">Role</label>
+      <input wicket:id="role"
+             id="edit_creator_role" type="text" size="32" maxlength="255" />
+    </div>
+  </fieldset>
+  <div wicket:id="feedback" class="feedback"></div>
+</form>
+</wicket:panel>
+</body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/EditCreatorDialog.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/EditCreatorDialog.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/EditCreatorDialog.java	(revision 5623)
@@ -0,0 +1,101 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.wizard;
+
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.RequiredTextField;
+import org.apache.wicket.markup.html.form.TextArea;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.panel.FeedbackPanel;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.validation.validator.EmailAddressValidator;
+import org.apache.wicket.validation.validator.StringValidator;
+import org.apache.wicket.validation.validator.UrlValidator;
+
+import eu.clarin.cmdi.virtualcollectionregistry.gui.dialog.ModalEditDialogBase;
+import eu.clarin.cmdi.virtualcollectionregistry.model.Creator;
+
+@SuppressWarnings("serial")
+public abstract class EditCreatorDialog extends ModalEditDialogBase<Creator> {
+    private final class Content extends
+            ModalEditDialogBase<Creator>.ContentPanel {
+        private final Form<Creator> form;
+        private final FeedbackPanel feedbackPanel;
+
+        public Content(String id, IModel<Creator> model) {
+            super(id);
+            form = new Form<Creator>("editCreatorForm", model);
+            final TextField<String> personField =
+                new RequiredTextField<String>("person");
+            personField.add(new StringValidator.MaximumLengthValidator(255));
+            form.add(personField);
+            final TextArea<String> addressArea =
+                new TextArea<String>("address");
+            addressArea.add(new StringValidator.MaximumLengthValidator(255));
+            form.add(addressArea);
+            final TextField<String> emailField =
+                new TextField<String>("email");
+            emailField.add(new StringValidator.MaximumLengthValidator(255));
+            emailField.add(EmailAddressValidator.getInstance());
+            form.add(emailField);
+            final TextField<String> organisationField =
+                new TextField<String>("organisation");
+            organisationField.add(
+                    new StringValidator.MaximumLengthValidator(255));
+            form.add(organisationField);
+            final TextField<String> telephoneField =
+                new TextField<String>("telephone");
+            telephoneField.add(new StringValidator.MaximumLengthValidator(255));
+            form.add(telephoneField);
+            final TextField<String> websiteField =
+                new TextField<String>("website");
+            websiteField.add(new StringValidator.MaximumLengthValidator(255));
+            websiteField.add(new UrlValidator());
+            form.add(websiteField);
+            final TextField<String> roleField =
+                new TextField<String>("role");
+            roleField.add(new StringValidator.MaximumLengthValidator(255));
+            form.add(roleField);
+            feedbackPanel = new FeedbackPanel("feedback");
+            form.add(feedbackPanel);
+            add(form);
+        }
+
+        @Override
+        public Form<Creator> getForm() {
+            return form;
+        }
+
+        @Override
+        public FeedbackPanel getFeedbackPanel() {
+            return feedbackPanel;
+        }
+    } // class EditCreatorDialog.Content
+
+    public EditCreatorDialog(final String id) {
+        super(id, new Model<String>("Add/Edit Creator"));
+        setInitialWidth(400);
+    }
+
+    @Override
+    protected ModalEditDialogBase<Creator>.ContentPanel
+        createContentPanel(String id, IModel<Creator> model) {
+        return new Content(id, model);
+    }
+
+    @Override
+    protected final IModel<Creator> newInstanceModel() {
+        return new CompoundPropertyModel<>(new Creator());
+    }
+
+    @Override
+    protected final IModel<Creator> createEmptyModel() {
+        return new CompoundPropertyModel<Creator>(null);
+    }
+
+    @Override
+    protected String getCssClass() {
+        return "editCreatorDialog";
+    }
+
+} // EditCreatorDialog
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/EditResourceDialog$Content.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/EditResourceDialog$Content.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/EditResourceDialog$Content.html	(revision 5623)
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:wicket="http://wicket.apache.org/">
+    <head />
+    <body>
+        <wicket:panel>
+            <form wicket:id="editResourceForm">
+                <fieldset>
+                    <div class="required">
+                        <label id="typelabel" class="tooltipparent" for="edit_resource_type">Type
+                            <span class="tooltipcontent">
+                                Type of reference<br /><br />
+                                Metadata: the referenced item is a CMDI metadata document that
+                                <em>describes</em> one or more resources<br /><br />
+                                Resource: the reference item is a resource that can be accessed
+                                directly through the specified URI
+                            </span>
+                        </label>
+                        <select wicket:id="type" id="edit_resource_type"></select>
+                    </div>
+                    <div class="required">
+                        <label id="referencelabel" class="tooltipparent" for="edit_resource_ref">Reference
+                            <span class="tooltipcontent">
+                                A PID or other type or URI identifying or locating the resource
+                                or metadata file
+                            </span>
+                        </label>
+                        <input wicket:id="ref" id="edit_resource_ref" type="text" />
+                    </div>
+                    <div class="optional">
+                        <label id="labellabel" class="tooltipparent" for="edit_resource_label">Label
+                            <span class="tooltipcontent">
+                                An optional label for this reference providing a short description
+                                of the item, to be shown instead of or in addition to the URI
+                            </span>
+                        </label>
+                        <input wicket:id="label" id="edit_resource_label" type="text" />
+                    </div>
+                    <div class="optional">
+                        <label id="descriptionlabel" class="tooltipparent" for="edit_resource_description">Description
+                            <span class="tooltipcontent">
+                                An optional, more detailed description of the referenced item
+                            </span>
+                        </label>
+                        <textarea wicket:id="description"
+                                  id="edit_resource_description" cols="80" rows="8"></textarea>
+                    </div>
+                </fieldset>
+                <div wicket:id="feedback" class="feedback"></div>
+            </form>
+        </wicket:panel>
+    </body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/EditResourceDialog.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/EditResourceDialog.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/EditResourceDialog.java	(revision 5623)
@@ -0,0 +1,91 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.wizard;
+
+import eu.clarin.cmdi.virtualcollectionregistry.service.impl.ReferenceValidator;
+import eu.clarin.cmdi.virtualcollectionregistry.gui.VolatileEntityModel;
+import java.util.Arrays;
+
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.EnumChoiceRenderer;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.RequiredTextField;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.panel.FeedbackPanel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.validation.validator.StringValidator;
+
+import eu.clarin.cmdi.virtualcollectionregistry.gui.dialog.ModalEditDialogBase;
+import eu.clarin.cmdi.virtualcollectionregistry.model.Resource;
+import org.apache.wicket.markup.html.form.TextArea;
+
+@SuppressWarnings("serial")
+public abstract class EditResourceDialog extends ModalEditDialogBase<Resource> {
+
+    private final class Content extends
+            ModalEditDialogBase<Resource>.ContentPanel {
+
+        private final Form<Resource> form;
+        private final FeedbackPanel feedbackPanel;
+
+        public Content(String id, IModel<Resource> model) {
+            super(id);
+            form = new Form<>("editResourceForm", model);
+
+            form.add(new DropDownChoice<>("type",
+                    Arrays.asList(Resource.Type.values()),
+                    new EnumChoiceRenderer<Resource.Type>(this))
+                    .setRequired(true)
+            );
+
+            form.add(new RequiredTextField<String>("ref")
+                    .add(new StringValidator.MaximumLengthValidator(255))
+                    .add(new ReferenceValidator()));
+
+            form.add(new TextField<String>("label")
+                    .add(new StringValidator.MaximumLengthValidator(255)));
+
+            form.add(new TextArea<String>("description"));
+
+            feedbackPanel = new FeedbackPanel("feedback");
+            form.add(feedbackPanel);
+            add(form);
+        }
+
+        @Override
+        public Form<Resource> getForm() {
+            return form;
+        }
+
+        @Override
+        public FeedbackPanel getFeedbackPanel() {
+            return feedbackPanel;
+        }
+    } // class EditResourceDialog.Content
+
+    public EditResourceDialog(final String id) {
+        super(id, Model.of("Add/Edit Resource"));
+        setInitialWidth(600);
+    }
+
+    @Override
+    protected ModalEditDialogBase<Resource>.ContentPanel
+            createContentPanel(String id, IModel<Resource> model) {
+        return new Content(id, model);
+    }
+
+    @Override
+    protected final IModel<Resource> newInstanceModel() {
+        return new VolatileEntityModel<>(new Resource());
+    }
+
+    @Override
+    protected final IModel<Resource> createEmptyModel() {
+        return new VolatileEntityModel<>(null);
+    }
+
+    @Override
+    protected String getCssClass() {
+        return "editResourceDialog";
+    }
+
+} // EditResourceDialog
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/WizardBase$ButtonBarPanel.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/WizardBase$ButtonBarPanel.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/WizardBase$ButtonBarPanel.html	(revision 5623)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:wicket="http://wicket.apache.org/">
+<head />
+<body>
+<wicket:panel>
+<div class="buttonbar">
+  <input wicket:id="previous" class="button previous" type="submit" value="previous" />
+  <input wicket:id="next" class="button next" type="submit" value="next" />
+  <input wicket:id="last" class="button last" type="submit" value="last" />
+  <input wicket:id="cancel" class="button cancel" type="submit" value="cancel" />
+  <input wicket:id="finish" class="button finish" type="submit" value="finish" />
+</div>
+</wicket:panel>
+</body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/WizardBase.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/WizardBase.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/WizardBase.html	(revision 5623)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:wicket="http://wicket.apache.org/">
+<head />
+<body>
+<wicket:panel>
+<form wicket:id="form" class="wizard">
+  <div class="wizard">
+    <div wicket:id="overview"></div>
+    <div wicket:id="header" class="wizardHeader"></div>
+    <div wicket:id="view" class="wizardView"></div>
+    <div wicket:id="feedback" class="wizardFeedback"></div>
+    <div class="wizardButtons">
+      <div wicket:id="buttons"></div>
+    </div>
+  </div>
+</form>
+</wicket:panel>
+</body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/WizardBase.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/WizardBase.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/WizardBase.java	(revision 5623)
@@ -0,0 +1,54 @@
+package eu.clarin.cmdi.virtualcollectionregistry.gui.wizard;
+
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.Component;
+import org.apache.wicket.extensions.wizard.CancelButton;
+import org.apache.wicket.extensions.wizard.FinishButton;
+import org.apache.wicket.extensions.wizard.IWizard;
+import org.apache.wicket.extensions.wizard.LastButton;
+import org.apache.wicket.extensions.wizard.NextButton;
+import org.apache.wicket.extensions.wizard.PreviousButton;
+import org.apache.wicket.extensions.wizard.Wizard;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.AbstractReadOnlyModel;
+
+@SuppressWarnings("serial")
+public class WizardBase extends Wizard {
+
+    private static final class ButtonBarPanel extends Panel {
+
+        private ButtonBarPanel(String id, final IWizard wizard) {
+            super(id);
+            add(new PreviousButton("previous", wizard));
+            add(new NextButton("next", wizard));
+            add(new LastButton("last", wizard));
+            add(new CancelButton("cancel", wizard));
+            add(new FinishButton("finish", wizard)
+                    // add an onclick confirmation event in the case a public
+                    // collection is being edited
+                    .add(new AttributeModifier("onclick", true, new AbstractReadOnlyModel<String>() {
+
+                        @Override
+                        public String getObject() {
+                            if (wizard instanceof CreateVirtualCollectionWizard) {
+                                final CreateVirtualCollectionWizard vcWizard = (CreateVirtualCollectionWizard) wizard;
+                                if (vcWizard.getVirtualCollectionModel().getObject().isPublic()) {
+                                    return "return confirm('Are you sure you want to update this published collection?');";
+                                }
+                            }
+                            return null;
+                        }
+                    })));
+        }
+    } // class WizardBase.ButtonBarPanel
+
+    public WizardBase(String id) {
+        super(id);
+    }
+
+    @Override
+    protected Component newButtonBar(String id) {
+        return new ButtonBarPanel(id, this);
+    }
+
+} // class WizardBase
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/wizardhelp.js
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/wizardhelp.js	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/wizardhelp.js	(revision 5623)
@@ -0,0 +1,60 @@
+/* 
+ * Copyright (C) 2014 CLARIN
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* For tooltips, the qtip jQuery plugin is used. For more info, see
+ * <http://craigsworks.com/projects/qtip/docs/>
+ */
+
+$(document).ready(function() {
+    activeTooltips();
+
+    /* toggle extra help information*/
+    $(".extrainfotoggle").click(function(event) {
+        event.preventDefault();
+        $(this).parent(".extrainfo").children(".notes").slideToggle();
+    });
+    $(".extrainfo .notes").hide();
+    $(".extrainfotoggle").qtip({
+        content: 'Help',
+        show: 'mouseover',
+        hide: 'mouseout',
+        style: {
+            background: '#ffffe1'
+        }
+    });
+});
+
+function activeTooltips() {
+    /* activate tooltip on annotated labels */
+    $(".tooltipparent").each(function() {
+        var tooltip = '#' + $(this).attr('id') + ' .tooltipcontent';
+        $(this).qtip({
+            content: $(tooltip),
+            show: 'mouseover',
+            hide: 'mouseout',
+            position: {
+                adjust: {
+                    x: -5
+                }
+            },
+            style: {
+                background: '#ffffe1'
+            }
+        });
+        $(".tooltipcontent", this).hide();
+    });
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/model/Creator.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/model/Creator.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/model/Creator.java	(revision 5623)
@@ -0,0 +1,181 @@
+package eu.clarin.cmdi.virtualcollectionregistry.model;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+
+@Entity
+@Table(name = "creator")
+public class Creator implements Serializable, IdentifiedEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.AUTO)
+    @Column(name = "id", nullable = false, updatable = false)
+    private Long id;
+
+    @Column(name = "person", nullable = false, length = 255)
+    private String person;
+
+    @Column(name = "address", length = 255)
+    private String address;
+
+    @Column(name = "email", length = 255)
+    private String email;
+
+    @Column(name = "organisation", length = 255)
+    private String organisation;
+
+    @Column(name = "telephone", length = 255)
+    private String telephone;
+
+    @Column(name = "website", length = 255)
+    private String website;
+
+    @Column(name = "role", length = 255)
+    private String role;
+
+    public Creator() {
+        super();
+    }
+
+    public Creator(String person) {
+        super();
+        this.setPerson(person);
+    }
+
+    @Override
+    public Long getId() {
+        return id;
+    }
+
+    public String getPerson() {
+        return person;
+    }
+
+    public void setPerson(String person) {
+        this.person = person;
+    }
+
+    public String getAddress() {
+        return address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public String getEMail() {
+        return email;
+    }
+
+    public void setEMail(String email) {
+        this.email = email;
+    }
+
+    public String getOrganisation() {
+        return organisation;
+    }
+
+    public void setOrganisation(String organisation) {
+        this.organisation = organisation;
+    }
+
+    public String getTelephone() {
+        return telephone;
+    }
+
+    public void setTelephone(String telephone) {
+        this.telephone = telephone;
+    }
+
+    public String getWebsite() {
+        return website;
+    }
+
+    public void setWebsite(String website) {
+        this.website = website;
+    }
+
+    public String getRole() {
+        return role;
+    }
+
+    public void setRole(String role) {
+        this.role = role;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null) {
+            return false;
+        }
+        if (obj == this) {
+            return true;
+        }
+        if (obj instanceof Creator) {
+            final Creator rhs = (Creator) obj;
+            return new EqualsBuilder()
+                    .append(this.getPerson(), rhs.getPerson())
+                    .append(this.getAddress(), rhs.getAddress())
+                    .append(this.getEMail(), rhs.getEMail())
+                    .append(this.getOrganisation(), rhs.getOrganisation())
+                    .append(this.getTelephone(), rhs.getTelephone())
+                    .append(this.getWebsite(), rhs.getWebsite())
+                    .append(this.getRole(), rhs.getRole())
+                    .isEquals();
+        }
+        return false;
+    }
+
+    @Override
+    public int hashCode() {
+        return new HashCodeBuilder(32361, 7611)
+                .append(this.getPerson())
+                .append(this.getAddress())
+                .append(this.getEMail())
+                .append(this.getOrganisation())
+                .append(this.getTelephone())
+                .append(this.getWebsite())
+                .append(this.getRole())
+                .toHashCode();
+    }
+    
+    public void setValuesFrom(Creator other) {
+        address = other.getAddress();
+        email = other.getEMail();
+        organisation = other.getOrganisation();
+        person = other.getPerson();
+        role = other.getRole();
+        telephone = other.getTelephone();
+        website = other.getWebsite();
+    }
+
+    /**
+     * Creates a copy 
+     *
+     * @return a clone of this creator
+     */
+    public Creator getCopy() {
+        final Creator copy = new Creator();
+        copy.id = id;
+        copy.setAddress(address);
+        copy.setEMail(email);
+        copy.setOrganisation(organisation);
+        copy.setPerson(person);
+        copy.setRole(role);
+        copy.setTelephone(telephone);
+        copy.setWebsite(website);
+        return copy;
+    }
+
+} // class Creator
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/model/GeneratedBy.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/model/GeneratedBy.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/model/GeneratedBy.java	(revision 5623)
@@ -0,0 +1,104 @@
+package eu.clarin.cmdi.virtualcollectionregistry.model;
+
+import java.io.Serializable;
+
+import javax.persistence.Basic;
+import javax.persistence.Column;
+import javax.persistence.Embeddable;
+import javax.persistence.Embedded;
+import javax.persistence.FetchType;
+import javax.persistence.Lob;
+
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+
+@Embeddable
+public class GeneratedBy implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @Lob
+    @Basic(fetch = FetchType.EAGER)
+    @Column(name = "generatedby_description", length = 8192)
+    private String description;
+
+    @Column(name = "generatedby_uri", nullable = true, length = 255)
+    private String uri;
+
+    @Embedded
+    private GeneratedByQuery query;
+
+    public GeneratedBy() {
+        super();
+    }
+
+    public GeneratedBy(String description) {
+        super();
+        this.setDescription(description);
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        if (description == null) {
+            throw new NullPointerException("description == null");
+        }
+        description = description.trim();
+        if (description.isEmpty()) {
+            throw new IllegalArgumentException("description is empty");
+        }
+        this.description = description;
+    }
+
+    public String getURI() {
+        return uri;
+    }
+
+    public void setURI(String uri) {
+        if (uri != null) {
+            uri = uri.trim();
+            if (uri.isEmpty()) {
+                uri = null;
+            }
+        }
+        this.uri = uri;
+    }
+
+    public GeneratedByQuery getQuery() {
+        return query;
+    }
+
+    public void setQuery(GeneratedByQuery query) {
+        this.query = query;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null) {
+            return false;
+        }
+        if (obj == this) {
+            return true;
+        }
+        if (obj instanceof GeneratedBy) {
+            final GeneratedBy rhs = (GeneratedBy) obj;
+            return new EqualsBuilder()
+                .append(this.getDescription(), rhs.getDescription())
+                .append(this.getURI(), rhs.getURI())
+                .append(this.getQuery(), rhs.getQuery())
+                .isEquals();
+        }
+        return false;
+    }
+
+    @Override
+    public int hashCode() {
+        return new HashCodeBuilder(7587, 16231)
+            .append(this.getDescription())
+            .append(uri)
+            .append(query)
+            .toHashCode();
+    }
+
+} // class GeneratedBy
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/model/GeneratedByQuery.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/model/GeneratedByQuery.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/model/GeneratedByQuery.java	(revision 5623)
@@ -0,0 +1,90 @@
+package eu.clarin.cmdi.virtualcollectionregistry.model;
+
+import java.io.Serializable;
+
+import javax.persistence.Basic;
+import javax.persistence.Column;
+import javax.persistence.Embeddable;
+import javax.persistence.FetchType;
+import javax.persistence.Lob;
+
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+
+@Embeddable
+public class GeneratedByQuery implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @Column(name = "generatedby_query_profile", length = 255)
+    private String profile;
+
+    @Lob
+    @Basic(fetch = FetchType.EAGER)
+    @Column(name = "generatedby_query_value", length = 8192)
+    private String value;
+
+
+    public GeneratedByQuery() {
+        super();
+    }
+
+    public GeneratedByQuery(String profile, String value) {
+        super();
+        this.setProfile(profile);
+        this.setValue(value);
+    }
+
+    public String getProfile() {
+        return profile;
+    }
+
+    public void setProfile(String profile) {
+        if (profile == null) {
+            throw new NullPointerException("profile == null");
+        }
+        profile = profile.trim();
+        if (profile.isEmpty()) {
+            throw new IllegalArgumentException("profile is empty");
+        }
+        this.profile = profile;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        if (value == null) {
+            throw new NullPointerException("value == null");
+        }
+        // do not trim and allow space only values
+        this.value = value;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null) {
+            return false;
+        }
+        if (obj == this) {
+            return true;
+        }
+        if (obj instanceof GeneratedByQuery) {
+            final GeneratedByQuery rhs = (GeneratedByQuery) obj;
+            return new EqualsBuilder()
+                .append(profile, rhs.profile)
+                .append(value, rhs.value)
+                .isEquals();
+        }
+        return false;
+    }
+
+    @Override
+    public int hashCode() {
+        return new HashCodeBuilder(10021, 32555)
+            .append(profile)
+            .append(value)
+            .toHashCode();
+    }
+
+} // class GeneratedBy.Query
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/model/IdentifiedEntity.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/model/IdentifiedEntity.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/model/IdentifiedEntity.java	(revision 5623)
@@ -0,0 +1,17 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package eu.clarin.cmdi.virtualcollectionregistry.model;
+
+/**
+ *
+ * @author twagoo
+ */
+public interface IdentifiedEntity {
+
+    Long getId();
+    
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/model/Resource.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/model/Resource.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/model/Resource.java	(revision 5623)
@@ -0,0 +1,149 @@
+package eu.clarin.cmdi.virtualcollectionregistry.model;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Lob;
+import javax.persistence.Table;
+
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+
+@Entity
+@Table(name = "resource")
+public class Resource implements Serializable, IdentifiedEntity {
+    
+    private static final long serialVersionUID = 1L;
+    
+    public static enum Type {
+        
+        METADATA,
+        RESOURCE;
+    } // enum Resource.Type
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.AUTO)
+    @Column(name = "id", nullable = false, updatable = false)
+    private Long id;
+    
+    @Column(name = "type", nullable = false)
+    @Enumerated(EnumType.ORDINAL)
+    private Type type;
+    
+    @Column(name = "ref", nullable = false, length = 255)
+    private String ref;
+    
+    @Column(name = "label", nullable = true, length = 255)
+    private String label;
+    
+    @Lob
+    @Column(name = "description", length = 8192)
+    private String description;
+    
+    public Resource() {
+        super();
+    }
+    
+    public Resource(Resource.Type type, String ref) {
+        super();
+        this.setType(type);
+        this.setRef(ref);
+    }
+    
+    @Override
+    public Long getId() {
+        return id;
+    }
+    
+    public Resource.Type getType() {
+        return type;
+    }
+    
+    public void setType(Resource.Type type) {
+        if (type == null) {
+            throw new NullPointerException("type == null");
+        }
+        this.type = type;
+    }
+    
+    public String getRef() {
+        return ref;
+    }
+    
+    public void setRef(String ref) {
+        if (ref == null) {
+            throw new NullPointerException("ref == null");
+        }
+        ref = ref.trim();
+        if (ref.isEmpty()) {
+            throw new IllegalArgumentException("ref is empty");
+        }
+        this.ref = ref;
+    }
+
+    public String getLabel() {
+        return label;
+    }
+
+    public void setLabel(String label) {
+        this.label = label;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+    
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null) {
+            return false;
+        }
+        if (obj == this) {
+            return true;
+        }
+        if (obj instanceof Resource) {
+            final Resource rhs = (Resource) obj;
+            return new EqualsBuilder()
+                    .append(this.getType(), rhs.getType())
+                    .append(this.getRef(), rhs.getRef())
+                    .isEquals();
+        }
+        return false;
+    }
+    
+    @Override
+    public int hashCode() {
+        return new HashCodeBuilder(25973, 1815)
+                .append(this.getType())
+                .append(this.getRef())
+                .toHashCode();
+    }
+    
+    public void valuesFrom(Resource resource) {
+        ref = resource.getRef();
+        type = resource.getType();
+        label = resource.getLabel();
+        description = resource.getDescription();
+    }
+    
+    public Resource getCopy() {
+        final Resource copy = new Resource();
+        copy.id = id;
+        copy.setRef(ref);
+        copy.setType(type);
+        copy.setLabel(label);
+        copy.setDescription(description);
+        return copy;
+    }
+    
+} // class Resource
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/model/User.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/model/User.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/model/User.java	(revision 5623)
@@ -0,0 +1,132 @@
+package eu.clarin.cmdi.virtualcollectionregistry.model;
+
+import java.io.Serializable;
+import java.security.Principal;
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+
+@Entity
+@Table(name = "user")
+@NamedQueries({
+    @NamedQuery(name = "User.findByName",
+                query = "SELECT u FROM User u WHERE u.name = :name")
+})
+public class User implements Serializable, IdentifiedEntity {
+    private static final long serialVersionUID = 1L;
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.AUTO)
+    @Column(name = "id")
+    private Long id;
+
+    @Column(name = "name", nullable = false, unique = true, length = 255)
+    private String name;
+
+    @Column(name = "display_name", length = 255)
+    private String displayName;
+
+    @OneToMany(cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY,
+               mappedBy = "owner",
+               orphanRemoval = true)
+    private Set<VirtualCollection> collections =
+        new LinkedHashSet<VirtualCollection>();
+
+
+    protected User() {
+    }
+
+    public User(String name, String displayName) {
+        super();
+        this.setName(name);
+        this.setDisplayName(displayName);
+    }
+
+    public User(String name) {
+        this(name, null);
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        if (name == null) {
+            throw new NullPointerException("name == null");
+        }
+        name = name.trim();
+        if (name.isEmpty()) {
+            throw new IllegalArgumentException("name is empty");
+        }
+        this.name = name;
+    }
+
+    public String getDisplayName() {
+        return displayName;
+    }
+
+    public void setDisplayName(String displayName) {
+        if (displayName != null) {
+            displayName = displayName.trim();
+            if (displayName.isEmpty()) {
+                displayName = null;
+            }
+        }
+        this.displayName = displayName;
+    }
+
+    public Set<VirtualCollection> getVirtualCollections() {
+        return collections;
+    }
+
+    public boolean equalsPrincipal(Principal principal) {
+        if (principal == null) {
+            throw new NullPointerException("principal == null");
+    }
+        return name.equals(principal.getName());
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null) {
+            return false;
+        }
+        if (obj == this) {
+            return true;
+        }
+        if (obj instanceof User) {
+            final User rhs = (User) obj;
+            return new EqualsBuilder()
+                .append(this.getName(), rhs.getName())
+                .isEquals();
+        }
+        return false;
+    }
+
+    @Override
+    public int hashCode() {
+        return new HashCodeBuilder(22391, 295)
+            .append(this.getName())
+            .toHashCode();
+    }
+
+} // class User
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/model/VirtualCollection.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/model/VirtualCollection.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/model/VirtualCollection.java	(revision 5623)
@@ -0,0 +1,498 @@
+package eu.clarin.cmdi.virtualcollectionregistry.model;
+
+import eu.clarin.cmdi.virtualcollectionregistry.pid.PersistentIdentifier;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.persistence.Basic;
+import javax.persistence.CascadeType;
+import javax.persistence.CollectionTable;
+import javax.persistence.Column;
+import javax.persistence.ElementCollection;
+import javax.persistence.Embedded;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.Lob;
+import javax.persistence.ManyToOne;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.OneToMany;
+import javax.persistence.OneToOne;
+import javax.persistence.OrderBy;
+import javax.persistence.OrderColumn;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.persistence.Version;
+
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+
+@Entity
+@Table(name = "virtualcollection")
+@NamedQueries({
+        @NamedQuery(name = "VirtualCollection.findAllPublic",
+                    query = "SELECT c FROM VirtualCollection c " +
+                            "WHERE c.state = eu.clarin.cmdi." +
+                            "virtualcollectionregistry.model." +
+                            "VirtualCollection$State.PUBLIC " +
+                            "ORDER BY c.id"),
+        @NamedQuery(name = "VirtualCollection.countAllPublic",
+                    query = "SELECT COUNT(c) FROM VirtualCollection c " +
+                            "WHERE c.state = eu.clarin.cmdi." +
+                            "virtualcollectionregistry.model." +
+                            "VirtualCollection$State.PUBLIC"),
+        @NamedQuery(name = "VirtualCollection.findByOwner",
+                    query = "SELECT c FROM VirtualCollection c " +
+                            "WHERE c.owner = :owner ORDER BY c.id"),
+        @NamedQuery(name = "VirtualCollection.countByOwner",
+                    query = "SELECT COUNT(c) FROM VirtualCollection c " +
+                            "WHERE c.owner = :owner"),
+        @NamedQuery(name = "VirtualCollection.findAllByState",
+                    query = "SELECT c FROM VirtualCollection c " +
+                            "WHERE c.state = :state AND c.dateModified < :date")
+})
+public class VirtualCollection implements Serializable, IdentifiedEntity {
+    private static final long serialVersionUID = 1L;
+
+    public static enum State {
+        PRIVATE,
+        PUBLIC_PENDING,
+        PUBLIC,
+        DELETED,
+        DEAD
+    } // enum VirtualCollection.State
+
+    public static enum Type {
+        EXTENSIONAL,
+        INTENSIONAL
+    } // enum VirtualCollecion.Type
+
+    public static enum Purpose {
+        RESEARCH,
+        REFERENCE,
+        SAMPLE,
+        FUTURE_USE
+    } // enum VirtualCollecion.Purpose
+
+    public static enum Reproducibility {
+        INTENDED,
+        FLUCTUATING,
+        UNTENDED
+    } // enum VirtualCollecion.Reproducibility
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.AUTO)
+    @Column(name = "id", nullable = false, updatable = false)
+    private Long id;
+
+    @ManyToOne(cascade = { CascadeType.PERSIST,
+                           CascadeType.REFRESH,
+                           CascadeType.MERGE,
+                           CascadeType.DETACH
+    },
+               fetch = FetchType.EAGER)
+    @JoinColumn(name = "owner_id",
+                nullable = false)
+    private User owner;
+
+    @OneToOne(cascade = CascadeType.ALL,
+              fetch = FetchType.EAGER,
+              mappedBy = "vc",
+              optional = true)
+    private PersistentIdentifier persistentId = null;
+
+    @Column(name = "state", nullable = false)
+    private VirtualCollection.State state;
+
+    @Enumerated(EnumType.ORDINAL)
+    @Column(name = "type", nullable = false)
+    private VirtualCollection.Type type;
+
+    @Column(name = "name", nullable = false, length = 255)
+    private String name;
+
+    @Lob
+    @Basic(fetch = FetchType.EAGER)
+    @Column(name = "description", length = 8192)
+    private String description;
+
+    @Temporal(TemporalType.DATE)
+    @Column(name = "creation_date")
+    private Date creationDate;
+
+    @OneToMany(cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY,
+               orphanRemoval = true)
+    @JoinColumn(name = "vc_id", nullable = false)
+    @OrderBy("id")
+    private List<Creator> creators;
+
+    @Enumerated(EnumType.ORDINAL)
+    @Column(name = "purpose")
+    private VirtualCollection.Purpose purpose;
+
+    @Enumerated(EnumType.ORDINAL)
+    @Column(name = "reproducibility")
+    private VirtualCollection.Reproducibility reproducibility;
+
+    @Lob
+    @Basic(fetch = FetchType.EAGER)
+    @Column(name = "reproducibility_notice", length = 8192)
+    private String reproducibilityNotice;
+
+    @ElementCollection
+    @CollectionTable(name = "keyword",
+                     joinColumns = @JoinColumn(name="vc_id"))
+    private List<String> keywords;
+
+    @OneToMany(cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY,
+               orphanRemoval = true)
+    @JoinColumn(name = "vc_id", nullable = false)    
+    @OrderColumn(nullable = false)
+    private List<Resource> resources;
+
+    @Embedded
+    private GeneratedBy generatedBy;
+
+    @Temporal(TemporalType.TIMESTAMP)
+    @Column(name = "created", nullable = false, updatable = false)
+    private Date dateCreated = new Date();
+
+    @Temporal(TemporalType.TIMESTAMP)
+    @Version
+    @Column(name = "modified", nullable = false)
+    private Date dateModified;
+
+    public VirtualCollection() {
+        super();
+        this.setState(VirtualCollection.State.PRIVATE);
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public User getOwner() {
+        return owner;
+    }
+
+    public void setOwner(User owner) {
+        if (owner == null) {
+            throw new NullPointerException("owner == null");
+        }
+        if (this.owner != null) {
+            this.owner.getVirtualCollections().remove(this);
+        }
+        this.owner = owner;
+        this.owner.getVirtualCollections().add(this);
+    }
+
+    public PersistentIdentifier getPersistentIdentifier() {
+        return persistentId;
+    }
+
+    public void setPersistentIdentifier(PersistentIdentifier persistentId) {
+        if (persistentId == null) {
+            throw new NullPointerException("pid == null");
+        }
+        if ((this.persistentId != null) || (state != State.PUBLIC_PENDING)) {
+            throw new IllegalStateException("illegal state");
+        }
+        this.persistentId = persistentId;
+        this.state = State.PUBLIC;
+    }
+
+    public State getState() {
+        return state;
+    }
+
+    public void setState(State state) {
+        if (state == null) {
+            throw new NullPointerException("state == null");
+        }
+        this.state = state;
+    }
+
+    public boolean isPrivate() {
+        return state == State.PRIVATE;
+    }
+
+    public boolean isPublic() {
+        return (state == State.PUBLIC_PENDING) || (state == State.PUBLIC);
+    }
+
+    public boolean isDeleted() {
+        return (state == State.DELETED) || (state == State.DEAD);
+    }
+
+    public VirtualCollection.Type getType() {
+        return type;
+    }
+
+    public void setType(VirtualCollection.Type type) {
+        this.type = type;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        if (name == null) {
+            throw new NullPointerException("name == null");
+        }
+        name = name.trim();
+        if (name.isEmpty()) {
+            throw new IllegalArgumentException("name is empty");
+        }
+        this.name = name;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        if (description != null) {
+            description = description.trim();
+            if (description.isEmpty()) {
+                description = null;
+            }
+        }
+        this.description = description;
+    }
+
+    public Date getCreationDate() {
+        return creationDate;
+    }
+
+    public void setCreationDate(Date creationDate) {
+        this.creationDate = creationDate;
+    }
+
+    public List<Creator> getCreators() {
+        if (creators == null) {
+            this.creators = new ArrayList<Creator>();
+        }
+        return creators;
+    }
+
+    public VirtualCollection.Purpose getPurpose() {
+        return purpose;
+    }
+
+    public void setPurpose(VirtualCollection.Purpose purpose) {
+        this.purpose = purpose;
+    }
+
+    public VirtualCollection.Reproducibility getReproducibility() {
+        return reproducibility;
+    }
+
+    public void setReproducibility(
+            VirtualCollection.Reproducibility reproducibility) {
+        this.reproducibility = reproducibility;
+    }
+
+    public String getReproducibilityNotice() {
+        return reproducibilityNotice;
+    }
+
+    public void setReproducibilityNotice(String reproducibilityNotice) {
+        if (reproducibilityNotice != null) {
+            reproducibilityNotice = reproducibilityNotice.trim();
+            if (reproducibilityNotice.isEmpty()) {
+                reproducibilityNotice = null;
+            }
+        }
+        this.reproducibilityNotice = reproducibilityNotice;
+    }
+
+    public List<String> getKeywords() {
+        if (keywords == null) {
+            keywords = new ArrayList<String>();
+        }
+        return keywords;
+    }
+
+    public List<Resource> getResources() {
+        if (resources == null) {
+            resources = new ArrayList<Resource>();
+        }
+        return resources;
+    }
+
+    public GeneratedBy getGeneratedBy() {
+        return generatedBy;
+    }
+
+    public void setGeneratedBy(GeneratedBy generatedBy) {
+        this.generatedBy = generatedBy;
+    }
+
+    public Date getDateCreated() {
+        return dateCreated;
+    }
+
+    public Date getDateModified() {
+        return dateModified;
+    }
+
+    public void setDateModified(Date dateModified) {
+        if (dateModified == null) {
+            throw new NullPointerException("dateModified == null");
+        }
+        this.dateModified = dateModified;
+    }
+
+    public void updateFrom(VirtualCollection vc) {
+        if (this == vc) {
+            return;
+        }
+        if (vc.getPersistentIdentifier() != null) {
+            this.setPersistentIdentifier(vc.getPersistentIdentifier());
+        }
+        this.setState(state);
+        this.setType(vc.getType());
+        this.setName(vc.getName());
+        this.setDescription(vc.getDescription());
+        this.setCreationDate(vc.getCreationDate());
+
+        // Creators
+        Set<Creator> obsolete_creators =
+            new HashSet<Creator>(this.getCreators());
+        for (Creator creator : vc.getCreators()) {
+            if (!obsolete_creators.contains(creator)) {
+                this.getCreators().add(creator);
+            }
+            obsolete_creators.remove(creator);
+        }
+        if (!obsolete_creators.isEmpty()) {
+            for (Creator creator : obsolete_creators) {
+                this.getCreators().remove(creator);
+            }
+            obsolete_creators = null;
+        }
+
+        this.setPurpose(vc.getPurpose());
+        this.setReproducibility(vc.getReproducibility());
+        this.setReproducibilityNotice(vc.getReproducibilityNotice());
+
+        // Keywords
+        Set<String> obsolete_keywords =
+            new HashSet<String>(this.getKeywords());
+        for (String keyword : vc.getKeywords()) {
+            if (!obsolete_keywords.contains(keyword)) {
+                this.getKeywords().add(keyword);
+            }
+            obsolete_keywords.remove(keyword);
+        }
+        if (!obsolete_keywords.isEmpty()) {
+            for (String keyword : obsolete_keywords) {
+                this.getKeywords().remove(keyword);
+            }
+            obsolete_keywords = null;
+        }
+
+        // Resources
+        Set<Resource> obsolete_resources =
+            new HashSet<Resource>(this.getResources());
+        for (Resource resource : vc.getResources()) {
+            if (!obsolete_resources.contains(resource)) {
+                this.getResources().add(resource);
+            }
+            obsolete_resources.remove(resource);
+        }
+        if (!obsolete_resources.isEmpty()) {
+            for (Resource resource : obsolete_resources) {
+                this.getResources().remove(resource);
+            }
+            obsolete_resources = null;
+        }
+
+        if (vc.generatedBy != null) {
+            final GeneratedBy genBy = vc.generatedBy;
+            if (this.generatedBy == null) {
+                this.generatedBy = new GeneratedBy(genBy.getDescription());
+            } else {
+                this.generatedBy.setDescription(genBy.getDescription());
+            }
+            this.generatedBy.setURI(genBy.getURI());
+            if (genBy.getQuery() != null) {
+                final GeneratedByQuery q = genBy.getQuery();
+                GeneratedByQuery query =
+                    new GeneratedByQuery(q.getProfile(), q.getValue());
+                this.generatedBy.setQuery(query);
+            }
+        }
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null) {
+            return false;
+        }
+        if (obj == this) {
+            return true;
+        }
+        if (obj instanceof VirtualCollection) {
+            final VirtualCollection rhs = (VirtualCollection) obj;
+            return new EqualsBuilder()
+                .append(this.getOwner(), rhs.getOwner())
+                .append(this.getPersistentIdentifier(),
+                            rhs.getPersistentIdentifier())
+                .append(this.getState(), rhs.getState())
+                .append(this.getType(), rhs.getType())
+                .append(this.getName(), rhs.getName())
+                .append(this.getDescription(), rhs.getDescription())
+                .append(this.getCreationDate(), rhs.getCreationDate())
+                .append(this.getCreators(), rhs.getCreators())
+                .append(this.getPurpose(), rhs.getPurpose())
+                .append(this.getReproducibility(), rhs.getReproducibility())
+                .append(this.getReproducibilityNotice(),
+                            rhs.getReproducibilityNotice())
+                .append(this.getKeywords(), rhs.getKeywords())
+                .append(this.getResources(), rhs.getResources())
+                .append(this.getGeneratedBy(), rhs.getGeneratedBy())
+                .isEquals();
+        }
+        return false;
+    }
+
+    @Override
+    public int hashCode() {
+        return new HashCodeBuilder(1391, 295)
+            .append(this.getOwner())
+            .append(this.getPersistentIdentifier())
+            .append(this.getState())
+            .append(this.getType())
+            .append(this.getName())
+            .append(this.getDescription())
+            .append(this.getCreationDate())
+            .append(this.getCreators())
+            .append(this.getPurpose())
+            .append(this.getReproducibility())
+            .append(this.getReproducibilityNotice())
+            .append(this.getKeywords())
+            .append(this.getResources())
+            .append(this.getGeneratedBy())
+            .toHashCode();
+    }
+
+} // class VirtualCollection
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/model/VirtualCollectionList.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/model/VirtualCollectionList.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/model/VirtualCollectionList.java	(revision 5623)
@@ -0,0 +1,40 @@
+package eu.clarin.cmdi.virtualcollectionregistry.model;
+
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.List;
+
+public class VirtualCollectionList implements Serializable {
+    private static final long serialVersionUID = 1L;
+    private List<VirtualCollection> collections;
+    private int offset;
+    private int totalCount;
+
+    public VirtualCollectionList(List<VirtualCollection> list, int offset,
+            int totalCount) {
+        if (list != null) {
+            this.collections = list;
+        } else {
+            this.collections = Collections.emptyList();
+        }
+        this.offset = offset;
+        this.totalCount = totalCount;
+    }
+
+    public int getOffset() {
+        return offset;
+    }
+
+    public int getTotalCount() {
+        return totalCount;
+    }
+
+    public boolean isPartialList() {
+        return collections.size() < totalCount;
+    }
+
+    public List<VirtualCollection> getItems() {
+        return collections;
+    }
+
+} // class VirtualCollectionList
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/oai/VirtualCollectionRegistryOAIConfiguration.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/oai/VirtualCollectionRegistryOAIConfiguration.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/oai/VirtualCollectionRegistryOAIConfiguration.java	(revision 5623)
@@ -0,0 +1,35 @@
+package eu.clarin.cmdi.virtualcollectionregistry.oai;
+
+import eu.clarin.cmdi.oai.provider.OAIException;
+import eu.clarin.cmdi.oai.provider.Repository;
+import eu.clarin.cmdi.oai.provider.impl.OAIProvider;
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistry;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * Spring configuration that defines beans for the OAI Provider to be used by
+ * {@link VirtualCollectionRegistry}
+ *
+ * @author twagoo
+ */
+@Configuration
+public class VirtualCollectionRegistryOAIConfiguration {
+
+    @Autowired
+    private VirtualCollectionRegistry vcr;
+
+    @Bean
+    public OAIProvider oaiProvider() throws OAIException {
+        final OAIProvider instance = OAIProvider.instance();
+        instance.setRepository(oaiRepository());
+        return instance;
+    }
+
+    @Bean
+    public Repository oaiRepository() {
+        return new VirtualColletionRegistryOAIRepository(vcr);
+    }
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/oai/VirtualColletionRegistryOAIRepository.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/oai/VirtualColletionRegistryOAIRepository.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/oai/VirtualColletionRegistryOAIRepository.java	(revision 5623)
@@ -0,0 +1,422 @@
+package eu.clarin.cmdi.virtualcollectionregistry.oai;
+
+import eu.clarin.cmdi.oai.provider.DublinCoreAdapter;
+import eu.clarin.cmdi.oai.provider.DublinCoreConverter;
+import eu.clarin.cmdi.oai.provider.MetadataFormat;
+import eu.clarin.cmdi.oai.provider.OAIException;
+import eu.clarin.cmdi.oai.provider.Record;
+import eu.clarin.cmdi.oai.provider.RecordList;
+import eu.clarin.cmdi.oai.provider.Repository;
+import eu.clarin.cmdi.oai.provider.SetSpecDesc;
+import eu.clarin.cmdi.virtualcollectionregistry.DataStore;
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionNotFoundException;
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistry;
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryException;
+import eu.clarin.cmdi.virtualcollectionregistry.model.Creator;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection_;
+import eu.clarin.cmdi.virtualcollectionregistry.service.VirtualCollectionCMDIWriter;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import javax.persistence.EntityManager;
+import javax.persistence.LockModeType;
+import javax.persistence.NoResultException;
+import javax.persistence.TypedQuery;
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Predicate;
+import javax.persistence.criteria.Root;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public class VirtualColletionRegistryOAIRepository implements Repository {
+
+    @Autowired
+    private VirtualCollectionCMDIWriter cmdiWriter;
+    @Autowired
+    private DataStore dataStore;
+
+    private static final Logger logger
+            = LoggerFactory.getLogger(VirtualColletionRegistryOAIRepository.class);
+
+    private class CMDIMetadataFormat implements MetadataFormat {
+
+        @Override
+        public String getPrefix() {
+            return "cmdi";
+        }
+
+        @Override
+        public String getNamespaceURI() {
+            return "http://www.clarin.eu/cmd/";
+        }
+
+        @Override
+        public String getSchemaLocation() {
+            // FIXME: for now minimal-cmdi.xsd
+            return "http://www.clarin.eu/cmd/xsd/minimal-cmdi.xsd";
+        }
+
+        @Override
+        public boolean canWriteClass(Class<?> clazz) {
+            return true;
+        }
+
+        @Override
+        public void writeObject(XMLStreamWriter stream, Object item)
+                throws XMLStreamException {
+            final VirtualCollection vc = (VirtualCollection) item;
+            cmdiWriter.writeCMDI(stream, vc);
+        }
+    } // class CMDIMetadataFormat
+
+    private final VirtualCollectionRegistry registry;
+
+    @Autowired
+    VirtualColletionRegistryOAIRepository(VirtualCollectionRegistry registry) {
+        this.registry = registry;
+    }
+
+    @Override
+    public String getId() {
+        return "virtualcollectionregistry.cmdi.clarin.eu";
+    }
+
+    @Override
+    public String getName() {
+        return "CLARIN Virtual Collection Registry";
+    }
+
+    @Override
+    public String getDescription() {
+        return "The virtual collection registry is a component of the "
+                + "CLARIN metadata initiative.";
+    }
+
+    @Override
+    public Date getEarliestTimestamp() {
+        Date result = null;
+        try {
+            EntityManager em = dataStore.getEntityManager();
+            CriteriaBuilder cb = em.getCriteriaBuilder();
+
+            CriteriaQuery<Date> cq = cb.createQuery(Date.class);
+            Root<VirtualCollection> root = cq.from(VirtualCollection.class);
+            cq.select(root.get(VirtualCollection_.dateModified));
+            cq.orderBy(cb.asc(root.get(VirtualCollection_.dateModified)));
+
+            em.getTransaction().begin();
+            TypedQuery<Date> q = em.createQuery(cq);
+            q.setMaxResults(1);
+            q.setLockMode(LockModeType.READ);
+            result = q.getSingleResult();
+            em.getTransaction().commit();
+        } catch (NoResultException e) {
+            /* IGNORE */
+        } catch (Exception e) {
+            logger.debug("error fetching earliest timestamp", e);
+        } finally {
+            dataStore.closeEntityManager();
+        }
+        return result;
+    }
+
+    @Override
+    public DeletedNotion getDeletedNotion() {
+        return DeletedNotion.TRANSIENT;
+    }
+
+    @Override
+    public Granularity getGranularity() {
+        return Granularity.SECONDS;
+    }
+
+    @Override
+    public int getCompressionMethods() {
+        return 0 /* COMPRESSION_GZIP|COMPRESSION_DEFLATE */;
+    }
+
+    @Override
+    public Set<String> getAdminAddreses() {
+        Set<String> addresses = new HashSet<String>();
+        addresses.add("cmdi@clarin.eu");
+        return addresses;
+    }
+
+    @Override
+    public Object getSampleRecordLocalId() {
+        return new Long(23);
+    }
+
+    @Override
+    public Set<DublinCoreConverter> getDublinCoreConverters() {
+        Set<DublinCoreConverter> converters
+                = new HashSet<DublinCoreConverter>();
+        converters.add(new DublinCoreAdapter() {
+            @Override
+            public boolean canProcessResource(Class<?> clazz) {
+                return clazz.isAssignableFrom(VirtualCollection.class);
+            }
+
+            @Override
+            public String getTitle(Object resource) {
+                return ((VirtualCollection) resource).getName();
+            }
+
+            @Override
+            public String getIdentifier(Object resource) {
+                return ((VirtualCollection) resource)
+                        .getPersistentIdentifier().getURI();
+            }
+
+            @Override
+            public Date getDate(Object resource) {
+                return ((VirtualCollection) resource).getCreationDate();
+            }
+
+            @Override
+            public List<String> getCreators(Object resource) {
+                final VirtualCollection vc = (VirtualCollection) resource;
+                if (!vc.getCreators().isEmpty()) {
+                    List<String> creators = new ArrayList<String>();
+                    for (Creator creator : vc.getCreators()) {
+                        creators.add(creator.getPerson());
+                    }
+                }
+                return null;
+            }
+
+            @Override
+            public String getDescription(Object resource) {
+                return ((VirtualCollection) resource).getDescription();
+            }
+        });
+        return converters;
+    }
+
+    @Override
+    public Set<MetadataFormat> getCustomMetadataFormats() {
+        Set<MetadataFormat> formats = new HashSet<MetadataFormat>();
+        formats.add(new CMDIMetadataFormat());
+        return formats;
+    }
+
+    @Override
+    public Set<SetSpecDesc> getSetDescs() {
+        return null;
+    }
+
+    @Override
+    public Object parseLocalId(String unparsedLocalId) {
+        try {
+            long id = Long.parseLong(unparsedLocalId);
+            if (id > 0) {
+                return new Long(id);
+            }
+        } catch (NumberFormatException e) {
+            /* FALL-THROUGH */
+        }
+        return null;
+    }
+
+    @Override
+    public String unparseLocalId(Object localId) {
+        return ((Long) localId).toString();
+    }
+
+    @Override
+    public Record getRecord(Object localId, boolean headerOnly)
+            throws OAIException {
+        try {
+            long id = (Long) localId;
+            VirtualCollection vc = registry.retrieveVirtualCollection(id);
+            return createRecord(vc, headerOnly);
+        } catch (VirtualCollectionNotFoundException e) {
+            return null;
+        } catch (VirtualCollectionRegistryException e) {
+            throw new OAIException("error", e);
+        }
+    }
+
+    @Override
+    public RecordList getRecords(String prefix, Date from, Date until,
+            String set, int offset, boolean headerOnly) throws OAIException {
+        try {
+            EntityManager em = dataStore.getEntityManager();
+            CriteriaBuilder cb = em.getCriteriaBuilder();
+
+            CriteriaQuery<Long> cq1 = cb.createQuery(Long.class);
+            Root<VirtualCollection> root1 = cq1.from(VirtualCollection.class);
+            cq1.select(cb.count(root1));
+            cq1.where(buildWhere(cb, cq1, root1, from, until));
+
+            CriteriaQuery<VirtualCollection> cq2
+                    = cb.createQuery(VirtualCollection.class);
+            Root<VirtualCollection> root2 = cq2.from(VirtualCollection.class);
+            cq2.select(root2);
+            cq2.where(buildWhere(cb, cq2, root2, from, until));
+            cq2.orderBy(cb.asc(root2.get(VirtualCollection_.dateModified)));
+
+            em.getTransaction().begin();
+            TypedQuery<Long> q1 = em.createQuery(cq1);
+            TypedQuery<VirtualCollection> q2 = em.createQuery(cq2);
+            List<VirtualCollection> vcs = null;
+            long count = q1.getSingleResult();
+            if (count > 0) {
+                if (offset > 0) {
+                    q2.setFirstResult(offset);
+                }
+                q2.setMaxResults(100);
+                vcs = q2.getResultList();
+            }
+            em.getTransaction().commit();
+
+            if ((vcs != null) && !vcs.isEmpty()) {
+                List<Record> records = new ArrayList<Record>(vcs.size());
+                for (VirtualCollection vc : vcs) {
+                    records.add(createRecord(vc, headerOnly));
+                    /*
+                     * XXX: force fetching of creators.
+                     */
+                    vc.getCreators().size();
+
+                    /*
+                     *  XXX: force fetching of resources in case of "cmdi"
+                     *  prefix.
+                     */
+                    if ("cmdi".equals(prefix) && !headerOnly) {
+                        vc.getResources().size();
+                    }
+                }
+                boolean hasMore = (offset + vcs.size()) < count;
+                return new RecordList(records, offset, hasMore, (int) count);
+            } else {
+                return null;
+            }
+        } catch (Exception e) {
+            throw new OAIException("error fetching records", e);
+        } finally {
+            dataStore.closeEntityManager();
+        }
+    }
+
+    private Predicate buildWhere(CriteriaBuilder cb, CriteriaQuery<?> cq,
+            Root<VirtualCollection> root, Date from, Date until) {
+        Predicate where
+                = cb.equal(root.get(VirtualCollection_.state),
+                        VirtualCollection.State.PUBLIC);
+        if ((from != null) && (until != null)) {
+            where = cb.and(where, cb.between(root
+                    .get(VirtualCollection_.dateModified), from, until));
+        } else if (from != null) {
+            where = cb.and(where, cb.greaterThanOrEqualTo(root
+                    .get(VirtualCollection_.dateModified), from));
+        } else if (until != null) {
+            where = cb.and(where, cb.lessThanOrEqualTo(root
+                    .get(VirtualCollection_.dateModified), until));
+        }
+        return where;
+    }
+
+    private final class RecordFullImpl implements Record {
+
+        private final VirtualCollection vc;
+
+        RecordFullImpl(VirtualCollection vc) {
+            this.vc = vc;
+        }
+
+        @Override
+        public Object getLocalId() {
+            return vc.getId();
+        }
+
+        @Override
+        public Date getDatestamp() {
+            return vc.getDateModified();
+        }
+
+        @Override
+        public boolean isDeleted() {
+            return vc.getState() == VirtualCollection.State.DELETED;
+        }
+
+        @Override
+        public List<String> getSetSpecs() {
+            return null;
+        }
+
+        @Override
+        public Object getItem() {
+            return vc;
+        }
+
+        @Override
+        public Class<?> getItemClass() {
+            return VirtualCollection.class;
+        }
+    }
+
+    private final class RecordHeaderImpl implements Record {
+
+        private final Long id;
+        private final Date datestamp;
+        private final boolean deleted;
+
+        RecordHeaderImpl(VirtualCollection vc) {
+            this.id = vc.getId();
+            this.datestamp = vc.getDateModified();
+            this.deleted = (vc.getState() == VirtualCollection.State.DELETED);
+        }
+
+        @Override
+        public Object getLocalId() {
+            return id;
+        }
+
+        @Override
+        public Date getDatestamp() {
+            return datestamp;
+        }
+
+        @Override
+        public boolean isDeleted() {
+            return deleted;
+        }
+
+        @Override
+        public List<String> getSetSpecs() {
+            return null;
+        }
+
+        @Override
+        public Object getItem() {
+            return null;
+        }
+
+        @Override
+        public Class<?> getItemClass() {
+            return VirtualCollection.class;
+        }
+    }
+
+    private Record createRecord(VirtualCollection vc, boolean headerOnly) {
+        if (vc != null) {
+            if (headerOnly) {
+                logger.debug("creating header-only wrapper for vc {}",
+                        vc.getId());
+                return new RecordHeaderImpl(vc);
+            } else {
+                logger.debug("creating full wrapper for vc {}", vc.getId());
+                return new RecordFullImpl(vc);
+            }
+        }
+        return null;
+    }
+} // VirtualColletionRegistryOAIRepository
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/pid/DummyPersistentIdentifierProvider.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/pid/DummyPersistentIdentifierProvider.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/pid/DummyPersistentIdentifierProvider.java	(revision 5623)
@@ -0,0 +1,35 @@
+package eu.clarin.cmdi.virtualcollectionregistry.pid;
+
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryException;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+import java.net.URI;
+import org.springframework.context.annotation.Profile;
+import org.springframework.stereotype.Service;
+
+@Service
+@Profile("vcr.pid.dummy")
+public class DummyPersistentIdentifierProvider implements
+        PersistentIdentifierProvider {
+
+    public DummyPersistentIdentifierProvider() throws VirtualCollectionRegistryException {
+        super();
+    }
+
+    @Override
+    public PersistentIdentifier createIdentifier(VirtualCollection vc)
+            throws VirtualCollectionRegistryException {
+        return new PersistentIdentifier(vc, PersistentIdentifier.Type.DUMMY,
+                "dummy-" + Long.toString(vc.getId()));
+    }
+
+    @Override
+    public void updateIdentifier(String pid, URI target)
+            throws VirtualCollectionRegistryException {
+    }
+
+    @Override
+    public void deleteIdentifier(String pid)
+            throws VirtualCollectionRegistryException {
+    }
+
+} // class DummyPersistentIdentifierProvider
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/pid/EPICPersistentIdentifierConfiguration.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/pid/EPICPersistentIdentifierConfiguration.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/pid/EPICPersistentIdentifierConfiguration.java	(revision 5623)
@@ -0,0 +1,52 @@
+package eu.clarin.cmdi.virtualcollectionregistry.pid;
+
+import de.uni_leipzig.asv.clarin.webservices.pidservices2.Configuration;
+import de.uni_leipzig.asv.clarin.webservices.pidservices2.impl.PidWriterImpl;
+import de.uni_leipzig.asv.clarin.webservices.pidservices2.interfaces.PidWriter;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Profile;
+
+/**
+ * Configuration for
+ * {@link EPICPersistentIdentifierProvider EPIC API v2 persistent identifier provider}.
+ * Reads a number of configuration values; assumes a
+ * {@link PropertyPlaceholderConfigurer} to be configured.
+ *
+ * The following properties are required:
+ * <ul>
+ * <li>pid_provider.epic.service_base_url</li>
+ * <li>pid_provider.epic.handle_prefix</li>
+ * <li>pid_provider.epic.user</li>
+ * <li>pid_provider.epic.password</li>
+ * </ul>
+ *
+ * @author twagoo
+ * @see Configuration#Configuration(java.lang.String, java.lang.String,
+ * java.lang.String, java.lang.String)
+ */
+@Profile("vcr.pid.epic")
+@org.springframework.context.annotation.Configuration
+public class EPICPersistentIdentifierConfiguration {
+
+    @Value("${pid_provider.epic.service_base_url}")
+    private String serviceBaseUrl;
+    @Value("${pid_provider.epic.handle_prefix}")
+    private String handlePrefix;
+    @Value("${pid_provider.epic.user}")
+    private String user;
+    @Value("${pid_provider.epic.password}")
+    private String password;
+
+    @Bean
+    public Configuration configuration() {
+        return new Configuration(serviceBaseUrl, handlePrefix, user, password);
+    }
+
+    @Bean
+    public PidWriter pidWriter() {
+        return new PidWriterImpl();
+    }
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/pid/EPICPersistentIdentifierProvider.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/pid/EPICPersistentIdentifierProvider.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/pid/EPICPersistentIdentifierProvider.java	(revision 5623)
@@ -0,0 +1,92 @@
+package eu.clarin.cmdi.virtualcollectionregistry.pid;
+
+import de.uni_leipzig.asv.clarin.webservices.pidservices2.Configuration;
+import de.uni_leipzig.asv.clarin.webservices.pidservices2.HandleField;
+import de.uni_leipzig.asv.clarin.webservices.pidservices2.interfaces.PidWriter;
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryException;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+import java.net.URI;
+import java.util.EnumMap;
+import java.util.Map;
+import org.apache.commons.httpclient.HttpException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Profile;
+import org.springframework.stereotype.Service;
+
+/**
+ * PID provider that uses the EPIC API v2 to communicate with a handle provider.
+ * Wraps around the PID Resolver / PID Writer library by Thomas Eckart (Leipzig
+ * University)
+ *
+ * @author twagoo
+ * @see âhttp://www.pidconsortium.eu/
+ * @see http://epic.gwdg.de/wiki/index.php/EPIC:API
+ * @see âhttps://github.com/CatchPlus/EPIC-API-v2/
+ */
+@Service
+@Profile("vcr.pid.epic")
+public class EPICPersistentIdentifierProvider implements PersistentIdentifierProvider {
+
+    private static final Logger logger = LoggerFactory.getLogger(EPICPersistentIdentifierProvider.class);
+    private final PidWriter pidWriter;
+    private final Configuration configuration;
+
+    @Value("${eu.clarin.cmdi.virtualcollectionregistry.base_uri}")
+    private String baseUri;
+
+    /**
+     *
+     * @param pidWriter PID writer implementation to use
+     * @param configuration configuration to be passed to PID writer methods
+     */
+    @Autowired
+    public EPICPersistentIdentifierProvider(PidWriter pidWriter, Configuration configuration) {
+        this.pidWriter = pidWriter;
+        this.configuration = configuration;
+    }
+
+    @Override
+    public PersistentIdentifier createIdentifier(VirtualCollection vc) throws VirtualCollectionRegistryException {
+        logger.debug("creating handle for virtual collection \"{}\"", vc.getId());
+        final Map<HandleField, String> fieldMap = createPIDFieldMap(vc);
+        try {
+            final String requestedPid = String.format("VCR-%d", vc.getId());
+            final String pid = pidWriter.registerNewPID(configuration, fieldMap, requestedPid);
+            return new PersistentIdentifier(vc, PersistentIdentifier.Type.HANDLE, pid);
+        } catch (HttpException ex) {
+            throw new VirtualCollectionRegistryException("Could not create EPIC identifier", ex);
+        }
+    }
+
+    private Map<HandleField, String> createPIDFieldMap(VirtualCollection vc) {
+        final Map<HandleField, String> pidMap = new EnumMap<>(HandleField.class);
+        pidMap.put(HandleField.URL, makeCollectionURI(vc));
+        pidMap.put(HandleField.TITLE, vc.getName());
+        if (!vc.getCreators().isEmpty()) {
+            pidMap.put(HandleField.CREATOR, vc.getCreators().get(0).getPerson());
+        }
+        return pidMap;
+    }
+
+    @Override
+    public void updateIdentifier(String pid, URI target) throws VirtualCollectionRegistryException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public void deleteIdentifier(String pid) throws VirtualCollectionRegistryException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    private String makeCollectionURI(VirtualCollection vc) {
+        return String.format("%s/service/virtualcollections/%d", baseUri, vc.getId());
+    }
+
+    protected void setBaseUri(String baseUri) {
+        this.baseUri = baseUri;
+    }
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/pid/GWDGPersistentIdentifierProvider.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/pid/GWDGPersistentIdentifierProvider.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/pid/GWDGPersistentIdentifierProvider.java	(revision 5623)
@@ -0,0 +1,304 @@
+package eu.clarin.cmdi.virtualcollectionregistry.pid;
+
+import eu.clarin.cmdi.virtualcollectionregistry.ServletUtils;
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryException;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.ServletContext;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamReader;
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.NameValuePair;
+import org.apache.http.StatusLine;
+import org.apache.http.auth.AuthScope;
+import org.apache.http.auth.UsernamePasswordCredentials;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.http.message.BasicNameValuePair;
+import org.apache.http.params.CoreProtocolPNames;
+import org.apache.http.protocol.BasicHttpContext;
+import org.apache.http.protocol.HttpContext;
+import org.apache.http.util.EntityUtils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Profile;
+import org.springframework.stereotype.Service;
+
+@Service
+@Profile("vcr.pid.gwdg")
+public class GWDGPersistentIdentifierProvider implements
+        PersistentIdentifierProvider {
+
+    public static final String BASE_URI = "eu.clarin.cmdi.virtualcollectionregistry.base_uri";
+
+    private static enum Attribute {
+
+        PID, URL, CREATOR, EXPDATE;
+
+        public static Attribute fromString(String s) {
+            if (s.equalsIgnoreCase("pid")) {
+                return PID;
+            } else if (s.equalsIgnoreCase("url")) {
+                return URL;
+            } else if (s.equalsIgnoreCase("creator")) {
+                return CREATOR;
+            } else if (s.equalsIgnoreCase("expdate")) {
+                return EXPDATE;
+            }
+            return null;
+        }
+
+        @Override
+        public String toString() {
+            switch (this) {
+                case PID:
+                    return "pid";
+                case URL:
+                    return "url";
+                case CREATOR:
+                    return "creator";
+                case EXPDATE:
+                    return "expdate";
+                default:
+                    throw new InternalError();
+            }
+        }
+    } // private enum Attribute
+
+    public static final String USERNAME = "pid_provider.username";
+    public static final String PASSWORD = "pid_provider.password";
+    private static final String SERVICE_URI_BASE
+            = "http://handle.gwdg.de:8080/pidservice/";
+    private static final String USER_AGENT
+            = "CLARIN-VirtualCollectionRegisty/1.0";
+    private static final Logger logger
+            = LoggerFactory.getLogger(GWDGPersistentIdentifierProvider.class);
+    private String base_uri = null;
+    private String username = null;
+    private String password = null;
+    private XMLInputFactory factory;
+
+    @Autowired
+    public GWDGPersistentIdentifierProvider(ServletContext servletContext) throws VirtualCollectionRegistryException {
+        this(ServletUtils.createParameterMap(servletContext));
+    }
+
+    public GWDGPersistentIdentifierProvider(Map<String, String> config)
+            throws VirtualCollectionRegistryException {
+        super();
+        try {
+            String base_uri = getConfigParameter(config, BASE_URI);
+            if (!base_uri.endsWith("/")) {
+                base_uri = base_uri + "/";
+            }
+            URI uri = new URI(base_uri);
+            this.base_uri = uri.toString();
+        } catch (URISyntaxException e) {
+            throw new VirtualCollectionRegistryException("configuration "
+                    + "parameter \"" + BASE_URI + "\" is invalid", e);
+        }
+        this.username = getConfigParameter(config, USERNAME);
+        this.password = getConfigParameter(config, PASSWORD);
+
+        this.factory = XMLInputFactory.newInstance();
+        factory.setProperty(XMLInputFactory.IS_COALESCING, Boolean.TRUE);
+        factory.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES,
+                Boolean.TRUE);
+    }
+
+    @Override
+    public PersistentIdentifier createIdentifier(VirtualCollection vc)
+            throws VirtualCollectionRegistryException {
+        if (vc == null) {
+            throw new NullPointerException("vc == null");
+        }
+        logger.debug("creating handle for virtual collection \"{}\"",
+                vc.getId());
+        try {
+            String target = makeCollectionURI(vc);
+            URI serviceURI = URI.create(SERVICE_URI_BASE + "write/create");
+
+            List<NameValuePair> params = new ArrayList<NameValuePair>();
+            params.add(new BasicNameValuePair("url", target));
+            Map<Attribute, String> props = invokeWebService(serviceURI, params);
+            String pid = props.get(Attribute.PID);
+            if (pid == null) {
+                throw new VirtualCollectionRegistryException(
+                        "no handle returned");
+            }
+            logger.info("created handle \"{}\" for virtual collection \"{}\"",
+                    pid, vc.getId());
+            return new PersistentIdentifier(vc, PersistentIdentifier.Type.HANDLE, pid);
+        } catch (VirtualCollectionRegistryException e) {
+            throw new RuntimeException("failed to create handle", e);
+        }
+    }
+
+    @Override
+    public void updateIdentifier(String pid, URI target)
+            throws VirtualCollectionRegistryException {
+        if (pid == null) {
+            throw new NullPointerException("pid == null");
+        }
+        if (pid.isEmpty()) {
+            throw new IllegalArgumentException("pid is empty");
+        }
+        if (target == null) {
+            throw new NullPointerException("target == null");
+        }
+        List<NameValuePair> params = new ArrayList<NameValuePair>();
+        params.add(new BasicNameValuePair("pid", pid));
+        params.add(new BasicNameValuePair("url", target.toString()));
+        URI serviceURI = URI.create(SERVICE_URI_BASE + "write/modify");
+        invokeWebService(serviceURI, params);
+        logger.info("updated handle \"{}\"", pid);
+    }
+
+    @Override
+    public void deleteIdentifier(String pid)
+            throws VirtualCollectionRegistryException {
+        if (pid == null) {
+            throw new NullPointerException("pid == null");
+        }
+        if (pid.isEmpty()) {
+            throw new IllegalArgumentException("pid is empty");
+        }
+        /*
+         * actually one cannot delete a handle, but we can set an expired date
+         * to mark it invalid
+         */
+        List<NameValuePair> params = new ArrayList<NameValuePair>();
+        params.add(new BasicNameValuePair("pid", pid));
+        params.add(new BasicNameValuePair("expdate", "1970-01-01"));
+        URI serviceURI = URI.create(SERVICE_URI_BASE + "write/modify");
+        invokeWebService(serviceURI, params);
+        logger.info("deleted/expired handle \"{}\"", pid);
+    }
+
+    private String makeCollectionURI(VirtualCollection vc) {
+        return base_uri + "service/clarin-virtualcollection/" + vc.getId();
+    }
+
+    private Map<Attribute, String> invokeWebService(URI serviceTargetURI,
+            List<NameValuePair> formparams)
+            throws VirtualCollectionRegistryException {
+        // force xml encoding
+        formparams.add(new BasicNameValuePair("encoding", "xml"));
+
+        DefaultHttpClient client = null;
+        try {
+            client = new DefaultHttpClient();
+            int port = serviceTargetURI.getPort() != -1 ? serviceTargetURI
+                    .getPort() : AuthScope.ANY_PORT;
+            client.getCredentialsProvider().setCredentials(
+                    new AuthScope(serviceTargetURI.getHost(), port),
+                    new UsernamePasswordCredentials(username, password));
+            // disable expect continue, GWDG does not like very well
+            client.getParams().setParameter(
+                    CoreProtocolPNames.USE_EXPECT_CONTINUE, Boolean.FALSE);
+            // set a proper user agent
+            client.getParams().setParameter(CoreProtocolPNames.USER_AGENT,
+                    USER_AGENT);
+            HttpPost request = new HttpPost(serviceTargetURI);
+            request.addHeader("Accept", "text/xml, application/xml");
+            request.setEntity(new UrlEncodedFormEntity(formparams, "UTF-8"));
+            HttpContext ctx = new BasicHttpContext();
+
+            logger.debug("invoking GWDG service at {}", serviceTargetURI);
+            HttpResponse response = client.execute(request, ctx);
+            StatusLine status = response.getStatusLine();
+            HttpEntity entity = response.getEntity();
+            Map<Attribute, String> props = Collections.emptyMap();
+
+            logger.debug("GWDG Service status: {}", status.toString());
+            if ((status.getStatusCode() >= 200)
+                    && (status.getStatusCode() <= 299) && (entity != null)) {
+                String encoding = EntityUtils.getContentCharSet(entity);
+                if (encoding == null) {
+                    encoding = "UTF-8";
+                }
+
+                XMLStreamReader reader = factory.createXMLStreamReader(entity
+                        .getContent(), encoding);
+                props = new HashMap<Attribute, String>();
+                while (reader.hasNext()) {
+                    reader.next();
+
+                    int type = reader.getEventType();
+                    if (type != XMLStreamConstants.START_ELEMENT) {
+                        continue;
+                    }
+                    Attribute attribute = Attribute.fromString(reader
+                            .getLocalName());
+                    if (attribute != null) {
+                        if (!reader.hasNext()) {
+                            throw new VirtualCollectionRegistryException(
+                                    "unexpected end of data stream");
+                        }
+                        reader.next();
+                        if (reader.getEventType() != XMLStreamConstants.CHARACTERS) {
+                            throw new VirtualCollectionRegistryException(
+                                    "unexpected element type: "
+                                    + reader.getEventType());
+                        }
+                        String value = reader.getText();
+                        if (value == null) {
+                            throw new VirtualCollectionRegistryException(
+                                    "element \"" + attribute + "\" was empty");
+                        }
+                        value = value.trim();
+                        if (!value.isEmpty()) {
+                            props.put(attribute, value);
+                        }
+                    }
+                }
+
+            } else {
+                logger.debug("GWDG Handle service failed: {}", status);
+                request.abort();
+                throw new VirtualCollectionRegistryException(
+                        "error invoking GWDG handle service");
+            }
+            return props;
+        } catch (VirtualCollectionRegistryException e) {
+            throw e;
+        } catch (Exception e) {
+            logger.debug("GWDG Handle service failed", e);
+            throw new VirtualCollectionRegistryException(
+                    "error invoking GWDG handle service", e);
+        } finally {
+            if (client != null) {
+                client.getConnectionManager().shutdown();
+            }
+        }
+    }
+
+    private static String getConfigParameter(Map<String, String> config,
+            String parameter) throws VirtualCollectionRegistryException {
+        String value = config.get(parameter);
+        if (value == null) {
+            throw new VirtualCollectionRegistryException("configuration "
+                    + "parameter \"" + parameter + "\" is not set");
+        }
+        value = value.trim();
+        if (value.isEmpty()) {
+            throw new VirtualCollectionRegistryException("configuration "
+                    + "parameter \"" + parameter + "\" is invalid");
+        }
+        return value;
+    }
+
+} // class GWDGPersistentIdentifierProvider
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/pid/PersistentIdentifier.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/pid/PersistentIdentifier.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/pid/PersistentIdentifier.java	(revision 5623)
@@ -0,0 +1,161 @@
+package eu.clarin.cmdi.virtualcollectionregistry.pid;
+
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+import java.io.Serializable;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToOne;
+import javax.persistence.Table;
+import org.apache.commons.lang.NullArgumentException;
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+
+@Entity
+@Table(name = "pid")
+public class PersistentIdentifier implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    public static enum Type {
+
+        DUMMY, HANDLE;
+    }
+    @Id
+    @GeneratedValue(strategy = GenerationType.AUTO)
+    @Column(name = "id", nullable = false, updatable = false)
+    private Long id;
+
+    @OneToOne(cascade = CascadeType.ALL,
+            fetch = FetchType.LAZY,
+            optional = true)
+    @JoinColumn(name = "vc_id",
+            nullable = false,
+            unique = true)
+    private VirtualCollection vc;
+
+    @Column(name = "type")
+    @Enumerated(EnumType.ORDINAL)
+    private Type type;
+
+    @Column(name = "identifier",
+            nullable = false,
+            unique = true,
+            length = 255)
+    private String identifier;
+
+    protected PersistentIdentifier() {
+    }
+
+    public PersistentIdentifier(VirtualCollection vc, Type type, String identifier) {
+        if (vc == null) {
+            throw new NullArgumentException("vc == null");
+        }
+        if (type == null) {
+            throw new NullPointerException("type == null");
+        }
+        if (identifier == null) {
+            throw new NullPointerException("identifier == null");
+        }
+        identifier = identifier.trim();
+        if (identifier.isEmpty()) {
+            throw new IllegalArgumentException("identifier is empty");
+        }
+        this.vc = vc;
+        this.type = type;
+        this.identifier = identifier;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public VirtualCollection getVirtualCollection() {
+        return vc;
+    }
+
+    public Type getType() {
+        return type;
+    }
+
+    public String getIdentifier() {
+        return identifier;
+    }
+
+    /**
+     * Provides a URI representation of this persistent identifier. Notice that
+     * this URI is not necessarily actionable, and may therefore differ from the
+     * result of {@link #getActionableURI() }
+     *
+     * @return a URI for this identifier
+     * @see #getActionableURI()
+     */
+    public String getURI() {
+        switch (type) {
+            case DUMMY:
+                return "dummy:identifier-" + vc.getId();
+            case HANDLE:
+                return "hdl:" + identifier;
+            default:
+                throw new InternalError();
+        }
+    }
+
+    /**
+     * Provides a URI that can be used, without modification, to "act on" this
+     * present identifier (as if clicked on in a standard web browser).
+     * <em>Actionable URI</em> is defined as follows: "URI (3.2.2) that has a
+     * resource-associated identifier (3.2.1) that is suitably encoded, such
+     * that when the URI is embedded in a web document and âclickedâ on, the
+     * browser will be redirected to the resource (3.1.1), and possibly
+     * supplementary services related to the resource" (ISO 24619:2011 (PISA),
+     * section 3.2.6.)
+     *
+     * @return a string representation of an actionable URI for this identifier
+     * @see ISO 24619:2011 (PISA), section 3.2.6
+     */
+    public String getActionableURI() {
+        switch (type) {
+            case DUMMY:
+                return "dummy:identifier-" + vc.getId();
+            case HANDLE:
+                return "http://hdl.handle.net/" + identifier;
+            default:
+                throw new InternalError();
+        }
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null) {
+            return false;
+        }
+        if (obj == this) {
+            return true;
+        }
+        if (obj instanceof PersistentIdentifier) {
+            final PersistentIdentifier rhs = (PersistentIdentifier) obj;
+            return new EqualsBuilder()
+                    .append(this.getType(), rhs.getType())
+                    .append(this.getIdentifier(), rhs.getIdentifier())
+                    .isEquals();
+        }
+        return false;
+    }
+
+    @Override
+    public int hashCode() {
+        return new HashCodeBuilder(26249, 4651)
+                .append(this.getType())
+                .append(this.getIdentifier())
+                .toHashCode();
+    }
+
+} // class PersistentIdentifier
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/pid/PersistentIdentifierProvider.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/pid/PersistentIdentifierProvider.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/pid/PersistentIdentifierProvider.java	(revision 5623)
@@ -0,0 +1,19 @@
+package eu.clarin.cmdi.virtualcollectionregistry.pid;
+
+import java.net.URI;
+
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryException;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+
+public abstract interface PersistentIdentifierProvider {
+
+    PersistentIdentifier createIdentifier(VirtualCollection vc)
+            throws VirtualCollectionRegistryException;
+
+    void updateIdentifier(String pid, URI target)
+            throws VirtualCollectionRegistryException;
+
+    void deleteIdentifier(String pid)
+            throws VirtualCollectionRegistryException;
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/query/ASTPredicate.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/query/ASTPredicate.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/query/ASTPredicate.java	(revision 5623)
@@ -0,0 +1,116 @@
+package eu.clarin.cmdi.virtualcollectionregistry.query;
+
+public class ASTPredicate extends SimpleNode {
+    private int attribute;
+    private int operator;
+    private String value;
+
+    public ASTPredicate(int id) {
+        super(id);
+    }
+
+    public ASTPredicate(QueryParser p, int id) {
+        super(p, id);
+    }
+
+    @Override
+    public Object jjtAccept(QueryParserVisitor visitor, Object data) {
+        return visitor.visit(this, data);
+    }
+
+    public void setAttribute(int attribute) {
+        this.attribute = attribute;
+    }
+
+    public int getAttribute() {
+        return attribute;
+    }
+
+    public void setOperator(int operator) {
+        this.operator = operator;
+    }
+
+    public int getOperator() {
+        return operator;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append("Predicate[");
+        switch (attribute) {
+        case QueryParserConstants.VC_NAME:
+            sb.append("vc_name");
+            break;
+        case QueryParserConstants.VC_DESC:
+            sb.append("vc_desc");
+            break;
+        case QueryParserConstants.VC_STATE:
+            sb.append("vc_state");
+            break;
+        case QueryParserConstants.VC_PURPOSE:
+            sb.append("vc_purpose");
+            break;
+        case QueryParserConstants.VC_REPRODUCIBILITY:
+            sb.append("vc_reproducibility");
+            break;
+        case QueryParserConstants.VC_MODIFIED:
+            sb.append("vc_modified");
+            break;
+        case QueryParserConstants.VC_CREATED:
+            sb.append("vc_created");
+            break;
+        case QueryParserConstants.VC_OWNER:
+            sb.append("vc_owner");
+            break;
+        case QueryParserConstants.CR_PERSON:
+            sb.append("cr_name");
+            break;
+        case QueryParserConstants.CR_EMAIL:
+            sb.append("cr_email");
+            break;
+        case QueryParserConstants.CR_ORGANIZATION:
+            sb.append("cr_organization");
+            break;
+        default:
+            sb.append("0x");
+            sb.append(Integer.toHexString(attribute));
+        } // switch (attribute)
+        sb.append(", ");
+        switch (operator) {
+        case QueryParserConstants.EQ:
+            sb.append("eq");
+            break;
+        case QueryParserConstants.NE:
+            sb.append("ne");
+            break;
+        case QueryParserConstants.GT:
+            sb.append("gt");
+            break;
+        case QueryParserConstants.GE:
+            sb.append("ge");
+            break;
+        case QueryParserConstants.LT:
+            sb.append("lt");
+            break;
+        case QueryParserConstants.LE:
+            sb.append("le");
+            break;
+         default:
+             sb.append("0x");
+             sb.append(Integer.toHexString(operator));
+        } // switch (operator)
+        sb.append(", ");
+        sb.append(value);
+        sb.append("]");
+        return sb.toString();
+    }
+} // class ASTPredicate
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/query/ParsedQuery.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/query/ParsedQuery.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/query/ParsedQuery.java	(revision 5623)
@@ -0,0 +1,104 @@
+package eu.clarin.cmdi.virtualcollectionregistry.query;
+
+import javax.persistence.EntityManager;
+import javax.persistence.TypedQuery;
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Predicate;
+import javax.persistence.criteria.Root;
+
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryException;
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryUsageException;
+import eu.clarin.cmdi.virtualcollectionregistry.model.User;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection_;
+
+public class ParsedQuery {
+    private static final WhereClauseBuilder visitor = new WhereClauseBuilder();
+    private final String query;
+    private final ASTStart start;
+
+    private ParsedQuery(String query, ASTStart start) {
+        this.query = query;
+        this.start = start;
+    }
+
+    public TypedQuery<Long> getCountQuery(EntityManager em, User owner,
+            VirtualCollection.State state)
+            throws VirtualCollectionRegistryException {
+        try {
+            CriteriaBuilder cb = em.getCriteriaBuilder();
+            CriteriaQuery<Long> cq = cb.createQuery(Long.class);
+            Root<VirtualCollection> root = cq.from(VirtualCollection.class);
+            WhereClauseBuilder.Data data =
+                new WhereClauseBuilder.Data(cb, cq, root);
+            visitor.visit(start, data);
+
+            Predicate where = data.getWhere();
+            if (owner != null) {
+                where = cb.and(where, cb.equal(
+                            root.get(VirtualCollection_.owner), owner));
+            }
+            if (state != null) {
+                where = cb.and(where, cb.equal(
+                            root.get(VirtualCollection_.state), state));
+            }
+            cq.where(where);
+            return em.createQuery(cq.select(cb.count(root)));
+        } catch (Throwable e) {
+            throw new VirtualCollectionRegistryException(
+                    "error building query", e);
+        }
+    }
+
+    public TypedQuery<VirtualCollection> getQuery(EntityManager em, User owner,
+            VirtualCollection.State state)
+            throws VirtualCollectionRegistryException {
+        try {
+            CriteriaBuilder cb = em.getCriteriaBuilder();
+            CriteriaQuery<VirtualCollection> cq =
+                cb.createQuery(VirtualCollection.class);
+            Root<VirtualCollection> root = cq.from(VirtualCollection.class);
+            WhereClauseBuilder.Data data =
+                new WhereClauseBuilder.Data(cb, cq, root);
+            visitor.visit(start, data);
+
+            Predicate where = data.getWhere();
+            if (owner != null) {
+                where = cb.and(where, cb.equal(
+                            root.get(VirtualCollection_.owner), owner));
+            }
+            if (state != null) {
+                where = cb.and(where, cb.equal(
+                            root.get(VirtualCollection_.state), state));
+            }
+            cq.where(where);
+            return em.createQuery(cq.select(root));
+        } catch (Throwable e) {
+            throw new VirtualCollectionRegistryException(
+                    "error building query", e);
+        }
+    }
+
+    public String getPrettyPrinted() {
+        StringBuilder sb = new StringBuilder();
+        sb.append("query: ");
+        sb.append(query);
+        sb.append("\n");
+        PrettyPrinter pp = new PrettyPrinter(sb);
+        pp.visit(start, null);
+        return sb.toString();
+    }
+
+    public static ParsedQuery parseQuery(String query)
+        throws VirtualCollectionRegistryUsageException {
+        try {
+            QueryParser parser = new QueryParser(query);
+            return new ParsedQuery(query, parser.start());
+        } catch (Throwable e) {
+            throw new VirtualCollectionRegistryUsageException(
+                        "invalid query", e);
+        }
+    }
+
+} // class ParsedQuery
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/query/PrettyPrinter.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/query/PrettyPrinter.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/query/PrettyPrinter.java	(revision 5623)
@@ -0,0 +1,92 @@
+package eu.clarin.cmdi.virtualcollectionregistry.query;
+
+import java.util.Stack;
+
+public class PrettyPrinter implements QueryParserVisitor {
+    private StringBuilder out;
+    private Stack<Node> parents = new Stack<Node>();
+
+    public PrettyPrinter(StringBuilder out) {
+        if (out == null) {
+            throw new NullPointerException("out == null");
+        }
+        this.out = out;
+    }
+
+    @Override
+    public Object visit(ASTStart node, Object data) {
+        out.append(node);
+        out.append("\n");
+        data = node.childrenAccept(this, data);
+        return data;
+    }
+
+    @Override
+    public Object visit(ASTOr node, Object data) {
+        printNode(node);
+        parents.push(node);
+        data = node.childrenAccept(this, data);
+        parents.pop();
+        return data;
+    }
+
+    @Override
+    public Object visit(ASTAnd node, Object data) {
+        printNode(node);
+        parents.push(node);
+        data = node.childrenAccept(this, data);
+        parents.pop();
+        return data;
+    }
+
+    @Override
+    public Object visit(ASTPredicate node, Object data) {
+        printNode(node);
+        return data;
+    }
+
+    @Override
+    public Object visit(SimpleNode node, Object data) {
+        System.err.println("simpleNode");
+        parents.push(node);
+        data = node.childrenAccept(this, data);
+        parents.pop();
+        return data;
+    }
+
+    private void printNode(Node node) {
+        for (Node parent : parents) {
+            if (isLastSibling(parent)) {
+                out.append("   ");
+            } else {
+                out.append(" | ");
+            }
+        }
+        if (isLastSibling(node)) {
+            out.append(" \\-");
+        } else {
+            out.append(" +-");
+        }
+        if (node instanceof ASTPredicate) {
+            out.append(" ");
+            out.append(node.toString());
+            out.append("\n");
+        } else {
+            out.append("[");
+            out.append(node.toString());
+            out.append("]");
+            out.append("\n");
+        }
+    }
+
+    private boolean isLastSibling(Node node) {
+        Node parent = node.jjtGetParent();
+        if (parent == null) {
+            return true;
+        } else {
+            int idx = parent.jjtGetNumChildren() -1;
+            Node n = parent.jjtGetChild(idx);
+            return node.equals(n);
+        }
+    }
+} // class PrettyPrinter
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/query/WhereClauseBuilder.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/query/WhereClauseBuilder.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/query/WhereClauseBuilder.java	(revision 5623)
@@ -0,0 +1,319 @@
+package eu.clarin.cmdi.virtualcollectionregistry.query;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.text.ParseException;
+import java.util.Date;
+import java.util.Stack;
+
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Expression;
+import javax.persistence.criteria.Predicate;
+import javax.persistence.criteria.Root;
+
+import eu.clarin.cmdi.virtualcollectionregistry.model.Creator_;
+import eu.clarin.cmdi.virtualcollectionregistry.model.User_;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection_;
+
+class WhereClauseBuilder implements QueryParserVisitor {
+    static class Data {
+        private CriteriaBuilder cb;
+        private CriteriaQuery<?> cq;
+        private Root<VirtualCollection> root;
+        private Stack<Predicate> stack;
+
+        public Data(CriteriaBuilder cb, CriteriaQuery<?> cq,
+                Root<VirtualCollection> root) {
+            this.cb = cb;
+            this.cq = cq;
+            this.root = root;
+            this.stack = new Stack<Predicate>();
+        }
+
+        public CriteriaBuilder getBuilder() {
+            return cb;
+        }
+
+        public CriteriaQuery<?> getQuery() {
+            return cq;
+        }
+
+        public Root<VirtualCollection> getRoot() {
+            return root;
+        }
+
+        public Stack<Predicate> getStack() {
+            return stack;
+        }
+
+        public Predicate getWhere() {
+            return stack.peek();
+        }
+    } // inner class Data
+
+    @Override
+    public Object visit(ASTStart node, Object d) {
+        final Data data = (Data) d;
+        node.childrenAccept(this, data);
+        if (data.getStack().size() != 1) {
+            throw new InternalError("expected only one element on stack");
+        }
+        return data;
+    }
+
+    @Override
+    public Object visit(ASTOr node, Object d) {
+        final Data data = (Data) d;
+        node.childrenAccept(this, data);
+        Predicate[] predicates = new Predicate[node.jjtGetNumChildren()];
+        for (int i = 0; i < node.jjtGetNumChildren(); i++) {
+            predicates[i] = data.getStack().pop();
+        }
+        data.getStack().push(data.getBuilder().or(predicates));
+        return data;
+    }
+
+    @Override
+    public Object visit(ASTAnd node, Object d) {
+        final Data data = (Data) d;
+        node.childrenAccept(this, data);
+        Predicate[] predicates = new Predicate[node.jjtGetNumChildren()];
+        for (int i = 0; i < node.jjtGetNumChildren(); i++) {
+            predicates[i] = data.getStack().pop();
+        }
+        data.getStack().push(data.getBuilder().and(predicates));
+        return data;
+    }
+
+    @Override
+    public Object visit(ASTPredicate node, Object d) {
+        final Data data = (Data) d;
+        final Root<VirtualCollection> root = data.getRoot();
+
+        Predicate predicate = null;
+        switch (node.getAttribute()) {
+        case QueryParserConstants.VC_NAME:
+            predicate = makeStringPredicate(data,
+                    root.get(VirtualCollection_.name),
+                    node.getOperator(), node.getValue());
+            break;
+        case QueryParserConstants.VC_DESC:
+            predicate = makeStringPredicate(data,
+                    root.get(VirtualCollection_.description),
+                    node.getOperator(), node.getValue());
+            break;
+        case QueryParserConstants.VC_STATE:
+            predicate = makeStatePredicate(data,
+                    node.getOperator(), node.getValue());
+            break;
+        case QueryParserConstants.VC_PURPOSE:
+            predicate = makePurposePredicate(data,
+                    node.getOperator(), node.getValue());
+            break;
+        case QueryParserConstants.VC_REPRODUCIBILITY:
+            predicate = makeReproducibilityPredicate(data,
+                    node.getOperator(), node.getValue());
+            break;
+        case QueryParserConstants.VC_CREATED:
+            predicate = makeDatePredicate(data,
+                    root.get(VirtualCollection_.dateCreated),
+                    node.getOperator(), node.getValue());
+            break;
+        case QueryParserConstants.VC_MODIFIED:
+            predicate = makeDatePredicate(data,
+                    root.get(VirtualCollection_.dateModified),
+                    node.getOperator(), node.getValue());
+            break;
+        case QueryParserConstants.VC_OWNER:
+            predicate = makeStringPredicate(data,
+                    root.get(VirtualCollection_.owner).get(User_.name),
+                    node.getOperator(), node.getValue());
+            break;
+        case QueryParserConstants.CR_PERSON:
+            predicate = makeStringPredicate(data,
+                    root.join(VirtualCollection_.creators).get(Creator_.person),
+                    node.getOperator(), node.getValue());
+            break;
+        case QueryParserConstants.CR_EMAIL:
+            predicate = makeStringPredicate(data,
+                    root.join(VirtualCollection_.creators).get(Creator_.email),
+                    node.getOperator(), node.getValue());
+            break;
+        case QueryParserConstants.CR_ORGANIZATION:
+            predicate = makeStringPredicate(data,
+                    root.join(VirtualCollection_.creators)
+                        .get(Creator_.organisation),
+                    node.getOperator(), node.getValue());
+            break;
+        default:
+            /* FALL-TROUGH */
+        } // switch (node.getAttribute())
+
+        if (predicate == null) {
+            throw new InternalError("bad attribute");
+        }
+        data.getStack().push(predicate);
+        return data;
+    }
+
+    @Override
+    public Object visit(SimpleNode node, Object data) {
+        throw new InternalError("unexpected node (" + node.value + ")");
+    }
+
+    private static Predicate makeStringPredicate(Data data,
+            Expression<String> attribute, int operator, String value) {
+        // escape SQL specific stuff
+        value = value.replace("\\", "\\\\");
+        value = value.replace("%", "\\%");
+        value = value.replace("_", "\\_");
+        // replace query language wildcards with add SQL wildcards
+        value = value.replace("*", "%");
+
+        // XXX: HSQLDB/Hibernate seems have trouble with escape char
+        switch (operator) {
+        case QueryParserConstants.EQ:
+            return data.getBuilder().like(attribute, value/*, '\\'*/);
+        case QueryParserConstants.NE:
+            return data.getBuilder().notLike(attribute, value/*, '\\'*/);
+        default:
+            throw new InternalError("bad operator");
+        } // switch (operator)
+    }
+
+    private static Predicate makeStatePredicate(Data data, int operator,
+            String value) {
+        VirtualCollection.State state = null;
+        if ("public".equalsIgnoreCase(value)) {
+            state = VirtualCollection.State.PUBLIC;
+        } else if ("private".equalsIgnoreCase(value)) {
+            state = VirtualCollection.State.PRIVATE;
+        } else if ("deleted".equalsIgnoreCase(value)) {
+            state = VirtualCollection.State.DELETED;
+        } else {
+            throw new InternalError("bad value");
+        }
+        CriteriaBuilder cb = data.getBuilder();
+        Expression<VirtualCollection.State> attribute =
+            data.getRoot().get(VirtualCollection_.state);
+        switch (operator) {
+        case QueryParserConstants.EQ:
+            // special case for public state
+            if (state == VirtualCollection.State.PUBLIC) {
+                return cb.or(
+                        cb.equal(attribute,
+                                 VirtualCollection.State.PUBLIC),
+                        cb.equal(attribute,
+                                 VirtualCollection.State.PUBLIC_PENDING));
+            } else {
+                return data.getBuilder().equal(attribute, state);
+            }
+        case QueryParserConstants.NE:
+            // special case for public state
+            if (state == VirtualCollection.State.PUBLIC) {
+                return cb.and(
+                        cb.notEqual(attribute,
+                                    VirtualCollection.State.PUBLIC),
+                        cb.notEqual(attribute,
+                                    VirtualCollection.State.PUBLIC_PENDING));
+
+            } else {
+                return data.getBuilder().notEqual(attribute, state);
+            }
+        default:
+            throw new InternalError("bad operator");
+        } // switch (operator)
+    }
+
+    private static Predicate makePurposePredicate(Data data, int operator,
+            String value) {
+        VirtualCollection.Purpose purpose = null;
+        if ("research".equalsIgnoreCase(value)) {
+            purpose = VirtualCollection.Purpose.RESEARCH;
+        } else if ("reference".equalsIgnoreCase(value)) {
+            purpose = VirtualCollection.Purpose.REFERENCE;
+        } else if ("sample".equalsIgnoreCase(value)) {
+            purpose = VirtualCollection.Purpose.SAMPLE;
+        } else if ("future-use".equalsIgnoreCase(value)) {
+            purpose = VirtualCollection.Purpose.FUTURE_USE;
+        } else {
+            throw new InternalError("bad value");
+        }
+        Expression<VirtualCollection.Purpose> attribute =
+            data.getRoot().get(VirtualCollection_.purpose);
+        switch (operator) {
+        case QueryParserConstants.EQ:
+            return data.getBuilder().equal(attribute, purpose);
+        case QueryParserConstants.NE:
+            return data.getBuilder().notEqual(attribute, purpose);
+        default:
+            throw new InternalError("bad operator");
+        } // switch (operator)
+    }
+
+    private static Predicate makeReproducibilityPredicate(Data data,
+            int operator, String value) {
+        VirtualCollection.Reproducibility reproducability = null;
+        if ("intended".equalsIgnoreCase(value)) {
+            reproducability = VirtualCollection.Reproducibility.INTENDED;
+        } else if ("fluctuating".equalsIgnoreCase(value)) {
+            reproducability = VirtualCollection.Reproducibility.FLUCTUATING;
+        } else if ("untended".equalsIgnoreCase(value)) {
+            reproducability = VirtualCollection.Reproducibility.UNTENDED;
+        } else {
+            throw new InternalError("bad value");
+        }
+        Expression<VirtualCollection.Reproducibility> attribute =
+            data.getRoot().get(VirtualCollection_.reproducibility);
+        switch (operator) {
+        case QueryParserConstants.EQ:
+            return data.getBuilder().equal(attribute, reproducability);
+        case QueryParserConstants.NE:
+            return data.getBuilder().notEqual(attribute, reproducability);
+        default:
+            throw new InternalError("bad operator");
+        } // switch (operator)
+    }
+
+    private static Predicate makeDatePredicate(Data data,
+            Expression<Date> attribute, int operator, String value) {
+        Date date = null;
+        try {
+            DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssz");
+            if (value.endsWith("Z")) {
+                value = value.substring(0, value.length() - 1) + "GMT-00:00";
+            } else {
+                int inset = 6;
+                String s0 =
+                    value.substring(0, value.length() - inset);
+                String s1 =
+                    value.substring(value.length() - inset, value.length());
+                value = s0 + "GMT" + s1;
+            }
+            date = df.parse(value);
+        } catch (ParseException e) {
+            throw new RuntimeException("invalid date", e);
+        }
+
+        CriteriaBuilder cb = data.getBuilder();
+        switch (operator) {
+        case QueryParserConstants.EQ:
+            return cb.equal(attribute, date);
+        case QueryParserConstants.NE:
+            return cb.notEqual(attribute, date);
+        case QueryParserConstants.GT:
+            return cb.greaterThan(attribute, date);
+        case QueryParserConstants.GE:
+            return cb.greaterThanOrEqualTo(attribute, date);
+        case QueryParserConstants.LT:
+            return cb.lessThan(attribute, date);
+        case QueryParserConstants.LE:
+            return cb.lessThanOrEqualTo(attribute, date);
+        default:
+            throw new InternalError("bad operator");
+        }
+    }
+
+} // class WhereClauseBuilder
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/BaseResource.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/BaseResource.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/BaseResource.java	(revision 5623)
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2014 CLARIN
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package eu.clarin.cmdi.virtualcollectionregistry.rest;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.StreamingOutput;
+import org.apache.wicket.util.io.IOUtils;
+
+/**
+ *
+ * @author twagoo
+ */
+@Path("")
+public class BaseResource {
+
+    /**
+     * Serves a short description HTML page at the service root
+     *
+     * @return
+     */
+    @GET
+    @Path("/")
+    @Produces({MediaType.TEXT_XML})
+    public Response getDescription() {
+        final StreamingOutput writer = new StreamingOutput() {
+            @Override
+            public void write(OutputStream output) throws IOException,
+                    WebApplicationException {
+                try (InputStream is = getClass().getResourceAsStream("/restIndex.html")) {
+                    IOUtils.copy(is, output);
+                } finally {
+                    output.close();
+                }
+            }
+        };
+        return Response.ok(writer).type(MediaType.TEXT_HTML).build();
+    }
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/IllegalArgumentExceptionMapper.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/IllegalArgumentExceptionMapper.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/IllegalArgumentExceptionMapper.java	(revision 5623)
@@ -0,0 +1,21 @@
+package eu.clarin.cmdi.virtualcollectionregistry.rest;
+
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.ExceptionMapper;
+import javax.ws.rs.ext.Provider;
+
+@Provider
+public class IllegalArgumentExceptionMapper implements
+        ExceptionMapper<IllegalArgumentException> {
+
+    @Override
+    public Response toResponse(IllegalArgumentException e) {
+        RestResponse response = new RestResponse();
+        response.setIsSuccess(false);
+        response.setInfo(e.getMessage());
+        return Response.status(Response.Status.BAD_REQUEST).type(
+                MediaType.APPLICATION_XML).entity(response).build();
+    }
+
+} // class IllegalArgumentExceptionMapper
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/MyVirtualCollectionsResource.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/MyVirtualCollectionsResource.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/MyVirtualCollectionsResource.java	(revision 5623)
@@ -0,0 +1,100 @@
+package eu.clarin.cmdi.virtualcollectionregistry.rest;
+
+import com.sun.jersey.api.core.InjectParam;
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistry;
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryException;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollectionList;
+import eu.clarin.cmdi.virtualcollectionregistry.service.VirtualCollectionMarshaller;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.net.URI;
+import java.security.Principal;
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.SecurityContext;
+import javax.ws.rs.core.StreamingOutput;
+import javax.ws.rs.core.UriInfo;
+
+/**
+ * REST resource representing the collection of the user's virtual collections
+ * (public or private)
+ *
+ * @author twagoo
+ */
+@Path("/my-virtualcollections")
+public class MyVirtualCollectionsResource {
+
+    @InjectParam
+    private VirtualCollectionRegistry registry;
+    @InjectParam
+    private VirtualCollectionMarshaller marshaller;
+    @Context
+    private SecurityContext security;
+    @Context
+    private UriInfo uriInfo;
+    @Context
+    private HttpHeaders headers;
+
+    /**
+     * All virtual collections owned by the authenticated user will be
+     * retrieved; if a query expression is used, only the virtual collections
+     * satisfying the query will be retrieved.
+     *
+     * @param query a Virtual Collection Query Language expression
+     * @param offset
+     * @param count
+     * @return a serialised list of all virtual collections created by the
+     * authenticated user
+     * @throws VirtualCollectionRegistryException if the collections could not
+     * be retrieved
+     * @see
+     * VirtualCollectionRegistry#getVirtualCollections(java.security.Principal,
+     * java.lang.String, int, int)
+     */
+    @GET
+    @Produces({MediaType.TEXT_XML,
+        MediaType.APPLICATION_XML,
+        MediaType.APPLICATION_JSON})
+    public Response getMyVirtualCollections(@QueryParam("q") String query,
+            @DefaultValue("0") @QueryParam("offset") int offset,
+            @DefaultValue("-1") @QueryParam("count") int count)
+            throws VirtualCollectionRegistryException {
+        Principal principal = security.getUserPrincipal();
+        if (principal == null) {
+            String path = uriInfo.getPath();
+            if (path.endsWith("/")) {
+                /*
+                 * fix bad client request and remove tailing slash
+                 */
+                path = path.substring(0, path.length() - 1);
+                URI uri = uriInfo.getBaseUriBuilder().path(path).build();
+                return Response.seeOther(uri).build();
+            }
+            /*
+             * should never happen, because servlet container should supply a
+             * valid principal
+             */
+            throw new AssertionError("principal == null");
+        }
+        final VirtualCollectionList vcs = registry.getVirtualCollections(
+                principal, query, (offset > 0) ? offset : 0, count);
+        StreamingOutput writer = new StreamingOutput() {
+            @Override
+            public void write(OutputStream output) throws IOException,
+                    WebApplicationException {
+                final VirtualCollectionMarshaller.Format format = RestUtils.getOutputFormat(headers.getAcceptableMediaTypes());
+                marshaller.marshal(output, format, vcs);
+                output.close();
+            }
+        };
+        return Response.ok(writer).build();
+    }
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/PersistenceFilter.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/PersistenceFilter.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/PersistenceFilter.java	(revision 5623)
@@ -0,0 +1,47 @@
+package eu.clarin.cmdi.virtualcollectionregistry.rest;
+
+import eu.clarin.cmdi.virtualcollectionregistry.DataStore;
+import java.io.IOException;
+import java.util.Collection;
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import org.springframework.web.context.WebApplicationContext;
+import org.springframework.web.context.support.WebApplicationContextUtils;
+
+public class PersistenceFilter implements Filter {
+
+    private DataStore dataStore;
+
+    @Override
+    public void init(FilterConfig config) throws ServletException {
+        final WebApplicationContext springContext
+                = WebApplicationContextUtils.getWebApplicationContext(config.getServletContext());
+        Collection<DataStore> values = springContext.getBeansOfType(DataStore.class).values();
+        if (values.isEmpty()) {
+            throw new ServletException("No data store bean found");
+        }
+        this.dataStore = values.iterator().next();
+    }
+
+    @Override
+    public void doFilter(ServletRequest req, ServletResponse res,
+            FilterChain chain) throws IOException, ServletException {
+        try {
+            chain.doFilter(req, res);
+        } catch (IOException e) {
+            throw e;
+        } finally {
+            dataStore.closeEntityManager();
+        }
+    }
+
+    @Override
+    public void destroy() {
+        // DO NOTHING
+    }
+
+} // class PersistenceFilter
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/RestResponse.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/RestResponse.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/RestResponse.java	(revision 5623)
@@ -0,0 +1,62 @@
+package eu.clarin.cmdi.virtualcollectionregistry.rest;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlRootElement(name = "RegistryResult")
+@XmlAccessorType(XmlAccessType.NONE)
+@XmlType(propOrder = { "id", "info", "errors" })
+public class RestResponse {
+    private boolean isSuccess;
+    private Long id;
+    private String info;
+    private List<String> errors;
+
+    public void setIsSuccess(boolean isSuccess) {
+        this.isSuccess = isSuccess;
+    }
+
+    @XmlAttribute(name = "success")
+    public boolean isSuccess() {
+        return isSuccess;
+    }
+
+    public void setId(long id) {
+        this.id = Long.valueOf(id);
+    }
+
+    @XmlElement(name = "VirtualCollectionId")
+    public Long getId() {
+        return id;
+    }
+
+    public void setInfo(String info) {
+        this.info = info;
+    }
+
+    @XmlElement(name = "Info")
+    public String getInfo() {
+        return info;
+    }
+
+    public void setError(List<String> errors) {
+        if ((errors != null) && !errors.isEmpty()) {
+            this.errors = errors;
+        }
+    }
+
+    @XmlElementWrapper(name = "Errors")
+    @XmlElements( { @XmlElement(name = "Error") })
+    public List<String> getErrors() {
+        return errors;
+    }
+
+} // class RestResponse
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/RestUtils.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/RestUtils.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/RestUtils.java	(revision 5623)
@@ -0,0 +1,70 @@
+package eu.clarin.cmdi.virtualcollectionregistry.rest;
+
+import eu.clarin.cmdi.virtualcollectionregistry.service.VirtualCollectionMarshaller.Format;
+import java.util.List;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+
+/**
+ * REST input/ouput utilities for the Virtual Collection Registry REST resources
+ *
+ * @author twagoo
+ */
+public final class RestUtils {
+
+    /**
+     *
+     * @param headers
+     * @return the encoding specified in the headers, defaults to "utf-8" if
+     * none is specified
+     * @see HttpHeaders#getMediaType()
+     */
+    public static String getInputEncoding(HttpHeaders headers) {
+        String encoding
+                = headers.getMediaType().getParameters().get("encoding");
+        return (encoding != null) ? encoding : "utf-8";
+    }
+
+    /**
+     *
+     * @param headers
+     * @return the input format specified in the headers, normalises to
+     * {@link Format#XML} or {@link Format#JSON}, or defaults to
+     * {@link Format#UNSUPPORTED} if none is specified in the headers
+     * @see HttpHeaders#getMediaType()
+     */
+    public static Format getInputFormat(HttpHeaders headers) {
+        Format format = getMediaType(headers.getMediaType());
+        return (format != null) ? format : Format.UNSUPPORTED;
+    }
+
+    /**
+     *
+     * @param headers
+     * @return the first accepted output format specified in the headers that
+     * can be normalised to {@link Format#XML} or {@link Format#JSON}, or
+     * defaults to {@link Format#UNSUPPORTED} if none is specified in the
+     * headers
+     * @see HttpHeaders#getAcceptableMediaTypes()
+     */
+    public static Format getOutputFormat(List<MediaType> mediaTypes) {
+        for (MediaType type : mediaTypes) {
+            Format format = getMediaType(type);
+            if (format != null) {
+                return format;
+            }
+        }
+        return Format.UNSUPPORTED;
+    }
+
+    private static Format getMediaType(MediaType type) {
+        if (type.isCompatible(MediaType.APPLICATION_XML_TYPE)
+                || type.isCompatible(MediaType.TEXT_XML_TYPE)) {
+            return Format.XML;
+        }
+        if (type.isCompatible(MediaType.APPLICATION_JSON_TYPE)) {
+            return Format.JSON;
+        }
+        return null;
+    }
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/State.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/State.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/State.java	(revision 5623)
@@ -0,0 +1,28 @@
+package eu.clarin.cmdi.virtualcollectionregistry.rest;
+
+import javax.xml.bind.annotation.XmlEnum;
+import javax.xml.bind.annotation.XmlEnumValue;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement(name="State")
+@XmlEnum(String.class)
+public enum State {
+    @XmlEnumValue("private")
+    PRIVATE,
+    @XmlEnumValue("public")
+    PUBLIC;
+
+    @Override
+    public String toString() {
+        switch (this) {
+        case PRIVATE:
+            return "private";
+        case PUBLIC:
+            return "public";
+        default:
+            throw new InternalError();
+
+        }
+    }
+
+} // enum State
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/VirtualCollectionCMDIBodyWriter.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/VirtualCollectionCMDIBodyWriter.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/VirtualCollectionCMDIBodyWriter.java	(revision 5623)
@@ -0,0 +1,49 @@
+package eu.clarin.cmdi.virtualcollectionregistry.rest;
+
+import com.sun.jersey.api.core.InjectParam;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+import eu.clarin.cmdi.virtualcollectionregistry.service.VirtualCollectionMarshaller;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import javax.ws.rs.Produces;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status;
+import javax.ws.rs.ext.MessageBodyWriter;
+import javax.ws.rs.ext.Provider;
+
+/**
+ * Body writer that outputs a CMDI representation of a virtual collection
+ *
+ * @author twagoo
+ */
+@Provider
+@Produces(VirtualCollectionResource.MediaTypes.CMDI)
+public class VirtualCollectionCMDIBodyWriter implements MessageBodyWriter<VirtualCollection> {
+
+    @InjectParam
+    private VirtualCollectionMarshaller marshaller;
+
+    @Override
+    public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
+        return type.equals(VirtualCollection.class);
+    }
+
+    @Override
+    public long getSize(VirtualCollection t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
+        return -1;
+    }
+
+    @Override
+    public void writeTo(VirtualCollection vc, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream stream) throws IOException, WebApplicationException {
+        if (!vc.isPublic() || (vc.getPersistentIdentifier() == null)) {
+            throw new WebApplicationException(Response.status(Status.NOT_ACCEPTABLE).entity("CMDI not available for unpublished profiles. Please request XML or JSON").build());
+        }
+        marshaller.marshalAsCMDI(stream, VirtualCollectionMarshaller.Format.XML, vc);
+    }
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/VirtualCollectionFormSubmissionResource.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/VirtualCollectionFormSubmissionResource.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/VirtualCollectionFormSubmissionResource.java	(revision 5623)
@@ -0,0 +1,157 @@
+package eu.clarin.cmdi.virtualcollectionregistry.rest;
+
+import com.sun.jersey.api.core.InjectParam;
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistry;
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryException;
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryUsageException;
+import eu.clarin.cmdi.virtualcollectionregistry.model.GeneratedBy;
+import eu.clarin.cmdi.virtualcollectionregistry.model.GeneratedByQuery;
+import eu.clarin.cmdi.virtualcollectionregistry.model.Resource;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection.Purpose;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection.Reproducibility;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection.Type;
+import java.net.URI;
+import java.security.Principal;
+import java.util.Date;
+import java.util.List;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.FormParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.SecurityContext;
+import javax.ws.rs.core.UriInfo;
+
+/**
+ *
+ * @author twagoo
+ */
+@Path("/submit")
+public class VirtualCollectionFormSubmissionResource {
+
+    @InjectParam
+    private VirtualCollectionRegistry registry;
+    @Context
+    private SecurityContext security;
+    @Context
+    private UriInfo uriInfo;
+
+    @POST
+    @Consumes({MediaType.APPLICATION_FORM_URLENCODED})
+    @Produces({MediaType.TEXT_HTML})
+    public Response submitNewVc(
+            @FormParam("type") @DefaultValue("EXTENSIONAL") Type type,
+            @FormParam("name") String name,
+            @FormParam("metadataUri") List<String> metadataUris,
+            @FormParam("resourceUri") List<String> resourceUris,
+            @FormParam("description") String description,
+            //optional params
+            @FormParam("keyword") List<String> keyword,
+            @FormParam("purpose") Purpose purpose,
+            @FormParam("reproducibility") Reproducibility reproducibility,
+            @FormParam("reproducibilityNotice") String reproducibilityNotice,
+            @FormParam("creationDate") Date creationDate,
+            @FormParam("queryDescription") String intensionalDescription,
+            @FormParam("queryUri") String intensionalUri,
+            @FormParam("queryProfile") String intensionalQueryProfile,
+            @FormParam("queryValue") String intensionalQueryValue
+    ) {
+        final Principal principal = security.getUserPrincipal();
+        if (principal == null) {
+            /*
+             * should never happen, because servlet container should supply a
+             * valid principal
+             */
+            throw new AssertionError("principal == null");
+        }
+
+        try {
+            // construct a proto-VC from the form parameters
+            final VirtualCollection vc = constructVirtualCollection(type, name,
+                    metadataUris, resourceUris, description, keyword, purpose,
+                    reproducibility, reproducibilityNotice, creationDate,
+                    intensionalDescription, intensionalUri, intensionalQueryProfile, intensionalQueryValue);
+
+            // create the VC in the registry (persist)
+            long id = registry.createVirtualCollection(principal, vc);
+
+            // respond with redirect to editor
+            final URI uri = uriInfo.getBaseUriBuilder()
+                    .path("../app/edit/{arg1}")
+                    .build(id);
+            return Response.seeOther(uri).build();
+        } catch (VirtualCollectionRegistryException ex) {
+            //TODO: wrap in friendly HTML page
+            final Response.Status response = Response.Status.BAD_REQUEST;
+            final String error = String.format("<html>\n<body>\n<h1>%d %s</h1>\nCould not create virtual collection. Reason: %s\n</body>\n</html>\n", response.getStatusCode(), response.toString(), ex.getMessage());
+            return Response.status(response).entity(error).build();
+        }
+    }
+
+    private VirtualCollection constructVirtualCollection(Type type, String name,
+            List<String> metadataUris, List<String> resourceUris, String description,
+            List<String> keywords, Purpose purpose, Reproducibility reproducibility,
+            String reproducibilityNotice, Date creationDate, String intensionalDescription,
+            String intensionalUri, String intensionalQueryProfile, String intensionalQueryValue) throws VirtualCollectionRegistryException {
+        final VirtualCollection vc = new VirtualCollection();
+
+        if (type == null) {
+            throw new VirtualCollectionRegistryUsageException("No type specified for collection");
+        }
+        if (name == null) {
+            throw new VirtualCollectionRegistryUsageException("No name specified for collection");
+
+        }
+
+        vc.setType(type);
+        vc.setName(name);
+
+        // add resources: type metadata
+        for (String uri : metadataUris) {
+            vc.getResources().add(new Resource(Resource.Type.METADATA, uri));
+        }
+        // add resources: type resource
+        for (String uri : resourceUris) {
+            vc.getResources().add(new Resource(Resource.Type.RESOURCE, uri));
+        }
+        // set optional values
+        for (String keyword : keywords) {
+            final String trimmed = keyword.trim();
+            if (!trimmed.isEmpty()) {
+                vc.getKeywords().add(keyword);
+            }
+        }
+        if (description != null) {
+            vc.setDescription(description);
+        }
+        if (purpose != null) {
+            vc.setPurpose(purpose);
+        }
+        if (reproducibility != null) {
+            vc.setReproducibility(reproducibility);
+        }
+        if (reproducibilityNotice != null) {
+            vc.setReproducibilityNotice(reproducibilityNotice);
+        }
+        if (creationDate == null) {
+            vc.setCreationDate(new Date());
+        } else {
+            vc.setCreationDate(creationDate);
+        }
+
+        if (intensionalDescription != null || intensionalQueryProfile != null || intensionalQueryValue != null || intensionalUri != null) {
+            final GeneratedBy generatedBy = new GeneratedBy();
+            generatedBy.setDescription(intensionalDescription);
+            generatedBy.setQuery(new GeneratedByQuery(intensionalQueryProfile, intensionalQueryValue));
+            generatedBy.setURI(intensionalUri);
+            vc.setGeneratedBy(generatedBy);
+        }
+        return vc;
+    }
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/VirtualCollectionMediaTypeFilter.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/VirtualCollectionMediaTypeFilter.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/VirtualCollectionMediaTypeFilter.java	(revision 5623)
@@ -0,0 +1,33 @@
+package eu.clarin.cmdi.virtualcollectionregistry.rest;
+
+import com.sun.jersey.api.container.filter.UriConnegFilter;
+import java.util.HashMap;
+import java.util.Map;
+import javax.ws.rs.core.MediaType;
+
+/**
+ * Extension of the Jersey filter that allows "content negotation" by means of
+ * URL extensions, {
+ *
+ * @lit e.g.} /service/virtualcollections/7.cmdi will call
+ * /service/virtualcollections/7 with content type application/x-cmdi+xml
+ *
+ * Based on description at {@link http://stackoverflow.com/a/8765749}
+ * @author twagoo
+ */
+public class VirtualCollectionMediaTypeFilter extends UriConnegFilter {
+
+    private static final Map<String, MediaType> mediaTypes = new HashMap<>();
+
+    static {
+        mediaTypes.put("xml", MediaType.APPLICATION_XML_TYPE);
+        mediaTypes.put("json", MediaType.APPLICATION_JSON_TYPE);
+        mediaTypes.put("html", MediaType.TEXT_HTML_TYPE);
+        mediaTypes.put("cmdi", VirtualCollectionResource.MediaTypes.CMDI_TYPE);
+    }
+
+    public VirtualCollectionMediaTypeFilter() {
+        super(mediaTypes);
+    }
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/VirtualCollectionRegistryExceptionMapper.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/VirtualCollectionRegistryExceptionMapper.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/VirtualCollectionRegistryExceptionMapper.java	(revision 5623)
@@ -0,0 +1,104 @@
+package eu.clarin.cmdi.virtualcollectionregistry.rest;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status;
+import javax.ws.rs.ext.ExceptionMapper;
+import javax.ws.rs.ext.Provider;
+import javax.xml.stream.XMLStreamException;
+
+import org.xml.sax.SAXParseException;
+
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionNotFoundException;
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryException;
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryPermissionException;
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryUsageException;
+
+@Provider
+public class VirtualCollectionRegistryExceptionMapper implements
+        ExceptionMapper<VirtualCollectionRegistryException> {
+
+    @Override
+    public Response toResponse(VirtualCollectionRegistryException e) {
+        Status       status = null;
+        List<String> errors = null;
+        if (e instanceof VirtualCollectionRegistryUsageException) {
+            status = Status.BAD_REQUEST;
+            errors = getErrors(e.getCause());
+        } else if (e instanceof VirtualCollectionRegistryPermissionException) {
+            status = Status.FORBIDDEN;
+        } else if (e instanceof VirtualCollectionNotFoundException) {
+            status = Status.NOT_FOUND;
+        } else {
+            if (hasCause(e.getCause(), XMLStreamException.class)) {
+                status = Status.BAD_REQUEST;
+            } else {
+                status = Status.INTERNAL_SERVER_ERROR;
+            }
+            errors = getErrors(e.getCause());
+        }
+        RestResponse response = new RestResponse();
+        response.setIsSuccess(false);
+        response.setInfo(e.getMessage());
+        if (errors != null) {
+            response.setError(errors);
+        }
+        return Response.status(status).type(MediaType.APPLICATION_XML)
+            .entity(response).build();
+    }
+
+    private static List<String> getErrors(Throwable t) {
+        ArrayList<String> errors = new ArrayList<String>();
+        while (t != null) {
+            if (t instanceof SAXParseException) {
+                final SAXParseException e = (SAXParseException) t;
+                String message = e.getMessage();
+                if (message.startsWith("cvc")) {
+                    int pos = message.indexOf(':');
+                    if (pos != 0) {
+                        message = message.substring(pos + 1);
+                    }
+                }
+                errors.add(message.trim() + " [line = " + e.getLineNumber() +
+                        ", column = " + e.getColumnNumber() + "]");
+            } else if (t instanceof XMLStreamException) {
+                final XMLStreamException e = (XMLStreamException) t;
+                String message = e.getMessage();
+                if (message.startsWith("ParseError")) {
+                    int pos = message.indexOf(':');
+                    if (pos != -1) {
+                        pos = message.indexOf(':', pos + 1);
+                        if (pos != -1) {
+                            message = message.substring(pos + 1);
+                        }
+                    }
+                }
+                if (e.getLocation() != null) {
+                    message = message.trim() + " [line = " +
+                            e.getLocation().getLineNumber() + ", column = " +
+                            e.getLocation().getColumnNumber() + "]";
+                }
+                errors.add(message);
+            } else {
+                errors.add(t.getMessage());
+            }
+            t = t.getCause();
+        }
+        ;
+        return errors;
+    }
+
+    private static boolean hasCause(Throwable t, Class<?> clazz) {
+        while (t != null) {
+            if (clazz.isInstance(t)) {
+                return true;
+            }
+            t = t.getCause();
+        }
+        return false;
+    }
+
+} // class VirtualCollectionRegistryExceptionMapper
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/VirtualCollectionResource.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/VirtualCollectionResource.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/VirtualCollectionResource.java	(revision 5623)
@@ -0,0 +1,272 @@
+package eu.clarin.cmdi.virtualcollectionregistry.rest;
+
+import com.sun.jersey.api.core.InjectParam;
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistry;
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryException;
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryUsageException;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+import eu.clarin.cmdi.virtualcollectionregistry.service.VirtualCollectionMarshaller;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.security.Principal;
+import java.util.List;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Request;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.SecurityContext;
+import javax.ws.rs.core.UriBuilder;
+import javax.ws.rs.core.UriInfo;
+import javax.ws.rs.core.Variant;
+
+/**
+ * REST resource representing an individual virtual collection.
+ *
+ * This was designed to act as a managed subresource of
+ * {@link VirtualCollectionsResource}. The user of this class is responsible for
+ * calling {@link #setId(long) } before handing it over or doing anything else
+ * with it.
+ *
+ * @author twagoo
+ */
+public final class VirtualCollectionResource {
+
+    public static class MediaTypes {
+
+        public static final String CMDI = "application/x-cmdi+xml";
+        public static final MediaType CMDI_TYPE = new MediaType("application", "x-cmdi+xml");
+    }
+
+    @InjectParam
+    private VirtualCollectionRegistry registry;
+    @InjectParam
+    private VirtualCollectionMarshaller marshaller;
+    @Context
+    private SecurityContext security;
+    @Context
+    private HttpHeaders headers;
+    @Context
+    private UriInfo uriInfo;
+
+    private Long id;
+
+    /**
+     * Default constructor needed so that it can act as a managed subresource of
+     * {@link VirtualCollectionsResource}, remember to
+     * {@link #setId(long) set the id} after construction!
+     */
+    public VirtualCollectionResource() {
+    }
+
+    /**
+     * Sets the id for this resource; should be called exactly once per
+     * instance; <strong>mandatory call</strong>, not setting will lead to
+     * NullPointerExceptions
+     *
+     * @param id
+     */
+    public synchronized void setId(long id) {
+        if (this.id != null) {
+            throw new IllegalStateException("Id was already set for Virtual Collection resource! Resource is recycled (by Jersey)?");
+        }
+        this.id = id;
+    }
+
+    /**
+     * The virtual collection referenced by the URI will be retrieved
+     *
+     * @param request request object, to be injected by JAX-RS context
+     * @return A response containing a representation of the requested Virtual
+     * Collection. If the virtual collection is not found the appropriate HTTP
+     * status code is issued and an error message is returned.
+     * @throws VirtualCollectionRegistryException
+     */
+    @GET
+    @Produces({VirtualCollectionResource.MediaTypes.CMDI,
+        MediaType.TEXT_XML,
+        MediaType.APPLICATION_XML,
+        MediaType.APPLICATION_JSON})
+    public Response getVirtualCollection(@Context Request request)
+            throws VirtualCollectionRegistryException {
+        final VirtualCollection vc = registry.retrieveVirtualCollection(id);
+        // CMDI's should not be returned for non-public VC's, so check this...
+        if (!vc.isPublic() || (vc.getPersistentIdentifier() == null)) {
+            // exclude CMDI from the options and check if this is ok for request
+            final List<Variant> variants = Variant.mediaTypes(
+                    MediaType.TEXT_XML_TYPE, 
+                    MediaType.APPLICATION_XML_TYPE, 
+                    MediaType.APPLICATION_JSON_TYPE).add().build();
+            final Variant selectVariant = request.selectVariant(variants);
+            if (selectVariant != null) {
+                // alternative option is accepted, return this
+                return Response.ok(vc, selectVariant).build();
+            }
+            // else proceed anyway, will probably fail on writing CMDI body
+        }
+        return Response.ok(vc).build();
+    }
+
+    /**
+     * Redirects the client to the VC's details page in the Wicket frontend
+     *
+     * @return
+     * @throws VirtualCollectionRegistryException
+     */
+    @GET
+    @Produces({MediaType.TEXT_HTML})
+    public Response getVirtualCollectionDetailsRedirect()
+            throws VirtualCollectionRegistryException {
+        final UriBuilder pathBuilder = uriInfo.getBaseUriBuilder().path("../app/details/{arg1}");
+        final URI detailsUri = pathBuilder.build(id);
+        return Response.seeOther(detailsUri).build();
+    }
+
+    /**
+     * The virtual collection identified by the URI will be updated, actually
+     * replaced, with the representation of the virtual collection sent in the
+     * request body.
+     *
+     * @param input Depending on Content-Type header either a valid XML instance
+     * or the JSON representation of a virtual collection conforming to the
+     * above mentioned XML schema. The root element is expected to be
+     * "VirtualCollection"
+     * @return A response containing a {@link RestResponse}
+     * @throws VirtualCollectionRegistryException
+     */
+    @PUT
+    @Consumes({MediaType.TEXT_XML,
+        MediaType.APPLICATION_XML,
+        MediaType.APPLICATION_JSON})
+    @Produces({MediaType.TEXT_XML,
+        MediaType.APPLICATION_XML,
+        MediaType.APPLICATION_JSON})
+    public Response updateVirtualCollection(InputStream input) throws VirtualCollectionRegistryException {
+        Principal principal = security.getUserPrincipal();
+        if (principal == null) {
+            throw new NullPointerException("princial == null");
+        }
+        try {
+            VirtualCollectionMarshaller.Format format = RestUtils.getInputFormat(headers);
+            String encoding = RestUtils.getInputEncoding(headers);
+            VirtualCollection vc
+                    = marshaller.unmarshal(input, format, encoding);
+            registry.updateVirtualCollection(principal, id, vc);
+            RestResponse response = new RestResponse();
+            response.setIsSuccess(true);
+            response.setInfo("updated");
+            response.setId(id);
+            return Response.ok(response).build();
+        } catch (IOException e) {
+            throw new VirtualCollectionRegistryException("update", e);
+
+        }
+    }
+
+    /**
+     * The virtual collection referenced by the URI will be deleted.
+     *
+     * @return A response containing a {@link RestResponse}
+     * @throws VirtualCollectionRegistryException
+     */
+    @DELETE
+    @Produces({MediaType.TEXT_XML,
+        MediaType.APPLICATION_XML,
+        MediaType.APPLICATION_JSON})
+    public Response deleteVirtualCollection()
+            throws VirtualCollectionRegistryException {
+        Principal principal = security.getUserPrincipal();
+        if (principal == null) {
+            throw new NullPointerException("principal == null");
+        }
+        registry.deleteVirtualCollection(principal, id);
+        RestResponse response = new RestResponse();
+        response.setIsSuccess(true);
+        response.setInfo("deleted");
+        response.setId(id);
+        return Response.ok(response).build();
+    }
+
+    /**
+     * The publication state of the virtual collection referenced by the URI
+     *
+     * @return a response containing the {@link State} of the identified Virtual
+     * Collection
+     * @throws VirtualCollectionRegistryException
+     */
+    @GET
+    @Path("/state")
+    @Produces({MediaType.TEXT_XML,
+        MediaType.APPLICATION_XML,
+        MediaType.APPLICATION_JSON})
+    public Response getVirtualCollectionState()
+            throws VirtualCollectionRegistryException {
+        VirtualCollection.State state = registry.getVirtualCollectionState(id);
+        State result = null;
+        switch (state) {
+            case PUBLIC_PENDING:
+            /* FALL-THROUGH */
+            case PUBLIC:
+                result = State.PUBLIC;
+                break;
+            default:
+                result = State.PRIVATE;
+        } // switch
+        return Response.ok(result).build();
+    }
+
+    /**
+     * Updates the publication state of the virtual collection referenced by the
+     * URI
+     *
+     * @param id
+     * @param state
+     * @return a response containg a {@link RestResponse}
+     * @throws VirtualCollectionRegistryException
+     */
+    @POST
+    @Path("/state")
+    @Consumes({MediaType.TEXT_XML,
+        MediaType.APPLICATION_XML,
+        MediaType.APPLICATION_JSON})
+    @Produces({MediaType.TEXT_XML,
+        MediaType.APPLICATION_XML,
+        MediaType.APPLICATION_JSON})
+    public Response setVirtualCollectionState(@PathParam("id") long id,
+            State state)
+            throws VirtualCollectionRegistryException {
+        Principal principal = security.getUserPrincipal();
+        if (principal == null) {
+            throw new NullPointerException("principal == null");
+        }
+        if (state == null) {
+            throw new VirtualCollectionRegistryUsageException("invalid state");
+        }
+        VirtualCollection.State vc_state = null;
+        switch (state) {
+            case PUBLIC:
+                vc_state = VirtualCollection.State.PUBLIC_PENDING;
+                break;
+            case PRIVATE:
+                vc_state = VirtualCollection.State.PRIVATE;
+                break;
+            default:
+                throw new VirtualCollectionRegistryUsageException("invalid state");
+        }
+        registry.setVirtualCollectionState(principal, id, vc_state);
+        RestResponse response = new RestResponse();
+        response.setIsSuccess(true);
+        response.setInfo("updated state to '" + state + "'");
+        response.setId(id);
+        return Response.ok(response).build();
+    }
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/VirtualCollectionXMLBodyWriter.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/VirtualCollectionXMLBodyWriter.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/VirtualCollectionXMLBodyWriter.java	(revision 5623)
@@ -0,0 +1,49 @@
+package eu.clarin.cmdi.virtualcollectionregistry.rest;
+
+import com.sun.jersey.api.core.InjectParam;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+import eu.clarin.cmdi.virtualcollectionregistry.service.VirtualCollectionMarshaller;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Collections;
+import javax.ws.rs.Produces;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.ext.MessageBodyWriter;
+import javax.ws.rs.ext.Provider;
+
+/**
+ * Body writer that outputs an XML representation of a virtual collection in the
+ * internal representation
+ *
+ * @author twagoo
+ */
+@Provider
+@Produces({MediaType.TEXT_XML,
+    MediaType.APPLICATION_XML,
+    MediaType.APPLICATION_JSON})
+public class VirtualCollectionXMLBodyWriter implements MessageBodyWriter<VirtualCollection> {
+
+    @InjectParam
+    private VirtualCollectionMarshaller marshaller;
+
+    @Override
+    public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
+        return type.equals(VirtualCollection.class);
+    }
+
+    @Override
+    public long getSize(VirtualCollection t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
+        return -1;
+    }
+
+    @Override
+    public void writeTo(VirtualCollection vc, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream stream) throws IOException, WebApplicationException {
+        final VirtualCollectionMarshaller.Format format = RestUtils.getOutputFormat(Collections.singletonList(mediaType));
+        marshaller.marshal(stream, format, vc);
+    }
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/VirtualCollectionsResource.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/VirtualCollectionsResource.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/VirtualCollectionsResource.java	(revision 5623)
@@ -0,0 +1,154 @@
+package eu.clarin.cmdi.virtualcollectionregistry.rest;
+
+import com.sun.jersey.api.core.InjectParam;
+import com.sun.jersey.api.core.ResourceContext;
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistry;
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryException;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollectionList;
+import eu.clarin.cmdi.virtualcollectionregistry.service.VirtualCollectionMarshaller;
+import eu.clarin.cmdi.virtualcollectionregistry.service.VirtualCollectionMarshaller.Format;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URI;
+import java.security.Principal;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.SecurityContext;
+import javax.ws.rs.core.StreamingOutput;
+import javax.ws.rs.core.UriInfo;
+
+/**
+ * REST resource representing the collection of virtual collections
+ *
+ * @author twagoo
+ */
+@Path("/virtualcollections")
+public class VirtualCollectionsResource {
+
+    @Context
+    private ResourceContext resourceContext;
+    @InjectParam
+    private VirtualCollectionRegistry registry;
+    @InjectParam
+    private VirtualCollectionMarshaller marshaller;
+    @Context
+    private SecurityContext security;
+    @Context
+    private UriInfo uriInfo;
+    @Context
+    private HttpHeaders headers;
+
+    /**
+     * All virtual collections will be retrieved; if a query expression is used,
+     * only the virtual collections satisfying the query will be retrieved.
+     *
+     * @param query a Virtual Collection Query Language expression
+     * @param offset
+     * @param count
+     * @return a serialised list of all public virtual collections. If no
+     * virtual collection are found an empty list will be returned.
+     * @throws VirtualCollectionRegistryException if the collections could not
+     * be retrieved
+     * @see VirtualCollectionRegistry#getVirtualCollections(java.lang.String,
+     * int, int)
+     */
+    @GET
+    @Produces({MediaType.TEXT_XML,
+        MediaType.APPLICATION_XML,
+        MediaType.APPLICATION_JSON})
+    public Response getVirtualCollections(@QueryParam("q") String query,
+            @DefaultValue("0") @QueryParam("offset") int offset,
+            @DefaultValue("-1") @QueryParam("count") int count)
+            throws VirtualCollectionRegistryException {
+        final VirtualCollectionList vcs = registry.getVirtualCollections(query,
+                (offset > 0) ? offset : 0, count);
+        StreamingOutput writer = new StreamingOutput() {
+            @Override
+            public void write(OutputStream output) throws IOException,
+                    WebApplicationException {
+                final Format format = RestUtils.getOutputFormat(headers.getAcceptableMediaTypes());
+                marshaller.marshal(output, format, vcs);
+                output.close();
+            }
+        };
+        return Response.ok(writer).build();
+    }
+
+    /**
+     * A virtual collection will be created based on the representation of the
+     * virtual collection sent in the request body.
+     *
+     * @param input Depending on Content-Type header either a valid XML instance
+     * or the JSON representation of a virtual collection conforming to the
+     * above mentioned XML schema. The root element is expected to be
+     * "VirtualCollection"
+     * @return A response containing a {@link RestResponse}. If successful, the
+     * result will contain the ID of the created virtual collection
+     *
+     * @throws VirtualCollectionRegistryException
+     */
+    @POST
+    @Consumes({MediaType.TEXT_XML,
+        MediaType.APPLICATION_XML,
+        MediaType.APPLICATION_JSON})
+    @Produces({MediaType.TEXT_XML,
+        MediaType.APPLICATION_XML,
+        MediaType.APPLICATION_JSON})
+    public Response createVirtualCollection(InputStream input)
+            throws VirtualCollectionRegistryException {
+        Principal principal = security.getUserPrincipal();
+        if (principal == null) {
+            String path = uriInfo.getPath();
+            if (path.endsWith("/")) {
+                /*
+                 * fix bad client request and remove tailing slash
+                 */
+                path = path.substring(0, path.length() - 1);
+                URI uri = uriInfo.getBaseUriBuilder().path(path).build();
+                return Response.temporaryRedirect(uri).build();
+            }
+            /*
+             * should never happen, because servlet container should supply a
+             * valid principal
+             */
+            throw new AssertionError("principal == null");
+        }
+        try {
+            VirtualCollectionMarshaller.Format format = RestUtils.getInputFormat(headers);
+            String encoding = RestUtils.getInputEncoding(headers);
+            VirtualCollection vc
+                    = marshaller.unmarshal(input, format, encoding);
+            long id = registry.createVirtualCollection(principal, vc);
+            RestResponse response = new RestResponse();
+            response.setIsSuccess(true);
+            response.setInfo("created");
+            response.setId(id);
+            URI uri
+                    = uriInfo.getRequestUriBuilder().path(Long.toString(id)).build();
+            return Response.created(uri).entity(response).build();
+        } catch (IOException e) {
+            throw new VirtualCollectionRegistryException("create", e);
+        }
+    }
+
+    @Path("/{id}")
+    public VirtualCollectionResource getVirtualCollection(@PathParam("id") long id) {
+        final VirtualCollectionResource resource = resourceContext.getResource(VirtualCollectionResource.class);
+        resource.setId(id);
+        return resource;
+    }
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/CreatorProvider.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/CreatorProvider.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/CreatorProvider.java	(revision 5623)
@@ -0,0 +1,19 @@
+package eu.clarin.cmdi.virtualcollectionregistry.service;
+
+import eu.clarin.cmdi.virtualcollectionregistry.model.Creator;
+import java.security.Principal;
+
+/**
+ *
+ * @author twagoo
+ */
+public interface CreatorProvider {
+    
+    /**
+     * 
+     * @return a new creator with the user's details filled in according to the
+     * implementation's specification
+     */
+    Creator getCreator(Principal principal);
+    
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/VirtualCollectionCMDICreator.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/VirtualCollectionCMDICreator.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/VirtualCollectionCMDICreator.java	(revision 5623)
@@ -0,0 +1,29 @@
+package eu.clarin.cmdi.virtualcollectionregistry.service;
+
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+import eu.clarin.cmdi.virtualcollectionregistry.model.cmdi.CMD;
+
+/**
+ * A service that converts virtual collection instances to CMDI
+ * object hierarchies
+ *
+ * @author twagoo
+ */
+public interface VirtualCollectionCMDICreator {
+
+    /**
+     *
+     * @param vc collection to generate a CMDI hierarchy for
+     * @return a CMDI hierarchy representing the provided collection
+     */
+    CMD createMetadataStructure(VirtualCollection vc);
+
+    /**
+     *
+     * @return the location of the XSD that specifies the schema of the profile
+     * on which the object hierarchy returned by {@link #createMetadataStructure(eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection)
+     * } is based
+     */
+    String getSchemaLocation();
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/VirtualCollectionCMDIWriter.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/VirtualCollectionCMDIWriter.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/VirtualCollectionCMDIWriter.java	(revision 5623)
@@ -0,0 +1,15 @@
+package eu.clarin.cmdi.virtualcollectionregistry.service;
+
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+/**
+ *
+ * @author twagoo
+ */
+public interface VirtualCollectionCMDIWriter {
+
+    void writeCMDI(XMLStreamWriter out, VirtualCollection vc) throws XMLStreamException;
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/VirtualCollectionMarshaller.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/VirtualCollectionMarshaller.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/VirtualCollectionMarshaller.java	(revision 5623)
@@ -0,0 +1,27 @@
+package eu.clarin.cmdi.virtualcollectionregistry.service;
+
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollectionList;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+/**
+ *
+ * @author twagoo
+ */
+public interface VirtualCollectionMarshaller {
+
+    public static enum Format {
+        XML, JSON, UNSUPPORTED
+    } // public enum Format
+
+    void marshal(OutputStream out, Format format, VirtualCollection vc) throws IOException;
+
+    void marshal(OutputStream out, Format format, VirtualCollectionList vcs) throws IOException;
+
+    void marshalAsCMDI(OutputStream out, Format format, VirtualCollection vc) throws IOException;
+
+    VirtualCollection unmarshal(InputStream in, Format format, String encoding) throws IOException;
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/VirtualCollectionValidator.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/VirtualCollectionValidator.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/VirtualCollectionValidator.java	(revision 5623)
@@ -0,0 +1,14 @@
+package eu.clarin.cmdi.virtualcollectionregistry.service;
+
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryUsageException;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+
+/**
+ *
+ * @author twagoo
+ */
+public interface VirtualCollectionValidator {
+
+    void validate(VirtualCollection vc) throws VirtualCollectionRegistryUsageException;
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/ChaningCreatorProvider.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/ChaningCreatorProvider.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/ChaningCreatorProvider.java	(revision 5623)
@@ -0,0 +1,74 @@
+package eu.clarin.cmdi.virtualcollectionregistry.service.impl;
+
+import eu.clarin.cmdi.virtualcollectionregistry.model.Creator;
+import eu.clarin.cmdi.virtualcollectionregistry.service.CreatorProvider;
+import java.security.Principal;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ *
+ * @author twagoo
+ */
+public class ChaningCreatorProvider implements CreatorProvider {
+
+    private final List<CreatorProvider> providerChain;
+
+    public ChaningCreatorProvider(List<CreatorProvider> providerChain) {
+        this.providerChain = providerChain;
+    }
+
+    @Override
+    public Creator getCreator(Principal principal) {
+        final List<Creator> creators = new ArrayList<>(providerChain.size());
+        for (CreatorProvider provider : providerChain) {
+            creators.add(provider.getCreator(principal));
+        }
+
+        final Creator creator = new Creator();
+        for (Creator template : creators) {
+            if (template.getAddress() != null) {
+                creator.setAddress(template.getAddress());
+                break;
+            }
+        }
+        for (Creator template : creators) {
+            if (template.getEMail() != null) {
+                creator.setEMail(template.getEMail());
+                break;
+            }
+        }
+        for (Creator template : creators) {
+            if (template.getOrganisation() != null) {
+                creator.setOrganisation(template.getOrganisation());
+                break;
+            }
+        }
+        for (Creator template : creators) {
+            if (template.getPerson() != null) {
+                creator.setPerson(template.getPerson());
+                break;
+            }
+        }
+        for (Creator template : creators) {
+            if (template.getRole() != null) {
+                creator.setRole(template.getRole());
+                break;
+            }
+        }
+        for (Creator template : creators) {
+            if (template.getTelephone() != null) {
+                creator.setTelephone(template.getTelephone());
+                break;
+            }
+        }
+        for (Creator template : creators) {
+            if (template.getWebsite() != null) {
+                creator.setWebsite(template.getWebsite());
+                break;
+            }
+        }
+        return creator;
+    }
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/ReferenceValidator.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/ReferenceValidator.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/ReferenceValidator.java	(revision 5623)
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2014 CLARIN
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package eu.clarin.cmdi.virtualcollectionregistry.service.impl;
+
+import java.util.regex.Pattern;
+import org.apache.wicket.validation.IValidatable;
+import org.apache.wicket.validation.IValidator;
+import org.apache.wicket.validation.Validatable;
+import org.apache.wicket.validation.ValidationError;
+import org.apache.wicket.validation.validator.AbstractValidator;
+import org.apache.wicket.validation.validator.UrlValidator;
+
+/**
+ * String validator that checks whether the value is a valid handle with 'hdl'
+ * scheme; if not, it passed the value on to an instance of {@link UrlValidator}
+ * (configured not to accept fragments, see {@link UrlValidator#NO_FRAGMENTS})
+ *
+ * @author twagoo
+ */
+public class ReferenceValidator extends AbstractValidator<String> {
+
+    private static final String HANDLE_SPECIFIC_PART_PATTERN = "[0-9\\.]+\\/.+$";
+    private static final Pattern HANDLE_PATTERN = Pattern.compile("^(hdl|doi):" + HANDLE_SPECIFIC_PART_PATTERN);
+    private static final Pattern HANDLE_RESOLVER_PATTERN = Pattern.compile("^http://(hdl\\.handle\\.net|dx\\.doi\\.org|)/" + HANDLE_SPECIFIC_PART_PATTERN);
+    private final IValidator<String> urlValidator = new UrlValidator(UrlValidator.NO_FRAGMENTS);
+
+    @Override
+    protected void onValidate(IValidatable<String> validatable) {
+        // first check if it is a valid handle
+        if (!HANDLE_PATTERN.matcher(validatable.getValue()).matches()) {
+            // check if it is a valid URL
+            urlValidator.validate(validatable);
+            if (!validatable.isValid()) {
+                validatable.error(new ValidationError().setMessage(String.format("'%s' is not a valid handle", validatable.getValue())));
+            }
+        }
+    }
+
+    public boolean validate(String value) {
+        final Validatable<String> validatable = new Validatable<>(value);
+        validate(validatable);
+        return validatable.isValid();
+    }
+
+    /**
+     *
+     * @param uri
+     * @return true IFF the expression is a URI consisting of a valid handle
+     * pattern preceded by a handle scheme expression (hdl: or doi:) OR one of
+     * the accepted handle resolver base URL's (http://hdl.handle.net or
+     * http://dx.doi.org)
+     */
+    public static boolean isPid(CharSequence uri) {
+        return HANDLE_PATTERN.matcher(uri).matches()
+                || HANDLE_RESOLVER_PATTERN.matcher(uri).matches();
+    }
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/SAMLCreatorProvider.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/SAMLCreatorProvider.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/SAMLCreatorProvider.java	(revision 5623)
@@ -0,0 +1,62 @@
+package eu.clarin.cmdi.virtualcollectionregistry.service.impl;
+
+import de.mpg.aai.shhaa.model.AuthAttribute;
+import de.mpg.aai.shhaa.model.AuthPrincipal;
+import eu.clarin.cmdi.virtualcollectionregistry.model.Creator;
+import eu.clarin.cmdi.virtualcollectionregistry.service.CreatorProvider;
+import java.security.Principal;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ *
+ * @author twagoo
+ */
+public class SAMLCreatorProvider implements CreatorProvider {
+
+    private final static Logger logger = LoggerFactory.getLogger(SAMLCreatorProvider.class);
+    public static final String[] DISPLAY_NAME_ATTRIBUTE = new String[]{"cn", "commonName", "displayName"};
+    public static final String[] ORGANISATION_ATTRIBUTE = new String[]{"o", "organizationName", "schacHomeOrganization"};
+    public static final String[] MAIL_ATTRIBUTE = new String[]{"mail"};
+
+    @Override
+    public Creator getCreator(Principal userPrincipal) {
+        final Creator creator = new Creator();
+        if (userPrincipal instanceof AuthPrincipal) {
+            final AuthPrincipal principal = (AuthPrincipal) userPrincipal;
+            creator.setPerson(getAttribute(principal, DISPLAY_NAME_ATTRIBUTE));
+            creator.setOrganisation(getAttribute(principal, ORGANISATION_ATTRIBUTE));
+            creator.setEMail(getAttribute(principal, MAIL_ATTRIBUTE));
+        }
+
+        if (creator.getPerson() == null) {
+            creator.setPerson(userPrincipal.getName());
+        }
+
+        return creator;
+    }
+
+    private static String getAttribute(final AuthPrincipal principal, String[] attrs) {
+        for (String attr : attrs) {
+            final String value = getAttributeValue(principal, attr);
+            if (value != null) {
+                return value;
+            }
+        }
+        return null;
+    }
+
+    private static String getAttributeValue(final AuthPrincipal principal, String attr) {
+        logger.trace("Looking for attribute {}", attr);
+        final AuthAttribute<?> attribute = principal.getAttribues().get(attr); 
+       if (attribute != null) {
+            final Object value = attribute.getValue();
+            if (value != null) {
+                logger.trace("Found attribute value: {} = {}", attr, value);
+                return value.toString();
+            }
+        }
+        return null;
+    }
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/SAMLCreatorProviderConfiguration.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/SAMLCreatorProviderConfiguration.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/SAMLCreatorProviderConfiguration.java	(revision 5623)
@@ -0,0 +1,23 @@
+package eu.clarin.cmdi.virtualcollectionregistry.service.impl;
+
+import eu.clarin.cmdi.virtualcollectionregistry.service.CreatorProvider;
+import java.util.Arrays;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ *
+ * @author twagoo
+ */
+@Configuration
+public class SAMLCreatorProviderConfiguration {
+
+    @Bean
+    public CreatorProvider creatorProvider() {
+        return new ChaningCreatorProvider(
+                Arrays.<CreatorProvider>asList(new SAMLCreatorProvider())
+                //TODO: add db provider with fallback to saml
+        );
+    }
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/VirtualCollectionCMDICreatorImpl.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/VirtualCollectionCMDICreatorImpl.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/VirtualCollectionCMDICreatorImpl.java	(revision 5623)
@@ -0,0 +1,343 @@
+package eu.clarin.cmdi.virtualcollectionregistry.service.impl;
+
+import eu.clarin.cmdi.virtualcollectionregistry.model.Creator;
+import eu.clarin.cmdi.virtualcollectionregistry.model.GeneratedBy;
+import eu.clarin.cmdi.virtualcollectionregistry.model.Resource;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+import static eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection.State.DEAD;
+import static eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection.State.DELETED;
+import static eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection.State.PUBLIC;
+import eu.clarin.cmdi.virtualcollectionregistry.model.cmdi.CMD;
+import eu.clarin.cmdi.virtualcollectionregistry.model.cmdi.CMD.Components.VirtualCollection.Creator.Email;
+import eu.clarin.cmdi.virtualcollectionregistry.model.cmdi.CMD.Components.VirtualCollection.Creator.Organisation;
+import eu.clarin.cmdi.virtualcollectionregistry.model.cmdi.CMD.Components.VirtualCollection.Description;
+import eu.clarin.cmdi.virtualcollectionregistry.model.cmdi.CMD.Components.VirtualCollection.GeneratedBy.QueryProfile;
+import eu.clarin.cmdi.virtualcollectionregistry.model.cmdi.CMD.Components.VirtualCollection.GeneratedBy.QueryValue;
+import eu.clarin.cmdi.virtualcollectionregistry.model.cmdi.CMD.Components.VirtualCollection.Name;
+import eu.clarin.cmdi.virtualcollectionregistry.model.cmdi.CMD.Components.VirtualCollection.ReproducabilityNotice;
+import eu.clarin.cmdi.virtualcollectionregistry.model.cmdi.CMD.Resources.ResourceProxyList.ResourceProxy;
+import eu.clarin.cmdi.virtualcollectionregistry.model.cmdi.CMD.Resources.ResourceProxyList.ResourceProxy.ResourceType;
+import eu.clarin.cmdi.virtualcollectionregistry.model.cmdi.ComplextypePurpose1;
+import eu.clarin.cmdi.virtualcollectionregistry.model.cmdi.ComplextypeReproducability1;
+import eu.clarin.cmdi.virtualcollectionregistry.model.cmdi.ComplextypeStatus1;
+import eu.clarin.cmdi.virtualcollectionregistry.model.cmdi.ResourcetypeSimple;
+import eu.clarin.cmdi.virtualcollectionregistry.model.cmdi.SimpletypePurpose1;
+import eu.clarin.cmdi.virtualcollectionregistry.model.cmdi.SimpletypeReproducability1;
+import eu.clarin.cmdi.virtualcollectionregistry.model.cmdi.SimpletypeStatus1;
+import eu.clarin.cmdi.virtualcollectionregistry.service.VirtualCollectionCMDICreator;
+import java.util.Date;
+import java.util.List;
+import java.util.UUID;
+import javax.xml.datatype.DatatypeConfigurationException;
+import javax.xml.datatype.DatatypeFactory;
+import javax.xml.datatype.XMLGregorianCalendar;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.time.FastDateFormat;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+/**
+ * A service implementation that creates a CMDI object hierarchy for a
+ * {@link VirtualCollection} object based on the classes generated from the
+ * Virtual Collection profile schema by JAXB (as configured in the pom.xml of
+ * this project)
+ *
+ * @author twagoo
+ */
+@Service
+public class VirtualCollectionCMDICreatorImpl implements VirtualCollectionCMDICreator {
+
+    private final static Logger logger = LoggerFactory.getLogger(VirtualCollectionCMDICreatorImpl.class);
+    private final DatatypeFactory dataTypeFactory;
+
+    // Collection display name value read from context.xml with a fallback value inserted by Spring
+    @Value("${eu.clarin.cmdi.virtualcollectionregistry.collectiondisplayname:CLARIN Virtual Collection Registry}")
+    private String collectionDisplayName;
+
+    public VirtualCollectionCMDICreatorImpl() throws DatatypeConfigurationException {
+        dataTypeFactory = DatatypeFactory.newInstance();
+    }
+
+    ///////// CMDI CONSTANTS ////////////////////
+    // These should match up with the schema   
+    // the classes in eu.clarin.cmdi.          
+    // virtualcollectionregistry.model.cmdi are
+    // generated from by JAXB                  
+    /////////////////////////////////////////////
+    public static final String VIRTUAL_COLLECTION_PROFILE_ID
+            = "clarin.eu:cr1:p_1404130561238";
+    public static final String VIRTUAL_COLLECTION_PROFILE_SCHEMA_LOCATION
+            = "http://www.clarin.eu/cmd/ http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/profiles/"
+            + VIRTUAL_COLLECTION_PROFILE_ID
+            + "/xsd";
+    private static final String CMD_VERSION = "1.1";
+    private static final FastDateFormat DATE_FORMAT = FastDateFormat.getInstance("yyyy-MM-dd");
+    ///////// END OF CMDI CONSTANTS   /////////
+
+    @Override
+    public String getSchemaLocation() {
+        return VIRTUAL_COLLECTION_PROFILE_SCHEMA_LOCATION;
+    }
+
+    @Override
+    public CMD createMetadataStructure(VirtualCollection vc) {
+        logger.debug("Creating CMD root");
+        final CMD cmdRoot = new CMD();
+        cmdRoot.setCMDVersion(CMD_VERSION);
+        logger.trace("Creating header");
+        cmdRoot.setHeader(createHeader(vc));
+        logger.trace("Creating resources");
+        final CMD.Resources resources = createResources(vc);
+        cmdRoot.setResources(resources);
+        logger.trace("Creating components");
+        cmdRoot.setComponents(createComponents(vc, resources));
+        return cmdRoot;
+    }
+
+    private CMD.Header createHeader(VirtualCollection vc) {
+        final CMD.Header header = new CMD.Header();
+        header.setMdCreationDate(dataTypeFactory.newXMLGregorianCalendar(DATE_FORMAT.format(new Date())));
+        header.setMdProfile(VIRTUAL_COLLECTION_PROFILE_ID);
+        header.getMdCreator().add(vc.getOwner().getName());
+        header.setMdSelfLink(vc.getPersistentIdentifier().getURI());
+        if (collectionDisplayName != null) {
+            header.setMdCollectionDisplayName(collectionDisplayName);
+        }
+        return header;
+    }
+
+    private CMD.Resources createResources(VirtualCollection vc) {
+        final CMD.Resources resources = new CMD.Resources();
+
+        final CMD.Resources.ResourceProxyList resourceProxyList = new CMD.Resources.ResourceProxyList();
+        resources.setResourceProxyList(resourceProxyList);
+        final List<ResourceProxy> proxyList = resourceProxyList.getResourceProxy();
+
+        for (Resource resource : vc.getResources()) {
+            final ResourceProxy resourceProxy = new ResourceProxy();
+            if (resource.getId() == null) {
+                resourceProxy.setId("r" + UUID.randomUUID().toString());
+            } else {
+                resourceProxy.setId("r" + Long.toString(resource.getId()));
+            }
+            resourceProxy.setResourceRef(resource.getRef());
+
+            final ResourceType type = new ResourceType();
+            if (resource.getType() == Resource.Type.METADATA) {
+                type.setValue(ResourcetypeSimple.METADATA);
+            } else {
+                type.setValue(ResourcetypeSimple.RESOURCE);
+            }
+            resourceProxy.setResourceType(type);
+
+            proxyList.add(resourceProxy);
+        }
+
+        // add empty instance of mandatory journal file proxy list
+        resources.setJournalFileProxyList(new CMD.Resources.JournalFileProxyList());
+        // add empty instance of mandatory resource relation list
+        resources.setResourceRelationList(new CMD.Resources.ResourceRelationList());
+        return resources;
+    }
+
+    private CMD.Components createComponents(VirtualCollection vc, CMD.Resources resources) {
+        final CMD.Components.VirtualCollection virtualCollection = new CMD.Components.VirtualCollection();
+
+        final Name name = new Name();
+        name.setValue(vc.getName());
+        virtualCollection.setName(name);
+
+        if (vc.getDescription() != null) {
+            final Description description = new Description();
+            description.setValue(vc.getDescription());
+            virtualCollection.setDescription(description);
+        }
+
+        virtualCollection.setCreationDate(getCreationDate(vc));
+        virtualCollection.setStatus(getStatus(vc));
+        virtualCollection.setPurpose(getPurpose(vc));
+        virtualCollection.getCreator().add(getCreator(vc));
+        virtualCollection.setReproducability(getReproducability(vc));
+
+        if (vc.getReproducibilityNotice() != null) {
+            final ReproducabilityNotice reproducabilityNotice = new ReproducabilityNotice();
+            reproducabilityNotice.setValue(vc.getReproducibilityNotice());
+            virtualCollection.setReproducabilityNotice(reproducabilityNotice);
+        }
+
+        for (String keyword : vc.getKeywords()) {
+            final CMD.Components.VirtualCollection.Keyword keywordElement = new CMD.Components.VirtualCollection.Keyword();
+            keywordElement.setValue(keyword);
+            virtualCollection.getKeyword().add(keywordElement);
+        }
+
+        for (Resource resource : vc.getResources()) {
+            addResource(virtualCollection, resource, resources);
+        }
+
+        if (vc.getType() == VirtualCollection.Type.INTENSIONAL && vc.getGeneratedBy() != null) {
+            virtualCollection.setGeneratedBy(getGeneratedBy(vc.getGeneratedBy()));
+        }
+
+        final CMD.Components components = new CMD.Components();
+        components.setVirtualCollection(virtualCollection);
+        return components;
+    }
+
+    private CMD.Components.VirtualCollection.GeneratedBy getGeneratedBy(GeneratedBy generatedBy) {
+        final CMD.Components.VirtualCollection.GeneratedBy component = new CMD.Components.VirtualCollection.GeneratedBy();
+
+        final String uri = generatedBy.getURI();
+        if (uri != null) {
+            component.setURI(uri);
+        }
+
+        final String description = generatedBy.getDescription();
+        if (description != null) {
+            final CMD.Components.VirtualCollection.GeneratedBy.Description descriptionElement = new CMD.Components.VirtualCollection.GeneratedBy.Description();
+            descriptionElement.setValue(description);
+            component.setDescription(descriptionElement);
+        }
+
+        if (generatedBy.getQuery() != null) {
+            final String profile = generatedBy.getQuery().getProfile();
+            if (profile != null) {
+                final QueryProfile profileElement = new QueryProfile();
+                profileElement.setValue(profile);
+                component.setQueryProfile(profileElement);
+            }
+
+            final String value = generatedBy.getQuery().getValue();
+            if (value != null) {
+                final QueryValue valueElement = new QueryValue();
+                valueElement.setValue(value);
+                component.setQueryValue(valueElement);
+            }
+        }
+
+        return component;
+    }
+
+    private XMLGregorianCalendar getCreationDate(VirtualCollection vc) {
+        final Date creationDate = vc.getCreationDate();
+        return dataTypeFactory.newXMLGregorianCalendar(DATE_FORMAT.format(creationDate));
+    }
+
+    private ComplextypeStatus1 getStatus(VirtualCollection vc) {
+        // status is a mandatory field
+        final ComplextypeStatus1 status = new ComplextypeStatus1();
+        switch (vc.getState()) {
+            case PUBLIC:
+                status.setValue(SimpletypeStatus1.PUBLISHED);
+                break;
+            case DELETED:
+                status.setValue(SimpletypeStatus1.DEPRECATED);
+                break;
+            case DEAD:
+                status.setValue(SimpletypeStatus1.DEPRECATED);
+                break;
+            default:
+                status.setValue(SimpletypeStatus1.DRAFT);
+        }
+        return status;
+    }
+
+    private ComplextypeReproducability1 getReproducability(VirtualCollection vc) {
+        if (vc.getReproducibility() == null) {
+            return null;
+        } else {
+            final ComplextypeReproducability1 reproducability = new ComplextypeReproducability1();
+            switch (vc.getReproducibility()) {
+                //TODO: better mapping
+                case FLUCTUATING:
+                    reproducability.setValue(SimpletypeReproducability1.FLUCTUATING);
+                    break;
+                case INTENDED:
+                    reproducability.setValue(SimpletypeReproducability1.INTENDED);
+                    break;
+                case UNTENDED:
+                    reproducability.setValue(SimpletypeReproducability1.UNTENDED);
+                    break;
+            }
+            return reproducability;
+        }
+    }
+
+    private ComplextypePurpose1 getPurpose(VirtualCollection vc) {
+        if (vc.getPurpose() == null) {
+            return null;
+        } else {
+            final ComplextypePurpose1 purpose = new ComplextypePurpose1();
+            switch (vc.getPurpose()) {
+                case FUTURE_USE:
+                    purpose.setValue(SimpletypePurpose1.FUTURE_USE);
+                    break;
+                case REFERENCE:
+                    purpose.setValue(SimpletypePurpose1.REFERENCE);
+                    break;
+                case RESEARCH:
+                    purpose.setValue(SimpletypePurpose1.RESEARCH);
+                    break;
+                case SAMPLE:
+                    purpose.setValue(SimpletypePurpose1.SAMPLE);
+                    break;
+            }
+            return purpose;
+        }
+    }
+
+    private CMD.Components.VirtualCollection.Creator getCreator(VirtualCollection vc) {
+        if (vc.getCreators().isEmpty()) {
+            return null;
+        } else {
+            final CMD.Components.VirtualCollection.Creator creator = new CMD.Components.VirtualCollection.Creator();
+            final Creator vcCreator = vc.getCreators().get(0);
+
+            // name/creator is a mandatory field
+            final CMD.Components.VirtualCollection.Creator.Name name = new CMD.Components.VirtualCollection.Creator.Name();
+            name.setValue(vcCreator.getPerson());
+            creator.setName(name);
+
+            if (vcCreator.getEMail() != null) {
+                final Email email = new Email();
+                email.setValue(vcCreator.getEMail());
+                creator.setEmail(email);
+            }
+
+            if (vcCreator.getOrganisation() != null) {
+                final Organisation organisation = new Organisation();
+                organisation.setValue(vcCreator.getOrganisation());
+                creator.setOrganisation(organisation);
+            }
+            return creator;
+        }
+    }
+
+    private void addResource(final CMD.Components.VirtualCollection virtualCollection, Resource resource, CMD.Resources resources) {
+        if (!StringUtils.isEmpty(resource.getLabel()) || !StringUtils.isEmpty(resource.getDescription())) {
+            final CMD.Components.VirtualCollection.Resource resourceComponent = new CMD.Components.VirtualCollection.Resource();
+            if (!StringUtils.isEmpty(resource.getLabel())) {
+                // add label
+                final CMD.Components.VirtualCollection.Resource.Label label = new CMD.Components.VirtualCollection.Resource.Label();
+                label.setValue(resource.getLabel());
+                resourceComponent.setLabel(label);
+            }
+            if (!StringUtils.isEmpty(resource.getDescription())) {
+                // add description
+                final CMD.Components.VirtualCollection.Resource.Description description = new CMD.Components.VirtualCollection.Resource.Description();
+                description.setValue(resource.getDescription());
+                resourceComponent.setDescription(description);
+            }
+            // look up the resource proxy (by URI) and set a reference
+            for (ResourceProxy rp : resources.getResourceProxyList().getResourceProxy()) {
+                if (rp.getResourceRef().equals(resource.getRef())) {
+                    resourceComponent.getRef().add(rp);
+                    break;
+                }
+            }
+            virtualCollection.getResource().add(resourceComponent);
+        }
+    }
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/VirtualCollectionCMDIWriterImpl.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/VirtualCollectionCMDIWriterImpl.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/VirtualCollectionCMDIWriterImpl.java	(revision 5623)
@@ -0,0 +1,75 @@
+package eu.clarin.cmdi.virtualcollectionregistry.service.impl;
+
+import eu.clarin.cmdi.virtualcollectionregistry.service.VirtualCollectionCMDICreator;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+import eu.clarin.cmdi.virtualcollectionregistry.model.cmdi.CMD;
+import eu.clarin.cmdi.virtualcollectionregistry.service.VirtualCollectionCMDIWriter;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * CMDI writer that uses the classes in
+ * eu.clarin.cmdi.virtualcollectionregistry.model.cmdi generated by the JAXB XJC
+ * plugin at build time (based on the virtual collection profile in the CLARIN
+ * Component Registry) to build a CMDI instance and then marshals it to the
+ * provided XML stream writer
+ *
+ * @author twagoo
+ * @see http://mojo.codehaus.org/jaxb2-maven-plugin/usage.html
+ * @see
+ * http://catalog.clarin.eu/ds/ComponentRegistry?item=clarin.eu:cr1:p_1271859438175
+ */
+@Service
+public class VirtualCollectionCMDIWriterImpl implements VirtualCollectionCMDIWriter {
+
+    private final static Logger logger = LoggerFactory.getLogger(VirtualCollectionCMDIWriterImpl.class);
+
+    private final VirtualCollectionCMDICreator cmdiCreator;
+    private final JAXBContext jc;
+
+    /**
+     *
+     * @param cmdiCreator creator instance to use for the generation of a CMDI
+     * object hierarchy
+     * @throws JAXBException if a JAXB context for class {@link CMD} could
+     * not be instantiated
+     */
+    @Autowired
+    public VirtualCollectionCMDIWriterImpl(VirtualCollectionCMDICreator cmdiCreator) throws JAXBException {
+        this.cmdiCreator = cmdiCreator;
+        this.jc = JAXBContext.newInstance(CMD.class);
+    }
+
+    /**
+     *
+     * @param out an XML stream writer that has been initialised
+     * ({@link XMLStreamWriter#writeStartDocument()} and
+     * ({@link XMLStreamWriter#writeEndDocument() }
+     * will <em>not</em> be called!
+     * @param vc collection to write as CMDI XML
+     * @throws XMLStreamException
+     */
+    @Override
+    public void writeCMDI(XMLStreamWriter out, VirtualCollection vc) throws XMLStreamException {
+        logger.debug("Constructing CMDI structure");
+        final CMD cmdRoot = cmdiCreator.createMetadataStructure(vc);
+
+        logger.debug("Marshalling CMD");
+        try {
+            final Marshaller marshaller = jc.createMarshaller();
+            marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);
+            marshaller.setProperty(Marshaller.JAXB_SCHEMA_LOCATION, cmdiCreator.getSchemaLocation());
+            marshaller.marshal(cmdRoot, out);
+        } catch (JAXBException ex) {
+            throw new RuntimeException(ex);
+        }
+    }
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/VirtualCollectionMarshallerImpl.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/VirtualCollectionMarshallerImpl.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/VirtualCollectionMarshallerImpl.java	(revision 5623)
@@ -0,0 +1,739 @@
+package eu.clarin.cmdi.virtualcollectionregistry.service.impl;
+
+import eu.clarin.cmdi.virtualcollectionregistry.service.VirtualCollectionCMDIWriter;
+import eu.clarin.cmdi.virtualcollectionregistry.service.VirtualCollectionMarshaller;
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryException;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URL;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Collections;
+import java.util.Map;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.codehaus.jettison.mapped.MappedXMLInputFactory;
+import org.codehaus.jettison.mapped.MappedXMLOutputFactory;
+import org.codehaus.stax2.XMLInputFactory2;
+import org.codehaus.stax2.XMLOutputFactory2;
+import org.codehaus.stax2.XMLStreamReader2;
+import org.codehaus.stax2.XMLStreamWriter2;
+import org.codehaus.stax2.validation.XMLValidationSchema;
+import org.codehaus.stax2.validation.XMLValidationSchemaFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import eu.clarin.cmdi.virtualcollectionregistry.model.Creator;
+import eu.clarin.cmdi.virtualcollectionregistry.model.GeneratedBy;
+import eu.clarin.cmdi.virtualcollectionregistry.model.GeneratedByQuery;
+import eu.clarin.cmdi.virtualcollectionregistry.model.Resource;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollectionList;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class VirtualCollectionMarshallerImpl implements VirtualCollectionMarshaller {
+
+    private static final String ENCODING = "UTF-8";
+    private static final String VERSION = "1.0";
+    private static final Logger logger =
+        LoggerFactory.getLogger(VirtualCollectionMarshallerImpl.class);
+    private final DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
+    private final XMLValidationSchema schema;
+    private final XMLInputFactory2 xmlReaderFactory;
+    private final XMLOutputFactory2 xmlWriterFactory;
+    private final MappedXMLInputFactory jsonReaderFactory;
+    private final MappedXMLOutputFactory jsonWriterFactory;
+
+    @Autowired
+    private VirtualCollectionCMDIWriter cmdiWriter;
+
+    VirtualCollectionMarshallerImpl() throws VirtualCollectionRegistryException {
+        logger.debug("initializing schemas for marshaller ...");
+        try {
+            XMLValidationSchemaFactory sf = XMLValidationSchemaFactory
+                    .newInstance(XMLValidationSchema.SCHEMA_ID_W3C_SCHEMA);
+            URL url = VirtualCollectionMarshallerImpl.class
+                    .getClassLoader()
+                    .getResource("META-INF/VirtualCollection.xsd");
+            if (url == null) {
+                throw new NullPointerException("schema not found!");
+            }
+            schema = sf.createSchema(url);
+
+            // XML factories
+            xmlReaderFactory =
+                (XMLInputFactory2) XMLInputFactory.newInstance();
+            xmlReaderFactory.configureForSpeed();
+            xmlReaderFactory
+                .setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, Boolean.TRUE);
+            xmlReaderFactory
+                .setProperty(XMLInputFactory2.P_INTERN_NAMES, Boolean.TRUE);
+            xmlReaderFactory
+                .setProperty(XMLInputFactory2.P_INTERN_NS_URIS, Boolean.TRUE);
+            xmlWriterFactory =
+                (XMLOutputFactory2) XMLOutputFactory.newInstance();
+            xmlWriterFactory.configureForSpeed();
+
+            // JSON factories
+            final Map<String, String> mapping = Collections.emptyMap();
+            jsonReaderFactory = new MappedXMLInputFactory(mapping);
+            jsonWriterFactory = new MappedXMLOutputFactory(mapping);
+        } catch (Exception e) {
+            logger.error("error initializing marshaller", e);
+            throw new VirtualCollectionRegistryException(
+                    "error initializing marshaller", e);
+        }
+    }
+
+    @Override
+    public void marshal(OutputStream out, Format format, VirtualCollection vc)
+            throws IOException {
+        if (vc == null) {
+            throw new NullPointerException("vc == null");
+        }
+        XMLStreamWriter writer = null;
+        try {
+            writer = createWriter(out, format, true);
+            writer.writeStartDocument(ENCODING, VERSION);
+            writeVirtualCollection(writer, vc);
+            writer.writeEndDocument();
+        } catch (XMLStreamException e) {
+            logger.error("error marshalling virtual collection", e);
+            throw new IOException("error marshalling virtual collection", e);
+        } finally {
+            try {
+                if (writer != null) {
+                    writer.close();
+                }
+            } catch (XMLStreamException e) {
+                /* IGNORE */
+            }
+        }
+    }
+
+    @Override
+    public void marshal(OutputStream out, Format format,
+            VirtualCollectionList vcs) throws IOException {
+        if (vcs == null) {
+            throw new NullPointerException("vcs == null");
+        }
+        XMLStreamWriter writer = null;
+        try {
+            writer = createWriter(out, format, true);
+            writer.writeStartDocument(ENCODING, VERSION);
+            writer.writeStartElement("VirtualCollections");
+            writer.writeAttribute("totalCount",
+                    Integer.toString(vcs.getTotalCount()));
+            writer.writeAttribute("offset",
+                    Integer.toString(vcs.getOffset()));
+            writer.writeAttribute("result",
+                    (vcs.isPartialList() ? "partial" : "full"));
+            for (VirtualCollection vc : vcs.getItems()) {
+                writeVirtualCollection(writer, vc);
+            }
+            writer.writeEndElement(); // "VirtualCollections" element
+            writer.writeEndDocument();
+        } catch (XMLStreamException e) {
+            logger.error("error marshalling virtual collections", e);
+            throw new IOException("error marshalling virtual collections", e);
+        } finally {
+            try {
+                if (writer != null) {
+                    writer.close();
+                }
+            } catch (XMLStreamException e) {
+                /* IGNORE */
+            }
+        }
+    }
+
+    @Override
+    public VirtualCollection unmarshal(InputStream in, Format format,
+            String encoding) throws IOException {
+        XMLStreamReader reader = null;
+        try {
+            reader = createReader(in, format, encoding);
+            return readVirtualCollection(reader);
+        } catch (XMLStreamException e) {
+            logger.error("error unmarshalling virtual collection", e);
+            throw new IOException("error unmarshalling virtual collection", e);
+        } finally {
+            try {
+                if (reader != null) {
+                    reader.close();
+                }
+            } catch (XMLStreamException e) {
+                /* IGNORE */
+            }
+        }
+    }
+
+    @Override
+    public void marshalAsCMDI(OutputStream out, Format format,
+            VirtualCollection vc) throws IOException {
+        if (vc == null) {
+            throw new NullPointerException("vc == null");
+        }
+
+        XMLStreamWriter writer = null;
+        try {
+            writer = createWriter(out, format, false);
+            writer.writeStartDocument(ENCODING, VERSION);
+            cmdiWriter.writeCMDI(writer, vc);
+            writer.writeEndDocument();
+        } catch (XMLStreamException e) {
+            logger.error("error marshalling clarin virtual collections", e);
+            throw new IOException(
+                    "error marshalling clarin virtual collections", e);
+        } finally {
+            try {
+                if (writer != null) {
+                    writer.close();
+                }
+            } catch (XMLStreamException e) {
+                /* IGNORE */
+            }
+        }
+    }
+
+    private void writeVirtualCollection(XMLStreamWriter writer,
+            VirtualCollection vc) throws XMLStreamException {
+        writer.writeStartElement("VirtualCollection");
+        if (vc.getId() != null) {
+            writer.writeAttribute("id", Long.toString(vc.getId()));
+        }
+        if (vc.getPersistentIdentifier() != null) {
+            writer.writeAttribute("persistentId",
+                    vc.getPersistentIdentifier().getIdentifier());
+        }
+        writer.writeAttribute("state", getStateRepresentation(vc.getState()));
+
+        writer.writeStartElement("Type");
+        switch (vc.getType()) {
+        case EXTENSIONAL:
+            writer.writeCharacters("extensional");
+            break;
+        case INTENSIONAL:
+            writer.writeCharacters("intensional");
+            break;
+        } // switch
+        writer.writeEndElement(); // "Type" element
+
+        writer.writeStartElement("Name");
+        writer.writeCharacters(vc.getName());
+        writer.writeEndElement(); // "Name" element
+
+        if (vc.getDescription() != null) {
+            writer.writeStartElement("Description");
+            writer.writeCharacters(vc.getDescription());
+            writer.writeEndElement(); // "Description" element
+        }
+
+        if (vc.getCreationDate() != null) {
+            writer.writeStartElement("CreationDate");
+            // XXX: threading vs. performance
+            synchronized (df) {
+                writer.writeCharacters(df.format(vc.getCreationDate()));
+            } // synchronized (df)
+            writer.writeEndElement(); // "CreationDate" element
+        }
+
+        if ((vc.getCreators() != null) && !vc.getCreators().isEmpty()) {
+            writer.writeStartElement("Creators");
+            for (Creator creator : vc.getCreators()) {
+                writeCreator(writer, creator);
+            }
+            writer.writeEndElement(); // "Creators" element
+        } // Creators
+
+        if (vc.getPurpose() != null) {
+            writer.writeStartElement("Purpose");
+            switch (vc.getPurpose()) {
+            case RESEARCH:
+                writer.writeCharacters("research");
+                break;
+            case REFERENCE:
+                writer.writeCharacters("reference");
+                break;
+            case SAMPLE:
+                writer.writeCharacters("sample");
+                break;
+            case FUTURE_USE:
+                writer.writeCharacters("future-use");
+                break;
+            } // switch
+            writer.writeEndElement(); // "Purpose" element
+        }
+
+        if (vc.getReproducibility() != null) {
+            writer.writeStartElement("Reproducibility");
+            switch (vc.getReproducibility()) {
+            case INTENDED:
+                writer.writeCharacters("intended");
+                break;
+            case FLUCTUATING:
+                writer.writeCharacters("fluctuating");
+                break;
+            case UNTENDED:
+                writer.writeCharacters("untended");
+                break;
+            } // switch
+            writer.writeEndElement(); // "Reproducibility" element
+        }
+
+        if (vc.getReproducibilityNotice() != null) {
+            writer.writeStartElement("ReproducibilityNotice");
+            writer.writeCharacters(vc.getReproducibilityNotice());
+            writer.writeEndElement(); // "ReproducibilityNotice" element
+        }
+
+        if ((vc.getKeywords() != null) && !vc.getKeywords().isEmpty()) {
+            writer.writeStartElement("Keywords");
+
+            for (final String keyword : vc.getKeywords()) {
+                writer.writeStartElement("Keyword");
+                writer.writeCharacters(keyword);
+                writer.writeEndElement(); // "Keyword" element
+            }
+
+            writer.writeEndElement(); // "Keywords" element
+        } // Keywords
+
+        if ((vc.getResources() != null) && !vc.getResources().isEmpty()) {
+            writer.writeStartElement("Resources");
+
+            for (final Resource resource : vc.getResources()) {
+                writeResource(writer, resource);
+            }
+
+            writer.writeEndElement(); // "Resources" element
+        } // Resources
+
+        if (vc.getGeneratedBy() != null) {
+            final GeneratedBy generatedBy = vc.getGeneratedBy();
+            writer.writeStartElement("GeneratedBy");
+
+            writer.writeStartElement("Description");
+            writer.writeCharacters(generatedBy.getDescription());
+            writer.writeEndElement(); // "Description" element
+
+            if (generatedBy.getURI() != null) {
+                writer.writeStartElement("URI");
+                writer.writeCharacters(generatedBy.getURI());
+                writer.writeEndElement(); // "URI" element
+            }
+
+            if (generatedBy.getQuery() != null) {
+                GeneratedByQuery query = generatedBy.getQuery();
+                writer.writeStartElement("Query");
+                writer.writeAttribute("profile", query.getProfile());
+                writer.writeCData(query.getValue());
+                writer.writeEndElement(); // "Query" element
+            }
+
+            writer.writeEndElement(); // "GeneratedBy" element
+        }
+
+        writer.writeEndElement(); // "VirtualCollection" element
+    }
+
+    private String getStateRepresentation(final VirtualCollection.State state) {
+        String s = null;
+        switch (state) {
+            case PRIVATE:
+                s = "private";
+                break;
+            case PUBLIC_PENDING:
+                s = "public-pending";
+                break;
+            case PUBLIC:
+                s = "public";
+                break;
+            case DELETED:
+                s = "deleted";
+                break;
+            case DEAD:
+                s = "dead";
+                break;
+        }
+        return s;
+    }
+
+    private void writeCreator(XMLStreamWriter writer, Creator creator) throws XMLStreamException {
+        writer.writeStartElement("Creator");
+        
+        writer.writeStartElement("Person");
+        writer.writeCharacters(creator.getPerson());
+        writer.writeEndElement(); // "Person" element
+        
+        if (creator.getAddress() != null) {
+            writer.writeStartElement("Address");
+            writer.writeCharacters(creator.getAddress());
+            writer.writeEndElement(); // "Address" element
+        }
+        
+        if (creator.getEMail() != null) {
+            writer.writeStartElement("Email");
+            writer.writeCharacters(creator.getEMail());
+            writer.writeEndElement(); // "Email" element
+        }
+        
+        if (creator.getOrganisation() != null) {
+            writer.writeStartElement("Organisation");
+            writer.writeCharacters(creator.getOrganisation());
+            writer.writeEndElement(); // "Organisation" element
+        }
+        
+        if (creator.getTelephone() != null) {
+            writer.writeStartElement("Telephone");
+            writer.writeCharacters(creator.getTelephone());
+            writer.writeEndElement(); // "Telephone" element
+        }
+        
+        if (creator.getWebsite() != null) {
+            writer.writeStartElement("Website");
+            writer.writeCharacters(creator.getWebsite());
+            writer.writeEndElement(); // "Website" element
+        }
+        
+        if (creator.getRole() != null) {
+            writer.writeStartElement("Role");
+            writer.writeCharacters(creator.getRole());
+            writer.writeEndElement(); // "Role" element
+        }
+        
+        writer.writeEndElement(); // "Creator" element
+    }
+
+    private void writeResource(XMLStreamWriter writer, final Resource resource) throws XMLStreamException {
+        writer.writeStartElement("Resource");
+        
+        writer.writeStartElement("ResourceType");
+        switch (resource.getType()) {
+            case METADATA:
+                writer.writeCharacters("Metadata");
+                break;
+            case RESOURCE:
+                writer.writeCharacters("Resource");
+                break;
+        } // switch
+        writer.writeEndElement(); // "ResourceType" element
+        
+        writer.writeStartElement("ResourceRef");
+        writer.writeCharacters(resource.getRef());
+        writer.writeEndElement(); // "ResourceRef" element
+        
+        if(resource.getLabel() != null) {
+            writer.writeStartElement("Label");
+            writer.writeCharacters(resource.getLabel());
+            writer.writeEndElement(); // "Label" element
+        }
+        
+        if(resource.getDescription() != null) {
+            writer.writeStartElement("Description");
+            writer.writeCharacters(resource.getDescription());
+            writer.writeEndElement();
+        }
+        
+        writer.writeEndElement(); // "Resource" element
+    }
+
+    private VirtualCollection readVirtualCollection(
+            XMLStreamReader reader) throws XMLStreamException {
+        readStart(reader, "VirtualCollection", true, false);
+
+        VirtualCollection vc = new VirtualCollection();
+        String s = reader.getAttributeValue(null, "state");
+        if ((s != null) && !s.isEmpty()) {
+            if ("private".equals(s)) {
+                vc.setState(VirtualCollection.State.PRIVATE);
+            } else if ("public-pending".equals(s)) {
+                vc.setState(VirtualCollection.State.PUBLIC_PENDING);
+            } else if ("public".equals(s)) {
+                vc.setState(VirtualCollection.State.PUBLIC);
+            } else if ("deleted".equals(s)) {
+                vc.setState(VirtualCollection.State.DELETED);
+            } else if ("dead".equals(s)) {
+                vc.setState(VirtualCollection.State.DEAD);
+            } else {
+                throw new XMLStreamException("invalid value for attribute " +
+                        "'state' on element 'VirtualCollecion', expected one " +
+                        "of 'private', 'public-pending', 'public', " +
+                        "'deleted' or 'dead'");
+            }
+        }
+        reader.next();
+        readStart(reader, "Type", true, true);
+        s = readString(reader, true);
+        if ("extensional".equals(s)) {
+            vc.setType(VirtualCollection.Type.EXTENSIONAL);
+        } else if ("intensional".equals(s)) {
+            vc.setType(VirtualCollection.Type.INTENSIONAL);
+        } else {
+            throw new XMLStreamException("invalid value for element 'Type', " +
+                    "expected either 'extensional' or 'intensional'");
+        }
+        readStart(reader, "Name", true, true);
+        vc.setName(readString(reader, false));
+        if (readStart(reader, "Description", false, true)) {
+            vc.setDescription(readString(reader, false));
+        }
+        if (readStart(reader, "CreationDate", false, true)) {
+            try {
+                // XXX: threading vs. performance
+                synchronized (df) {
+                    vc.setCreationDate(df.parse(readString(reader, false)));
+                } // synchronized df
+            } catch (ParseException e) {
+                throw new XMLStreamException("invalid date format", e);
+            }
+        }
+        if (readStart(reader, "Creators", false, true)) {
+            readStart(reader, "Creator", true, true);
+            do {
+                readStart(reader, "Person", true, true);
+                Creator creator = new Creator(readString(reader, false));
+                if (readStart(reader, "Address", false, true)) {
+                    creator.setAddress(readString(reader, false));
+                }
+                if (readStart(reader, "Email", false, true)) {
+                    creator.setEMail(readString(reader, false));
+                }
+                if (readStart(reader, "Organisation", false, true)) {
+                    creator.setOrganisation(readString(reader, false));
+                }
+                if (readStart(reader, "Telephone", false, true)) {
+                    creator.setTelephone(readString(reader, false));
+                }
+                if (readStart(reader, "Website", false, true)) {
+                    creator.setWebsite(readString(reader, false));
+                }
+                if (readStart(reader, "Role", false, true)) {
+                    creator.setRole(readString(reader, false));
+                }
+                vc.getCreators().add(creator);
+            } while (readStart(reader, "Creator", false, true));
+        }
+        if (readStart(reader, "Purpose", false, true)) {
+            s = readString(reader, true);
+            if ("research".equals(s)) {
+                vc.setPurpose(VirtualCollection.Purpose.RESEARCH);
+            } else if ("reference".equals(s)) {
+                vc.setPurpose(VirtualCollection.Purpose.REFERENCE);
+            } else if ("sample".equals(s)) {
+                vc.setPurpose(VirtualCollection.Purpose.SAMPLE);
+            } else if ("future-use".equals(s)) {
+                vc.setPurpose(VirtualCollection.Purpose.FUTURE_USE);
+            } else {
+                throw new XMLStreamException("invalid value for element " +
+                        "'Purpose', expected one of 'research', 'reference'," +
+                        " 'sample' or 'future-use'");
+            }
+        }
+        if (readStart(reader, "Reproducibility", false, true)) {
+            s = readString(reader, true);
+            if ("intended".equals(s)) {
+                vc.setReproducibility(VirtualCollection
+                        .Reproducibility.INTENDED);
+            } else if ("fluctuating".equals(s)) {
+                vc.setReproducibility(VirtualCollection
+                        .Reproducibility.FLUCTUATING);
+            } else if ("untended".endsWith(s)) {
+                vc.setReproducibility(VirtualCollection
+                        .Reproducibility.UNTENDED);
+            } else {
+                throw new XMLStreamException("invalid value for element " +
+                        "'Reproducibility', expected one of 'intended', "+
+                        "'fluctuating' or 'fluctuating'");
+            }
+        }
+        if (readStart(reader, "ReproducibilityNotice", false, true)) {
+            vc.setReproducibilityNotice(readString(reader, false));
+        }
+        if (readStart(reader, "Keywords", false, true)) {
+            readStart(reader, "Keyword", true, true);
+            do {
+                vc.getKeywords().add(readString(reader, false));
+            } while (readStart(reader, "Keyword", false, true));
+        }
+        if (readStart(reader, "Resources", false, true)) {
+            readStart(reader, "Resource", true, true);
+            do {
+                readStart(reader, "ResourceType", true, true);
+                Resource.Type r_type;
+                s = readString(reader, true);
+                if ("Metadata".equals(s)) {
+                    r_type = Resource.Type.METADATA;
+                } else if ("Resource".equals(s)) {
+                    r_type = Resource.Type.RESOURCE;
+                } else {
+                    throw new XMLStreamException("invalid value for element " +
+                            "'ResourceType', expected either 'Metadata' " +
+                            "or 'Resource'");
+                }
+                readStart(reader, "ResourceRef", true, true);
+                final Resource resource = new Resource(r_type, readString(reader, false));
+                
+                if(readStart(reader, "Label", false, true)){
+                    resource.setLabel(readString(reader, false));
+                }
+
+                if(readStart(reader, "Description", false, true)){
+                    resource.setDescription(readString(reader, false));
+                }
+
+                vc.getResources().add(resource);
+                
+            } while (readStart(reader, "Resource", false, true));
+        }
+        if (readStart(reader, "GeneratedBy", false, true)) {
+            readStart(reader, "Description", true, true);
+            GeneratedBy generatedBy =
+                new GeneratedBy(readString(reader, false));
+            if (readStart(reader, "URI", false, true)) {
+                generatedBy.setURI(readString(reader, false));
+            }
+            if (readStart(reader, "Query", false, false)) {
+                s = reader.getAttributeValue(null, "profile");
+                if ((s == null) || s.isEmpty()) {
+                    throw new XMLStreamException("missing or empty " +
+                            "attribute 'profile' on element 'Query'");
+                }
+                reader.next();
+                final GeneratedByQuery query =
+                    new GeneratedByQuery(s, readString(reader, false));
+                generatedBy.setQuery(query);
+            }
+            vc.setGeneratedBy(generatedBy);
+        }
+        // skip to end of virtual collection
+        for (int t = reader.getEventType();
+             reader.hasNext();
+             t = reader.next()) {
+            if ((t == XMLStreamConstants.END_ELEMENT) &&
+                    "VirtualCollection".equals(reader.getLocalName())) {
+                break;
+            }
+        }
+        return vc;
+    }
+
+    private XMLStreamWriter createWriter(OutputStream out, Format format,
+            boolean validate) throws XMLStreamException {
+        if (out == null) {
+            throw new NullPointerException("out == null");
+        }
+        if (format == null) {
+            throw new NullPointerException("format == null");
+        }
+
+        switch (format) {
+        case XML:
+            XMLStreamWriter writer =
+                xmlWriterFactory.createXMLStreamWriter(out, ENCODING);
+            if (validate) {
+                ((XMLStreamWriter2) writer).validateAgainst(schema);
+            }
+            return writer;
+        case JSON:
+            return jsonWriterFactory.createXMLStreamWriter(out, ENCODING);
+        default:
+            // should never happen
+            throw new IllegalArgumentException("unsupported input format");
+        } // switch
+    }
+
+    private XMLStreamReader createReader(InputStream in, Format format,
+            String encoding) throws XMLStreamException {
+        if (in == null) {
+            throw new NullPointerException("in == null");
+        }
+        if (format == null) {
+            throw new NullPointerException("format == null");
+        }
+        if (encoding == null) {
+            throw new NullPointerException("encoding == null");
+        }
+
+        switch (format) {
+        case XML:
+            XMLStreamReader reader =
+                xmlReaderFactory.createXMLStreamReader(in, encoding);
+            ((XMLStreamReader2) reader).validateAgainst(schema);
+            return reader;
+        case JSON:
+            // FIXME: json + schema validation?
+            return jsonReaderFactory.createXMLStreamReader(in, encoding);
+        default:
+            // should never happen
+            throw new IllegalArgumentException("unsupported input format");
+        } // switch
+    }
+
+    private static boolean readStart(XMLStreamReader reader, String element,
+            boolean required, boolean advance) throws XMLStreamException {
+        for (int type = reader.getEventType();
+             reader.hasNext();
+             type = reader.next()) {
+            if (type == XMLStreamConstants.START_ELEMENT) {
+                if (element.equals(reader.getLocalName())) {
+                    if (advance) {
+                        reader.next(); // advance to next tag
+                    }
+                    return true;
+                }
+                break;
+            }
+        } // for
+        if (required) {
+            throw new XMLStreamException("expected element '" +  element +
+                    "' at this position");
+        }
+        return false;
+    }
+
+    private static String readString(XMLStreamReader reader, boolean intern)
+            throws XMLStreamException {
+        int type = reader.getEventType();
+        while (type == XMLStreamConstants.SPACE) {
+            type = reader.next();
+        }
+        switch (type) {
+        case XMLStreamConstants.CHARACTERS:
+            /* FALL-TROUGH */
+        case XMLStreamConstants.CDATA:
+            if (!reader.hasNext()) {
+                throw new XMLStreamException("unexpected end of stream");
+            }
+            String s = reader.getText();
+            if (s != null) {
+                s = s.trim();
+                if (intern) {
+                    s = s.intern();
+                }
+            }
+            if (s == null || s.isEmpty()) {
+                throw new XMLStreamException("expected character content " +
+                        "at this position", reader.getLocation());
+            }
+            reader.next();
+            return s;
+        default:
+            throw new XMLStreamException("expected character content " +
+                    "at this position", reader.getLocation());
+        } // switch
+    }
+
+} // class VirtualCollectionRegistryMarshaller
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/VirtualCollectionPrePublicationValidator.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/VirtualCollectionPrePublicationValidator.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/VirtualCollectionPrePublicationValidator.java	(revision 5623)
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2014 CLARIN
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package eu.clarin.cmdi.virtualcollectionregistry.service.impl;
+
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryUsageException;
+import eu.clarin.cmdi.virtualcollectionregistry.model.Resource;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+import eu.clarin.cmdi.virtualcollectionregistry.service.VirtualCollectionValidator;
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.wicket.util.string.Strings;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Service;
+
+/**
+ * A virtual collection validator performing "soft" validation that should occur
+ * before publication. Validated collections are <em>assumed</em> to be valid
+ * according to the 'minimal' validator applied on creation and update of the
+ * collection.
+ *
+ * @author twagoo
+ */
+@Service(value = "publication-soft")
+@Qualifier("publication-soft")
+public class VirtualCollectionPrePublicationValidator implements VirtualCollectionValidator {
+
+    @Override
+    public void validate(VirtualCollection vc) throws VirtualCollectionRegistryUsageException {
+        final List<String> warnings = new ArrayList<>();
+
+        switch (vc.getType()) {
+            case EXTENSIONAL:
+                validateResources(vc, warnings);
+                break;
+            case INTENSIONAL:
+                validateGeneratedBy(vc, warnings);
+                break;
+        }
+
+        if (Strings.isEmpty(vc.getDescription())) {
+            warnings.add("The collection has no description");
+        }
+
+        if (vc.getPurpose() == null) {
+            warnings.add("The purpose has not been specified");
+        }
+
+        if (vc.getPurpose() == VirtualCollection.Purpose.FUTURE_USE) {
+            warnings.add("The reproducibility of the collection has been marked 'future use'");
+        }
+
+        if (vc.getReproducibility() == null) {
+            warnings.add("The degree of reproducibility has not been specified");
+        }
+
+        if (vc.getCreators().isEmpty()) {
+            warnings.add("No creators have been specified for the collection");
+        }
+
+        if (!warnings.isEmpty()) {
+            throw new VirtualCollectionRegistryUsageException("Collection is not fit for publication", warnings);
+        }
+    }
+
+    private void validateResources(VirtualCollection vc, List<String> warnings) {
+        int nonPidCount = 0;
+        for (Resource resource : vc.getResources()) {
+            if (!ReferenceValidator.isPid(resource.getRef())) {
+                nonPidCount++;
+            }
+        }
+        if (nonPidCount == 0) {
+            return;
+        }
+
+        if (nonPidCount == 1) {
+            warnings.add(String.format("One resource is not referenced through a persistent identifier", nonPidCount));
+        } else {
+            warnings.add(String.format("%d resources are not referenced through a persistent identifier", nonPidCount));
+        }
+    }
+
+    private void validateGeneratedBy(VirtualCollection vc, List<String> warnings) {
+        final String queryUri = vc.getGeneratedBy().getURI();
+        if (!ReferenceValidator.isPid(queryUri)) {
+            warnings.add("The query URI is not a persistent identifer");
+        }
+    }
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/VirtualCollectionValidatorImpl.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/VirtualCollectionValidatorImpl.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/VirtualCollectionValidatorImpl.java	(revision 5623)
@@ -0,0 +1,130 @@
+package eu.clarin.cmdi.virtualcollectionregistry.service.impl;
+
+import eu.clarin.cmdi.virtualcollectionregistry.service.VirtualCollectionValidator;
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryUsageException;
+import eu.clarin.cmdi.virtualcollectionregistry.model.Creator;
+import eu.clarin.cmdi.virtualcollectionregistry.model.GeneratedBy;
+import eu.clarin.cmdi.virtualcollectionregistry.model.GeneratedByQuery;
+import eu.clarin.cmdi.virtualcollectionregistry.model.Resource;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Service;
+
+/**
+ * A virtual collection validator. Reusable and thread safe.
+ *
+ * @author twagoo
+ */
+@Service
+@Qualifier("creation")
+public class VirtualCollectionValidatorImpl implements VirtualCollectionValidator {
+
+    @Override
+    public void validate(VirtualCollection vc)
+            throws VirtualCollectionRegistryUsageException {
+        if (vc == null) {
+            throw new NullPointerException("vc == null");
+        }
+
+        final Set<Creator> uniqueCreators = new HashSet<Creator>(16);
+        final Set<String> uniqueResourceRefs = new HashSet<String>(512);
+
+        // proceed to validate ...
+        if ((vc.getName() == null) || vc.getName().trim().isEmpty()) {
+            throw new VirtualCollectionRegistryUsageException(
+                    "collection has an empty name");
+        }
+
+        for (Creator creator : vc.getCreators()) {
+            if (uniqueCreators.contains(creator)) {
+                throw new VirtualCollectionRegistryUsageException(
+                        "collection contains non unique creators");
+            }
+            uniqueCreators.add(creator);
+        }
+
+        switch (vc.getType()) {
+            case EXTENSIONAL:
+                if (vc.getResources().isEmpty()) {
+                    throw new VirtualCollectionRegistryUsageException(
+                            "extensional collection must contain on or "
+                            + "more resources");
+                }
+                if (vc.getGeneratedBy() != null) {
+                    throw new VirtualCollectionRegistryUsageException(
+                            "extensional collection must not contain GeneratedBy");
+                }
+                final List<String> invalidRefs = getInvalidReferences(vc);
+                if (!invalidRefs.isEmpty()) {
+                    throw new VirtualCollectionRegistryUsageException(
+                            String.format(
+                                    "one or more references are not valid: %s",
+                                    invalidRefs));
+                }
+                break;
+            case INTENSIONAL:
+                final GeneratedBy generatedBy = vc.getGeneratedBy();
+                if (generatedBy == null) {
+                    throw new VirtualCollectionRegistryUsageException(
+                            "intensional collections needs GeneratedBy");
+                }
+                if (generatedBy.getDescription() == null) {
+                    throw new VirtualCollectionRegistryUsageException(
+                            "GeneratedBy has empty description");
+                }
+                final GeneratedByQuery query = generatedBy.getQuery();
+                if (query != null) {
+                    if (query.getProfile() == null) {
+                        throw new VirtualCollectionRegistryUsageException(
+                                "profile of GeneratedBy.Query is empty");
+                    }
+                    if (query.getValue() == null) {
+                        throw new VirtualCollectionRegistryUsageException(
+                                "query of GeneratedBy.Query is empty");
+                    }
+                }
+        }
+
+        if ((vc.getReproducibilityNotice() != null)
+                && (vc.getReproducibility() == null)) {
+            throw new VirtualCollectionRegistryUsageException(
+                    "reproducibility notice without reproducubility");
+        }
+
+        for (String keyword : vc.getKeywords()) {
+            if ((keyword == null) || (keyword.trim().isEmpty())) {
+                throw new VirtualCollectionRegistryUsageException(
+                        "keyword is empty");
+            }
+        }
+
+        for (Resource resource : vc.getResources()) {
+            String ref = resource.getRef();
+            if (ref == null) {
+                throw new VirtualCollectionRegistryUsageException(
+                        "collection contains resource with empty ResourceRef");
+            }
+            if (uniqueResourceRefs.contains(ref)) {
+                throw new VirtualCollectionRegistryUsageException(
+                        "collection contains non-unique ResourceRefs");
+            }
+            uniqueResourceRefs.add(ref);
+        }
+    }
+
+    private List<String> getInvalidReferences(VirtualCollection vc) {
+        final ReferenceValidator referenceValidator = new ReferenceValidator();
+        final List<String> invalidRefs = new ArrayList<>();
+        for (Resource resource : vc.getResources()) {
+            if (!referenceValidator.validate(resource.getRef())) {
+                invalidRefs.add(resource.getRef());
+            }
+        }
+        return invalidRefs;
+    }
+
+} // class VirtualCollectionValidator
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/jjtree/eu/clarin/cmdi/virtualcollectionregistry/query/QueryParser.jjt
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/jjtree/eu/clarin/cmdi/virtualcollectionregistry/query/QueryParser.jjt	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/jjtree/eu/clarin/cmdi/virtualcollectionregistry/query/QueryParser.jjt	(revision 5623)
@@ -0,0 +1,158 @@
+options {
+    DEBUG_PARSER      = false;
+    MULTI             = true;
+    NODE_DEFAULT_VOID = true;
+    STATIC            = false;
+    VISITOR           = true;
+}
+PARSER_BEGIN(QueryParser)
+package eu.clarin.cmdi.virtualcollectionregistry.query;
+
+public class QueryParser {
+    public QueryParser(String s) {
+        this(new java.io.StringReader(s));
+    }
+} // class QueryParser
+PARSER_END(QueryParser)
+/*
+  (vc.)name:           STRING (EQ, NE)
+  (vc.)description:    STRING (EQ, NE)
+  (vc.)state:          { "public", "private", "deleted" } (EQ, NE)
+  {vc.}purpose:        { "research", "reference",
+                         "sample", "future-use" } (EQ, NE)
+  {vc.}reproducibility { "intended", "fluctuating", "untended" } (EQ, NE)
+  (vc.)created:        ISO-DATE (EQ, NE, GT, GE, LT, LE)
+  {vc.}modified:       ISO-DATE (EQ, NE, GT, GE, LT, LE)
+  {vc.}owner           STRING (EQ, NE)
+  (cr.)creator:        STRING (EQ, NE)
+  {cr.}email:          STRING (EQ, NE)
+  {cr.}organization:   STRING (EQ, NE)
+*/
+SKIP: {
+    " "
+    | "\t"
+    | "\n"
+    | "\r"
+}
+TOKEN: {
+      <VC_NAME: "name">
+    | <VC_DESC: "description">
+    | <VC_CREATED: "created">
+    | <VC_MODIFIED: "modified">
+    | <VC_STATE: "state">
+    | <VC_PURPOSE: "purpose">
+    | <VC_REPRODUCIBILITY: "reproducibility">
+    | <VC_OWNER: "owner">
+    | <CR_PERSON: "person">
+    | <CR_ORGANIZATION: "organization">
+    | <CR_EMAIL: "email">
+    | <AND: "and">
+    | <OR: "or">
+    | <EQ: "=">
+    | <NE: "<>">
+    | <GT: ">">
+    | <GE: ">=">
+    | <LT: "<">
+    | <LE: "<=">
+    | <LPAREN: "(">
+    | <RPAREN: ")">
+    | <STATE_PUBLIC: "public">
+    | <STATE_PRIVATE: "private">
+    | <STATE_DELETED: "deleted">
+    | <PURPOSE_RESEARCH: "research">
+    | <PURPOSE_REFERENCE: "reference">
+    | <PURPOSE_SAMPLE: "sample">
+    | <PURPOSE_FUTURE_USE: "future-use">
+    | <REPRODUCIBILITY_INTENDED: "intended">
+    | <REPRODUCIBILITY_FLUCTUATING: "fluctuating">
+    | <REPRODUCIBILITY_UNTENDED: "untended">
+    | <#DIGIT: ["0"-"9"]>
+    | <ISO_DATE: <DIGIT> <DIGIT> <DIGIT> <DIGIT> "-"
+                 <DIGIT> <DIGIT> "-"
+                 <DIGIT> <DIGIT> "T"
+                 <DIGIT> <DIGIT> ":"
+                 <DIGIT> <DIGIT> ":"
+                 <DIGIT> <DIGIT> "Z">
+    | <QUOTED_STRING: "\"" (~["\""])+ "\"" >
+}
+ASTStart start() #Start : {
+}
+{
+    expressionOr() <EOF>
+    { return jjtThis; }
+}
+private void expressionOr() : {
+}
+{
+    (expressionAnd() (<OR> expressionAnd())*) #Or(>1)
+}
+private void expressionAnd() : {
+}
+{
+    (term() (<AND> term())*) #And(>1)
+}
+private void term() : {
+}
+{
+    predicate()
+    | (<LPAREN> expressionOr() <RPAREN>)
+}
+private void predicate() #Predicate : {
+    Token attribute = null;
+    Token operator = null;
+    Token value = null;
+}
+{
+    (
+     ( ( attribute = <VC_NAME>
+       | attribute = <VC_DESC>
+       | attribute = <VC_OWNER>
+       | attribute = <CR_PERSON>
+       | attribute = <CR_ORGANIZATION>
+       | attribute = <CR_EMAIL> )
+       ( operator = <EQ>
+       | operator = <NE> )
+       value = <QUOTED_STRING> )
+     | ( attribute = <VC_STATE>
+        ( operator = <EQ>
+        | operator = <NE> )
+        ( value = <STATE_PUBLIC>
+        | value = <STATE_PRIVATE>
+        | value = <STATE_DELETED> ) )
+     | ( ( attribute = <VC_CREATED>
+         | attribute = <VC_MODIFIED> )
+         ( operator = <EQ>
+         | operator = <NE>
+         | operator = <GT>
+         | operator = <GE>
+         | operator = <LT>
+         | operator = <LE> )
+         value = <ISO_DATE> )
+     | ( attribute = <VC_PURPOSE>
+        ( operator = <EQ>
+        | operator = <NE> )
+        ( value = <PURPOSE_RESEARCH>
+        | value = <PURPOSE_REFERENCE>
+        | value = <PURPOSE_SAMPLE>
+        | value = <PURPOSE_FUTURE_USE> ) )
+     | ( attribute = <VC_REPRODUCIBILITY>
+        ( operator = <EQ>
+        | operator = <NE> )
+        ( value = <REPRODUCIBILITY_INTENDED>
+        | value = <REPRODUCIBILITY_FLUCTUATING>
+        | value = <REPRODUCIBILITY_UNTENDED> ) )
+    )
+    {
+        if ((attribute == null) || (operator == null) || (value == null)) {
+            throw new ParseException("internal error while parsing query");
+        }
+        // strip quotes from QUOTED_STRING
+        String v = value.image;
+        if (value.kind == QUOTED_STRING) {
+            v = v.substring(1, v.length() - 1);
+        }
+        jjtThis.setAttribute(attribute.kind);
+        jjtThis.setOperator(operator.kind);
+        jjtThis.setValue(v);
+    }
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/resources/META-INF/VirtualCollection.xsd
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/resources/META-INF/VirtualCollection.xsd	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/resources/META-INF/VirtualCollection.xsd	(revision 5623)
@@ -0,0 +1,152 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+  elementFormDefault="unqualified">
+
+  <xs:element name="VirtualCollections">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="VirtualCollection" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+      <xs:attribute name="totalCount" type="xs:integer"/>
+      <xs:attribute name="offset" type="xs:integer"/>
+      <xs:attribute name="result">
+        <xs:simpleType>
+          <xs:restriction base="xs:string">
+            <xs:enumeration value="full"/>
+            <xs:enumeration value="partial"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="VirtualCollection">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="Type">
+          <xs:simpleType>
+            <xs:restriction base="xs:string">
+              <xs:enumeration value="extensional"/>
+              <xs:enumeration value="intensional"/>
+            </xs:restriction>
+          </xs:simpleType>
+        </xs:element>
+        <xs:element name="Name" type="xs:string"/>
+        <xs:element name="Description" type="xs:string" minOccurs="0"/>
+        <xs:element name="CreationDate" type="xs:date" minOccurs="0"/>
+        <xs:element name="Creators" minOccurs="0">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="Creator" minOccurs="1" maxOccurs="unbounded">
+                <xs:complexType>
+                    <xs:sequence>
+                      <xs:element name="Person" type="xs:string"/>
+                      <xs:element name="Address" type="xs:string" minOccurs="0"/>
+                      <xs:element name="Email" type="xs:string" minOccurs="0"/>
+                      <xs:element name="Organisation" type="xs:string" minOccurs="0"/>
+                      <xs:element name="Telephone" type="xs:string" minOccurs="0" />
+                      <xs:element name="Website" type="xs:anyURI" minOccurs="0" />
+                      <xs:element name="Role" type="xs:string" minOccurs="0" />
+                    </xs:sequence>
+                </xs:complexType>
+              </xs:element>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="Purpose" minOccurs="0">
+          <xs:simpleType>
+            <xs:restriction base="xs:string">
+              <xs:enumeration value="research"/>
+              <xs:enumeration value="reference"/>
+              <xs:enumeration value="sample"/>
+              <xs:enumeration value="future-use"/>
+              <!-- to be extended -->
+            </xs:restriction>
+          </xs:simpleType>
+        </xs:element>
+        <xs:element name="Reproducibility" minOccurs="0">
+          <xs:simpleType>
+            <xs:restriction base="xs:string">
+              <xs:enumeration value="intended"/>
+              <xs:enumeration value="fluctuating"/>
+              <xs:enumeration value="untended"/>
+            </xs:restriction>
+          </xs:simpleType>
+        </xs:element>
+        <xs:element name="ReproducibilityNotice" type="xs:string" minOccurs="0" />
+        <xs:element name="Keywords" minOccurs="0">
+          <xs:complexType>
+        	<xs:sequence>
+        	  <xs:element name="Keyword" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>
+        	</xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="Resources" minOccurs="0">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="Resource" minOccurs="1" maxOccurs="unbounded">
+                <xs:complexType>
+                  <xs:sequence>
+                    <xs:element name="ResourceType">
+                      <xs:simpleType>
+                        <xs:restriction base="xs:string">
+                          <xs:enumeration value="Metadata"/>
+                          <xs:enumeration value="Resource"/>
+                        </xs:restriction>
+                      </xs:simpleType>
+                    </xs:element>
+                    <xs:element name="ResourceRef">
+                      <xs:simpleType>
+                        <xs:restriction base="xs:anyURI"/>
+                      </xs:simpleType>
+                    </xs:element>
+                    <xs:element name="Label" minOccurs="0">
+                      <xs:simpleType>
+                        <xs:restriction base="xs:string"/>
+                      </xs:simpleType>
+                    </xs:element>
+                    <xs:element name="Description" minOccurs="0">
+                      <xs:simpleType>
+                        <xs:restriction base="xs:string"/>
+                      </xs:simpleType>
+                    </xs:element>
+                  </xs:sequence>
+                </xs:complexType>
+              </xs:element>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="GeneratedBy" minOccurs="0">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="Description" type="xs:string"/>
+              <xs:element name="URI" type="xs:anyURI" minOccurs="0"/>
+              <xs:element name="Query" minOccurs="0">
+                <xs:complexType>
+                  <xs:simpleContent>
+                    <xs:extension base="xs:string">
+                      <xs:attribute name="profile" type="xs:string" use="required"/>
+                    </xs:extension>
+                  </xs:simpleContent>
+                </xs:complexType>
+              </xs:element>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+      </xs:sequence>
+      <xs:attribute name="id" type="xs:long" use="optional" />
+      <xs:attribute name="persistentId" type="xs:string" use="optional" />
+      <xs:attribute name="state" use="optional">
+        <xs:simpleType>
+          <xs:restriction base="xs:string">
+            <xs:enumeration value="private" />
+            <xs:enumeration value="public-pending" />
+            <xs:enumeration value="public" />
+            <xs:enumeration value="deleted" />
+            <xs:enumeration value="dead" />
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+</xs:schema>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/resources/META-INF/persistence.xml
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/resources/META-INF/persistence.xml	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/resources/META-INF/persistence.xml	(revision 5623)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
+  <persistence-unit name="VirtualCollectionStore" transaction-type="RESOURCE_LOCAL">
+    <provider>org.hibernate.ejb.HibernatePersistence</provider>
+    <jta-data-source>java:comp/env/jdbc/VirtualCollectionStore</jta-data-source>
+    <class>eu.clarin.cmdi.virtualcollectionregistry.model.User</class>
+    <class>eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection</class>
+    <class>eu.clarin.cmdi.virtualcollectionregistry.model.Creator</class>
+    <class>eu.clarin.cmdi.virtualcollectionregistry.model.Resource</class>
+    <class>eu.clarin.cmdi.virtualcollectionregistry.pid.PersistentIdentifier</class>
+    <validation-mode>NONE</validation-mode>
+    <properties>
+      <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/>
+      <property name="hibernate.max_fetch_depth" value="3"/>
+      <property name="hibernate.hbm2ddl.auto" value="update"/>
+      <property name="hibernate.show_sql" value="false"/>
+      <property name="hibernate.format_sql" value="false"/>
+    </properties>
+  </persistence-unit>
+</persistence>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/resources/log4j.properties
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/resources/log4j.properties	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/resources/log4j.properties	(revision 5623)
@@ -0,0 +1,16 @@
+log4j.appender.Console=org.apache.log4j.ConsoleAppender
+log4j.appender.Console.layout=org.apache.log4j.PatternLayout
+log4j.appender.Console.layout.conversionPattern=%d %p [%20.20t %c#%M:%L] - %m%n
+
+log4j.appender.File.File=${catalina.base}/logs/vcr.log
+log4j.appender.File=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.File.layout=org.apache.log4j.PatternLayout
+log4j.appender.File.layout.ConversionPattern=%d  %p [%20.20t %c#%M:%L] - %m%n
+
+log4j.rootLogger=INFO,${log4j.appender}
+
+log4j.logger.eu.clarin.cmdi.virtualcollectionregistry=INFO
+#log4j.logger.eu.clarin.cmdi.virtualcollectionregistry=DEBUG
+log4j.logger.org.springframework=INFO
+log4j.logger.org.hibernate=INFO
+log4j.logger.org.apache.wicket=INFO
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/resources/restIndex.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/resources/restIndex.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/resources/restIndex.html	(revision 5623)
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<!--
+Copyright (C) 2014 CLARIN
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+-->
+<html>
+    <head>
+        <title>Virtual Collection Registry REST service</title>
+        <meta charset="UTF-8">
+        <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    </head>
+    <body>
+        <h1>Virtual Collection Registry REST service</h1>
+        <p>
+            For more information, please read the <a href="Protocol.txt">documentation</a>.
+        </p>
+        <p>
+            Example requests:
+        </p>
+        <ul>
+            <li>GET service/virtualcollections</li>
+            <li>POST service/virtualcollections</li>
+            <li>GET service/virtualcollections/1</li>
+            <li>PUT service/virtualcollections/1</li>
+            <li>GET service/my-virtualcollections</li>
+        </ul>
+    </body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/META-INF/MANIFEST.MF
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/META-INF/MANIFEST.MF	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/META-INF/MANIFEST.MF	(revision 5623)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path: 
+
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/META-INF/context.xml
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/META-INF/context.xml	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/META-INF/context.xml	(revision 5623)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Context antiJARLocking="true" path="/VirtualCollectionRegistry"/>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/WEB-INF/applicationContext.xml
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/WEB-INF/applicationContext.xml	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/WEB-INF/applicationContext.xml	(revision 5623)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
+          http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
+">
+    <!-- 
+    Spring configuration for Virtual Collection Registry 
+    -->
+    
+    <!-- 
+    Bootstrap component scanning, so that Spring picks up @Component, 
+    @Service, @Repository annotations on classes and creates beans for these, as
+    well as @Configuration annotations for classes defining beans and properties
+    -->
+    <context:component-scan base-package="eu.clarin.cmdi.virtualcollectionregistry" />
+    
+    <!--
+    Will enable reading properties from the servlet context (with fallback to a
+    packaged properties file). Used by EPIC persistent identifier provider.
+    -->
+    <bean class="org.springframework.web.context.support.ServletContextPropertyPlaceholderConfigurer">
+        <!--<property name="location" value="classpath:vcr-defaults.properties"/>-->
+    </bean>
+                
+</beans>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/WEB-INF/shhaa.xml
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/WEB-INF/shhaa.xml	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/WEB-INF/shhaa.xml	(revision 5623)
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<ROOT>
+    <shhaa>
+
+        <authentication>
+            <shibheader>
+                <username>oid:eppn</username>
+                <username>mace:eppn</username>
+                <username>eppn</username>
+		
+                <username>oid:eduPersonPrincipalName</username>
+                <username>mace:eduPersonPrincipalName</username>
+                <username>eduPersonPrincipalName</username>
+		
+                <username>oid:eduPersonTargetedID</username>
+                <username>mace:eduPersonTargetedID</username>
+                <username>eduPersonTargetedID</username>
+
+                <session>Shib-Session-ID</session>
+                <idp>Shib-Identity-Provider</idp>
+                <timestamp>Shib-Authentication-Instant</timestamp>
+            </shibheader>
+            <fallback>
+                <username>anonymous</username>
+            </fallback>
+            <sso action="lI">https://sp.shibtest.clarin.eu/Shibboleth.sso/Login</sso> 
+            <slo action="lO">https://sp.shibtest.clarin.eu/Shibboleth.sso/Logout</slo>     
+        </authentication>
+	
+	
+        <composition action="rF">
+            <shibheader>
+                <attribute>cn</attribute>
+                <attribute>commonName</attribute>
+                <attribute>displayName</attribute>
+                
+                <attribute>mail</attribute>
+                
+                <attribute>o</attribute>                
+                <attribute>organizationName</attribute>
+                <attribute>schacHomeOrganization</attribute>
+                
+            </shibheader>
+        </composition>
+	
+        <authorization>
+	    <location  target="/app/login" />
+	    <location  target="/service/submit" />
+            <location target="/service/virtualcollections" methods="post"/>
+            <location target="/service/virtualcollections/*" methods="post put delete"/>
+            <location target="/service/my-virtualcollections" />
+        </authorization>
+	
+        <handler>
+            <ignore>
+                <location target="/css/*" />
+                <location target="/img/*" />
+            </ignore>
+		
+            <!-- configures the view-control targets -->
+            <pages>
+                <!--  <info action="dI">/protected/info.jsp</info> -->
+                <denied action="dD">pages/noaccess.jsp</denied> 
+            </pages>
+		
+        </handler>
+	
+    </shhaa>
+</ROOT>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/WEB-INF/web-dev.xml
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/WEB-INF/web-dev.xml	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/WEB-INF/web-dev.xml	(revision 5623)
@@ -0,0 +1,187 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app id="WebApp_ID" version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+    <display-name>CLARIN Virtual Collection Registry</display-name>
+
+    <!-- Spring -->
+    
+    <listener>
+        <listener-class>
+            org.springframework.web.context.ContextLoaderListener
+        </listener-class>
+    </listener>
+ 
+    <context-param>
+        <param-name>spring.profiles.active</param-name>
+        <param-value>vcr.pid.dummy</param-value>
+        <!--<param-value>vcr.pid.gwdg</param-value>-->
+    </context-param>
+    
+    <!-- Persistence -->
+ 
+    <filter>
+        <filter-name>PersistenceFilter</filter-name>
+        <filter-class>eu.clarin.cmdi.virtualcollectionregistry.rest.PersistenceFilter</filter-class>
+    </filter>
+    
+    <filter-mapping>
+        <filter-name>PersistenceFilter</filter-name>
+        <servlet-name>REST-Web-Service</servlet-name>
+    </filter-mapping>
+    
+    <filter-mapping>
+        <filter-name>PersistenceFilter</filter-name>
+        <url-pattern>/app/*</url-pattern>
+    </filter-mapping>
+    
+    <filter>
+        <filter-name>CharacterEncodingFilter</filter-name>
+        <filter-class>eu.clarin.cmdi.virtualcollectionregistry.gui.CharacterEncodingFilter</filter-class>
+    </filter>
+    
+    <filter-mapping>
+        <filter-name>CharacterEncodingFilter</filter-name>
+        <url-pattern>/app/*</url-pattern>
+    </filter-mapping>
+    
+    <filter>
+        <filter-name>VirtualCollectionRegistryApplication</filter-name>
+        <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
+        <init-param>
+            <param-name>applicationFactoryClassName</param-name>
+            <param-value>org.apache.wicket.spring.SpringWebApplicationFactory</param-value>
+        </init-param>
+        <init-param>
+            <param-name>configuration</param-name>
+            <!-- 
+           <param-value>deployment</param-value>
+            -->
+            <param-value>development</param-value>
+        </init-param>
+    </filter>
+    
+    <filter-mapping>
+        <filter-name>VirtualCollectionRegistryApplication</filter-name>
+        <url-pattern>/app/*</url-pattern>
+    </filter-mapping>
+    
+    <servlet>
+        <display-name>Virtual Collection Registry REST web service</display-name>
+        <servlet-name>REST-Web-Service</servlet-name>
+        <servlet-class>com.sun.jersey.spi.spring.container.servlet.SpringServlet</servlet-class>
+        <init-param>
+            <param-name>com.sun.jersey.config.property.packages</param-name>
+            <param-value>eu.clarin.cmdi.virtualcollectionregistry.rest</param-value>
+        </init-param>
+        <init-param>
+            <param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
+            <param-value>eu.clarin.cmdi.virtualcollectionregistry.rest.VirtualCollectionMediaTypeFilter</param-value>
+        </init-param>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+    
+    <servlet-mapping>
+        <servlet-name>REST-Web-Service</servlet-name>
+        <url-pattern>/service/*</url-pattern>
+    </servlet-mapping>
+    
+    <servlet>
+        <display-name>Virtual Collection Registry OAI-PMH Provider</display-name>
+        <servlet-name>OAI-PMH-Provider</servlet-name>
+        <servlet-class>eu.clarin.cmdi.oai.provider.ProviderServlet</servlet-class>
+        <load-on-startup>2</load-on-startup>
+    </servlet>
+    
+    <servlet-mapping>
+        <servlet-name>OAI-PMH-Provider</servlet-name>
+        <url-pattern>/oai</url-pattern>
+    </servlet-mapping>
+    
+    <resource-ref>
+        <description>Virtual Collection Datastore Connection</description>
+        <res-ref-name>jdbc/VirtualCollectionStore</res-ref-name>
+        <res-type>javax.sql.DataSource</res-type>
+        <res-auth>Container</res-auth>
+    </resource-ref>
+    
+    <!-- 
+        Security constraints; authentication mechanism must be configured
+        by means of a security realm (by default the UserDatabaseRealm is
+        configured in Tomcat, which uses the tomcat-users.xml file)
+    -->
+    <security-constraint>
+        <display-name>REST-Web-Service</display-name>
+        <web-resource-collection>
+            <web-resource-name>REST-Web-Service</web-resource-name>
+            <description></description>
+            <url-pattern>/service/virtualcollections</url-pattern>
+            <http-method>POST</http-method>
+        </web-resource-collection>
+        <web-resource-collection>
+            <web-resource-name>REST-Web-Service</web-resource-name>
+            <description></description>
+            <url-pattern>/service/virtualcollections/*</url-pattern>
+            <http-method>DELETE</http-method>
+            <http-method>POST</http-method>
+            <http-method>PUT</http-method>
+        </web-resource-collection>
+        <web-resource-collection>
+            <web-resource-name>REST-Web-Service</web-resource-name>
+            <description></description>
+            <url-pattern>/service/my-virtualcollections</url-pattern>
+            <http-method>GET</http-method>
+        </web-resource-collection>
+        <web-resource-collection>
+            <web-resource-name>REST-Web-Service</web-resource-name>
+            <description></description>
+            <url-pattern>/service/submit</url-pattern>
+            <http-method>POST</http-method>
+        </web-resource-collection>
+        <web-resource-collection>
+            <web-resource-name>VirtualCollectionRegistryApplication</web-resource-name>
+            <description></description>
+            <url-pattern>/app/login</url-pattern>
+            <http-method>GET</http-method>
+        </web-resource-collection>
+        <auth-constraint>
+            <role-name>vcr</role-name>
+        </auth-constraint>
+    </security-constraint>
+
+    <security-role>
+        <role-name>vcr</role-name>
+    </security-role>
+    
+    <login-config>
+        <auth-method>BASIC</auth-method>
+    </login-config>
+    
+    <security-role>
+        <role-name>*</role-name>
+    </security-role>
+    
+    <mime-mapping>
+        <extension>xsd</extension>
+        <mime-type>application/xml</mime-type>
+    </mime-mapping>
+    
+    <welcome-file-list>
+        <welcome-file>index.jsp</welcome-file>
+    </welcome-file-list>
+    
+    <!-- 
+        Enable JavaMelody for application monitoring
+        More info at https://code.google.com/p/javamelody/
+    -->
+    
+    <filter>
+        <filter-name>monitoring</filter-name>
+        <filter-class>net.bull.javamelody.MonitoringFilter</filter-class>
+    </filter>
+    <filter-mapping>
+        <filter-name>monitoring</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+    <listener>
+        <listener-class>net.bull.javamelody.SessionListener</listener-class>
+    </listener>
+</web-app>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/WEB-INF/web-shib.xml
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/WEB-INF/web-shib.xml	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/WEB-INF/web-shib.xml	(revision 5623)
@@ -0,0 +1,151 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+         id="WebApp_ID" version="2.5">
+    <display-name>CLARIN Virtual Collection Registry</display-name>
+
+    <!-- Shibboleth -->
+
+    <context-param>
+        <param-name>ShhaaConfigLocation</param-name>
+        <param-value>/WEB-INF/shhaa.xml</param-value>
+    </context-param>
+    
+    <!-- Make sure this one is declared before the wicket filter, the order matters. Shibboleth should trigger the login, before continuing with the wicket filter.-->
+    <filter>
+        <filter-name>AAIFilter</filter-name>
+        <filter-class>de.mpg.aai.shhaa.AuthFilter</filter-class>
+    </filter>
+    <filter-mapping>
+        <filter-name>AAIFilter</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+    
+    <!-- Spring -->
+    
+    <listener>
+        <listener-class>
+            org.springframework.web.context.ContextLoaderListener
+        </listener-class>
+    </listener>
+ 
+    <context-param>
+        <param-name>spring.profiles.active</param-name>
+        <param-value>vcr.pid.dummy</param-value>
+        <!--<param-value>vcr.pid.gwdg</param-value>-->
+    </context-param>
+    
+    <!-- Persistence -->
+
+    <filter>
+        <filter-name>PersistenceFilter</filter-name>
+        <filter-class>eu.clarin.cmdi.virtualcollectionregistry.rest.PersistenceFilter</filter-class>
+    </filter>
+
+    <filter-mapping>
+        <filter-name>PersistenceFilter</filter-name>
+        <servlet-name>REST-Web-Service</servlet-name>
+    </filter-mapping>
+    
+    <filter-mapping>
+        <filter-name>PersistenceFilter</filter-name>
+        <url-pattern>/app/*</url-pattern>
+    </filter-mapping>
+
+    <filter>
+        <filter-name>CharacterEncodingFilter</filter-name>
+        <filter-class>eu.clarin.cmdi.virtualcollectionregistry.gui.CharacterEncodingFilter</filter-class>
+    </filter>
+
+    <filter-mapping>
+        <filter-name>CharacterEncodingFilter</filter-name>
+        <url-pattern>/app/*</url-pattern>
+    </filter-mapping>
+
+    <filter>
+        <filter-name>VirtualCollectionRegistryApplication</filter-name>
+        <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
+        <init-param>
+            <param-name>applicationFactoryClassName</param-name>
+            <param-value>org.apache.wicket.spring.SpringWebApplicationFactory</param-value>
+        </init-param>
+        <init-param>
+            <param-name>configuration</param-name>
+            <!-- 
+           <param-value>deployment</param-value>
+            -->
+            <param-value>development</param-value>
+        </init-param>
+    </filter>
+
+    <filter-mapping>
+        <filter-name>VirtualCollectionRegistryApplication</filter-name>
+        <url-pattern>/app/*</url-pattern>
+    </filter-mapping>
+
+    <servlet>
+        <display-name>Virtual Collection Registry REST web service</display-name>
+        <servlet-name>REST-Web-Service</servlet-name>
+        <servlet-class>com.sun.jersey.spi.spring.container.servlet.SpringServlet</servlet-class>
+        <init-param>
+            <param-name>com.sun.jersey.config.property.packages</param-name>
+            <param-value>eu.clarin.cmdi.virtualcollectionregistry.rest</param-value>
+        </init-param>
+        <init-param>
+            <param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
+            <param-value>eu.clarin.cmdi.virtualcollectionregistry.rest.VirtualCollectionMediaTypeFilter</param-value>
+        </init-param>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>REST-Web-Service</servlet-name>
+        <url-pattern>/service/*</url-pattern>
+    </servlet-mapping>
+
+    <servlet>
+        <display-name>Virtual Collection Registry OAI-PMH Provider</display-name>
+        <servlet-name>OAI-PMH-Provider</servlet-name>
+        <servlet-class>eu.clarin.cmdi.oai.provider.ProviderServlet</servlet-class>
+        <load-on-startup>2</load-on-startup>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>OAI-PMH-Provider</servlet-name>
+        <url-pattern>/oai</url-pattern>
+    </servlet-mapping>
+
+    <resource-ref>
+        <description>Virtual Collection Datastore Connection</description>
+        <res-ref-name>jdbc/VirtualCollectionStore</res-ref-name>
+        <res-type>javax.sql.DataSource</res-type>
+        <res-auth>Container</res-auth>
+    </resource-ref>
+
+    <mime-mapping>
+        <extension>xsd</extension>
+        <mime-type>application/xml</mime-type>
+    </mime-mapping>
+
+    <welcome-file-list>
+        <welcome-file>index.jsp</welcome-file>
+    </welcome-file-list>
+    
+    <!-- 
+        Enable JavaMelody for application monitoring
+        More info at https://code.google.com/p/javamelody/
+    -->
+    
+    <filter>
+        <filter-name>monitoring</filter-name>
+        <filter-class>net.bull.javamelody.MonitoringFilter</filter-class>
+    </filter>
+    <filter-mapping>
+        <filter-name>monitoring</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+    <listener>
+        <listener-class>net.bull.javamelody.SessionListener</listener-class>
+    </listener>
+</web-app>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/css/CLARIN.scss
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/css/CLARIN.scss	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/css/CLARIN.scss	(revision 5623)
@@ -0,0 +1,502 @@
+@charset "UTF-8";
+
+$indent: 7px;
+
+// Colors
+
+$red: #9e0025;
+//$blue: #52acda;
+//$dark_powder_blue: #003399;
+//$clarin_blue_old: #007bc5;
+$clarin_blue: #00406f;
+$grey: #e3e3e3;
+$light_grey: #f3f3f3;
+
+$thin_separator_grey: #e7e7e7;
+$text_emphasized: #222;
+$text_deemphasized: #666;
+//$hyperlink_color: #03683f;
+$text_emphasized_periphery: #806a52;
+$text_deemphasized_periphery: #c0a37c;
+$hyperlink: $text_emphasized_periphery;
+$hyperlink_visited: $text_deemphasized_periphery;
+$background_color: #f9f9f9;
+
+// Font
+// https://bugzilla.mozilla.org/show_bug.cgi?id=604421
+/*
+@font-face {
+  font-family: 'Roboto Condensed';
+  font-style: normal;
+  font-weight: 400;
+  src: local('Roboto Condensed Regular'), local('RobotoCondensed-Regular'), url('Roboto_Condensed_with_European_character_sets.woff') format('woff');
+}
+*/
+
+@font-face {
+  font-family: 'Roboto';
+  font-style: normal;
+  font-weight: 400;
+  src: local('Roboto Regular'), local('Roboto-Regular'), url('Roboto_with_European_character_sets.woff') format('woff');
+}
+
+$font-stack: 'Roboto', sans-serif;
+
+body {
+  font-family: $font-stack;
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
+  color: $text_emphasized;
+  font-size: 100%;
+  word-wrap: break-word;
+}
+
+a {
+  color: $hyperlink;
+  text-decoration: dotted !important;
+
+  &:hover, &:focus {
+    // color: inherit;
+    text-decoration: none !important;
+  }
+
+  &:visited {
+    color: $hyperlink_visited;
+  }
+}
+
+div.navbar-header {
+  text-overflow: ellipsis;
+  overflow: hidden;
+  //max-height: 30px; // TODO: transition to flex divs.
+}
+
+a.navbar-brand {
+  color: $text_emphasized_periphery;
+  //text-shadow: 3px 3px 0px #2c2e38, 5px 5px 0px #5c5f72;
+  font-size: 2em;
+  text-overflow: ellipsis;
+  //overflow: hidden;
+  //letter-spacing: 1px;
+
+  //$clarin_blue1: #00406f;
+  //$clarin_blue2: #006dab;
+  //$clarin_blue3: #007eda;
+
+  //font-weight: bold;
+  line-height: 1em;
+  //color: $clarin_blue !important;
+
+  //text-shadow: -.025em -.025em .0125em rgba(0, 64, 111, 0.8), -.060em -.080em 0.02em rgba(0, 64, 111, 0.6); //rgba(90, 90, 90, .6);
+}
+
+/*
+a {
+    text-decoration: none;
+}
+
+a:link {
+    color: #00c;
+    border-bottom: 1px solid #00c;
+}
+
+a:visited {
+    color: #6D006D;
+    border-bottom: 1px dotted #6D006D;
+}
+
+a:focus {
+    color: #c00;
+    border-bottom: 1px dashed #c00;
+}
+
+a:hover {
+    color: #c00;
+    border-bottom: 1px dashed #c00;
+}
+
+a:active {
+    color: #c00;
+    border-bottom: 1px solid #c00;
+    font-style: italic;
+}
+*/
+
+h1, h2, h3, h4, h5, h6, label {
+  color: $text_deemphasized;
+  font-weight: normal;
+  line-height: 1.2em;
+}
+
+body, h1, h2, h3, h4, h5, h6 {
+  font-size-adjust: 0.5;
+}
+
+/* Based on http://typecast.com/blog/a-more-modern-scale-for-web-typography */
+
+#page {
+  font-size: 1em;
+  /* equivalent to 16px */
+  line-height: 1.25;
+  /* equivalent to 20px */
+}
+
+h1 {
+  font-size: 2em;
+  /* 2x body copy size = 32px */
+  line-height: 1.25;
+  /* 45px / 36px */
+  margin-top: 0px !important;
+  margin-bottom: 0px !important;
+}
+
+h2 {
+  font-size: 1.625em;
+  /* 1.625x body copy size = 26px */
+  line-height: 1.15384615;
+  /* 30px / 26px */
+}
+
+h3 {
+  font-size: 1.375em;
+  /* 1.375x body copy size = 22px */
+  line-height: 1.13636364;
+  /* 25px / 22px */
+}
+
+h4 {
+  font-size: 1.125em;
+  /* 1.125x body copy size = 18px */
+  line-height: 1.11111111;
+}
+
+blockquote {
+  font-size: 1.25em;
+  /* 20px / 16px */
+  line-height: 1.25;
+  /* 25px / 20px */
+}
+
+@media (min-width: 56.25em) {
+  h1 {
+    font-size: 3em;
+    /* 3x body copy size = 48px */
+    line-height: 1.05;
+    /* keep to a multiple of the 20px line height
+    and something more appropriate for display headings */
+  }
+
+  h2 {
+    font-size: 2.25em;
+    /* 2.25x body copy size = 36px */
+    line-height: 1.25;
+  }
+
+  h3 {
+    font-size: 1.75em;
+    /* 1.75x body copy size = 28px */
+    line-height: 1.25;
+  }
+}
+
+@media (min-width: 43.75em) {
+  #page {
+    font-size: 1em;
+    /* equivalent to 16px */
+    line-height: 1.375;
+    /* equivalent to 22px */
+  }
+
+  h1 {
+    font-size: 2.5em;
+    /* 2.5x body copy size = 40px */
+    line-height: 1.125;
+  }
+
+  h2 {
+    font-size: 2em;
+    /* 2x body copy size = 32px */
+    line-height: 1.25;
+  }
+
+  h3 {
+    font-size: 1.5em;
+    /* 1.5x body copy size = 24px */
+    line-height: 1.25;
+  }
+
+  h4 {
+    line-height: 1.22222222;
+    /* (22px / 18px */
+  }
+
+  blockquote {
+    font-size: 1.5em;
+    /* 24px / 16px = */
+    line-height: 1.45833333;
+    /* 35px / 24px */
+  }
+}
+
+p {
+  margin: 0 0 15px 0;
+}
+
+//input {
+//  @include box-sizing(border-box);
+//}
+
+menu, ol, ul {
+  padding: 0 0 0 20px;
+}
+
+hr {
+  clear: both;
+}
+
+div.container {
+  z-index: -1 !important;
+}
+
+// Tables
+
+//@import "compass/utilities/tables";
+
+table.display {
+  border-collapse: collapse !important;
+  position: relative !important;
+  border-spacing: 0 !important;
+  border: 0px !important;
+  background-clip: padding-box;
+  //background-repeat: no-repeat;
+  //background-position: center top;
+
+  th, td {
+    border: 0px !important;
+    //background-clip: content-box !important;
+  }
+
+  thead tr th {
+    background-color: $clarin_blue !important;
+    border-collapse: collapse !important;
+    //background-clip: content-box !important;
+    background-attachment: scroll !important;
+    //border-bottom: 0px !important;
+    color: #fff !important;
+  }
+
+  thead {
+    tr th:first-child {
+      border-top-left-radius: 6px !important;
+      border-bottom-left-radius: 6px !important;
+
+      -webkit-border-top-left-radius: 6px !important;
+      -webkit-border-bottom-left-radius: 6px !important;
+
+      -moz-border-top-left-radius: 6px !important;
+      -moz-border-bottom-left-radius: 6px !important;
+    }
+
+    tr {
+      padding: $indent $indent !important;
+      font-weight: bolder !important;
+      text-align: left !important;
+      border: 0px !important;
+    }
+
+    tr th a {
+      color: #fff !important;
+      text-decoration: underline !important;
+    }
+
+    tr th:last-child {
+      border-top-right-radius: 6px !important;
+      border-bottom-right-radius: 6px !important;
+
+      -webkit-border-top-right-radius: 6px !important;
+      -webkit-border-bottom-right-radius: 6px !important;
+
+      -moz-border-top-right-radius: 6px !important;
+      -moz-border-bottom-right-radius: 6px !important;
+    }
+  }
+}
+
+table {
+  tbody {
+    tr:nth-child(2n+1) td {
+      background-color: $grey !important;
+    }
+
+    td:first-child {
+      -webkit-border-top-left-radius: 6px !important;
+      -webkit-border-bottom-left-radius: 6px !important;
+
+      -moz-border-top-left-radius: 6px !important;
+      -moz-border-bottom-left-radius: 6px !important;
+
+      border-top-left-radius: 6px !important;
+      border-bottom-left-radius: 6px !important;
+    }
+
+    td:last-child {
+      -webkit-border-top-right-radius: 6px !important;
+      -webkit-border-bottom-right-radius: 6px !important;
+
+      -moz-border-top-right-radius: 6px !important;
+      -moz-border-bottom-right-radius: 6px !important;
+
+      border-top-right-radius: 6px !important;
+      border-bottom-right-radius: 6px !important;
+    }
+
+    tr {
+      //border-bottom: 1px solid #e6e6e6 !important;
+      vertical-align: middle !important;
+      //background-clip: padding-box !important;
+      //border-collapse: collapse !important;
+    }
+
+    tr:last-child td:first-child {
+      -webkit-border-bottom-left-radius: 6px !important;
+      -moz-border-bottom-left-radius: 6px !important;
+      border-bottom-left-radius: 6px !important;
+    }
+
+    tr:last-child td:last-child {
+      -webkit-border-bottom-right-radius: 6px !important;
+      -moz-border-bottom-right-radius: 6px !important;
+      border-bottom-right-radius: 6px !important;
+    }
+
+    tr:last-child {
+      border-bottom: 1px solid $clarin_blue !important;
+    }
+  }
+}
+
+table:not(.display) {
+  tr:first-child {
+    border-top: 1px solid $clarin_blue !important;
+  }
+
+  td, th {
+    padding: 5px;
+  }
+
+  th {
+    background-color: $grey;
+    border-right: 1px dotted black;
+  }
+}
+
+html body ul#nav ul, html body ul#nav ul li {
+  width: 200px;
+}
+
+html body ul#nav ul ul {
+  margin: 0 0 0 200px;
+}
+
+div#body {
+  min-height: 100%;
+  height: auto;
+  //margin: 0 auto -60px;
+  /* Pad top and bottom to prevent overflow over body div if using fixed-top navbar. */
+  //padding: 60px 0 60px; // TODO: transition to flex divs.
+}
+
+div#footer {
+  //height: 60px;
+  background-color: #f5f5f5; // TODO: parameterize
+  //position: absolute;
+  bottom: 0;
+  left: 0;
+  width: 100%;
+  border-top: 1px solid $thin_separator_grey;
+  margin-top: 20px;
+
+  div.container {
+    //height: 60px !important;
+    height: 100%;
+    display : flex;
+    flex-flow: row wrap;
+    justify-content: space-between;
+    align-items: center;
+    align-content: space-around;
+
+    div#CLARIN_footer_left {
+      order: 1;
+      //float: left;
+      //display: inline-block;
+      display: flex !important;
+      text-align: left;
+      vertical-align: middle;
+      margin: auto;
+      align-content: space-around;
+      //width: 25%;
+      //max-height: 100%;
+    }
+
+    div#CLARIN_footer_middle {
+      order: 2;
+      //float: left;
+      //display: inline-block;
+      display: flex !important;
+      text-align: center;
+      margin: auto;
+      align-content: space-around;
+      //width: 50%;
+      //max-height: 100%;
+
+      img {
+        display: inline-block;
+        max-width: 100%;
+        max-height: 100%;
+        overflow: hidden;
+      }
+    }
+
+    div#CLARIN_footer_right {
+      order: 3;
+      //float: left;
+      text-align: right;
+      vertical-align: middle;
+      display: flex !important;
+      margin: auto;
+      align-content: space-around;
+      //width: 25%;
+      //max-height: 100%;
+    }
+  }
+}
+
+ul#CLARIN_header_right, div#CLARIN_footer_left, div#CLARIN_footer_right {
+  :not(.glyphicon) {
+    font-family: $font-stack;
+    font-size: smaller;
+    font-variant: small-caps;
+  }
+
+  a {
+    color: $text_emphasized_periphery;
+    text-decoration: none;
+
+    &:hover, &:focus {
+      color: inherit !important;
+      text-decoration: none !important;
+    }
+
+    &:visited {
+      color: inherit !important;
+      text-decoration: none !important;
+      //color: $text_deemphasized_periphery;
+    }
+  }
+
+  margin: 0px 4px 0 p x 4px;
+  //text-shadow: -1px -1px 1px #fff, 1px 1px 1px #000;
+  color: $text_emphasized_periphery;
+  //opacity: 0.8;
+}
+
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/css/_collectiondetails.scss
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/css/_collectiondetails.scss	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/css/_collectiondetails.scss	(revision 5623)
@@ -0,0 +1,109 @@
+/*
+Copyright (C) 2014 CLARIN
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+div.collectionDetails { 
+
+    div.property {
+        clear: both;
+        font-size: 100%;
+        border: none;
+        padding: 0 10px 0 10px;
+        margin: 0 0 4px 0;
+
+        label, div {
+            line-height: 1.5em;
+        }
+
+        label {
+            display: block;
+            float: left;
+            width: 140px;
+            padding: 0px 2px;
+            margin: 0;
+            text-align: right;
+            font-weight: normal;
+
+            &:after {
+                content: ':';
+            }
+        }
+
+        div {
+            display: block;
+            clear: none;
+            padding: 0px 2px;
+            margin-left: 144px;
+        }
+
+    } //div.collectionDetails div.property
+
+    ul {
+
+        &.keywords {
+            margin: 0 0 0 16px;
+            padding: 0;
+            list-style: square;
+        }
+
+        &.creators {
+            margin: 0;
+            padding: 0;
+            list-style: none;
+
+            li {
+                border-top: 1px dotted #000000;
+                margin-top: 4px;
+                padding-top: 4px;
+            }
+
+            li.first {
+                border-top: none;
+                margin-top: 0;
+                padding-top: 0;
+            }
+        }
+    } //div.collectionDetails ul
+
+    &.resources {
+        padding-left: 1em !important;
+
+        table {
+            width: 100%;
+            table-layout: fixed;
+
+            td, th {
+                padding-left: .5em;
+                width: auto;
+
+                &.reference {
+                    width: auto;
+                }
+
+                &.type {
+                    width: 9em;
+                }
+            }
+        }
+
+    } //div.collectionDetails.resources
+
+    &.buttons {
+        margin: 10px 0 10px 0;
+        text-align: center;
+    } //div.collectionDetails.buttons
+
+} //div.collectionDetails
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/css/_feedback.scss
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/css/_feedback.scss	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/css/_feedback.scss	(revision 5623)
@@ -0,0 +1,43 @@
+/*
+Copyright (C) 2014 CLARIN
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#feedback ul {
+    padding-left: 0px;
+
+    $feedbackiconsize: 16px;
+
+    li {
+        font-weight: bold;
+        padding: 5px 5px 5px $feedbackiconsize + 8;
+        list-style: none;
+        margin: 1em;
+        min-height: $feedbackiconsize;
+        background-size: $feedbackiconsize;
+        background-repeat: no-repeat;
+        background-position-x: 4px;
+        background-position-y: 50%;
+
+        @include roundborder(6px);
+
+        &.feedbackPanelERROR {
+            background-image: url(../icons/glyphicons_078_warning_sign.png);
+            background-color: $red;
+            color: wheat;
+        }
+    }
+}
+
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/css/_filterform.scss
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/css/_filterform.scss	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/css/_filterform.scss	(revision 5623)
@@ -0,0 +1,32 @@
+/*
+Copyright (C) 2014 CLARIN
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+form.filterForm {
+    margin: 0;
+    padding: 0;
+}
+
+form.filterForm fieldset {
+    padding: 0;
+    margin: 0;
+    border: none;
+}
+
+form.filterForm div.optional {
+    margin-bottom: 4px;
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/css/_mixins.scss
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/css/_mixins.scss	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/css/_mixins.scss	(revision 5623)
@@ -0,0 +1,37 @@
+/*
+Copyright (C) 2014 CLARIN
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+/* 
+    Created on : Aug 20, 2014, 10:36:04 AM
+    Author     : twagoo
+*/
+
+@mixin roundborder($radius) {
+
+    border-top-left-radius: $radius !important;
+    border-bottom-left-radius: $radius !important;
+    -webkit-border-top-left-radius: $radius !important;
+    -webkit-border-bottom-left-radius: $radius !important;
+    -moz-border-top-left-radius: $radius !important;
+    -moz-border-bottom-left-radius: $radius !important;  
+
+    border-top-right-radius: $radius !important;
+    border-bottom-right-radius: $radius !important;
+    -webkit-border-top-right-radius: $radius !important;
+    -webkit-border-bottom-right-radius: $radius !important;
+    -moz-border-top-right-radius: $radius !important;
+    -moz-border-bottom-right-radius: $radius !important;
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/css/_popup.scss
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/css/_popup.scss	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/css/_popup.scss	(revision 5623)
@@ -0,0 +1,36 @@
+/*
+Copyright (C) 2014 CLARIN
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+div.popupMenu {
+    -moz-box-shadow: 3px 3px 3px #888;
+    -webkit-box-shadow: 3px 3px 3px #888;
+    box-shadow: 3px 3px 3px #888;
+    -moz-border-radius: 4px;
+    border-radius: 4px;
+}
+
+div.popupMenu li a {
+    color: #000000;
+}
+
+div.popupMenu li a:hover {
+    color: #AE0000;
+}
+
+div.popupTrigger span.title {
+    color: #AE0000;
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/css/_table.scss
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/css/_table.scss	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/css/_table.scss	(revision 5623)
@@ -0,0 +1,203 @@
+/*
+Copyright (C) 2014 CLARIN
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+table {
+    
+    td, th {
+        padding: .2em;
+    }
+    
+    td.action {
+        width: 8em;
+        text-align: right;
+    }
+
+    td.type {
+        width: 5em;
+    }
+}
+
+table.moving {
+
+    tr:hover td {
+        border-top: 6px solid $red !important;
+    }
+
+    tr.moving:hover td {
+        border-top: 0px !important;
+    }
+}
+
+table.resourcesTable {
+
+    width: 800px;
+    table-layout: fixed;     
+    
+    td.move {
+        width: 5em;
+    }
+
+    tr.moving {
+        background-color: $red !important;
+
+        td, td a {
+            background-color: $red !important;
+            color: white !important;
+        }
+    }
+
+} //table.resourcesTable
+
+table.creatorsTable {
+
+    width: 800px;
+    table-layout: fixed;
+
+    td {
+        width: 252px;
+        overflow: hidden;
+    }
+} //table.creatorsTable
+
+table.collectionsTable {
+
+    width: 100%;
+    table-layout: fixed;
+    position: static !important;
+
+    th, td {
+        vertical-align: top;
+        padding-left: .5em;
+
+        &.state {
+            width: 5em;
+        }
+
+        &.type {
+            width: 7em;
+        }
+
+        &.created {
+            width: 7em;
+        }
+
+        &.action {
+            width: 2em;
+        }
+    }
+
+    td.name {
+
+        width: auto;
+        
+        div.name {
+            padding-left: 16px;
+            /* icon from GLYPHICONS.com */
+            background-image: url('../icons/glyphicons_367_expand.png');
+            background-size: $iconsize;
+            background-repeat: no-repeat;
+            background-position: center left;
+            cursor: pointer;
+
+
+
+            &:hover {
+                color: #AE0000;
+                background-color: inherit;
+            }
+
+            &.detailsShown {
+                padding-left: 16px;
+                /* icon from GLYPHICONS.com */
+                background-image: url('../icons/glyphicons_369_collapse_top.png');
+                background-size: $iconsize;
+                background-repeat: no-repeat;
+                background-position: center left;
+            }
+
+            &.noDetails{
+                background-image: none;
+            }
+
+        }
+
+        div.details {
+            margin-left: 16px;
+            margin-right: -248px;
+            width: 964px;
+        }
+
+        div.desc {
+            text-align: justify;
+            padding: 4px 0 0 0;
+        }
+
+        div.actions {
+            margin: 4px 0 2px 0;
+        }
+    } //td.name
+
+
+    &.public td.action span,
+    &.private td.action div.popupTrigger span {
+        display: none;
+    }
+
+    &.public td.action a, &.private td.action div.popupTrigger {
+        display: block;
+        width: $iconsize;
+        height: $iconsize;
+        background: transparent no-repeat center center;
+        background-size: $iconsize;
+        margin-right: 2px;
+        margin-top: 3px;
+    }
+
+    &.public td.action a {
+        /* icon from GLYPHICONS.com */
+        background-image: url('../icons/glyphicons_236_zoom_in.png');
+    }
+
+    &.private td.action div.popupTrigger {
+        /* icon from GLYPHICONS.com */
+        background-image: url('../icons/glyphicons_136_cogwheel.png');
+    }
+} //table.collectionsTable
+
+/* ORDERING */
+
+tr.headers {
+
+    a.wicket_orderNone, a.wicket_orderUp, a.wicket_orderDown {        
+        padding-right: 18px;
+        background-color: transparent;
+        background-repeat: no-repeat;
+        background-position: center right;
+    }
+
+    a.wicket_orderNone {
+        background-image: url('../icons/sort_both.png');
+    }
+
+    a.wicket_orderUp {
+        background-image: url('../icons/sort_asc.png');
+    }
+
+    a.wicket_orderDown {
+        background-image: url('../icons/sort_desc.png');
+    }
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/css/_toggleborder.scss
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/css/_toggleborder.scss	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/css/_toggleborder.scss	(revision 5623)
@@ -0,0 +1,52 @@
+/*
+Copyright (C) 2014 CLARIN
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+div.toggleBorder {
+
+    div.toggleBorderHeader {
+        margin: 0;
+        padding-left: 4px;
+        color: #fff;
+        font-weight: bolder;
+        cursor: pointer;
+
+        /* mimick header of 'display' table (CLARIN style) */
+        background-color: $clarin_blue;
+
+        @include roundborder(6px);
+
+        span {
+            font-weight: bold;
+            padding: 2px 2px 2px ($iconsize + 4px);
+            /* icon from GLYPHICONS.com */
+            background-image: url('../icons/glyphicons_369_collapse_top_white.png');
+            background-size: $iconsize;
+            background-repeat: no-repeat;
+            background-position: center left;
+        }
+
+        &.collapsed span {
+            /* icon from GLYPHICONS.com */
+            background-image: url('../icons/glyphicons_367_expand_white.png');
+        }
+    }
+
+    div.toggleBorderContent {
+        margin: 0;
+        padding: 5px;
+    }
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/css/_wizard.scss
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/css/_wizard.scss	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/css/_wizard.scss	(revision 5623)
@@ -0,0 +1,317 @@
+/*
+Copyright (C) 2014 CLARIN
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+div.wizard {
+
+    .wicketExtensionsWizardHeaderTitle {
+        padding: 0px 10px;
+        font-size: 16px;
+        font-weight: bold;
+    }
+
+    .wicketExtensionsWizardHeaderSummary {
+        padding: 5px 10px 0 10px;
+        font-style: italics;
+    }
+
+    .wizardHeader {
+        border-bottom: 1px solid #000000;
+        margin: 0 0 10px 0;
+        padding: 0 0 10px 0;
+    }
+
+    .wizardFeedback {
+        // redundant because of global feedback, suppress 
+        display: none !important;
+    }
+
+}
+
+form.wizard {
+    margin: 5px 4px;
+    padding: 0;
+    font-size: 100%;
+    width: 978px;
+    min-width: 978px;
+}
+
+form.wizard fieldset,
+div.wizard div.fieldset {
+    clear: both;
+    font-size: 100%;
+    border: none;
+    padding: 0 10px 0 10px;
+    margin: 0 0 0 0;
+}
+
+form.wizard div,
+div.editDialog div {
+    clear: left;
+    display: block;
+    /*  width: 354px;
+      zoom: 1;
+      margin: 5px 0 0 0;
+      padding: 1px 3px;
+    */
+}
+
+form.wizard .extrainfo {
+    margin-left: 50px;
+}
+
+$help-icon-size: 16px;
+
+form.wizard .extrainfo a.extrainfotoggle {
+    display: inline-block;
+    float: right;
+    vertical-align: top;
+    width: $help-icon-size;
+    height: $help-icon-size;
+    /* icon from GLYPHICONS.com */
+    background-image: url(../icons/glyphicons_194_circle_question_mark.png);
+    background-size: $help-icon-size;
+    background-repeat: no-repeat;
+}
+
+form.wizard {
+
+    .extrainfo a.extrainfotoggle span {
+        display: none;
+    }
+
+    div.notes, div.sidenotes {
+        display: inline-block;
+        height: auto;
+        padding: 5px;
+        border: 1px solid #666666;
+        background-color: #ffffe1;
+        color: #666666;
+
+        h4 {
+            text-align: center;
+            padding: 3px 0 3px 0;
+            margin: 0 0 3px 0;
+            border-width: 0 0 1px 0;
+            border-style: solid;
+            border-color: #666666;
+            color: #666666;
+            font-size: 100%;
+        }
+
+        p, ul {
+            margin: 0em 0em 0.5em 0em;
+            color: #666666;
+            font-size: 80%;
+        }
+
+        p.last {
+            margin: 0em;
+        }
+    } //div.notes, div.sidenotes
+
+    div.notes {
+        width: 80%;
+        margin: 0 0 10px 70px;
+    }
+
+    div.sidenotes {
+        float: right;
+        width: 198px;
+        margin: 0 0 10px 10px;    
+    }
+
+    div label {
+        display: block;
+        float: left;
+        width: 140px;
+        padding: 3px 10px;
+        margin: 0 0 5px 0;
+        text-align: right;
+        font-weight: normal;
+    }
+
+
+    textarea {
+        font-family: Verdana, sans-serif;
+        font-size: 100%;
+        width: 570px;
+        overflow: auto;
+        margin-bottom: 5px;
+    }
+
+    .wizardButtons {
+        border-top: 1px solid #000000;
+        margin: 10px 0 0 0;
+        clear: both;
+    }
+
+    .buttonbar {
+        margin: 10px 220px 0 0;
+        padding: 0 10px 0 0;
+        text-align: right; 
+    }
+} //form.wizard
+
+
+form.wizard .buttonbar, div.modalDialog div.modalDialogButtons {
+
+    input.button:hover {
+        color: #AE0000;
+        background-color: #E9EEF7;
+    }
+
+    input.button[disabled],input.button[disabled]:hover {
+        color: #AFAFAF;
+        border-color: #EFEFEF;
+    }
+}
+
+div.required label,
+label.required {
+    font-weight: bold !important;
+}
+
+/*
+ * modal dialog
+ */
+div.modalDialog {
+    margin: 0;
+    padding: 0;
+
+    div.modalDialogContent {
+        margin: 10px;
+
+        p {
+            margin: 1em;
+        }
+    }
+
+    div.modalDialogButtons {
+        border-top: 1px solid #BBBBBB;
+        margin: 0 5px 5px 5px;
+        padding: 5px 0 0 0;
+        text-align: center;
+    }
+}
+
+
+div.confirmationDialog {
+    text-align: center;
+}
+
+div.longConfirmationDialog {
+    text-align: left;
+}
+
+div.editDialog fieldset {
+    border: none;
+    margin: 0;
+    padding: 0;
+}
+
+div.editDialog fieldset label {
+    display: block;
+    float: left;
+    /* width: 100px; */
+    padding: 3px 5px 3px 0;
+    margin: 0 0 5px 0;
+    text-align: right;
+}
+
+/*
+ * dialog customizations
+ */
+div.editCreatorDialog fieldset {
+
+    label {
+        width: 7em;
+    }
+
+    input, textarea {
+        width: 17em;
+    }
+}
+
+div.editResourceDialog fieldset {
+
+    label {
+        width: 6em;
+    }
+
+    input, textarea {
+        width: 30em;
+    }
+}
+
+div.addResourcesDialog fieldset {
+
+    label {
+        width: 6em;
+    }
+
+    input, textarea {
+        width: 30em;
+    }
+}
+
+div.addKeywordDialog fieldset input {
+    width: 20em;
+}
+
+/*
+ * create virtual collection wizard
+ */
+div.wizard a {
+    font-weight: normal;
+}
+
+div.keywordsList {
+    clear: none !important;
+    width: 602px;
+    margin-left: 160px;
+    padding: 3px 0;
+
+
+    div {
+        clear: none;
+    }
+
+    ul {
+        list-style-type: square;
+        margin: 0;
+        padding: 0 0 0 16px;
+
+        li {
+            margin-top: 2px;
+        }
+
+        li.first {
+            margin-top: 0;
+        }
+    }
+}
+
+
+input.button {
+    padding: 1px 4px;
+    margin: 0 2px;
+    color: #000000;
+    background-color: #E9EEF7;
+    border: 2px solid #D4DEEF;
+    border-radius: 4px;
+    -moz-border-radius: 4px;
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/css/vcr.scss
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/css/vcr.scss	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/css/vcr.scss	(revision 5623)
@@ -0,0 +1,94 @@
+@import 'CLARIN';
+
+/* global variables */
+$iconsize: 12px;
+
+@import 'mixins';
+@import 'toggleborder';
+@import 'table';
+@import 'collectiondetails';
+@import 'wizard';
+@import 'feedback';
+@import 'filterform';
+@import 'popup';
+
+body {
+    font-size: 120%;
+}
+
+noscript {
+    margin: 0 auto;
+    padding: 0;
+    width: 1024px;
+}
+
+#noscript-warning {
+    color: #FFFFFF;
+    background-color: #AE0000;
+    font-size: 13px;
+    font-weight: bold;
+    text-align: center;
+    line-height: 24px;
+    margin: 0 auto;
+    padding: 0;
+    text-align: center;
+    vertical-align: middle;
+    position: fixed;
+    top: 0;
+    left: 0;
+    width: 100%;
+    z-index: 101;
+}
+
+.tooltipparent .tooltipcontent {
+    display: none;
+}
+
+.navbar-collapse {
+    font-size: 120%;
+}
+
+a.navbar-brand {
+    line-height: 20px;
+}
+
+ul#CLARIN_header_right li.authenticated {
+    text-shadow: none;
+    padding-top: 15px;
+    color: #000;
+    font-size: 120%;
+}
+
+div#CLARIN_footer_middle img {
+    max-height: 80px !important;
+    padding: 6px 4px;
+}
+
+div#help  {
+
+    dd {
+        /* indent for the definitions on the help page */
+        margin-left: 2em;
+    }
+}
+
+div#betabadge {
+    position: relative;
+
+    span {
+        display: block;
+        position: absolute;
+        left: 1em;
+        top: 1em;
+        color: black;
+        font-size: larger;
+        background: red;
+        opacity: .7;
+        padding: .2em .4em;
+    }
+}
+
+#aboutlogos img {
+    max-height: 6em;
+    margin: 1em;
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/index.jsp
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/index.jsp	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/index.jsp	(revision 5623)
@@ -0,0 +1,4 @@
+<%@ page language="java" %>
+<%
+    response.sendRedirect("app/");
+%>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/oai2.xsl
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/oai2.xsl	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/webapp/oai2.xsl	(revision 5623)
@@ -0,0 +1,650 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+  XSL Transform to convert OAI 2.0 responses into XHTML
+
+  By Christopher Gutteridge, University of Southampton
+
+  v1.1
+
+-->
+<!-- 
+  
+Copyright (c) 2006 University of Southampton, UK. SO17 1BJ.
+
+EPrints 3 is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+EPrints 3 is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with EPrints 3; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+-->
+<!--
+  
+  All the elements really needed for EPrints are done but if
+  you want to use this XSL for other OAI archive you may want
+  to make some minor changes or additions.
+
+  Not Done
+    The 'about' section of 'record'
+    The 'compession' part of 'identify'
+    The optional attributes of 'resumptionToken'
+    The optional 'setDescription' container of 'set'
+
+  All the links just link to oai_dc versions of records.
+
+-->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:oai="http://www.openarchives.org/OAI/2.0/">
+
+<xsl:output method="html"/>
+
+
+
+<xsl:template name="style">
+td.value {
+	vertical-align: top;
+	padding-left: 1em;
+	padding: 3px;
+}
+td.key {
+	background-color: #e0e0ff;
+	padding: 3px;
+	text-align: right;
+	border: 1px solid #c0c0c0;
+	white-space: nowrap;
+	font-weight: bold;
+	vertical-align: top;
+}
+.dcdata td.key {
+	background-color: #ffffe0;
+}
+body { 
+	margin: 1em 2em 1em 2em;
+}
+h1, h2, h3 {
+	font-family: sans-serif;
+	clear: left;
+}
+h1 {
+	padding-bottom: 4px;
+	margin-bottom: 0px;
+}
+h2 {
+	margin-bottom: 0.5em;
+}
+h3 {
+	margin-bottom: 0.3em;
+	font-size: medium;
+}
+.link {
+	border: 1px outset #88f;
+	background-color: #c0c0ff;
+	padding: 1px 4px 1px 4px;
+	font-size: 80%;
+	text-decoration: none;
+	font-weight: bold;
+	font-family: sans-serif;
+	color: black;
+}
+.link:hover {
+	color: red;
+}
+.link:active {
+	color: red;
+	border: 1px inset #88f;
+	background-color: #a0a0df;
+}
+.oaiRecord, .oaiRecordTitle {
+	background-color: #f0f0ff;
+	border-style: solid;
+	border-color: #d0d0d0;
+}
+h2.oaiRecordTitle {
+	background-color: #e0e0ff;
+	font-size: medium;
+	font-weight: bold;
+	padding: 10px;
+	border-width: 2px 2px 0px 2px;
+	margin: 0px;
+}
+.oaiRecord {
+	margin-bottom: 3em;
+	border-width: 2px;
+	padding: 10px;
+}
+
+.results {
+	margin-bottom: 1.5em;
+}
+ul.quicklinks {
+	margin-top: 2px;
+	padding: 4px;
+	text-align: left;
+	border-bottom: 2px solid #ccc;
+	border-top: 2px solid #ccc;
+	clear: left;
+}
+ul.quicklinks li {
+	font-size: 80%;
+	display: inline;
+	list-stlye: none;
+	font-family: sans-serif;
+}
+p.intro {
+	font-size: 80%;
+}
+<xsl:call-template name="xmlstyle"/>
+</xsl:template>
+
+<xsl:variable name="identifier" select="substring-before(concat(substring-after(/oai:OAI-PMH/oai:request,'identifier='),'&amp;'),'&amp;')"/>
+
+<xsl:template match="/">
+<html>
+  <head>
+    <title>OAI 2.0 Request Results</title>
+    <style><xsl:call-template name="style"/></style>
+  </head>
+  <body>
+    <h1>OAI 2.0 Request Results</h1>
+    <xsl:call-template name="quicklinks"/>
+    <p class="intro">You are viewing an HTML version of the XML OAI response. To see the underlying XML use your web browsers view source option. More information about this XSLT is at the <a href="#moreinfo">bottom of the page</a>.</p>
+    <xsl:apply-templates select="/oai:OAI-PMH"/>
+    <xsl:call-template name="quicklinks"/>
+    <h2><a name="moreinfo">About the XSLT</a></h2>
+    <p>An XSLT file has converted the <a href="http://www.openarchives.org">OAI-PMH 2.0</a> responses into XHTML which looks nice in a browser which supports XSLT such as Mozilla, Firebird and Internet Explorer. The XSLT file was created by <a href="http://www.ecs.soton.ac.uk/people/cjg">Christopher Gutteridge</a> at the University of Southampton as part of the <a href="http://www.eprints.org/software/">GNU EPrints system</a>, and is freely redistributable under the <a href="http://www.gnu.org">GPL</a>.</p><p>If you want to use the XSL file on your own OAI interface you may but due to the way XSLT works you must install the XSL file on the same server as the OAI script, you can't just link to this copy.</p><p>For more information or to download the XSL file please see the <a href="http://software.eprints.org/xslt.php">OAI to XHTML XSLT homepage</a>.</p>
+
+  </body>
+</html>
+</xsl:template>
+
+<xsl:template name="quicklinks">
+    <ul class="quicklinks">
+      <li><a href="?verb=Identify">Identify</a> | </li> 
+      <li><a href="?verb=ListRecords&amp;metadataPrefix=oai_dc">ListRecords</a> | </li>
+      <li><a href="?verb=ListSets">ListSets</a> | </li>
+      <li><a href="?verb=ListMetadataFormats">ListMetadataFormats</a> | </li>
+      <li><a href="?verb=ListIdentifiers&amp;metadataPrefix=oai_dc">ListIdentifiers</a></li>
+    </ul>
+</xsl:template>
+
+
+<xsl:template match="/oai:OAI-PMH">
+  <table class="values">
+    <tr><td class="key">Datestamp of response</td>
+    <td class="value"><xsl:value-of select="oai:responseDate"/></td></tr>
+    <tr><td class="key">Request URL</td>
+    <td class="value"><xsl:value-of select="oai:request"/></td></tr>
+  </table>
+<!--  verb: [<xsl:value-of select="oai:request/@verb" />]<br /> -->
+  <xsl:choose>
+    <xsl:when test="oai:error">
+      <h2>OAI Error(s)</h2>
+      <p>The request could not be completed due to the following error or errors.</p>
+      <div class="results">
+        <xsl:apply-templates select="oai:error"/>
+      </div>
+    </xsl:when>
+    <xsl:otherwise>
+      <p>Request was of type <xsl:value-of select="oai:request/@verb"/>.</p>
+      <div class="results">
+        <xsl:apply-templates select="oai:Identify"/>
+        <xsl:apply-templates select="oai:GetRecord"/>
+        <xsl:apply-templates select="oai:ListRecords"/>
+        <xsl:apply-templates select="oai:ListSets"/>
+        <xsl:apply-templates select="oai:ListMetadataFormats"/>
+        <xsl:apply-templates select="oai:ListIdentifiers"/>
+      </div>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+
+<!-- ERROR -->
+
+<xsl:template match="/oai:OAI-PMH/oai:error">
+  <table class="values">
+    <tr><td class="key">Error Code</td>
+    <td class="value"><xsl:value-of select="@code"/></td></tr>
+  </table>
+  <p class="error"><xsl:value-of select="."/></p>
+</xsl:template>
+
+<!-- IDENTIFY -->
+
+<xsl:template match="/oai:OAI-PMH/oai:Identify">
+  <table class="values">
+    <tr><td class="key">Repository Name</td>
+    <td class="value"><xsl:value-of select="oai:repositoryName"/></td></tr>
+    <tr><td class="key">Base URL</td>
+    <td class="value"><xsl:value-of select="oai:baseURL"/></td></tr>
+    <tr><td class="key">Protocol Version</td>
+    <td class="value"><xsl:value-of select="oai:protocolVersion"/></td></tr>
+    <tr><td class="key">Earliest Datestamp</td>
+    <td class="value"><xsl:value-of select="oai:earliestDatestamp"/></td></tr>
+    <tr><td class="key">Deleted Record Policy</td>
+    <td class="value"><xsl:value-of select="oai:deletedRecord"/></td></tr>
+    <tr><td class="key">Granularity</td>
+    <td class="value"><xsl:value-of select="oai:granularity"/></td></tr>
+    <xsl:apply-templates select="oai:adminEmail"/>
+  </table>
+  <xsl:apply-templates select="oai:description"/>
+<!--no warning about unsupported descriptions -->
+</xsl:template>
+
+<xsl:template match="/oai:OAI-PMH/oai:Identify/oai:adminEmail">
+    <tr><td class="key">Admin Email</td>
+    <td class="value"><xsl:value-of select="."/></td></tr>
+</xsl:template>
+
+<!--
+   Identify / Unsupported Description
+-->
+
+<xsl:template match="oai:description/*" priority="-100">
+  <h2>Unsupported Description Type</h2>
+  <p>The XSL currently does not support this type of description.</p>
+  <div class="xmlSource">
+    <xsl:apply-templates select="." mode="xmlMarkup"/>
+  </div>
+</xsl:template>
+
+
+<!--
+   Identify / OAI-Identifier
+-->
+
+<xsl:template match="id:oai-identifier" xmlns:id="http://www.openarchives.org/OAI/2.0/oai-identifier">
+  <h2>OAI-Identifier</h2>
+  <table class="values">
+    <tr><td class="key">Scheme</td>
+    <td class="value"><xsl:value-of select="id:scheme"/></td></tr>
+    <tr><td class="key">Repository Identifier</td>
+    <td class="value"><xsl:value-of select="id:repositoryIdentifier"/></td></tr>
+    <tr><td class="key">Delimiter</td>
+    <td class="value"><xsl:value-of select="id:delimiter"/></td></tr>
+    <tr><td class="key">Sample OAI Identifier</td>
+    <td class="value"><xsl:value-of select="id:sampleIdentifier"/></td></tr>
+  </table>
+</xsl:template>
+
+
+<!--
+   Identify / EPrints
+-->
+
+<xsl:template match="ep:eprints" xmlns:ep="http://www.openarchives.org/OAI/1.1/eprints">
+  <h2>EPrints Description</h2>
+  <xsl:if test="ep:content">
+    <h3>Content</h3>
+    <xsl:apply-templates select="ep:content"/>
+  </xsl:if>
+  <xsl:if test="ep:submissionPolicy">
+    <h3>Submission Policy</h3>
+    <xsl:apply-templates select="ep:submissionPolicy"/>
+  </xsl:if>
+  <h3>Metadata Policy</h3>
+  <xsl:apply-templates select="ep:metadataPolicy"/>
+  <h3>Data Policy</h3>
+  <xsl:apply-templates select="ep:dataPolicy"/>
+  <xsl:apply-templates select="ep:comment"/>
+</xsl:template>
+
+<xsl:template match="ep:content|ep:dataPolicy|ep:metadataPolicy|ep:submissionPolicy" xmlns:ep="http://www.openarchives.org/OAI/1.1/eprints">
+  <xsl:if test="ep:text">
+    <p><xsl:value-of select="ep:text"/></p>
+  </xsl:if>
+  <xsl:if test="ep:URL">
+    <div><a href="{ep:URL}"><xsl:value-of select="ep:URL"/></a></div>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="ep:comment" xmlns:ep="http://www.openarchives.org/OAI/1.1/eprints">
+  <h3>Comment</h3>
+  <div><xsl:value-of select="."/></div>
+</xsl:template>
+
+
+<!--
+   Identify / Friends
+-->
+
+<xsl:template match="fr:friends" xmlns:fr="http://www.openarchives.org/OAI/2.0/friends/">
+  <h2>Friends</h2>
+  <ul>
+    <xsl:apply-templates select="fr:baseURL"/>
+  </ul>
+</xsl:template>
+
+<xsl:template match="fr:baseURL" xmlns:fr="http://www.openarchives.org/OAI/2.0/friends/">
+  <li><xsl:value-of select="."/> 
+<xsl:text> </xsl:text>
+<a class="link" href="{.}?verb=Identify">Identify</a></li>
+</xsl:template>
+
+
+<!--
+   Identify / Branding
+-->
+
+<xsl:template match="br:branding" xmlns:br="http://www.openarchives.org/OAI/2.0/branding/">
+  <h2>Branding</h2>
+  <xsl:apply-templates select="br:collectionIcon"/>
+  <xsl:apply-templates select="br:metadataRendering"/>
+</xsl:template>
+
+<xsl:template match="br:collectionIcon" xmlns:br="http://www.openarchives.org/OAI/2.0/branding/">
+  <h3>Icon</h3>
+  <xsl:choose>
+    <xsl:when test="link!=''">
+      <a href="{br:link}"><img src="{br:url}" alt="{br:title}" width="{br:width}" height="{br:height}" border="0"/></a>
+    </xsl:when>
+    <xsl:otherwise>
+      <img src="{br:url}" alt="{br:title}" width="{br:width}" height="{br:height}" border="0"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="br:metadataRendering" xmlns:br="http://www.openarchives.org/OAI/2.0/branding/">
+  <h3>Metadata Rendering Rule</h3>
+  <table class="values">
+    <tr><td class="key">URL</td>
+    <td class="value"><xsl:value-of select="."/></td></tr>
+    <tr><td class="key">Namespace</td>
+    <td class="value"><xsl:value-of select="@metadataNamespace"/></td></tr>
+    <tr><td class="key">Mime Type</td>
+    <td class="value"><xsl:value-of select="@mimetype"/></td></tr>
+  </table>
+</xsl:template>
+
+
+
+<!--
+   Identify / Gateway
+-->
+
+<xsl:template match="gw:gateway" xmlns:gw="http://www.openarchives.org/OAI/2.0/gateway/x">
+  <h2>Gateway Information</h2>
+  <table class="values">
+    <tr><td class="key">Source</td>
+    <td class="value"><xsl:value-of select="gw:source"/></td></tr>
+    <tr><td class="key">Description</td>
+    <td class="value"><xsl:value-of select="gw:gatewayDescription"/></td></tr>
+    <xsl:apply-templates select="gw:gatewayAdmin"/>
+    <xsl:if test="gw:gatewayURL">
+      <tr><td class="key">URL</td>
+      <td class="value"><xsl:value-of select="gw:gatewayURL"/></td></tr>
+    </xsl:if>
+    <xsl:if test="gw:gatewayNotes">
+      <tr><td class="key">Notes</td>
+      <td class="value"><xsl:value-of select="gw:gatewayNotes"/></td></tr>
+    </xsl:if>
+  </table>
+</xsl:template>
+
+<xsl:template match="gw:gatewayAdmin" xmlns:gw="http://www.openarchives.org/OAI/2.0/gateway/">
+  <tr><td class="key">Admin</td>
+  <td class="value"><xsl:value-of select="."/></td></tr>
+</xsl:template>
+
+
+<!-- GetRecord -->
+
+<xsl:template match="oai:GetRecord">
+  <xsl:apply-templates select="oai:record"/>
+</xsl:template>
+
+<!-- ListRecords -->
+
+<xsl:template match="oai:ListRecords">
+  <xsl:apply-templates select="oai:record"/>
+  <xsl:apply-templates select="oai:resumptionToken"/>
+</xsl:template>
+
+<!-- ListIdentifiers -->
+
+<xsl:template match="oai:ListIdentifiers">
+  <xsl:apply-templates select="oai:header"/>
+  <xsl:apply-templates select="oai:resumptionToken"/>
+</xsl:template>
+
+<!-- ListSets -->
+
+<xsl:template match="oai:ListSets">
+  <xsl:apply-templates select="oai:set"/>
+  <xsl:apply-templates select="oai:resumptionToken"/>
+</xsl:template>
+
+<xsl:template match="oai:set">
+  <h2>Set</h2>
+  <table class="values">
+    <tr><td class="key">setName</td>
+    <td class="value"><xsl:value-of select="oai:setName"/></td></tr>
+    <xsl:apply-templates select="oai:setSpec"/>
+  </table>
+</xsl:template>
+
+<!-- ListMetadataFormats -->
+
+<xsl:template match="oai:ListMetadataFormats">
+  <xsl:choose>
+    <xsl:when test="$identifier">
+      <p>This is a list of metadata formats available for the record "<xsl:value-of select="$identifier"/>". Use these links to view the metadata: <xsl:apply-templates select="oai:metadataFormat/oai:metadataPrefix"/></p>
+    </xsl:when>
+    <xsl:otherwise>
+      <p>This is a list of metadata formats available from this archive.</p>
+    </xsl:otherwise>
+  </xsl:choose>
+  <xsl:apply-templates select="oai:metadataFormat"/>
+</xsl:template>
+
+<xsl:template match="oai:metadataFormat">
+  <h2>Metadata Format</h2>
+  <table class="values">
+    <tr><td class="key">metadataPrefix</td>
+    <td class="value"><xsl:value-of select="oai:metadataPrefix"/></td></tr>
+    <tr><td class="key">metadataNamespace</td>
+    <td class="value"><xsl:value-of select="oai:metadataNamespace"/></td></tr>
+    <tr><td class="key">schema</td>
+    <td class="value"><a href="{oai:schema}"><xsl:value-of select="oai:schema"/></a></td></tr>
+  </table>
+</xsl:template>
+
+<xsl:template match="oai:metadataPrefix">
+      <xsl:text> </xsl:text><a class="link" href="?verb=GetRecord&amp;metadataPrefix={.}&amp;identifier={$identifier}"><xsl:value-of select="."/></a>
+</xsl:template>
+
+<!-- record object -->
+
+<xsl:template match="oai:record">
+  <h2 class="oaiRecordTitle">OAI Record: <xsl:value-of select="oai:header/oai:identifier"/></h2>
+  <div class="oaiRecord">
+    <xsl:apply-templates select="oai:header"/>
+    <xsl:apply-templates select="oai:metadata"/>
+    <xsl:apply-templates select="oai:about"/>
+  </div>
+</xsl:template>
+
+<xsl:template match="oai:header">
+  <h3>OAI Record Header</h3>
+  <table class="values">
+    <tr><td class="key">OAI Identifier</td>
+    <td class="value">
+      <xsl:value-of select="oai:identifier"/>
+      <xsl:text> </xsl:text><a class="link" href="?verb=GetRecord&amp;metadataPrefix=oai_dc&amp;identifier={oai:identifier}">oai_dc</a>
+      <xsl:text> </xsl:text><a class="link" href="?verb=ListMetadataFormats&amp;identifier={oai:identifier}">formats</a>
+    </td></tr>
+    <tr><td class="key">Datestamp</td>
+    <td class="value"><xsl:value-of select="oai:datestamp"/></td></tr>
+  <xsl:apply-templates select="oai:setSpec"/>
+  </table>
+  <xsl:if test="@status='deleted'">
+    <p>This record has been deleted.</p>
+  </xsl:if>
+</xsl:template>
+
+
+<xsl:template match="oai:about">
+  <p>"about" part of record container not supported by the XSL</p>
+</xsl:template>
+
+<xsl:template match="oai:metadata">
+  Â 
+  <div class="metadata">
+    <xsl:apply-templates select="*"/>
+  </div>
+</xsl:template>
+
+
+
+
+<!-- oai setSpec object -->
+
+<xsl:template match="oai:setSpec">
+  <tr><td class="key">setSpec</td>
+  <td class="value"><xsl:value-of select="."/>
+    <xsl:text> </xsl:text><a class="link" href="?verb=ListIdentifiers&amp;metadataPrefix=oai_dc&amp;set={.}">Identifiers</a>
+    <xsl:text> </xsl:text><a class="link" href="?verb=ListRecords&amp;metadataPrefix=oai_dc&amp;set={.}">Records</a>
+  </td></tr>
+</xsl:template>
+
+
+
+<!-- oai resumptionToken -->
+
+<xsl:template match="oai:resumptionToken">
+   <p>There are more results.</p>
+   <table class="values">
+     <tr><td class="key">resumptionToken:</td>
+     <td class="value"><xsl:value-of select="."/>
+<xsl:text> </xsl:text>
+<a class="link" href="?verb={/oai:OAI-PMH/oai:request/@verb}&amp;resumptionToken={.}">Resume</a></td></tr>
+   </table>
+</xsl:template>
+
+<!-- unknown metadata format -->
+
+<xsl:template match="oai:metadata/*" priority="-100">
+  <h3>Unknown Metadata Format</h3>
+  <div class="xmlSource">
+    <xsl:apply-templates select="." mode="xmlMarkup"/>
+  </div>
+</xsl:template>
+
+<!-- oai_dc record -->
+
+<xsl:template match="oai_dc:dc" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/">
+  <div class="dcdata">
+    <h3>Dublin Core Metadata (oai_dc)</h3>
+    <table class="dcdata">
+      <xsl:apply-templates select="*"/>
+    </table>
+  </div>
+</xsl:template>
+
+<xsl:template match="dc:title" xmlns:dc="http://purl.org/dc/elements/1.1/">
+<tr><td class="key">Title</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+
+<xsl:template match="dc:creator" xmlns:dc="http://purl.org/dc/elements/1.1/">
+<tr><td class="key">Author or Creator</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+
+<xsl:template match="dc:subject" xmlns:dc="http://purl.org/dc/elements/1.1/">
+<tr><td class="key">Subject and Keywords</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+
+<xsl:template match="dc:description" xmlns:dc="http://purl.org/dc/elements/1.1/">
+<tr><td class="key">Description</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+
+<xsl:template match="dc:publisher" xmlns:dc="http://purl.org/dc/elements/1.1/">
+<tr><td class="key">Publisher</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+
+<xsl:template match="dc:contributor" xmlns:dc="http://purl.org/dc/elements/1.1/">
+<tr><td class="key">Other Contributor</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+
+<xsl:template match="dc:date" xmlns:dc="http://purl.org/dc/elements/1.1/">
+<tr><td class="key">Date</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+
+<xsl:template match="dc:type" xmlns:dc="http://purl.org/dc/elements/1.1/">
+<tr><td class="key">Resource Type</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+
+<xsl:template match="dc:format" xmlns:dc="http://purl.org/dc/elements/1.1/">
+<tr><td class="key">Format</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+
+<xsl:template match="dc:identifier" xmlns:dc="http://purl.org/dc/elements/1.1/">
+<tr><td class="key">Resource Identifier</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+
+<xsl:template match="dc:source" xmlns:dc="http://purl.org/dc/elements/1.1/">
+<tr><td class="key">Source</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+
+<xsl:template match="dc:language" xmlns:dc="http://purl.org/dc/elements/1.1/">
+<tr><td class="key">Language</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+
+<xsl:template match="dc:relation" xmlns:dc="http://purl.org/dc/elements/1.1/">
+<tr><td class="key">Relation</td><td class="value">
+  <xsl:choose>
+    <xsl:when test="starts-with(.,&quot;http&quot; )">
+      <xsl:choose>
+        <xsl:when test="string-length(.) &gt; 50">
+          <a class="link" href="{.}">URL</a>
+          <i> URL not shown as it is very long.</i>
+        </xsl:when>
+        <xsl:otherwise>
+          <a href="{.}"><xsl:value-of select="."/></a>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="."/>
+    </xsl:otherwise>
+  </xsl:choose>
+</td></tr></xsl:template>
+
+<xsl:template match="dc:coverage" xmlns:dc="http://purl.org/dc/elements/1.1/">
+<tr><td class="key">Coverage</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+
+<xsl:template match="dc:rights" xmlns:dc="http://purl.org/dc/elements/1.1/">
+<tr><td class="key">Rights Management</td><td class="value"><xsl:value-of select="."/></td></tr></xsl:template>
+
+<!-- XML Pretty Maker -->
+
+<xsl:template match="node()" mode="xmlMarkup">
+  <div class="xmlBlock">
+    &lt;<span class="xmlTagName"><xsl:value-of select="name(.)"/></span><xsl:apply-templates select="@*" mode="xmlMarkup"/>&gt;<xsl:apply-templates select="node()" mode="xmlMarkup"/>&lt;/<span class="xmlTagName"><xsl:value-of select="name(.)"/></span>&gt;
+  </div>
+</xsl:template>
+
+<xsl:template match="text()" mode="xmlMarkup"><span class="xmlText"><xsl:value-of select="."/></span></xsl:template>
+
+<xsl:template match="@*" mode="xmlMarkup">
+  <xsl:text> </xsl:text><span class="xmlAttrName"><xsl:value-of select="name()"/></span>="<span class="xmlAttrValue"><xsl:value-of select="."/></span>"
+</xsl:template>
+
+<xsl:template name="xmlstyle">
+.xmlSource {
+	font-size: 70%;
+	border: solid #c0c0a0 1px;
+	background-color: #ffffe0;
+	padding: 2em 2em 2em 0em;
+}
+.xmlBlock {
+	padding-left: 2em;
+}
+.xmlTagName {
+	color: #800000;
+	font-weight: bold;
+}
+.xmlAttrName {
+	font-weight: bold;
+}
+.xmlAttrValue {
+	color: #0000c0;
+}
+</xsl:template>
+
+</xsl:stylesheet>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/xsd/VirtualCollection.xsd
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/xsd/VirtualCollection.xsd	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/main/xsd/VirtualCollection.xsd	(revision 5623)
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?><xs:schema xmlns:cmd="http://www.clarin.eu/cmd/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:dcr="http://www.isocat.org/ns/dcr" xmlns:ann="http://www.clarin.eu" targetNamespace="http://www.clarin.eu/cmd/" elementFormDefault="qualified"><xs:annotation><xs:appinfo><ann:Header><ann:ID>clarin.eu:cr1:p_1404130561238</ann:ID><ann:Name>VirtualCollection</ann:Name><ann:Description>A component for describing personalized sets of metadata descriptions</ann:Description></ann:Header></xs:appinfo></xs:annotation><xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/><xs:simpleType name="simpletype-Status-1---"><xs:restriction base="xs:string"><xs:enumeration value="draft" dcr:datcat="http://www.isocat.org/datcat/DC-4381" ann:label=""/><xs:enumeration value="published" dcr:datcat="http://www.isocat.org/datcat/DC-4383" ann:label=""/><xs:enumeration value="deprecated" dcr:datcat="http://www.isocat.org/datcat/DC-4385" ann:label=""/></xs:restriction></xs:simpleType><xs:simpleType name="simpletype-Reproducability-1---"><xs:restriction base="xs:string"><xs:enumeration value="fluctuating" dcr:datcat="" ann:label="Processing results may vary"/><xs:enumeration value="intended" dcr:datcat="" ann:label="Processing results can be expected to remain stable"/><xs:enumeration value="untended" dcr:datcat="" ann:label="No claims with respect to the stability of the processing results are made"/></xs:restriction></xs:simpleType><xs:simpleType name="simpletype-Purpose-1---"><xs:restriction base="xs:string"><xs:enumeration value="research" dcr:datcat="" ann:label="The virtual collection bundles resources that are relevant to a specific research (question)"/><xs:enumeration value="reference" dcr:datcat="" ann:label="The virtual collection bundles resources, that are to be cited in a publication"/><xs:enumeration value="future use" dcr:datcat="" ann:label="The purpose of this virtual collection is not specified yet. Used in published collection is advised against"/><xs:enumeration value="sample" dcr:datcat="" ann:label="This virtual collection bundles is intended to serve as an sample for research data"/></xs:restriction></xs:simpleType><xs:simpleType name="Resourcetype_simple"><xs:restriction base="xs:string"><xs:enumeration value="Metadata"><xs:annotation><xs:documentation>The ResourceProxy refers to another component metadata
+                            instance (e.g. for grouping metadata descriptions into
+                            collections)</xs:documentation></xs:annotation></xs:enumeration><xs:enumeration value="Resource"><xs:annotation><xs:documentation>The ResourceProxy refers to a file that is not a metadata
+                            instance (e.g. a text document)</xs:documentation></xs:annotation></xs:enumeration><xs:enumeration value="SearchService"><xs:annotation><xs:documentation>The ResourceProxy refers to a (SRU/CQL) web service that can be used to query the resource described in this file</xs:documentation></xs:annotation></xs:enumeration><xs:enumeration value="SearchPage"><xs:annotation><xs:documentation>The ResourceProxy refers to a web page that can be used to query the resource described in this file</xs:documentation></xs:annotation></xs:enumeration><xs:enumeration value="LandingPage"><xs:annotation><xs:documentation>The ResourceProxy refers to a web page that contains the "original context" of the resource described in this file (e.g. repository web page displaying the metadata).</xs:documentation></xs:annotation></xs:enumeration></xs:restriction></xs:simpleType><xs:complexType name="complextype-Status-1---"><xs:simpleContent><xs:extension base="cmd:simpletype-Status-1---"/></xs:simpleContent></xs:complexType><xs:complexType name="complextype-Reproducability-1---"><xs:simpleContent><xs:extension base="cmd:simpletype-Reproducability-1---"/></xs:simpleContent></xs:complexType><xs:complexType name="complextype-Purpose-1---"><xs:simpleContent><xs:extension base="cmd:simpletype-Purpose-1---"/></xs:simpleContent></xs:complexType><xs:element name="CMD"><xs:complexType><xs:sequence><xs:element name="Header"><xs:complexType><xs:sequence><xs:element name="MdCreator" type="xs:string" minOccurs="0" maxOccurs="unbounded"/><xs:element name="MdCreationDate" type="xs:date" minOccurs="0"/><xs:element name="MdSelfLink" type="xs:anyURI" minOccurs="0"/><xs:element name="MdProfile" type="xs:anyURI" minOccurs="0"/><xs:element name="MdCollectionDisplayName" type="xs:string" minOccurs="0"/></xs:sequence></xs:complexType></xs:element><xs:element name="Resources"><xs:complexType><xs:sequence><xs:element name="ResourceProxyList"><xs:complexType><xs:sequence><xs:element maxOccurs="unbounded" minOccurs="0" name="ResourceProxy"><xs:complexType><xs:sequence><xs:element maxOccurs="1" minOccurs="1" name="ResourceType"><xs:complexType><xs:simpleContent><xs:extension base="cmd:Resourcetype_simple"><xs:attribute name="mimetype" type="xs:string"/></xs:extension></xs:simpleContent></xs:complexType></xs:element><xs:element maxOccurs="1" minOccurs="1" name="ResourceRef" type="xs:anyURI"/></xs:sequence><xs:attribute name="id" type="xs:ID" use="required"/></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element><xs:element name="JournalFileProxyList"><xs:complexType><xs:sequence><xs:element maxOccurs="unbounded" minOccurs="0" name="JournalFileProxy"><xs:complexType><xs:sequence><xs:element maxOccurs="1" minOccurs="1" name="JournalFileRef" type="xs:anyURI"/></xs:sequence></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element><xs:element name="ResourceRelationList"><xs:complexType><xs:sequence><xs:element maxOccurs="unbounded" minOccurs="0" name="ResourceRelation"><xs:complexType><xs:sequence><xs:element maxOccurs="1" minOccurs="1" name="RelationType"/><xs:element maxOccurs="1" minOccurs="1" name="Res1"><xs:complexType><xs:attribute name="ref" type="xs:IDREF"/></xs:complexType></xs:element><xs:element maxOccurs="1" minOccurs="1" name="Res2"><xs:complexType><xs:attribute name="ref" type="xs:IDREF"/></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element><xs:element minOccurs="0" name="IsPartOfList"><xs:complexType><xs:sequence><xs:element maxOccurs="unbounded" minOccurs="0" name="IsPartOf" type="xs:anyURI"/></xs:sequence></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element><xs:element name="Components"><xs:complexType><xs:sequence><xs:element name="VirtualCollection" minOccurs="1" maxOccurs="1"><xs:complexType><xs:sequence><xs:element name="Name" dcr:datcat="http://www.isocat.org/datcat/DC-6119" minOccurs="1" maxOccurs="1" ann:displaypriority="1"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element><xs:element name="Description" dcr:datcat="http://www.isocat.org/datcat/DC-2520" minOccurs="0" maxOccurs="1"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element><xs:element name="CreationDate" dcr:datcat="http://www.isocat.org/datcat/DC-2510" type="xs:date" minOccurs="1" maxOccurs="1"/><xs:element name="Status" dcr:datcat="http://www.isocat.org/datcat/DC-3818" minOccurs="1" maxOccurs="1" type="cmd:complextype-Status-1---"/><xs:element name="Reproducability" minOccurs="0" maxOccurs="1" type="cmd:complextype-Reproducability-1---" ann:documentation="An indication of the degree to which results obtained from processing of the present collection can be expected to be stable"/><xs:element name="Purpose" dcr:datcat="http://www.isocat.org/datcat/DC-6151" minOccurs="0" maxOccurs="1" type="cmd:complextype-Purpose-1---" ann:documentation="An indication of the intended usage of the present virtual collection"/><xs:element name="ReproducabilityNotice" minOccurs="0" maxOccurs="1" ann:documentation="Optional notes describing the expected reproducibility of processing results in more detail"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element><xs:element name="Origin" minOccurs="0" maxOccurs="1"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element><xs:element name="Keyword" dcr:datcat="http://www.isocat.org/datcat/DC-5436" minOccurs="0" maxOccurs="unbounded" ann:documentation="A word or short phrase signifying a salient facet of the present virtual collection"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element><xs:element name="Creator" minOccurs="1" maxOccurs="unbounded" dcr:datcat="http://www.isocat.org/datcat/DC-6714"><xs:complexType><xs:sequence><xs:element name="Name" dcr:datcat="http://www.isocat.org/datcat/DC-2512" minOccurs="1" maxOccurs="1" ann:displaypriority="1"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element><xs:element name="Email" dcr:datcat="http://www.isocat.org/datcat/DC-2521" minOccurs="0" maxOccurs="1"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element><xs:element name="Organisation" dcr:datcat="http://www.isocat.org/datcat/DC-2459" minOccurs="0" maxOccurs="1"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element></xs:sequence><xs:attribute name="ref" type="xs:IDREFS"/></xs:complexType></xs:element><xs:element name="Resource" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="Label" dcr:datcat="http://www.isocat.org/datcat/DC-2544" minOccurs="0" maxOccurs="1" ann:displaypriority="1"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element><xs:element name="Description" dcr:datcat="http://www.isocat.org/datcat/DC-2520" minOccurs="0" maxOccurs="1"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element></xs:sequence><xs:attribute name="ref" type="xs:IDREFS"/></xs:complexType></xs:element><xs:element name="GeneratedBy" minOccurs="0" maxOccurs="1"><xs:complexType><xs:sequence><xs:element name="Description" dcr:datcat="http://www.isocat.org/datcat/DC-2520" minOccurs="1" maxOccurs="1" ann:documentation="A prose description of the procedure by which the collection items can be retrieved from the external service"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element><xs:element name="URI" dcr:datcat="http://www.isocat.org/datcat/DC-5643" type="xs:anyURI" minOccurs="1" maxOccurs="1" ann:documentation="The location of the service from which the items should be retrieved. This value may be a persistent identifier, but could also be a plain URI although this is advised against for published collections." ann:displaypriority="3"/><xs:element name="QueryProfile" minOccurs="1" maxOccurs="1" ann:documentation="Identifier of the mechanism, i.e. the protocol to be used, by which the members of the virtual collection should be retrieved. A application exploiting the query can use this to use a proper driver to talk to the service. Example: In case of CLARIN-FCS access the endpoint by FCS-compatible means." ann:displaypriority="2"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element><xs:element name="QueryValue" minOccurs="1" maxOccurs="1" ann:documentation="The query that should be passed on to the service by which it can look up the items that are part of this collection. This value should be in the query language supported by the service. Example: In case of CLARIN-FCS, this value is the CQL query to be send to the endpoint." ann:displaypriority="1"><xs:complexType><xs:simpleContent><xs:extension base="xs:string"/></xs:simpleContent></xs:complexType></xs:element></xs:sequence><xs:attribute name="ref" type="xs:IDREFS"/></xs:complexType></xs:element></xs:sequence><xs:attribute name="ref" type="xs:IDREFS"/></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element></xs:sequence><xs:attribute name="CMDVersion" fixed="1.1" use="required"/></xs:complexType></xs:element></xs:schema>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/java/eu/clarin/cmdi/virtualcollectionregistry/gui/HandleLinkModelTest.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/java/eu/clarin/cmdi/virtualcollectionregistry/gui/HandleLinkModelTest.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/java/eu/clarin/cmdi/virtualcollectionregistry/gui/HandleLinkModelTest.java	(revision 5623)
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2014 CLARIN
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package eu.clarin.cmdi.virtualcollectionregistry.gui;
+
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.junit.Test;
+import static org.junit.Assert.*;
+import org.junit.Before;
+
+/**
+ *
+ * @author twagoo
+ */
+public class HandleLinkModelTest {
+
+    private HandleLinkModel instance;
+    private IModel<String> model;
+
+    @Before
+    public void setUp() {
+        model = new Model<>("http://clarin.eu");
+        instance = new HandleLinkModel(model);
+    }
+
+    @Test
+    public void testGetObjectUrl() {
+        // non-handles should stay intact
+        assertEquals("http://clarin.eu", instance.getObject());
+    }
+
+    @Test
+    public void testGetObjectHdl() {
+
+        // handle
+        model.setObject("hdl:1234/5678-abCD");
+        assertEquals("http://hdl.handle.net/1234/5678-abCD", instance.getObject());
+    }
+
+    @Test
+    public void testGetObjectDOI() {
+        // doi
+        model.setObject("doi:10.1000/182-Xyz");
+        assertEquals("http://hdl.handle.net/10.1000/182-Xyz", instance.getObject());
+    }
+
+    @Test
+    public void testGetObjectURN() {
+        // urn:nbn
+        model.setObject("urn:nbn:de:bvb:19-146642");
+        assertEquals("http://www.nbn-resolving.org/redirect/urn:nbn:de:bvb:19-146642", instance.getObject());
+    }
+
+    @Test
+    public void testGetObject() {
+        // not the model's task to validate content
+        model.setObject("Something else");
+        assertEquals("Something else", instance.getObject());
+    }
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/java/eu/clarin/cmdi/virtualcollectionregistry/pid/EPICPersistentIdentifierProviderTest.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/java/eu/clarin/cmdi/virtualcollectionregistry/pid/EPICPersistentIdentifierProviderTest.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/java/eu/clarin/cmdi/virtualcollectionregistry/pid/EPICPersistentIdentifierProviderTest.java	(revision 5623)
@@ -0,0 +1,68 @@
+package eu.clarin.cmdi.virtualcollectionregistry.pid;
+
+import de.uni_leipzig.asv.clarin.webservices.pidservices2.Configuration;
+import de.uni_leipzig.asv.clarin.webservices.pidservices2.HandleField;
+import de.uni_leipzig.asv.clarin.webservices.pidservices2.interfaces.PidWriter;
+import eu.clarin.cmdi.virtualcollectionregistry.model.Creator;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+import eu.clarin.cmdi.virtualcollectionregistry.pid.PersistentIdentifier.Type;
+import static org.hamcrest.Matchers.*;
+import org.jmock.Expectations;
+import org.jmock.Mockery;
+import org.jmock.integration.junit4.JUnit4Mockery;
+import static org.junit.Assert.*;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ *
+ * @author twagoo
+ */
+public class EPICPersistentIdentifierProviderTest {
+
+    private final Mockery context = new JUnit4Mockery();
+    private final Configuration pidConfig = new Configuration("http://epic/server", "9999", "user", "password");
+    private EPICPersistentIdentifierProvider instance;
+    private PidWriter pidWriter;
+
+    @Before
+    public void setUp() {
+        pidWriter = context.mock(PidWriter.class);
+        instance = new EPICPersistentIdentifierProvider(pidWriter, pidConfig);
+        instance.setBaseUri("http://vcr");
+    }
+
+    /**
+     * Test of createIdentifier method, of class
+     * EPIC2PersistentIdentifierProvider.
+     */
+    @Test
+    public void testCreateIdentifier() throws Exception {
+        VirtualCollection vc = new VirtualCollection();
+        vc.setName("VC Name");
+        vc.setId(123L);
+        vc.getCreators().add(new Creator("Joe Unit"));
+        vc.getCreators().add(new Creator("Joe Mock"));
+
+        context.checking(new Expectations() {
+            {
+                // should call pidwriter
+                exactly(1).of(equal(pidWriter)).method("registerNewPID").with(
+                        equal(pidConfig),
+                        allOf(
+                                hasEntry(HandleField.URL, "http://vcr/service/virtualcollections/123"),
+                                hasEntry(HandleField.TITLE, "VC Name"),
+                                hasEntry(HandleField.CREATOR, "Joe Unit")
+                        ),
+                        equalTo("VCR-123")
+                );
+                will(returnValue("9999/VCR-123"));
+            }
+        });
+
+        PersistentIdentifier result = instance.createIdentifier(vc);
+        assertEquals("9999/VCR-123", result.getIdentifier());
+        assertEquals(Type.HANDLE, result.getType());
+    }
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/ChaningCreatorProviderTest.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/ChaningCreatorProviderTest.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/ChaningCreatorProviderTest.java	(revision 5623)
@@ -0,0 +1,73 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package eu.clarin.cmdi.virtualcollectionregistry.service.impl;
+
+import eu.clarin.cmdi.virtualcollectionregistry.model.Creator;
+import eu.clarin.cmdi.virtualcollectionregistry.service.CreatorProvider;
+import java.security.Principal;
+import java.util.Arrays;
+import org.jmock.Expectations;
+import org.jmock.Mockery;
+import org.jmock.integration.junit4.JUnit4Mockery;
+import static org.junit.Assert.*;
+import org.junit.Test;
+
+/**
+ *
+ * @author twagoo
+ */
+public class ChaningCreatorProviderTest {
+
+    private final Mockery context = new JUnit4Mockery();
+
+    /**
+     * Test of getCreator method, of class ChaningCreatorProvider.
+     */
+    @Test
+    public void testGetCreator() {
+        final CreatorProvider provider1 = context.mock(CreatorProvider.class, "p1");
+        final Creator creator1 = new Creator();
+        creator1.setAddress("addr1");
+        creator1.setEMail("email1");
+        creator1.setOrganisation("org1");
+        
+        final CreatorProvider provider2 = context.mock(CreatorProvider.class, "p2");
+        final Creator creator2 = new Creator();
+        creator2.setPerson("pers2");
+        creator2.setRole("role2");
+        creator2.setTelephone("tel2");
+        creator2.setWebsite("web2");
+
+        Creator expResult = new Creator();
+        expResult.setAddress("addr1");
+        expResult.setEMail("email1");
+        expResult.setOrganisation("org1");
+        expResult.setPerson("pers2");
+        expResult.setRole("role2");
+        expResult.setTelephone("tel2");
+        expResult.setWebsite("web2");
+        
+        final Principal principal = new Principal() {
+
+            @Override
+            public String getName() {
+                return "name";
+            }
+        };
+        
+        context.checking(new Expectations(){{
+            oneOf(provider1).getCreator(principal);
+            will(returnValue(creator1));
+            oneOf(provider2).getCreator(principal);
+            will(returnValue(creator2));
+        }});
+        final ChaningCreatorProvider instance = new ChaningCreatorProvider(Arrays.asList(provider1, provider2));
+        final Creator result = instance.getCreator(principal);
+        
+        assertEquals(expResult, result);
+    }
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/ReferenceValidatorTest.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/ReferenceValidatorTest.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/ReferenceValidatorTest.java	(revision 5623)
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2014 CLARIN
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package eu.clarin.cmdi.virtualcollectionregistry.service.impl;
+
+import org.apache.wicket.validation.IValidatable;
+import org.apache.wicket.validation.Validatable;
+import org.junit.Test;
+import static org.junit.Assert.*;
+import org.junit.Before;
+
+/**
+ *
+ * @author twagoo
+ */
+public class ReferenceValidatorTest {
+
+    private ReferenceValidator instance;
+
+    @Before
+    public void setUp() {
+        instance = new ReferenceValidator();
+    }
+
+    /**
+     * Test of onValidate method, of class ReferenceValidator.
+     */
+    @Test
+    public void testOnValidateUrl() {
+        IValidatable<String> validatable = new Validatable<>("http://www.clarin.eu");
+        instance.validate(validatable);
+        assertTrue(validatable.isValid());
+    }
+
+    /**
+     * Test of onValidate method, of class ReferenceValidator.
+     */
+    @Test
+    public void testOnValidateHdl() {
+        IValidatable<String> validatable = new Validatable<>("hdl:1234/abcd-EF-5678");
+        instance.validate(validatable);
+        assertTrue(validatable.isValid());
+    }
+
+    /**
+     * Test of onValidate method, of class ReferenceValidator.
+     */
+    @Test
+    public void testOnValidateDoi() {
+        IValidatable<String> validatable = new Validatable<>("doi:10.1000/182");
+        instance.validate(validatable);
+        assertTrue(validatable.isValid());
+    }
+
+    /**
+     * Test of onValidate method, of class ReferenceValidator.
+     */
+    @Test
+    public void testOnValidateIllegal() {
+        IValidatable<String> validatable = new Validatable<>("not a legal URL or handle");
+        instance.validate(validatable);
+        assertFalse(validatable.isValid());
+    }
+
+    /**
+     * Test of onValidate method, of class ReferenceValidator.
+     */
+    @Test
+    public void testOnValidateIllegalHdl() {
+        IValidatable<String> validatable = new Validatable<>("hdl:12a4/abcd-EF-5678");
+        instance.validate(validatable);
+        assertFalse(validatable.isValid());
+    }
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/VirtualCollectionCMDIWriterImplTest.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/VirtualCollectionCMDIWriterImplTest.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/VirtualCollectionCMDIWriterImplTest.java	(revision 5623)
@@ -0,0 +1,153 @@
+package eu.clarin.cmdi.virtualcollectionregistry.service.impl;
+
+import eu.clarin.cmdi.virtualcollectionregistry.model.Creator;
+import eu.clarin.cmdi.virtualcollectionregistry.model.Resource;
+import eu.clarin.cmdi.virtualcollectionregistry.model.User;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+import eu.clarin.cmdi.virtualcollectionregistry.pid.PersistentIdentifier;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.text.DateFormat;
+import static java.text.DateFormat.SHORT;
+import java.text.ParseException;
+import java.util.List;
+import java.util.Locale;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.regex.Pattern;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamWriter;
+import org.custommonkey.xmlunit.Diff;
+import org.custommonkey.xmlunit.Difference;
+import org.custommonkey.xmlunit.DifferenceListener;
+import org.custommonkey.xmlunit.XMLTestCase;
+import org.custommonkey.xmlunit.XMLUnit;
+import org.junit.Test;
+import org.w3c.dom.Node;
+import org.xml.sax.SAXException;
+
+/**
+ *
+ * @author twagoo
+ */
+public class VirtualCollectionCMDIWriterImplTest extends XMLTestCase {
+
+    private static final String CONTROL_INSTANCE = "/vc-instance1.xml";
+
+    /**
+     * Patterns for paths to be ignored in XML comparison
+     */
+    private final List<Pattern> IGNORE_PATHS = new CopyOnWriteArrayList<>(new Pattern[]{
+        //ignore creation date
+        Pattern.compile("\\/CMD\\[1\\]\\/Header\\[1\\]\\/MdCreationDate\\[1\\]\\/text\\(\\).*"),
+        //ignore resource proxy id's
+        Pattern.compile("\\/CMD\\[1\\]\\/Resources\\[1\\]\\/ResourceProxyList\\[1\\]\\/ResourceProxy\\[.*\\]\\/@id"),
+        //ignore resource proxy references from Resource component instances
+        Pattern.compile("\\/CMD\\[1\\]\\/Components\\[1\\]\\/VirtualCollection\\[1\\]\\/Resource\\[.*\\]\\/@ref")
+    });
+
+    /**
+     * Test of writeCMDI method, of class VirtualCollectionCMDIWriterImpl.
+     *
+     * @throws java.lang.Exception
+     */
+    @Test
+    public void testWriteCMDIExtensional() throws Exception {
+        final VirtualCollectionCMDIWriterImpl instance = new VirtualCollectionCMDIWriterImpl(new VirtualCollectionCMDICreatorImpl());
+
+        // create a collection to serialize
+        final VirtualCollection vc = createTestVC();
+
+        // prepare an output writer
+        final XMLOutputFactory xmlOutputFactory = XMLOutputFactory.newFactory();
+        final StringWriter stringWriter = new StringWriter();
+        final XMLStreamWriter xmlWriter = xmlOutputFactory.createXMLStreamWriter(stringWriter);
+
+        // write CMDI for instance to the writer
+        xmlWriter.writeStartDocument();
+        instance.writeCMDI(xmlWriter, vc);
+        xmlWriter.writeEndDocument();
+        xmlWriter.close();
+
+        // compare output to control document
+        final StringReader testOutputReader = new StringReader(stringWriter.toString());
+        final InputStreamReader controlReader = new InputStreamReader(getClass().getResourceAsStream(CONTROL_INSTANCE));
+
+        assertCMDIEqual(controlReader, testOutputReader);
+    }
+
+    private VirtualCollection createTestVC() throws ParseException {
+        final VirtualCollection vc = new VirtualCollection();
+        vc.setName("Virtual Collection Name");
+        vc.setDescription("Test collection description");
+        vc.setType(VirtualCollection.Type.EXTENSIONAL);
+        vc.setReproducibility(VirtualCollection.Reproducibility.INTENDED);
+        vc.setPurpose(VirtualCollection.Purpose.SAMPLE);
+
+        vc.setOwner(new User("Test user"));
+        vc.setCreationDate(DateFormat.getDateInstance(SHORT, Locale.US).parse("01/01/14"));
+
+        vc.setState(VirtualCollection.State.PUBLIC_PENDING);
+        //setting the pid requires 'public pending' state and will set the state to public
+        vc.setPersistentIdentifier(new PersistentIdentifier(vc, PersistentIdentifier.Type.HANDLE, "9999/1234-5678"));
+
+        vc.getKeywords().add("keyword1");
+        vc.getKeywords().add("keyword2");
+
+        final Creator creator = new Creator("Test creator");
+        creator.setEMail("test@creator.org");
+        creator.setOrganisation("Test Inc.");
+        vc.getCreators().add(creator);
+
+        final Resource resource1 = new Resource(Resource.Type.METADATA, "http://my/metadata.cmdi");
+        resource1.setLabel("Label of first");
+        vc.getResources().add(resource1);
+
+        final Resource resource2 = new Resource(Resource.Type.RESOURCE, "http://my/resource.mpg");
+        resource2.setDescription("Description of second");
+        vc.getResources().add(resource2);
+
+        // add one without label or description
+        vc.getResources().add(new Resource(Resource.Type.RESOURCE, "http://other/resource.mpg"));
+        return vc;
+    }
+
+    private void assertCMDIEqual(final InputStreamReader controlReader, final StringReader testOutputReader) throws IOException, SAXException {
+        XMLUnit.setIgnoreWhitespace(true);
+        XMLUnit.setIgnoreAttributeOrder(true);
+
+        final Diff diff = XMLUnit.compareXML(controlReader, testOutputReader);
+        setIgnorePaths(diff);
+
+        assertTrue(diff.toString(), diff.similar());
+    }
+
+    /**
+     * approach based on
+     * http://ayazanwar.wordpress.com/2012/09/23/xmlunit-ignoring-certain-pieces-of-xml-during-xml-comparison-using-regular-expression/
+     *
+     * @param diff
+     * @param ignorePaths
+     */
+    private void setIgnorePaths(final Diff diff) {
+        diff.overrideDifferenceListener(new DifferenceListener() {
+
+            @Override
+            public int differenceFound(Difference difference) {
+                final String testXPath = difference.getTestNodeDetail().getXpathLocation();
+                for (Pattern ignorePath : IGNORE_PATHS) {
+                    if (ignorePath.matcher(testXPath).find()) {
+                        return DifferenceListener.RETURN_IGNORE_DIFFERENCE_NODES_SIMILAR;
+                    }
+                }
+                return DifferenceListener.RETURN_ACCEPT_DIFFERENCE;
+            }
+
+            @Override
+            public void skippedComparison(Node control, Node test) {
+            }
+        });
+    }
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/VirtualCollectionMarshallerTest.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/VirtualCollectionMarshallerTest.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/VirtualCollectionMarshallerTest.java	(revision 5623)
@@ -0,0 +1,224 @@
+package eu.clarin.cmdi.virtualcollectionregistry.service.impl;
+
+import eu.clarin.cmdi.virtualcollectionregistry.model.Creator;
+import eu.clarin.cmdi.virtualcollectionregistry.model.GeneratedBy;
+import eu.clarin.cmdi.virtualcollectionregistry.model.GeneratedByQuery;
+import eu.clarin.cmdi.virtualcollectionregistry.model.Resource;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+import eu.clarin.cmdi.virtualcollectionregistry.service.VirtualCollectionMarshaller.Format;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.io.StringReader;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import org.custommonkey.xmlunit.Diff;
+import org.custommonkey.xmlunit.XMLUnit;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertNull;
+
+import static org.junit.Assert.assertTrue;
+import org.junit.Test;
+
+public class VirtualCollectionMarshallerTest {
+
+    @Test
+    public void testMinmalExtensional() throws Exception {
+        VirtualCollectionMarshallerImpl m =
+           new VirtualCollectionMarshallerImpl();
+        VirtualCollection vc = new VirtualCollection();
+        vc.setType(VirtualCollection.Type.EXTENSIONAL);
+        vc.setName("Test 12");
+        vc.getResources().add(new Resource(Resource.Type.RESOURCE, "a/ref/"));
+
+        ByteArrayOutputStream out = new ByteArrayOutputStream(65536);
+        m.marshal(out, Format.XML, vc);
+        VirtualCollection vc2 =
+            m.unmarshal(new ByteArrayInputStream(out.toByteArray()),
+                        Format.XML, "utf-8");
+
+        assertEquals(vc, vc2);
+    }
+
+    @Test
+    public void testUnmarshallExtensionalCollection() throws Exception {
+        VirtualCollectionMarshallerImpl m =
+            new VirtualCollectionMarshallerImpl();
+         InputStream in = this.getClass().getClassLoader()
+                .getResourceAsStream("VirtualCollection-extensional.xml");
+        VirtualCollection vc = m.unmarshal(in, Format.XML, "utf-8");
+
+        final DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        assertNotNull(vc);
+        assertEquals("Test Collection 1", vc.getName());
+        assertEquals(VirtualCollection.Type.EXTENSIONAL, vc.getType());
+        assertEquals("Test Description", vc.getDescription());
+        assertEquals(sdf.parse("2009-12-31"), vc.getCreationDate());
+        assertEquals(VirtualCollection.Purpose.SAMPLE, vc.getPurpose());
+        assertEquals(VirtualCollection.Reproducibility.UNTENDED,
+                vc.getReproducibility());
+        assertEquals("Unmaintaned test collection.",
+                vc.getReproducibilityNotice());
+
+        assertNotNull(vc.getKeywords());
+        assertEquals(2, vc.getKeywords().size());
+        assertNotNull(vc.getKeywords());
+        assertEquals("test", vc.getKeywords().get(0));
+        assertEquals("unmaintained", vc.getKeywords().get(1));
+
+        assertNotNull(vc.getCreators());
+        assertEquals(2, vc.getCreators().size());
+        Creator c = vc.getCreators().get(0);
+        assertNotNull(c);
+        assertEquals("Joe User", c.getPerson());
+        assertEquals("Example Address Joe", c.getAddress());
+        assertEquals("joe.user@example.com", c.getEMail());
+        assertEquals("Example Organization", c.getOrganisation());
+        assertEquals("+1-800-555-0101", c.getTelephone());
+        assertEquals("http://www.example.org/~joe/", c.getWebsite());
+        assertEquals("Test Role Joe", c.getRole());
+        c = vc.getCreators().get(1);
+        assertNotNull(c);
+        assertEquals("Jane User", c.getPerson());
+        assertEquals("Example Address Jane", c.getAddress());
+        assertEquals("jane.user@example.com", c.getEMail());
+        assertEquals("Example Organization", c.getOrganisation());
+        assertEquals("+1-800-555-0102", c.getTelephone());
+        assertEquals("http://www.example.org/~jane/", c.getWebsite());
+        assertEquals("Test Role Jane", c.getRole());
+
+        assertNotNull(vc.getResources());
+        assertEquals(3, vc.getResources().size());
+
+        Resource r = vc.getResources().get(0);
+        assertNotNull(r);
+        assertEquals(Resource.Type.METADATA, r.getType());
+        assertEquals("http://hdl.handle.net/1839/00-0000-0000-0005-671C-C",
+                r.getRef());
+        assertNull(r.getLabel());
+        assertNull(r.getDescription());
+
+        r = vc.getResources().get(1);
+        assertNotNull(r);
+        assertEquals(Resource.Type.METADATA, r.getType());
+        assertEquals("http://hdl.handle.net/1839/00-0000-0000-0006-671C-C",
+                r.getRef());
+        assertEquals("Second metadata resource", r.getLabel());
+        assertNull(r.getDescription());
+        
+        r = vc.getResources().get(2);
+        assertNotNull(r);
+        assertEquals(Resource.Type.METADATA, r.getType());
+        assertEquals("http://hdl.handle.net/1839/00-0000-0000-0007-671C-C",
+                r.getRef());
+        assertNull(r.getLabel());
+        assertEquals("Third metadata resource", r.getDescription());
+
+        assertNull(vc.getGeneratedBy());
+
+        // round-tripping
+        ByteArrayOutputStream out = new ByteArrayOutputStream(65536);
+        m.marshal(out, Format.XML, vc);
+        VirtualCollection vc2 =
+            m.unmarshal(new ByteArrayInputStream(out.toByteArray()),
+                    Format.XML, "utf-8");
+        assertEquals(vc.getOwner(), vc2.getOwner());
+        assertEquals(vc.getPersistentIdentifier(),
+                vc2.getPersistentIdentifier());
+        assertEquals(vc.getState(), vc2.getState());
+        assertEquals(vc.getType(), vc2.getType());
+        assertEquals(vc.getName(), vc2.getName());
+        assertEquals(vc.getDescription(), vc2.getDescription());
+        assertEquals(vc.getCreationDate(), vc2.getCreationDate());
+        assertEquals(vc.getCreators(), vc2.getCreators());
+        assertEquals(vc.getPurpose(), vc2.getPurpose());
+        assertEquals(vc.getReproducibility(), vc2.getReproducibility());
+        assertEquals(vc.getReproducibilityNotice(),
+                vc2.getReproducibilityNotice());
+        assertEquals(vc.getKeywords(), vc2.getKeywords());
+        assertEquals(vc.getResources(), vc2.getResources());
+        assertEquals(vc.getGeneratedBy(), vc2.getGeneratedBy());
+        assertEquals(vc, vc2);        
+    }
+
+    @Test
+    public void testUnmarshallIntensionalCollection() throws Exception {
+        VirtualCollectionMarshallerImpl m =
+            new VirtualCollectionMarshallerImpl();
+        InputStream in = this.getClass().getClassLoader()
+                .getResourceAsStream("VirtualCollection-intensional.xml");
+        VirtualCollection vc = m.unmarshal(in, Format.XML, "utf-8");
+
+        final DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        assertNotNull(vc);
+        assertEquals("Test Collection 2", vc.getName());
+        assertEquals(VirtualCollection.Type.INTENSIONAL, vc.getType());
+        assertEquals("Test Description", vc.getDescription());
+        assertEquals(sdf.parse("2009-12-31"), vc.getCreationDate());
+        assertEquals(VirtualCollection.Purpose.SAMPLE, vc.getPurpose());
+        assertEquals(VirtualCollection.Reproducibility.UNTENDED,
+                vc.getReproducibility());
+        assertEquals("Unmaintaned test collection.",
+                vc.getReproducibilityNotice());
+
+        assertNotNull(vc.getKeywords());
+        assertEquals(2, vc.getKeywords().size());
+        assertNotNull(vc.getKeywords());
+        assertEquals("test", vc.getKeywords().get(0));
+        assertEquals("unmaintained", vc.getKeywords().get(1));
+
+        assertNotNull(vc.getCreators());
+        assertEquals(1, vc.getCreators().size());
+        Creator c = vc.getCreators().get(0);
+        assertNotNull(c);
+        assertEquals("Joe User", c.getPerson());
+        assertEquals("joe.user@example.com", c.getEMail());
+        assertEquals("Example Organization", c.getOrganisation());
+
+
+        assertEquals(0, vc.getResources().size());
+
+        GeneratedBy generatedBy = vc.getGeneratedBy();
+        assertNotNull(generatedBy);
+        assertEquals("GeneratedBy description", generatedBy.getDescription());
+        assertEquals("urn:x-vcr:test-uri", generatedBy.getURI());
+        GeneratedByQuery query = generatedBy.getQuery();
+        assertNotNull(query);
+        assertEquals("sql", query.getProfile());
+        assertEquals("<SQL>Test-Query</SQL>", query.getValue());
+
+        // round-tripping
+        ByteArrayOutputStream out = new ByteArrayOutputStream(65536);
+        m.marshal(out, Format.XML, vc);
+        VirtualCollection vc2 =
+            m.unmarshal(new ByteArrayInputStream(out.toByteArray()),
+                    Format.XML, "utf-8");
+        assertEquals(vc.getOwner(), vc2.getOwner());
+        assertEquals(vc.getPersistentIdentifier(),
+                vc2.getPersistentIdentifier());
+        assertEquals(vc.getState(), vc2.getState());
+        assertEquals(vc.getType(), vc2.getType());
+        assertEquals(vc.getName(), vc2.getName());
+        assertEquals(vc.getDescription(), vc2.getDescription());
+        assertEquals(vc.getCreationDate(), vc2.getCreationDate());
+        assertEquals(vc.getCreators(), vc2.getCreators());
+        assertEquals(vc.getPurpose(), vc2.getPurpose());
+        assertEquals(vc.getReproducibility(), vc2.getReproducibility());
+        assertEquals(vc.getReproducibilityNotice(),
+                vc2.getReproducibilityNotice());
+        assertEquals(vc.getKeywords(), vc2.getKeywords());
+        assertEquals(vc.getResources(), vc2.getResources());
+        assertEquals(vc.getGeneratedBy(), vc2.getGeneratedBy());
+        assertEquals(vc, vc2);
+    }
+
+} // class VirtualCollectionMarshallerTest
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/VirtualCollectionPrePublicationValidatorTest.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/VirtualCollectionPrePublicationValidatorTest.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/VirtualCollectionPrePublicationValidatorTest.java	(revision 5623)
@@ -0,0 +1,118 @@
+/*
+ * Copyright (C) 2014 CLARIN
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package eu.clarin.cmdi.virtualcollectionregistry.service.impl;
+
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryUsageException;
+import eu.clarin.cmdi.virtualcollectionregistry.model.Creator;
+import eu.clarin.cmdi.virtualcollectionregistry.model.GeneratedBy;
+import eu.clarin.cmdi.virtualcollectionregistry.model.Resource;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+import eu.clarin.cmdi.virtualcollectionregistry.service.VirtualCollectionValidator;
+import org.junit.Before;
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+/**
+ *
+ * @author twagoo
+ */
+public class VirtualCollectionPrePublicationValidatorTest {
+
+    private VirtualCollection vc;
+    private VirtualCollectionValidator instance;
+
+    @Before
+    public void setUp() {
+        // start with a extensional collection that is valid (enough)
+        vc = new VirtualCollection();
+        vc.setType(VirtualCollection.Type.EXTENSIONAL);
+        vc.setName("Name");
+        vc.setDescription("Description");
+        vc.setPurpose(VirtualCollection.Purpose.SAMPLE);
+        vc.setReproducibility(VirtualCollection.Reproducibility.INTENDED);
+        vc.getCreators().add(new Creator("creator"));
+        instance = new VirtualCollectionPrePublicationValidator();
+    }
+    
+    @Test
+    public void testValidateResources() {
+        // this is a valid resource set
+        vc.getResources().add(new Resource(Resource.Type.METADATA, "hdl:1234/5678"));
+        vc.getResources().add(new Resource(Resource.Type.METADATA, "doi:1.2.3/456"));
+        vc.getResources().add(new Resource(Resource.Type.METADATA, "http://hdl.handle.net/1234/5678"));
+        vc.getResources().add(new Resource(Resource.Type.METADATA, "http://dx.doi.org/1.2.3/456"));
+        try {
+            instance.validate(vc);
+        } catch (VirtualCollectionRegistryUsageException ex) {
+            fail("Validation should not fail");
+        }
+    }
+    
+    @Test(expected = VirtualCollectionRegistryUsageException.class)
+    public void testValidateResourcesNonPid() throws Exception {
+        // Non-PIDs should not be allowed as references
+        vc.getResources().add(new Resource(Resource.Type.METADATA, "hdl:1234/5678"));
+        vc.getResources().add(new Resource(Resource.Type.METADATA, "doi:1.2.3/456"));
+        vc.getResources().add(new Resource(Resource.Type.METADATA, "http://clarin.eu"));
+        instance.validate(vc);
+    }
+    
+    @Test(expected = VirtualCollectionRegistryUsageException.class)
+    public void testValidateQueryUriNonPid() throws Exception {
+        // Non-PIDs should not be allowed as query URI
+        vc.setType(VirtualCollection.Type.INTENSIONAL);
+        final GeneratedBy generatedBy = new GeneratedBy();
+        generatedBy.setURI("http://catalog.clarin.eu/vlo");
+        vc.setGeneratedBy(generatedBy);
+        instance.validate(vc);
+    }
+    
+    @Test(expected = VirtualCollectionRegistryUsageException.class)
+    public void testValidateNoDescription() throws Exception {
+        // Description should not be allowed to be null
+        vc.setDescription(null);
+        instance.validate(vc);
+    }
+    
+    @Test(expected = VirtualCollectionRegistryUsageException.class)
+    public void testValidateNoCreators() throws Exception {
+        // Description should not be allowed to be null
+        vc.getCreators().clear();
+        instance.validate(vc);
+    }
+    
+    @Test(expected = VirtualCollectionRegistryUsageException.class)
+    public void testValidatePurposeFutureUse() throws Exception {
+        // Description should not be allowed to be null
+        vc.setPurpose(VirtualCollection.Purpose.FUTURE_USE);
+        instance.validate(vc);
+    }
+    
+    @Test(expected = VirtualCollectionRegistryUsageException.class)
+    public void testValidateNoPurpose() throws Exception {
+        // Description should not be allowed to be null
+        vc.setPurpose(null);
+        instance.validate(vc);
+    }
+    
+    @Test(expected = VirtualCollectionRegistryUsageException.class)
+    public void testValidateNoReproducibility() throws Exception {
+        // Description should not be allowed to be null
+        vc.setReproducibility(null);
+        instance.validate(vc);
+    }
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/VirtualCollectionValidatorImplTest.java
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/VirtualCollectionValidatorImplTest.java	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/VirtualCollectionValidatorImplTest.java	(revision 5623)
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2014 CLARIN
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package eu.clarin.cmdi.virtualcollectionregistry.service.impl;
+
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryException;
+import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryUsageException;
+import eu.clarin.cmdi.virtualcollectionregistry.model.Resource;
+import eu.clarin.cmdi.virtualcollectionregistry.model.VirtualCollection;
+import eu.clarin.cmdi.virtualcollectionregistry.service.VirtualCollectionValidator;
+import static org.junit.Assert.fail;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ *
+ * @author twagoo
+ */
+public class VirtualCollectionValidatorImplTest {
+
+    private VirtualCollectionValidator instance;
+    private VirtualCollection vc;
+
+    @Before
+    public void setUp() {
+        vc = new VirtualCollection();
+        instance = new VirtualCollectionValidatorImpl();
+    }
+
+    @Test(expected = VirtualCollectionRegistryUsageException.class)
+    public void testValidateExtensionalEmptyResources() throws Exception {
+        vc.setName("Name");
+        vc.setType(VirtualCollection.Type.EXTENSIONAL);
+        instance.validate(vc);
+    }
+
+    @Test
+    public void testValidateExtensionalLegalResources() throws Exception {
+        vc.setName("Name");
+        vc.setType(VirtualCollection.Type.EXTENSIONAL);
+        vc.getResources().add(new Resource(Resource.Type.METADATA, "http://clarin.eu"));
+        vc.getResources().add(new Resource(Resource.Type.METADATA, "hdl:1234/5678"));
+        vc.getResources().add(new Resource(Resource.Type.METADATA, "doi:10.1000/182"));
+        try {
+            instance.validate(vc);
+        } catch (VirtualCollectionRegistryException ex) {
+            fail("Validation of valid collection failed: " + ex.getMessage());
+        }
+    }
+
+    @Test(expected = VirtualCollectionRegistryUsageException.class)
+    public void testValidateExtensionalIllegalResources() throws Exception {
+        vc.setName("Name");
+        vc.setType(VirtualCollection.Type.EXTENSIONAL);
+        vc.getResources().add(new Resource(Resource.Type.METADATA, "http://clarin.eu"));
+        vc.getResources().add(new Resource(Resource.Type.METADATA, "hdl:1234/5678"));
+        vc.getResources().add(new Resource(Resource.Type.METADATA, "doi:10.1000/182"));
+        vc.getResources().add(new Resource(Resource.Type.METADATA, "some://illegal/url"));
+        instance.validate(vc);
+    }
+
+}
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/resources/SubmitTest.html
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/resources/SubmitTest.html	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/resources/SubmitTest.html	(revision 5623)
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <title>VCR form submission test</title>
+        <meta charset="UTF-8">
+        <meta name="viewport" content="width=device-width, initial-scale=1.0">
+        <style>
+            li {
+                list-style-type: none;
+                margin-bottom: 1em;
+            }
+            input[type='text'] {
+                min-width: 400px;
+                position: absolute;
+                left: 20em;
+                clear: right;
+            }
+        </style>
+    </head>
+    <body>
+        <h1>Extensional</h1>
+        <form 
+            action="http://localhost:8080/VirtualCollectionRegistry/service/submit"
+            method="POST">
+            <input type="hidden" name="type" value="EXTENSIONAL" />
+            <ul>
+                <li><label>Name: <input type="text" name="name" value="Test extensional" /></label></li>
+                <li><label>Metadata URI 1: <input type="text" name="metadataUri" value="http://md1" /></label></li>
+                <li><label>Metadata URI 2: <input type="text" name="metadataUri" value="http://md2" /></label></li>
+                <li><label>Resource URI 1: <input type="text" name="resourceUri" value="http://res1" /></label></li>
+                <li><label>Resource URI 2: <input type="text" name="resourceUri" value="http://res2" /></label></li>
+                <li><label>Keyword: <input type="text" name="keyword" value="test" /></label></li>
+                <li><label>Keyword: <input type="text" name="keyword" value="form" /></label></li>
+            </ul>
+            <input type="submit" />
+        </form>      
+        
+        <hr />
+        
+        <h1>Intensional</h1>
+        <form 
+            action="http://localhost:8080/VirtualCollectionRegistry/service/submit"
+            method="POST">
+            <input type="hidden" name="type" value="INTENSIONAL" />
+            <ul>
+                <li><label>Name: <input type="text" name="name" value="Test intensional" /></label></li>
+                <li><label>Description <input type="text" name="queryDescription" value="Description" /></label></li>
+                <li><label>URI: <input type="text" name="queryUri" value="http://catalog.clarin.eu/vlo" /></label></li>
+                <li><label>Query profile: <input type="text" name="queryProfile" value="fq" /></label></li>
+                <li><label>Query value: <input type="text" name="queryValue" value="language:Dutch" /></label></li>
+            </ul>
+            <input type="submit" />
+        </form>
+    </body>
+</html>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/resources/VirtualCollection-extensional.xml
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/resources/VirtualCollection-extensional.xml	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/resources/VirtualCollection-extensional.xml	(revision 5623)
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<VirtualCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:noNamespaceSchemaLocation="VirtualCollection.xsd">
+    <Type>extensional</Type>
+    <Name>Test Collection 1</Name>
+    <Description>Test Description</Description>
+    <CreationDate>2009-12-31</CreationDate>
+    <Creators>
+        <Creator>
+            <Person>Joe User</Person>
+            <Address>Example Address Joe</Address>
+            <Email>joe.user@example.com</Email>
+            <Organisation>Example Organization</Organisation>
+            <Telephone>+1-800-555-0101</Telephone>
+            <Website>http://www.example.org/~joe/</Website>
+            <Role>Test Role Joe</Role>
+        </Creator>
+        <Creator>
+            <Person>Jane User</Person>
+            <Address>Example Address Jane</Address>
+            <Email>jane.user@example.com</Email>
+            <Organisation>Example Organization</Organisation>
+            <Telephone>+1-800-555-0102</Telephone>
+            <Website>http://www.example.org/~jane/</Website>
+            <Role>Test Role Jane</Role>
+        </Creator>
+    </Creators>
+    <Purpose>sample</Purpose>
+    <Reproducibility>untended</Reproducibility>
+    <ReproducibilityNotice>Unmaintaned test collection.</ReproducibilityNotice>
+    <Keywords>
+        <Keyword>test</Keyword>
+        <Keyword>unmaintained</Keyword>
+    </Keywords>
+    <Resources>
+        <Resource>
+            <ResourceType>Metadata</ResourceType>
+            <ResourceRef>http://hdl.handle.net/1839/00-0000-0000-0005-671C-C</ResourceRef>
+        </Resource>
+        <Resource>
+            <ResourceType>Metadata</ResourceType>
+            <ResourceRef>http://hdl.handle.net/1839/00-0000-0000-0006-671C-C</ResourceRef>
+            <Label>Second metadata resource</Label>
+        </Resource>
+        <Resource>
+            <ResourceType>Metadata</ResourceType>
+            <ResourceRef>http://hdl.handle.net/1839/00-0000-0000-0007-671C-C</ResourceRef>
+            <Description>Third metadata resource</Description>
+        </Resource>
+    </Resources>
+</VirtualCollection>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/resources/VirtualCollection-intensional.xml
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/resources/VirtualCollection-intensional.xml	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/resources/VirtualCollection-intensional.xml	(revision 5623)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<VirtualCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:noNamespaceSchemaLocation="VirtualCollection.xsd">
+    <Type>intensional</Type>
+    <Name>Test Collection 2</Name>
+    <Description>Test Description</Description>
+    <CreationDate>2009-12-31</CreationDate>
+    <Creators>
+        <Creator>
+            <Person>Joe User</Person>
+            <Email>joe.user@example.com</Email>
+            <Organisation>Example Organization</Organisation>
+        </Creator>
+    </Creators>
+    <Purpose>sample</Purpose>
+    <Reproducibility>untended</Reproducibility>
+    <ReproducibilityNotice>Unmaintaned test collection.</ReproducibilityNotice>
+    <Keywords>
+        <Keyword>test</Keyword>
+        <Keyword>unmaintained</Keyword>
+    </Keywords>
+    <GeneratedBy>
+        <Description>GeneratedBy description</Description>
+        <URI>urn:x-vcr:test-uri</URI>
+        <Query profile="sql"><![CDATA[<SQL>Test-Query</SQL>]]></Query>
+    </GeneratedBy>
+</VirtualCollection>
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/resources/log4j.properties
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/resources/log4j.properties	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/resources/log4j.properties	(revision 5623)
@@ -0,0 +1,10 @@
+log4j.appender.Console=org.apache.log4j.ConsoleAppender
+log4j.appender.Console.layout=org.apache.log4j.PatternLayout
+log4j.appender.Console.layout.conversionPattern=%d %p [%c#%M:%L] - %m%n
+
+log4j.rootLogger=INFO,Console
+
+log4j.logger.eu.clarin.cmdi.virtualcollectionregistry=DEBUG
+log4j.logger.org.springframework=INFO
+log4j.logger.org.hibernate=INFO
+log4j.logger.org.apache.wicket=INFO
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/resources/testdb.properties
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/resources/testdb.properties	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/resources/testdb.properties	(revision 5623)
@@ -0,0 +1,13 @@
+hibernate.dialect=org.hibernate.dialect.HSQLDialect
+hibernate.connection.driver_class=org.hsqldb.jdbcDriver
+hibernate.connection.username=sa
+hibernate.connection.password=
+hibernate.connection.url=jdbc:hsqldb:target/test-database/database
+#hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
+#hibernate.connection.driver_class=com.mysql.jdbc.Driver
+#hibernate.connection.username=vcr_devel
+#hibernate.connection.password=***
+#hibernate.connection.url=jdbc:mysql://clarin.ids-mannheim.de:3306/vcr_devel
+hibernate.hbm2ddl.auto=create-drop
+hibernate.show_sql=true
+hibernate.format_sql=true
Index: /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/resources/vc-instance1.xml
===================================================================
--- /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/resources/vc-instance1.xml	(revision 5623)
+++ /VirtualCollectionRegistry/tags/VirtualCollectionRegistry-1.0-beta/src/test/resources/vc-instance1.xml	(revision 5623)
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- CMDI instance valid to cmdi-virtual-collection (clarin.eu:cr1:p_1271859438175) profile -->
+<!-- It should reflect the collection created programatically in the VirtualCollectionCMDIWriterImplTest -->
+<cmd:CMD xmlns:cmd="http://www.clarin.eu/cmd/"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://www.clarin.eu/cmd/ http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/profiles/clarin.eu:cr1:p_1404130561238/xsd" CMDVersion="1.1">
+    <cmd:Header>
+        <cmd:MdCreator>Test user</cmd:MdCreator>
+        <cmd:MdCreationDate>2014-01-01</cmd:MdCreationDate>
+        <cmd:MdSelfLink>hdl:9999/1234-5678</cmd:MdSelfLink>
+        <cmd:MdProfile>clarin.eu:cr1:p_1404130561238</cmd:MdProfile>
+    </cmd:Header>
+    <cmd:Resources>
+        <cmd:ResourceProxyList>
+            <cmd:ResourceProxy id="r1">
+                <cmd:ResourceType>Metadata</cmd:ResourceType>
+                <cmd:ResourceRef>http://my/metadata.cmdi</cmd:ResourceRef>
+            </cmd:ResourceProxy>
+            <cmd:ResourceProxy id="r2">
+                <cmd:ResourceType>Resource</cmd:ResourceType>
+                <cmd:ResourceRef>http://my/resource.mpg</cmd:ResourceRef>
+            </cmd:ResourceProxy>
+            <cmd:ResourceProxy id="r3">
+                <cmd:ResourceType>Resource</cmd:ResourceType>
+                <cmd:ResourceRef>http://other/resource.mpg</cmd:ResourceRef>
+            </cmd:ResourceProxy>
+        </cmd:ResourceProxyList>
+        <cmd:JournalFileProxyList>
+        </cmd:JournalFileProxyList>
+        <cmd:ResourceRelationList>
+        </cmd:ResourceRelationList>
+    </cmd:Resources>
+    <cmd:Components>
+        <cmd:VirtualCollection>
+            <cmd:Name>Virtual Collection Name</cmd:Name>
+            <cmd:Description>Test collection description</cmd:Description>
+            <cmd:CreationDate>2014-01-01</cmd:CreationDate>
+            <cmd:Status>published</cmd:Status>
+            <cmd:Reproducability>intended</cmd:Reproducability>
+            <cmd:Purpose>sample</cmd:Purpose>
+            <cmd:Keyword>keyword1</cmd:Keyword>
+            <cmd:Keyword>keyword2</cmd:Keyword>
+            <cmd:Creator>
+                <cmd:Name>Test creator</cmd:Name>
+                <cmd:Email>test@creator.org</cmd:Email>
+                <cmd:Organisation>Test Inc.</cmd:Organisation>
+            </cmd:Creator>
+            <cmd:Resource ref="r1">
+                <cmd:Label>Label of first</cmd:Label>
+            </cmd:Resource>
+            <cmd:Resource ref="r2">
+                <cmd:Description>Description of second</cmd:Description>
+            </cmd:Resource>
+        </cmd:VirtualCollection>
+    </cmd:Components>
+</cmd:CMD>
