Index: /extensions/jiwigo-ws-api/.classpath
===================================================================
--- /extensions/jiwigo-ws-api/.classpath	(revision 9387)
+++ /extensions/jiwigo-ws-api/.classpath	(revision 9387)
@@ -0,0 +1,24 @@
+<classpath>
+  <classpathentry kind="src" path="src/test/java" output="target/test-classes" including="**/*.java"/>
+  <classpathentry kind="src" path="src/test/resources" output="target/test-classes" excluding="**/*.java"/>
+  <classpathentry kind="src" path="src/main/java" including="**/*.java"/>
+  <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
+  <classpathentry kind="output" path="target/classes"/>
+  <classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.3/servlet-api-2.3.jar"/>
+  <classpathentry kind="var" path="M2_REPO/avalon-framework/avalon-framework/4.1.3/avalon-framework-4.1.3.jar"/>
+  <classpathentry kind="var" path="M2_REPO/commons-codec/commons-codec/1.2/commons-codec-1.2.jar"/>
+  <classpathentry kind="var" path="M2_REPO/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/commons-lang/commons-lang/2.5/commons-lang-2.5.jar"/>
+  <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1/commons-logging-1.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/net/iharder/filedrop/1.0/filedrop-1.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/com/jhlabs/filters/2.0.235/filters-2.0.235.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jdom/jdom/1.1/jdom-1.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/junit/junit/4.8.1/junit-4.8.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.16/log4j-1.2.16.jar"/>
+  <classpathentry kind="var" path="M2_REPO/logkit/logkit/1.0.1/logkit-1.0.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/com/drew/metadata-extractor/2.3.1/metadata-extractor-2.3.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/sanselan/sanselan/0.97-incubator/sanselan-0.97-incubator.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/swinglabs/swing-worker/1.1/swing-worker-1.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/swinglabs/swingx/1.6.1/swingx-1.6.1.jar"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+</classpath>
Index: /extensions/jiwigo-ws-api/.project
===================================================================
--- /extensions/jiwigo-ws-api/.project	(revision 9387)
+++ /extensions/jiwigo-ws-api/.project	(revision 9387)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>jiwigo-ws-api</name>
+	<comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.maven.ide.eclipse.maven2Builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.maven.ide.eclipse.maven2Nature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
Index: /extensions/jiwigo-ws-api/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- /extensions/jiwigo-ws-api/.settings/org.eclipse.jdt.core.prefs	(revision 9387)
+++ /extensions/jiwigo-ws-api/.settings/org.eclipse.jdt.core.prefs	(revision 9387)
@@ -0,0 +1,271 @@
+#Fri Aug 27 22:21:44 CEST 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=false
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false
+org.eclipse.jdt.core.formatter.comment.format_line_comments=false
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=120
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=mixed
+org.eclipse.jdt.core.formatter.tabulation.size=8
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
Index: /extensions/jiwigo-ws-api/.settings/org.eclipse.jdt.ui.prefs
===================================================================
--- /extensions/jiwigo-ws-api/.settings/org.eclipse.jdt.ui.prefs	(revision 9387)
+++ /extensions/jiwigo-ws-api/.settings/org.eclipse.jdt.ui.prefs	(revision 9387)
@@ -0,0 +1,56 @@
+#Fri Aug 27 21:19:26 CEST 2010
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_Java
+formatter_settings_version=11
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=true
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=false
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=false
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=false
+sp_cleanup.remove_unused_imports=false
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_blocks=false
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
Index: /extensions/jiwigo-ws-api/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- /extensions/jiwigo-ws-api/.settings/org.maven.ide.eclipse.prefs	(revision 9387)
+++ /extensions/jiwigo-ws-api/.settings/org.maven.ide.eclipse.prefs	(revision 9387)
@@ -0,0 +1,9 @@
+#Fri Aug 27 21:10:33 CEST 2010
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
Index: /extensions/jiwigo-ws-api/pom.xml
===================================================================
--- /extensions/jiwigo-ws-api/pom.xml	(revision 9387)
+++ /extensions/jiwigo-ws-api/pom.xml	(revision 9387)
@@ -0,0 +1,68 @@
+<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>fr.mael.jiwigo</groupId>
+  <artifactId>jiwigo-ws-api</artifactId>
+  <version>0.13</version>
+
+
+
+  <dependencies>
+
+
+	<dependency>
+	    <groupId>org.jdom</groupId>
+	    <artifactId>jdom</artifactId>
+	    <version>1.1</version>
+	</dependency>
+	<dependency>
+	    <groupId>commons-lang</groupId>
+	    <artifactId>commons-lang</artifactId>
+	    <version>2.5</version>
+	</dependency>
+	<dependency>
+	    <groupId>commons-httpclient</groupId>
+	    <artifactId>commons-httpclient</artifactId>
+	    <version>3.1</version>
+	</dependency>
+	<dependency>
+		<groupId>commons-logging</groupId>
+		<artifactId>commons-logging</artifactId>
+		<version>1.1</version>
+	</dependency>
+	<dependency>
+	    <groupId>log4j</groupId>
+	    <artifactId>log4j</artifactId>
+	    <version>1.2.16</version>
+	</dependency>
+	<dependency>
+	    <groupId>org.apache.sanselan</groupId>
+	    <artifactId>sanselan</artifactId>
+	    <version>0.97-incubator</version>
+	</dependency>
+	<dependency>
+	    <groupId>com.drew</groupId>
+	    <artifactId>metadata-extractor</artifactId>
+	    <version>2.3.1</version>
+	</dependency>
+	<dependency>
+	    <groupId>junit</groupId>
+	    <artifactId>junit</artifactId>
+	    <version>4.8.1</version>
+	</dependency>
+
+  </dependencies>
+
+  <build>
+  	<plugins>
+	  	<plugin>
+	        <artifactId>maven-assembly-plugin</artifactId>
+	        <version>2.2</version>
+	        <configuration>
+	          <descriptorRefs>
+	            <descriptorRef>jar-with-dependencies</descriptorRef>
+	          </descriptorRefs>
+	        </configuration>
+	  	</plugin>
+  	</plugins>
+  </build>
+</project>
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/CategoryDao.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/CategoryDao.java	(revision 9387)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/CategoryDao.java	(revision 9387)
@@ -0,0 +1,131 @@
+package fr.mael.jiwigo.dao;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jdom.Document;
+import org.jdom.Element;
+
+import fr.mael.jiwigo.om.Category;
+import fr.mael.jiwigo.transverse.enumeration.CategoryEnum;
+import fr.mael.jiwigo.transverse.enumeration.MethodsEnum;
+import fr.mael.jiwigo.transverse.session.SessionManager;
+import fr.mael.jiwigo.transverse.util.Outil;
+
+/*
+Copyright (c) 2010, Mael
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+ * Neither the name of jiwigo nor the
+   names of its contributors may be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL Mael BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+/**
+
+ * Dao for the categories
+ * @author mael
+ *
+ */
+public class CategoryDao {
+    /**
+     * Logger
+     */
+    public static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory
+	    .getLog(CategoryDao.class);
+    /**
+     * Instance to use a singleton
+     */
+    private static CategoryDao instance;
+
+    private SessionManager sessionManager;
+
+    /**
+     * Private constructor to use a singleton
+     */
+    private CategoryDao(SessionManager sessionManager) {
+	this.sessionManager = sessionManager;
+    }
+
+    /**
+     * @return the instance
+     */
+    public static CategoryDao getInstance(SessionManager sessionManager) {
+	if (instance == null) {
+	    instance = new CategoryDao(sessionManager);
+	}
+	return instance;
+    }
+
+    /**
+     * Lists the categories
+     * @param rafraichir true : uses the categories of the cache
+     * @param recursive true : recursive listing of the categories
+     * @return the list of categories
+     * @throws IOException
+     */
+    public List<Category> lister(boolean recursive) throws IOException {
+	Document doc = sessionManager.executerReturnDocument(MethodsEnum.LISTER_CATEGORIES.getLabel(), "recursive",
+		String.valueOf(recursive));
+	Element element = doc.getRootElement().getChild("categories");
+	List<Element> listElement = (List<Element>) element.getChildren("category");
+	ArrayList<Category> categories = new ArrayList<Category>();
+	for (Element cat : listElement) {
+	    Category myCat = new Category();
+	    myCat.setIdentifiant(Integer.valueOf(cat.getAttributeValue(CategoryEnum.ID.getLabel())));
+	    myCat.setUrlCategory(cat.getAttributeValue(CategoryEnum.URL.getLabel()));
+	    myCat.setNbImages(Integer.valueOf(cat.getAttributeValue(CategoryEnum.NB_IMAGES.getLabel())));
+	    myCat.setNbTotalImages(Integer.valueOf(cat.getAttributeValue(CategoryEnum.NB_TOTAL_IMAGES.getLabel())));
+	    myCat.setNom(cat.getChildText(CategoryEnum.NAME.getLabel()));
+	    String catMeres = cat.getChildText(CategoryEnum.CAT_MERES.getLabel());
+	    ArrayList<Integer> idCategoriesMeres = new ArrayList<Integer>();
+	    for (String catA : catMeres.split(",")) {
+		if (!catA.equals("")) {
+		    idCategoriesMeres.add(Integer.valueOf(catA));
+		}
+	    }
+	    myCat.setIdCategoriesMeres(idCategoriesMeres);
+	    categories.add(myCat);
+	}
+	return categories;
+    }
+
+    /**
+     * Creation of a category
+     * @param category the category to create
+     * @return true if the category is successfully created
+     */
+    public boolean creer(Category category) {
+	try {
+	    if (category.getParentDirect() != null) {
+		return Outil.checkOk(sessionManager.executerReturnDocument(MethodsEnum.AJOUTER_CATEGORIE.getLabel(),
+			"name", category.getNom(), "parent", String.valueOf(category.getParentDirect())));
+	    } else {
+		return Outil.checkOk(sessionManager.executerReturnDocument(MethodsEnum.AJOUTER_CATEGORIE.getLabel(),
+			"name", category.getNom()));
+	    }
+	} catch (IOException e) {
+	    LOG.error(Outil.getStackTrace(e));
+	}
+	return false;
+    }
+
+}
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/CommentDao.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/CommentDao.java	(revision 9387)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/CommentDao.java	(revision 9387)
@@ -0,0 +1,131 @@
+package fr.mael.jiwigo.dao;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jdom.Document;
+import org.jdom.Element;
+
+import fr.mael.jiwigo.om.Comment;
+import fr.mael.jiwigo.transverse.enumeration.MethodsEnum;
+import fr.mael.jiwigo.transverse.session.SessionManager;
+import fr.mael.jiwigo.transverse.util.Outil;
+
+/*
+Copyright (c) 2010, Mael
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+ * Neither the name of jiwigo nor the
+   names of its contributors may be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL Mael BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+/**
+
+ * Dao for the comments
+ * @author mael
+ *
+ */
+public class CommentDao {
+    /**
+     * Logger
+     */
+    public static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory
+	    .getLog(CommentDao.class);
+    /**
+     *  Instance that allows to use a singleton
+     */
+    private static CommentDao instance;
+
+    private SessionManager sessionManager;
+
+    /**
+     * private constructor, to use a singleton
+     */
+    private CommentDao(SessionManager sessionManager) {
+	this.sessionManager = sessionManager;
+    }
+
+    /**
+     * @return the singleton
+     */
+    public static CommentDao getInstance(SessionManager sessionManager) {
+	if (instance == null) {
+	    instance = new CommentDao(sessionManager);
+	}
+	return instance;
+    }
+
+    /**
+     * Listing of the comments for the given image
+     * @param idImage id of the  image
+     * @return list of comments
+     * @throws IOException
+     */
+    public List<Comment> lister(Integer idImage) throws IOException {
+	Document doc = (sessionManager.executerReturnDocument(MethodsEnum.GET_INFO.getLabel(), "image_id", String
+		.valueOf(idImage)));
+	Element element = doc.getRootElement().getChild("image").getChild("comments");
+	List<Element> listElement = (List<Element>) element.getChildren("comment");
+	ArrayList<Comment> comments = new ArrayList<Comment>();
+	for (Element com : listElement) {
+	    Comment myCom = new Comment();
+	    myCom.setIdentifiant(Integer.valueOf(com.getAttributeValue("id")));
+	    myCom.setDate(com.getAttributeValue("date"));
+	    myCom.setAuthor(com.getChildText("author"));
+	    myCom.setContent(com.getChildText("content"));
+	    comments.add(myCom);
+	}
+	return comments;
+    }
+
+    /**
+     * Gets the key essential to add a comment
+     * @param idImage the id of the image
+     * @return the key
+     * @throws IOException
+     */
+    public String getKey(Integer idImage) throws IOException {
+	Document doc = (sessionManager.executerReturnDocument(MethodsEnum.GET_INFO.getLabel(), "image_id", String
+		.valueOf(idImage)));
+	String key = doc.getRootElement().getChild("image").getChild("comment_post").getAttributeValue("key");
+	return key;
+    }
+
+    /**
+     * Creates a comment
+     * @param commentaire the comment to add
+     * @return true if the comment is successfully added
+     * @throws IOException
+     */
+    public boolean creer(Comment commentaire) throws IOException {
+	String key = getKey(commentaire.getImageId());
+	try {
+	    Thread.sleep(2200);
+	} catch (InterruptedException e) {
+	    e.printStackTrace();
+	}
+	return Outil.checkOk(sessionManager.executerReturnDocument(MethodsEnum.AJOUTER_COMMENTAIRE.getLabel(),
+		"image_id", String.valueOf(commentaire.getImageId()), "author", commentaire.getAuthor(), "content",
+		commentaire.getContent(), "key", key));
+
+    }
+}
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/ImageDao.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/ImageDao.java	(revision 9387)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/ImageDao.java	(revision 9387)
@@ -0,0 +1,263 @@
+package fr.mael.jiwigo.dao;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.jdom.Document;
+import org.jdom.Element;
+import org.jdom.output.XMLOutputter;
+
+import sun.misc.BASE64Encoder;
+import fr.mael.jiwigo.om.Image;
+import fr.mael.jiwigo.transverse.enumeration.MethodsEnum;
+import fr.mael.jiwigo.transverse.session.SessionManager;
+import fr.mael.jiwigo.transverse.util.Outil;
+
+/*
+Copyright (c) 2010, Mael
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+ * Neither the name of jiwigo nor the
+   names of its contributors may be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL Mael BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+/**
+
+ * Dao of the images
+ * @author mael
+ *
+ */
+public class ImageDao {
+
+    /**
+     * Logger
+     */
+    public static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory
+	    .getLog(ImageDao.class);
+
+    /**
+     * Singleton
+     */
+    private static ImageDao instance;
+
+    /**
+     * cache to avoid downloading image for each access
+     */
+    private HashMap<Integer, List<Image>> cache;
+
+    /**
+     *
+     */
+    private Integer firstCatInCache;
+
+    private SessionManager sessionManager;
+
+    /**
+     * Private singleton, to use a singleton
+     */
+    private ImageDao(SessionManager sessionManager) {
+	cache = new HashMap<Integer, List<Image>>();
+	this.sessionManager = sessionManager;
+    }
+
+    /**
+     * @return le singleton
+     */
+    public static ImageDao getInstance(SessionManager sessionManager) {
+	if (instance == null) {
+	    instance = new ImageDao(sessionManager);
+	}
+	return instance;
+    }
+
+    /**
+     * Lists all images
+     * @return the list of images
+     * @throws IOException
+     */
+    public List<Image> lister(boolean rafraichir) throws IOException {
+	return listerParCategory(null, rafraichir);
+    }
+
+    /**
+     * Listing of the images for a category
+     * @param categoryId the id of the category
+     * @return the list of images
+     * @throws IOException
+     */
+    public List<Image> listerParCategory(Integer categoryId, boolean rafraichir) throws IOException {
+	if (rafraichir || cache.get(categoryId) == null) {
+	    Document doc = null;
+
+	    if (categoryId != null) {
+		doc = sessionManager.executerReturnDocument(MethodsEnum.LISTER_IMAGES.getLabel(), "cat_id", String
+			.valueOf(categoryId));
+	    } else {
+		doc = sessionManager.executerReturnDocument(MethodsEnum.LISTER_IMAGES.getLabel());
+	    }
+	    Element element = doc.getRootElement().getChild("images");
+	    List<Image> images = getImagesFromElement(element);
+	    cache.remove(categoryId);
+	    cache.put(categoryId, images);
+	    if (firstCatInCache == null) {
+		firstCatInCache = categoryId;
+	    }
+	    return images;
+	} else {
+	    return cache.get(categoryId);
+	}
+    }
+
+    /**
+     * Creation of an image<br/>
+     * Sequence : <br/>
+     * <li>
+     * <ul>sending of the thumbnail in base64, thanks to the method addchunk.</ul>
+     * <ul>sending of the image in base64, thanks to the method addchunk</ul>
+     * <ul>using of the add method to add the image to the database<ul>
+     * </li>
+     * Finally, the response of the webservice is checked
+     *
+     * @param the image to create
+     * @return true if the creation of the image was the successful
+     * @throws Exception
+     */
+    //TODO ne pas continuer si une des réponses précédentes est négative
+    public boolean creer(Image image, Double chunkSize) throws Exception {
+	//thumbnail converted to base64
+	BASE64Encoder base64 = new BASE64Encoder();
+
+	String thumbnailBase64 = base64.encode(Outil.getBytesFromFile(image.getThumbnail()));
+	//sends the thumbnail and gets the result
+	Document reponseThumb = (sessionManager.executerReturnDocument("pwg.images.addChunk", "data", thumbnailBase64,
+		"type", "thumb", "position", "1", "original_sum", Outil.getMD5Checksum(image.getOriginale()
+			.getAbsolutePath())));
+
+	//begin feature:0001827
+	int chunk = chunkSize.intValue();
+	ArrayList<File> fichiersAEnvoyer = Outil.splitFile(image.getOriginale(), chunk);
+	boolean echec = false;
+	for (int i = 0; i < fichiersAEnvoyer.size(); i++) {
+	    File fichierAEnvoyer = fichiersAEnvoyer.get(i);
+	    String originaleBase64 = base64.encode(Outil.getBytesFromFile(fichierAEnvoyer));
+	    Document reponseOriginale = (sessionManager.executerReturnDocument("pwg.images.addChunk", "data",
+		    originaleBase64, "type", "file", "position", String.valueOf(i), "original_sum", Outil
+			    .getMD5Checksum(image.getOriginale().getAbsolutePath())));
+	    if (!Outil.checkOk(reponseOriginale)) {
+		echec = true;
+		break;
+	    }
+	}
+	//end
+
+	//add the image in the database and get the result of the webservice
+	Document reponseAjout = (sessionManager.executerReturnDocument("pwg.images.add", "file_sum", Outil
+		.getMD5Checksum(image.getOriginale().getAbsolutePath()), "thumbnail_sum", Outil.getMD5Checksum(image
+		.getThumbnail().getCanonicalPath()), "position", "1", "original_sum", Outil.getMD5Checksum(image
+		.getOriginale().getAbsolutePath()), "categories", String.valueOf(image.getIdCategory()), "name", image
+		.getName(), "author", sessionManager.getLogin(), "level", image.getPrivacyLevel()));
+	LOG.debug("Response add : " + Outil.documentToString(reponseAjout));
+	//	System.out.println(Main.sessionManager.executerReturnString("pwg.images.add", "file_sum", Outil
+	//		.getMD5Checksum(image.getOriginale().getAbsolutePath()), "thumbnail_sum", Outil.getMD5Checksum(image
+	//		.getThumbnail().getCanonicalPath()), "position", "1", "original_sum", Outil.getMD5Checksum(image
+	//		.getOriginale().getAbsolutePath()), "categories", String.valueOf(image.getIdCategory()), "name", image
+	//		.getName(), "author", Main.sessionManager.getLogin()));
+	//	Document reponsePrivacy = null;
+	//	if (Outil.checkOk(reponseAjout)) {
+	//	    reponsePrivacy = Main.sessionManager.executerReturnDocument(MethodsEnum.SET_PRIVACY_LEVEL.getLabel());
+	//	}
+	boolean reussite = true;
+	if (!Outil.checkOk(reponseThumb) || echec || !Outil.checkOk(reponseAjout)) {
+	    reussite = false;
+	}
+	suppressionFichierTemporaires();
+	return reussite;
+
+    }
+
+    /**
+     * Add tags to an image
+     * @param imageId id of the image
+     * @param tagId ids of the tags
+     * @throws IOException
+     */
+    public boolean addTags(Integer imageId, String tagId) throws IOException {
+	Document doc = sessionManager.executerReturnDocument(MethodsEnum.SET_INFO.getLabel(), "image_id", String
+		.valueOf(imageId), "tag_ids", tagId);
+	return Outil.checkOk(doc);
+
+    }
+
+    /**
+     * parse an element to find images
+     * @param element the element to parse
+     * @return the list of images
+     */
+    private List<Image> getImagesFromElement(Element element) {
+	List<Element> listElement = (List<Element>) element.getChildren("image");
+	ArrayList<Image> images = new ArrayList<Image>();
+	for (Element im : listElement) {
+	    Image myImage = new Image();
+	    myImage.setMiniature(im.getAttributeValue("tn_url"));
+	    myImage.setUrl(im.getAttributeValue("element_url"));
+	    myImage.setWidth(Integer.valueOf(im.getAttributeValue("width")));
+	    myImage.setHeight(Integer.valueOf(im.getAttributeValue("height")));
+	    myImage.setFile(im.getAttributeValue("file"));
+	    myImage.setVue(Integer.valueOf(im.getAttributeValue("hit")));
+	    myImage.setIdentifiant(Integer.valueOf(im.getAttributeValue("id")));
+	    myImage.setName(im.getChildText("name"));
+	    System.out.println(new XMLOutputter().outputString(im));
+	    //	    myImage.setIdCategory(Integer.valueOf(im.getChild("categories").getChild("category")
+	    //		    .getAttributeValue("id")));
+	    if (myImage.getName() == null) {
+		myImage.setName(myImage.getFile());
+	    }
+	    images.add(myImage);
+	}
+	return images;
+    }
+
+    /**
+     * Search images
+     * @param searchString the string to search
+     * @return the list of images matching the string
+     * @throws IOException
+     */
+    public List<Image> search(String searchString) throws IOException {
+	Document doc = sessionManager.executerReturnDocument(MethodsEnum.SEARCH.getLabel(), "query", searchString);
+	LOG.debug(doc);
+	Element element = doc.getRootElement().getChild("images");
+	return getImagesFromElement(element);
+
+    }
+
+    private void suppressionFichierTemporaires() {
+	File file = new File(System.getProperty("java.io.tmpdir") + "/originale.jpg");
+	file.delete();
+	file = new File(System.getProperty("java.io.tmpdir") + "/thumb.jpg");
+	file.delete();
+
+    }
+
+}
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/TagDao.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/TagDao.java	(revision 9387)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/TagDao.java	(revision 9387)
@@ -0,0 +1,136 @@
+package fr.mael.jiwigo.dao;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jdom.Document;
+import org.jdom.Element;
+
+import fr.mael.jiwigo.om.Image;
+import fr.mael.jiwigo.om.Tag;
+import fr.mael.jiwigo.transverse.enumeration.MethodsEnum;
+import fr.mael.jiwigo.transverse.enumeration.TagEnum;
+import fr.mael.jiwigo.transverse.session.SessionManager;
+import fr.mael.jiwigo.transverse.util.Outil;
+/*
+   Copyright (c) 2010, Mael
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions are met:
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+    * Neither the name of jiwigo nor the
+      names of its contributors may be used to endorse or promote products
+      derived from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+   ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+   DISCLAIMED. IN NO EVENT SHALL Mael BE LIABLE FOR ANY
+   DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+   LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+   ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+/**
+ * Dao of the categories
+ * @author mael
+ *
+ */
+public class TagDao {
+    /**
+     * Logger
+     */
+    public static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory.getLog(TagDao.class);
+    /**
+     * Instance, to use a singleton
+     */
+    private static TagDao instance;
+
+    private SessionManager sessionManager;
+
+    /**
+     * private constructor to use a singleton
+     */
+    private TagDao(SessionManager sessionManager) {
+	this.sessionManager = sessionManager;
+    }
+
+    /**
+     * @return the instance
+     */
+    public static TagDao getInstance(SessionManager sessionManager) {
+	if (instance == null) {
+	    instance = new TagDao(sessionManager);
+	}
+	return instance;
+    }
+
+    /**
+     * lists the tags
+     * @return the list of tags
+     * @throws IOException
+     */
+    public List<Tag> lister() throws IOException {
+	Document doc = sessionManager.executerReturnDocument(MethodsEnum.TAGS_ADMIN_LIST.getLabel());
+	//	System.out.println(Outil.documentToString(doc));
+	return getTagsFromDocument(doc.getRootElement().getChild("tags"));
+
+    }
+
+    /**
+     * COnstructs a list of tags from a document
+     * @param doc the document
+     * @return the list of tags
+     */
+    private List<Tag> getTagsFromDocument(Element element) {
+
+	List<Element> listElement = (List<Element>) element.getChildren("tag");
+	ArrayList<Tag> tags = new ArrayList<Tag>();
+	for (Element tagElement : listElement) {
+	    Tag tag = new Tag();
+	    tag.setId(Integer.valueOf(tagElement.getAttributeValue(TagEnum.ID.getLabel())));
+	    tag.setNom(tagElement.getAttributeValue(TagEnum.NAME.getLabel()));
+	    tags.add(tag);
+	}
+	return tags;
+
+    }
+
+    /**
+     * Creation of a tag
+     * @param tag the tag to create
+     * @return true if the tag as been successfully created
+     */
+    public boolean creer(Tag tag) {
+	try {
+	    return Outil.checkOk(sessionManager.executerReturnDocument(MethodsEnum.ADD_TAG.getLabel(), "name", tag
+		    .getNom()));
+	} catch (IOException e) {
+	    LOG.error(Outil.getStackTrace(e));
+	}
+	return false;
+    }
+
+    /**
+     * Function that returns the tags for an image
+     * @param image the image
+     * @return the tags list
+     * @throws IOException
+     */
+    public List<Tag> tagsForImage(Image image) throws IOException {
+	Document doc = sessionManager.executerReturnDocument(MethodsEnum.GET_INFO.getLabel(), "image_id", String
+		.valueOf(image.getIdentifiant()));
+	return getTagsFromDocument(doc.getRootElement().getChild("image").getChild("tags"));
+    }
+
+}
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/om/Category.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/om/Category.java	(revision 9387)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/om/Category.java	(revision 9387)
@@ -0,0 +1,210 @@
+package fr.mael.jiwigo.om;
+
+import java.util.ArrayList;
+
+import org.jdom.Element;
+
+/*
+Copyright (c) 2010, Mael
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+ * Neither the name of jiwigo nor the
+   names of its contributors may be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL Mael BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+/**
+
+ * @author mael
+ *
+ */
+public class Category {
+
+    private ArrayList<Integer> idCategoriesMeres;
+    private Integer identifiant;
+    private String urlCategory;
+    private Integer nbImages;
+    private Integer nbTotalImages;
+    private ArrayList<Category> categoriesFilles;
+    private ArrayList<Category> categoriesMeres;
+    private String nom;
+    private Element element;
+    private Integer parentDirect;
+    private Integer level;
+
+    public Category() {
+	categoriesFilles = new ArrayList<Category>();
+	categoriesMeres = new ArrayList<Category>();
+    }
+
+    @Override
+    public String toString() {
+	return nom;
+    }
+
+    /**
+     * @return the idCategoriesMeres
+     */
+    public ArrayList<Integer> getIdCategoriesMeres() {
+	return idCategoriesMeres;
+    }
+
+    /**
+     * @param idCategoriesMeres the idCategoriesMeres to set
+     */
+    public void setIdCategoriesMeres(ArrayList<Integer> idCategoriesMeres) {
+	this.idCategoriesMeres = idCategoriesMeres;
+    }
+
+    /**
+     * @return the identifiant
+     */
+    public Integer getIdentifiant() {
+	return identifiant;
+    }
+
+    /**
+     * @param identifiant the identifiant to set
+     */
+    public void setIdentifiant(Integer identifiant) {
+	this.identifiant = identifiant;
+    }
+
+    /**
+     * @return the urlCategory
+     */
+    public String getUrlCategory() {
+	return urlCategory;
+    }
+
+    /**
+     * @param urlCategory the urlCategory to set
+     */
+    public void setUrlCategory(String urlCategory) {
+	this.urlCategory = urlCategory;
+    }
+
+    /**
+     * @return the nbImages
+     */
+    public Integer getNbImages() {
+	return nbImages;
+    }
+
+    /**
+     * @param nbImages the nbImages to set
+     */
+    public void setNbImages(Integer nbImages) {
+	this.nbImages = nbImages;
+    }
+
+    /**
+     * @return the nbTotalImages
+     */
+    public Integer getNbTotalImages() {
+	return nbTotalImages;
+    }
+
+    /**
+     * @param nbTotalImages the nbTotalImages to set
+     */
+    public void setNbTotalImages(Integer nbTotalImages) {
+	this.nbTotalImages = nbTotalImages;
+    }
+
+    /**
+     * @return the categoriesFilles
+     */
+    public ArrayList<Category> getCategoriesFilles() {
+	return categoriesFilles;
+    }
+
+    /**
+     * @param categoriesFilles the categoriesFilles to set
+     */
+    public void setCategoriesFilles(ArrayList<Category> categoriesFilles) {
+	this.categoriesFilles = categoriesFilles;
+    }
+
+    /**
+     * @return the categoriesMeres
+     */
+    public ArrayList<Category> getCategoriesMeres() {
+	return categoriesMeres;
+    }
+
+    /**
+     * @param categoriesMeres the categoriesMeres to set
+     */
+    public void setCategoriesMeres(ArrayList<Category> categoriesMeres) {
+	this.categoriesMeres = categoriesMeres;
+    }
+
+    /**
+     * @return the nom
+     */
+    public String getNom() {
+	return nom;
+    }
+
+    /**
+     * @param nom the nom to set
+     */
+    public void setNom(String nom) {
+	this.nom = nom;
+    }
+
+    /**
+     * @return the element
+     */
+    public Element getElement() {
+	return element;
+    }
+
+    /**
+     * @param element the element to set
+     */
+    public void setElement(Element element) {
+	this.element = element;
+    }
+
+    /**
+     * @return the parentDirect
+     */
+    public Integer getParentDirect() {
+	return parentDirect;
+    }
+
+    /**
+     * @param parentDirect the parentDirect to set
+     */
+    public void setParentDirect(Integer parentDirect) {
+	this.parentDirect = parentDirect;
+    }
+
+    public Integer getLevel() {
+	return level;
+    }
+
+    public void setLevel(Integer level) {
+	this.level = level;
+    }
+
+}
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/om/Comment.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/om/Comment.java	(revision 9387)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/om/Comment.java	(revision 9387)
@@ -0,0 +1,126 @@
+package fr.mael.jiwigo.om;
+
+/*
+Copyright (c) 2010, Mael
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+ * Neither the name of jiwigo nor the
+   names of its contributors may be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL Mael BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+/**
+ *
+ * @author mael
+ *
+ */
+public class Comment {
+    private Integer imageId;
+    private String author;
+    private String content;
+    private String key;
+    private Integer identifiant;
+    private String date;
+
+    /**
+     * @return the imageId
+     */
+    public Integer getImageId() {
+	return imageId;
+    }
+
+    /**
+     * @param imageId the imageId to set
+     */
+    public void setImageId(Integer imageId) {
+	this.imageId = imageId;
+    }
+
+    /**
+     * @return the author
+     */
+    public String getAuthor() {
+	return author;
+    }
+
+    /**
+     * @param author the author to set
+     */
+    public void setAuthor(String author) {
+	this.author = author;
+    }
+
+    /**
+     * @return the content
+     */
+    public String getContent() {
+	return content;
+    }
+
+    /**
+     * @param content the content to set
+     */
+    public void setContent(String content) {
+	this.content = content;
+    }
+
+    /**
+     * @return the key
+     */
+    public String getKey() {
+	return key;
+    }
+
+    /**
+     * @param key the key to set
+     */
+    public void setKey(String key) {
+	this.key = key;
+    }
+
+    /**
+     * @return the identifiant
+     */
+    public Integer getIdentifiant() {
+	return identifiant;
+    }
+
+    /**
+     * @param identifiant the identifiant to set
+     */
+    public void setIdentifiant(Integer identifiant) {
+	this.identifiant = identifiant;
+    }
+
+    /**
+     * @return the date
+     */
+    public String getDate() {
+	return date;
+    }
+
+    /**
+     * @param date the date to set
+     */
+    public void setDate(String date) {
+	this.date = date;
+    }
+
+}
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/om/Image.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/om/Image.java	(revision 9387)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/om/Image.java	(revision 9387)
@@ -0,0 +1,241 @@
+package fr.mael.jiwigo.om;
+
+import java.io.File;
+
+/*
+Copyright (c) 2010, Mael
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+ * Neither the name of jiwigo nor the
+   names of its contributors may be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL Mael BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+/**
+ *
+
+ * @author mael
+ *
+ */
+public class Image {
+    private String miniature;
+    private String url;
+    private Integer width;
+    private Integer height;
+    private String file;
+    private Integer identifiant;
+    private Integer vue;
+    private String name;
+    private Integer idCategory;
+    private String auteur;
+    private File thumbnail;
+    private String privacyLevel;
+
+    /**
+     * @return the privacyLevel
+     */
+    public String getPrivacyLevel() {
+	return privacyLevel;
+    }
+
+    /**
+     * @param privacyLevel the privacyLevel to set
+     */
+    public void setPrivacyLevel(String privacyLevel) {
+	this.privacyLevel = privacyLevel;
+    }
+
+    /**
+     * @return the auteur
+     */
+    public String getAuteur() {
+	return auteur;
+    }
+
+    /**
+     * @param auteur the auteur to set
+     */
+    public void setAuteur(String auteur) {
+	this.auteur = auteur;
+    }
+
+    /**
+     * @return the thumbnail
+     */
+    public File getThumbnail() {
+	return thumbnail;
+    }
+
+    /**
+     * @param thumbnail the thumbnail to set
+     */
+    public void setThumbnail(File thumbnail) {
+	this.thumbnail = thumbnail;
+    }
+
+    /**
+     * @return the originale
+     */
+    public File getOriginale() {
+	return originale;
+    }
+
+    /**
+     * @param originale the originale to set
+     */
+    public void setOriginale(File originale) {
+	this.originale = originale;
+    }
+
+    private File originale;
+
+    @Override
+    public String toString() {
+	// TODO Auto-generated method stub
+	return name;
+    }
+
+    /**
+     * @return the miniature
+     */
+    public String getMiniature() {
+	return miniature;
+    }
+
+    /**
+     * @param miniature the miniature to set
+     */
+    public void setMiniature(String miniature) {
+	this.miniature = miniature;
+    }
+
+    /**
+     * @return the url
+     */
+    public String getUrl() {
+	return url;
+    }
+
+    /**
+     * @param url the url to set
+     */
+    public void setUrl(String url) {
+	this.url = url;
+    }
+
+    /**
+     * @return the width
+     */
+    public Integer getWidth() {
+	return width;
+    }
+
+    /**
+     * @param width the width to set
+     */
+    public void setWidth(Integer width) {
+	this.width = width;
+    }
+
+    /**
+     * @return the height
+     */
+    public Integer getHeight() {
+	return height;
+    }
+
+    /**
+     * @param height the height to set
+     */
+    public void setHeight(Integer height) {
+	this.height = height;
+    }
+
+    /**
+     * @return the file
+     */
+    public String getFile() {
+	return file;
+    }
+
+    /**
+     * @param file the file to set
+     */
+    public void setFile(String file) {
+	this.file = file;
+    }
+
+    /**
+     * @return the identifiant
+     */
+    public Integer getIdentifiant() {
+	return identifiant;
+    }
+
+    /**
+     * @param identifiant the identifiant to set
+     */
+    public void setIdentifiant(Integer identifiant) {
+	this.identifiant = identifiant;
+    }
+
+    /**
+     * @return the vue
+     */
+    public Integer getVue() {
+	return vue;
+    }
+
+    /**
+     * @param vue the vue to set
+     */
+    public void setVue(Integer vue) {
+	this.vue = vue;
+    }
+
+    /**
+     * @return the name
+     */
+    public String getName() {
+	return name;
+    }
+
+    /**
+     * @param name the name to set
+     */
+    public void setName(String name) {
+	this.name = name;
+    }
+
+    /**
+     * @return the idCategory
+     */
+    public Integer getIdCategory() {
+	return idCategory;
+    }
+
+    /**
+     * @param idCategory the idCategory to set
+     */
+    public void setIdCategory(Integer idCategory) {
+	this.idCategory = idCategory;
+    }
+
+}
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/om/Tag.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/om/Tag.java	(revision 9387)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/om/Tag.java	(revision 9387)
@@ -0,0 +1,78 @@
+package fr.mael.jiwigo.om;
+
+/*
+Copyright (c) 2010, Mael
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+ * Neither the name of jiwigo nor the
+   names of its contributors may be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL Mael BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+/**
+
+* @author mael
+*
+*/
+public class Tag {
+    /**
+     * Name of the tag
+     */
+    private String nom;
+
+    /**
+     * Id of the tag
+     */
+    private Integer identifiant;
+
+    /**
+     * @return the nom
+     */
+    public String getNom() {
+	return nom;
+    }
+
+    /**
+     * @param nom the nom to set
+     */
+    public void setNom(String nom) {
+	this.nom = nom;
+    }
+
+    /**
+     * @return the id
+     */
+    public Integer getId() {
+	return identifiant;
+    }
+
+    /**
+     * @param id the id to set
+     */
+    public void setId(Integer id) {
+	this.identifiant = id;
+    }
+
+    @Override
+    public String toString() {
+	// TODO Auto-generated method stub
+	return nom;
+    }
+}
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/CategoryService.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/CategoryService.java	(revision 9387)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/CategoryService.java	(revision 9387)
@@ -0,0 +1,130 @@
+package fr.mael.jiwigo.service;
+
+import java.io.IOException;
+import java.util.List;
+
+import fr.mael.jiwigo.dao.CategoryDao;
+import fr.mael.jiwigo.om.Category;
+import fr.mael.jiwigo.transverse.session.SessionManager;
+
+/*
+Copyright (c) 2010, Mael
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+ * Neither the name of jiwigo nor the
+   names of its contributors may be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL Mael BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+/**
+
+ * @author mael
+ *
+ */
+public class CategoryService {
+    /**
+     * Logger
+     */
+    public static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory
+	    .getLog(CategoryService.class);
+
+    /**
+     * singleton
+     */
+    private static CategoryService instance;
+
+    private SessionManager sessionManager;
+
+    /**
+     * @return the singleton
+     */
+    public static CategoryService getInstance(SessionManager sessionManager) {
+	if (instance == null) {
+	    instance = new CategoryService(sessionManager);
+	}
+	return instance;
+    }
+
+    /**
+     * private constructor to use a singleton
+     */
+    private CategoryService(SessionManager sessionManager) {
+	this.sessionManager = sessionManager;
+
+    }
+
+    /**
+     * Lists all categories
+     * @param rafraichir true to refresh
+     * @param recursive true : recursive listing
+     * @return the list of categories
+     * @throws IOException
+     */
+    public List<Category> lister(boolean recursive) throws IOException {
+	return CategoryDao.getInstance(sessionManager).lister(recursive);
+    }
+
+    /**
+     * Allows to create the categories tree
+     * @return list of categories
+     * @throws IOException
+     */
+    public List<Category> makeTree() throws IOException {
+	List<Category> list = CategoryDao.getInstance(sessionManager).lister(true);
+	for (Category category : list) {
+	    for (Category category2 : list) {
+		if (category2.getIdCategoriesMeres().size() != 1
+			&& category.getIdentifiant().equals(
+				category2.getIdCategoriesMeres().get(category2.getIdCategoriesMeres().size() - 2))) {
+		    category.getCategoriesFilles().add(category2);
+		    category2.getCategoriesMeres().add(category);
+		}
+
+	    }
+	}
+
+	return list;
+
+    }
+
+    /**
+     * creation of a category
+     * @param nom name of the category
+     * @param parent parent category
+     * @return true if successful
+     */
+    public boolean creer(String nom, Integer parent) {
+	Category category = new Category();
+	category.setParentDirect(parent);
+	category.setNom(nom);
+	return CategoryDao.getInstance(sessionManager).creer(category);
+    }
+
+    /**
+     * creation of a category without parent
+     * @param nom name of the category
+     * @return true if successful
+     */
+    public boolean creer(String nom) {
+	Category category = new Category();
+	category.setNom(nom);
+	return CategoryDao.getInstance(sessionManager).creer(category);
+    }
+}
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/CommentService.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/CommentService.java	(revision 9387)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/CommentService.java	(revision 9387)
@@ -0,0 +1,98 @@
+package fr.mael.jiwigo.service;
+
+import java.io.IOException;
+import java.util.List;
+
+import fr.mael.jiwigo.dao.CommentDao;
+import fr.mael.jiwigo.om.Comment;
+import fr.mael.jiwigo.transverse.session.SessionManager;
+
+/*
+Copyright (c) 2010, Mael
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+ * Neither the name of jiwigo nor the
+   names of its contributors may be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL Mael BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+/**
+
+ * @author mael
+ *
+ */
+public class CommentService {
+    /**
+     * Logger
+     */
+    public static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory
+	    .getLog(CommentService.class);
+
+    /**
+     * singleton
+     */
+    private static CommentService instance;
+
+    private SessionManager sessionManager;
+
+    /**
+     * @return the singleton
+     */
+    public static CommentService getInstance(SessionManager sessionManager) {
+	if (instance == null) {
+	    instance = new CommentService(sessionManager);
+	}
+	return instance;
+    }
+
+    /**
+     * private constructor, to use a singleton
+     */
+    private CommentService(SessionManager sessionManager) {
+	this.sessionManager = sessionManager;
+    }
+
+    /**
+     * Lists all comments for an image
+     * @param imageId the id of the image
+     * @return the list of comments
+     * @throws IOException
+     */
+    public List<Comment> lister(Integer imageId) throws IOException {
+	return CommentDao.getInstance(sessionManager).lister(imageId);
+    }
+
+    /**
+     * Creates a comment for an image
+     * @param content the comment
+     * @param imageId the id of the image
+     * @param auteur the author of the comment
+     * @return true if successful
+     * @throws IOException
+     */
+    public boolean creer(String content, Integer imageId, String auteur) throws IOException {
+	Comment commentaire = new Comment();
+	commentaire.setContent(content);
+	commentaire.setImageId(imageId);
+	commentaire.setAuthor(auteur);
+	return CommentDao.getInstance(sessionManager).creer(commentaire);
+    }
+
+}
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/ImageService.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/ImageService.java	(revision 9387)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/ImageService.java	(revision 9387)
@@ -0,0 +1,169 @@
+package fr.mael.jiwigo.service;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+
+import fr.mael.jiwigo.dao.ImageDao;
+import fr.mael.jiwigo.om.Image;
+import fr.mael.jiwigo.transverse.session.SessionManager;
+import fr.mael.jiwigo.transverse.util.ImagesUtil;
+import fr.mael.jiwigo.transverse.util.Outil;
+
+/*
+Copyright (c) 2010, Mael
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+ * Neither the name of jiwigo nor the
+   names of its contributors may be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL Mael BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+/**
+ *
+
+ * @author mael
+ *
+ */
+public class ImageService {
+
+    /**
+     * Logger
+     */
+    public static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory
+	    .getLog(ImageService.class);
+
+    /**
+     * Singleton
+     */
+    private static ImageService instance;
+
+    private SessionManager sessionManager;
+
+    /**
+     * @return the singleton
+     */
+    public static ImageService getInstance(SessionManager sessionManager) {
+	if (instance == null) {
+	    instance = new ImageService(sessionManager);
+	}
+	return instance;
+    }
+
+    /**
+     * private constructor to use a singleton
+     */
+    private ImageService(SessionManager sessionManager) {
+	this.sessionManager = sessionManager;
+    }
+
+    /**
+     * Lists all images for a category
+     * @param categoryId the id of the category
+     * @param rafraichir true : refresh the list of images
+     * @return the list of images
+     * @throws IOException
+     */
+    public List<Image> listerParCategory(Integer categoryId, boolean rafraichir) throws IOException {
+	return ImageDao.getInstance(sessionManager).listerParCategory(categoryId, rafraichir);
+    }
+
+    /**
+     * Method called to send an image to the server.
+     * @param filePath
+     * @param idCategory
+     * @param originalWidth width for the original image
+     * @param originalHeight height for the original image
+     * @return
+     * @throws Exception
+     */
+    public boolean creer(String filePath, Integer idCategory, Integer originalWidth, Integer originalHeight,
+	    Double chunckSize, Integer privacyLevel) throws Exception {
+	File originalFile = new File(filePath);
+	//get the byte array of the original file, to keep metadata
+	byte[] bytesFichierOriginal = Outil.getBytesFromFile(originalFile);
+
+	//resize the picture (or not)
+	boolean originaleRedimensionnee = ImagesUtil.scale(filePath, "originale.jpg", originalWidth, originalHeight);
+	//create the thumbnail
+	ImagesUtil.scale(filePath, "thumb.jpg", 120, 90);
+	//get the thumbnail
+	File thumbnail = new File(System.getProperty("java.io.tmpdir") + "/thumb.jpg");
+	File originale = null;
+	if (originaleRedimensionnee) {
+	    originale = new File(System.getProperty("java.io.tmpdir") + "/originale.jpg");
+	    //if the original file has been resized, we put the metadata in the resized file
+	    //I use here a try catch because if the original file isn't a jpeg
+	    //the methode Outil.enrich will fail, but the procedure has to continue
+	    try {
+		byte[] fichierEnrichi = Outil.enrich(bytesFichierOriginal, Outil.getBytesFromFile(new File(System
+			.getProperty("java.io.tmpdir")
+			+ "/originale.jpg")));
+		Outil.byteToFile(System.getProperty("java.io.tmpdir") + "/originale.jpg", fichierEnrichi);
+	    } catch (Exception e) {
+	    }
+	} else {
+	    originale = originalFile;
+
+	}
+	Image image = new Image();
+	image.setName(getImageName(filePath));
+	image.setThumbnail(thumbnail);
+	image.setOriginale(originale);
+	image.setIdCategory(idCategory);
+	image.setPrivacyLevel(String.valueOf(privacyLevel));
+	//now we call the dao to send the image to the webservice
+	return ImageDao.getInstance(sessionManager).creer(image, chunckSize);
+    }
+
+    /**
+     * Add tags to an existing image
+     * @param image the image
+     * @param tagId the ids of the tags
+     * @return true if successful
+     * @throws IOException
+     */
+    public boolean addTags(Image image, String tagId) throws IOException {
+	return ImageDao.getInstance(sessionManager).addTags(image.getIdentifiant(), tagId);
+    }
+
+    /**
+     * Search images from a string
+     * @param queryString the string
+     * @return images matching the string
+     * @throws IOException
+     */
+    public List<Image> search(String queryString) throws IOException {
+	return ImageDao.getInstance(sessionManager).search(queryString);
+    }
+
+    /**
+     * Deletes the file extension
+     * @param path
+     * @return
+     */
+    private String getImageName(String path) {
+	File fichier = new File(path);
+	StringBuffer name = new StringBuffer(fichier.getName());
+	return (name.delete(name.lastIndexOf("."), name.length())).toString();
+
+    }
+
+}
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/TagService.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/TagService.java	(revision 9387)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/TagService.java	(revision 9387)
@@ -0,0 +1,105 @@
+package fr.mael.jiwigo.service;
+
+import java.io.IOException;
+import java.util.List;
+
+import fr.mael.jiwigo.dao.TagDao;
+import fr.mael.jiwigo.om.Image;
+import fr.mael.jiwigo.om.Tag;
+import fr.mael.jiwigo.transverse.session.SessionManager;
+
+/*
+Copyright (c) 2010, Mael
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+ * Neither the name of jiwigo nor the
+   names of its contributors may be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL Mael BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+/**
+ *
+
+ * @author mael
+ *
+ */
+public class TagService {
+    /**
+     * Logger
+     */
+    public static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory
+	    .getLog(TagService.class);
+
+    /**
+     * The instance, to use a singleton
+     */
+    private static TagService instance;
+
+    private SessionManager sessionManager;
+
+    /**
+     * @return the singleton
+     */
+    public static TagService getInstance(SessionManager sessionManager) {
+	if (instance == null) {
+	    instance = new TagService(sessionManager);
+	}
+	return instance;
+    }
+
+    /**
+     * private constructor
+     */
+    private TagService(SessionManager sessionManager) {
+	this.sessionManager = sessionManager;
+    }
+
+    /**
+     * Lists all tags
+     * @return le list of tags
+     * @throws IOException
+     */
+    public List<Tag> lister() throws IOException {
+	return TagDao.getInstance(sessionManager).lister();
+    }
+
+    /**
+     * Creates a tag
+     * @param nom name of the tag
+     * @return true if the tag is created
+     * @throws IOException
+     */
+    public boolean creer(String nom) throws IOException {
+	Tag tag = new Tag();
+	tag.setNom(nom);
+	return TagDao.getInstance(sessionManager).creer(tag);
+    }
+
+    /**
+     * Returns all the tag for an image
+     * @param image the image to check
+     * @return the list of tags
+     * @throws IOException
+     */
+    public List<Tag> tagsForImage(Image image) throws IOException {
+	return TagDao.getInstance(sessionManager).tagsForImage(image);
+    }
+
+}
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/enumeration/CacheEnum.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/enumeration/CacheEnum.java	(revision 9387)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/enumeration/CacheEnum.java	(revision 9387)
@@ -0,0 +1,51 @@
+/**
+ *
+ */
+package fr.mael.jiwigo.transverse.enumeration;
+
+/*
+Copyright (c) 2010, Mael
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+ * Neither the name of jiwigo nor the
+   names of its contributors may be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL Mael BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+/**
+
+ * @author mael
+ *
+ */
+public enum CacheEnum {
+
+    MAX_IMAGES_IN_IMAGE_DAO(10);
+
+    protected Integer nb;
+
+    /** Constructeur */
+    CacheEnum(Integer pNb) {
+	this.nb = pNb;
+    }
+
+    public Integer getNb() {
+	return this.nb;
+    }
+}
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/enumeration/CategoryEnum.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/enumeration/CategoryEnum.java	(revision 9387)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/enumeration/CategoryEnum.java	(revision 9387)
@@ -0,0 +1,52 @@
+/**
+ *
+ */
+package fr.mael.jiwigo.transverse.enumeration;
+
+/*
+Copyright (c) 2010, Mael
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+ * Neither the name of jiwigo nor the
+   names of its contributors may be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL Mael BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+/**
+
+ * @author mael
+ *
+ */
+public enum CategoryEnum {
+
+    ID("id"), NB_IMAGES("nb_images"), NB_TOTAL_IMAGES("total_nb_images"), URL("url"), NAME("name"), CAT_MERES(
+	    "uppercats");
+
+    protected String label;
+
+    /** Constructeur */
+    CategoryEnum(String pLabel) {
+	this.label = pLabel;
+    }
+
+    public String getLabel() {
+	return this.label;
+    }
+}
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/enumeration/MethodsEnum.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/enumeration/MethodsEnum.java	(revision 9387)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/enumeration/MethodsEnum.java	(revision 9387)
@@ -0,0 +1,55 @@
+/**
+ *
+ */
+package fr.mael.jiwigo.transverse.enumeration;
+
+/*
+Copyright (c) 2010, Mael
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+ * Neither the name of jiwigo nor the
+   names of its contributors may be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL Mael BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+/**
+
+ * Lists the methods of the webservice
+ * @author mael
+ *
+ */
+public enum MethodsEnum {
+
+    LOGIN("pwg.session.login"), LISTER_CATEGORIES("pwg.categories.getList"), LISTER_IMAGES("pwg.categories.getImages"), GET_INFO(
+	    "pwg.images.getInfo"), AJOUTER_CATEGORIE("pwg.categories.add"), AJOUTER_COMMENTAIRE("pwg.images.addComment"), LISTER_TAGS(
+	    "pwg.tags.getList"), TAGS_ADMIN_LIST("pwg.tags.getAdminList"), ADD_TAG("pwg.tags.add"), SET_INFO(
+	    "pwg.images.setInfo"), SEARCH("pwg.images.search"), SET_PRIVACY_LEVEL("pwg.images.setPrivacyLevel");
+
+    protected String label;
+
+    /** Constructeur */
+    MethodsEnum(String pLabel) {
+	this.label = pLabel;
+    }
+
+    public String getLabel() {
+	return this.label;
+    }
+}
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/enumeration/TagEnum.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/enumeration/TagEnum.java	(revision 9387)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/enumeration/TagEnum.java	(revision 9387)
@@ -0,0 +1,51 @@
+/**
+ *
+ */
+package fr.mael.jiwigo.transverse.enumeration;
+
+/*
+Copyright (c) 2010, Mael
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+ * Neither the name of jiwigo nor the
+   names of its contributors may be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL Mael BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+/**
+
+ * @author mael
+ *
+ */
+public enum TagEnum {
+
+    ID("id"), NAME("name");
+
+    protected String label;
+
+    /** Constructeur */
+    TagEnum(String pLabel) {
+	this.label = pLabel;
+    }
+
+    public String getLabel() {
+	return this.label;
+    }
+}
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/session/SessionManager.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/session/SessionManager.java	(revision 9387)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/session/SessionManager.java	(revision 9387)
@@ -0,0 +1,321 @@
+package fr.mael.jiwigo.transverse.session;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+
+import org.apache.commons.httpclient.Credentials;
+import org.apache.commons.httpclient.HostConfiguration;
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpException;
+import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
+import org.apache.commons.httpclient.UsernamePasswordCredentials;
+import org.apache.commons.httpclient.auth.AuthScope;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.lang.StringUtils;
+import org.jdom.Document;
+import org.jdom.JDOMException;
+
+import fr.mael.jiwigo.transverse.enumeration.MethodsEnum;
+import fr.mael.jiwigo.transverse.util.Outil;
+
+/*
+Copyright (c) 2010, Mael
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+ * Neither the name of jiwigo nor the
+   names of its contributors may be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL Mael BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+/**
+
+ * @author mael
+ * Gestionnaire de connexion
+ */
+public class SessionManager {
+
+    /**
+     * Logger
+     */
+    public static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory
+	    .getLog(SessionManager.class);
+    /**
+     * the entered login
+     */
+    private String login;
+    /**
+     * the entered password
+     */
+    private String motDePasse;
+    /**
+     * the url of the site
+     */
+    private String url;
+    /**
+     * the http client
+     */
+    private HttpClient client;
+
+    /**
+     * defines if the user uses a proxy
+     */
+    private boolean usesProxy;
+
+    /**
+     * url of the proxy
+     */
+    private String urlProxy;
+
+    /**
+     * port of the proxy
+     */
+    private int portProxy;
+
+    /**
+     * login for the proxy
+     */
+    private String loginProxy;
+
+    /**
+     * pass for the proxy
+     */
+    private String passProxy;
+
+    /**
+     * true : an error was found for the proxy
+     */
+    private boolean erreurProxy;
+
+    /**
+     * Constructor
+     * @param login the login
+     * @param motDePasse the password
+     * @param url the url of the site
+     */
+    public SessionManager(String login, String motDePasse, String url) {
+	this.login = login;
+	this.motDePasse = motDePasse;
+	this.url = url + "/ws.php";
+	MultiThreadedHttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager();
+	client = new HttpClient(connectionManager);
+	//Using of a Linux user agent. cause... it's better 8)
+	client.getParams().setParameter("http.useragent",
+		"Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.9.1.1) Gecko/20090715 Firefox/3.5.1");
+
+    }
+
+    /**
+     * Connection method
+     * @return true if successful
+     */
+    public boolean processLogin() {
+	Document doc;
+	//configures the proxy
+	if (usesProxy) {
+	    HostConfiguration config = client.getHostConfiguration();
+	    config.setProxy(urlProxy, portProxy);
+	    if (!StringUtils.isEmpty(loginProxy) && !StringUtils.isEmpty(passProxy)) {
+		Credentials credentials = new UsernamePasswordCredentials(loginProxy, passProxy);
+		AuthScope authScope = new AuthScope(urlProxy, portProxy);
+		client.getState().setProxyCredentials(authScope, credentials);
+	    }
+	}
+	try {
+	    doc = executerReturnDocument(MethodsEnum.LOGIN.getLabel(), "username", login, "password", motDePasse);
+	    return Outil.checkOk(doc);
+	} catch (Exception e) {
+	    LOG.error(Outil.getStackTrace(e));
+	}
+	return false;
+    }
+
+    /**
+     * Executes a method on the webservice and returns the result as a string
+     * @param methode the method to execute
+     * @param parametres the parameters of the method. Must be even : the name of the parameter followed by its value
+     * @return the result
+     * @throws UnsupportedEncodingException
+     */
+    public String executerReturnString(String methode, String... parametres) throws UnsupportedEncodingException {
+	if (parametres.length % 2 != 0 && !(parametres == null)) {
+	    try {
+		throw new Exception("Le nombre de parametres doit etre pair");
+	    } catch (Exception e) {
+		LOG.error(Outil.getStackTrace(e));
+		return null;
+	    }
+	}
+	PostMethod method = new PostMethod(url);
+	method.addParameter("method", methode);
+	for (int i = 0; i < parametres.length; i += 2) {
+	    System.out.println(parametres[i] + " -> " + parametres[i + 1]);
+	    method.addParameter(parametres[i], parametres[i + 1]);
+
+	}
+	//begin bug:0001833
+	method.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
+	//end
+
+	try {
+	    client.executeMethod(method);
+	    InputStream streamResponse = method.getResponseBodyAsStream();
+	    //	    System.out.println(Outil.readInputStreamAsString(streamResponse));
+	    //	    String toReturn = method.getResponseBodyAsString();
+	    String toReturn = Outil.readInputStreamAsString(streamResponse);
+	    LOG.debug(toReturn);
+	    return toReturn;
+	} catch (HttpException e) {
+	    // TODO Auto-generated catch block
+	    LOG.error(Outil.getStackTrace(e));
+	} catch (IOException e) {
+	    // TODO Auto-generated catch block
+	    LOG.error(Outil.getStackTrace(e));
+	} catch (IllegalArgumentException e) {
+	    LOG.error(Outil.getStackTrace(e));
+	} finally {
+	    method.releaseConnection();
+	}
+	return null;
+
+    }
+
+    /**
+     * Executes a method on the webservice and returns the result as a Dom document
+     * @param methode the method to execute
+     * @param parametres the parameters of the method. Must be even : the name of the parameter followed by its value
+     * @return the result
+     * @throws IOException
+     */
+    public Document executerReturnDocument(String methode, String... parametres) throws IOException {
+	try {
+	    return Outil.stringToDocument(executerReturnString(methode, parametres));
+	} catch (JDOMException e) {
+	    // TODO Auto-generated catch block
+	    LOG.error(Outil.getStackTrace(e));
+	}
+	return null;
+
+    }
+
+    /**
+     * Executes a method on the webservice and returns the result as a Dom document
+     * @param methode the method to execute
+     * @return the result
+     */
+    public Document executerReturnDocument(String methode) {
+	try {
+	    return Outil.stringToDocument(executerReturnString(methode));
+	} catch (JDOMException e) {
+	    // TODO Auto-generated catch block
+	    LOG.error(Outil.getStackTrace(e));
+	} catch (IOException e) {
+	    // TODO Auto-generated catch block
+	    LOG.error(Outil.getStackTrace(e));
+	}
+	return null;
+
+    }
+
+    /**
+     * @return the login
+     */
+    public String getLogin() {
+	return login;
+    }
+
+    /**
+     * @param login the login to set
+     */
+    public void setLogin(String login) {
+	this.login = login;
+    }
+
+    /**
+     * @return the motDePasse
+     */
+    public String getMotDePasse() {
+	return motDePasse;
+    }
+
+    /**
+     * @param motDePasse the motDePasse to set
+     */
+    public void setMotDePasse(String motDePasse) {
+	this.motDePasse = motDePasse;
+    }
+
+    /**
+     * @return the url
+     */
+    public String getUrl() {
+	return url;
+    }
+
+    /**
+     * @param url the url to set
+     */
+    public void setUrl(String url) {
+	this.url = url;
+    }
+
+    /**
+     * @param usesProxy the usesProxy to set
+     */
+    public void setUsesProxy(boolean usesProxy) {
+	this.usesProxy = usesProxy;
+    }
+
+    /**
+     * @param urlProxy the urlProxy to set
+     */
+    public void setUrlProxy(String urlProxy) {
+	this.urlProxy = urlProxy;
+    }
+
+    /**
+     * @param portProxy the portProxy to set
+     */
+    public void setPortProxy(int portProxy) {
+	this.portProxy = portProxy;
+    }
+
+    /**
+     * @param loginProxy the loginProxy to set
+     */
+    public void setLoginProxy(String loginProxy) {
+	this.loginProxy = loginProxy;
+    }
+
+    /**
+     * @param passProxy the passProxy to set
+     */
+    public void setPassProxy(String passProxy) {
+	this.passProxy = passProxy;
+    }
+
+    /**
+     * @return the erreurProxy
+     */
+    public boolean isErreurProxy() {
+	return erreurProxy;
+    }
+
+}
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/util/ImagesUtil.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/util/ImagesUtil.java	(revision 9387)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/util/ImagesUtil.java	(revision 9387)
@@ -0,0 +1,240 @@
+package fr.mael.jiwigo.transverse.util;
+
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import java.awt.HeadlessException;
+import java.awt.Image;
+import java.awt.RenderingHints;
+import java.awt.Transparency;
+import java.awt.image.BufferedImage;
+import java.awt.image.ColorModel;
+import java.awt.image.PixelGrabber;
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Iterator;
+
+import javax.imageio.IIOImage;
+import javax.imageio.ImageIO;
+import javax.imageio.ImageWriteParam;
+import javax.imageio.ImageWriter;
+import javax.imageio.stream.FileImageOutputStream;
+import javax.swing.ImageIcon;
+
+/*
+Copyright (c) 2010, Mael
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+ * Neither the name of jiwigo nor the
+   names of its contributors may be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL Mael BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+/**
+
+ * @author mael
+ *
+ */
+public class ImagesUtil {
+    /**
+     * Logger
+     */
+    public static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory
+	    .getLog(ImagesUtil.class);
+
+    /**
+     * rotates an image
+     * @param image the image to rotate
+     * @param angle the angle of rotation
+     * @return the rotated image
+     */
+    public static BufferedImage rotate(BufferedImage image, double angle) {
+	GraphicsConfiguration gc = getDefaultConfiguration();
+	double sin = Math.abs(Math.sin(angle)), cos = Math.abs(Math.cos(angle));
+	int w = image.getWidth(), h = image.getHeight();
+	int neww = (int) Math.floor(w * cos + h * sin), newh = (int) Math.floor(h * cos + w * sin);
+	int transparency = image.getColorModel().getTransparency();
+	BufferedImage result = gc.createCompatibleImage(neww, newh, transparency);
+	Graphics2D g = result.createGraphics();
+	g.translate((neww - w) / 2, (newh - h) / 2);
+	g.rotate(angle, w / 2, h / 2);
+	g.drawRenderedImage(image, null);
+	return result;
+    }
+
+    /**
+     * @return
+     */
+    public static GraphicsConfiguration getDefaultConfiguration() {
+	GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
+	GraphicsDevice gd = ge.getDefaultScreenDevice();
+	return gd.getDefaultConfiguration();
+    }
+
+    /**
+     * Writes an image in a file
+     * @param file the file
+     * @param bufferedImage the image
+     * @throws IOException
+     */
+    public static void writeImageToPNG(File file, BufferedImage bufferedImage) throws IOException {
+	ImageIO.write(bufferedImage, "png", file);
+    }
+
+    /**
+     * scales an image
+     * @param filePath the path to the file of the image
+     * @param tempName the name of the resulting file
+     * @param width the width
+     * @param height the height
+     * @return true if successful
+     * @throws Exception
+     */
+    public static boolean scale(String filePath, String tempName, int width, int height) throws Exception {
+	File file = new File(filePath);
+	InputStream imageStream = new BufferedInputStream(new FileInputStream(filePath));
+	Image image = (Image) ImageIO.read(imageStream);
+
+	double thumbRatio = (double) width / (double) height;
+	int imageWidth = image.getWidth(null);
+	int imageHeight = image.getHeight(null);
+	if (imageWidth < width || imageHeight < height) {
+	    return false;
+	}
+	double imageRatio = (double) imageWidth / (double) imageHeight;
+	if (thumbRatio < imageRatio) {
+	    height = (int) (width / imageRatio);
+	} else {
+	    width = (int) (height * imageRatio);
+	}
+	BufferedImage thumbImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
+	Graphics2D graphics2D = thumbImage.createGraphics();
+	graphics2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
+	graphics2D.drawImage(image, 0, 0, width, height, null);
+
+	//	ImageIO.write(thumbImage, "jpg", new FileOutputStream(System.getProperty("java.io.tmpdir") + "/" + tempName));
+	saveImage(System.getProperty("java.io.tmpdir") + "/" + tempName, thumbImage);
+	return true;
+
+    }
+
+    /**
+     * Save an image
+     * @param fileName the name of the file
+     * @param img the img
+     * @throws FileNotFoundException
+     * @throws IOException
+     */
+    private static void saveImage(String fileName, BufferedImage img) throws FileNotFoundException, IOException {
+	Iterator iter = ImageIO.getImageWritersByFormatName("jpeg");
+	ImageWriter writer = (ImageWriter) iter.next();
+	ImageWriteParam iwp = writer.getDefaultWriteParam();
+	iwp.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
+	iwp.setCompressionQuality(1);
+	File outputfile = new File(fileName);
+	FileImageOutputStream output = new FileImageOutputStream(outputfile);
+	writer.setOutput(output);
+	IIOImage outimage = new IIOImage(img, null, null);
+	writer.write(null, outimage, iwp);
+	writer.dispose();
+    }
+
+    // This method returns a buffered image with the contents of an image
+    public static BufferedImage toBufferedImage(Image image) {
+	if (image instanceof BufferedImage) {
+	    return (BufferedImage) image;
+	}
+
+	// This code ensures that all the pixels in the image are loaded
+	image = new ImageIcon(image).getImage();
+
+	// Determine if the image has transparent pixels; for this method's
+	// implementation, see Determining If an Image Has Transparent Pixels
+	boolean hasAlpha = hasAlpha(image);
+
+	// Create a buffered image with a format that's compatible with the screen
+	BufferedImage bimage = null;
+	GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
+	try {
+	    // Determine the type of transparency of the new buffered image
+	    int transparency = Transparency.OPAQUE;
+	    if (hasAlpha) {
+		transparency = Transparency.BITMASK;
+	    }
+
+	    // Create the buffered image
+	    GraphicsDevice gs = ge.getDefaultScreenDevice();
+	    GraphicsConfiguration gc = gs.getDefaultConfiguration();
+	    bimage = gc.createCompatibleImage(image.getWidth(null), image.getHeight(null), transparency);
+	} catch (HeadlessException e) {
+	    // The system does not have a screen
+	}
+
+	if (bimage == null) {
+	    // Create a buffered image using the default color model
+	    int type = BufferedImage.TYPE_INT_RGB;
+	    if (hasAlpha) {
+		type = BufferedImage.TYPE_INT_ARGB;
+	    }
+	    bimage = new BufferedImage(image.getWidth(null), image.getHeight(null), type);
+	}
+
+	// Copy image to buffered image
+	Graphics g = bimage.createGraphics();
+
+	// Paint the image onto the buffered image
+	g.drawImage(image, 0, 0, null);
+	g.dispose();
+
+	return bimage;
+    }
+
+    /**
+     *  This method returns true if the specified image has transparent pixels
+     * @param image the image to check
+     * @return true or false
+     */
+    public static boolean hasAlpha(Image image) {
+	// If buffered image, the color model is readily available
+	if (image instanceof BufferedImage) {
+	    BufferedImage bimage = (BufferedImage) image;
+	    return bimage.getColorModel().hasAlpha();
+	}
+
+	// Use a pixel grabber to retrieve the image's color model;
+	// grabbing a single pixel is usually sufficient
+	PixelGrabber pg = new PixelGrabber(image, 0, 0, 1, 1, false);
+	try {
+	    pg.grabPixels();
+	} catch (InterruptedException e) {
+	}
+
+	// Get the image's color model
+	ColorModel cm = pg.getColorModel();
+	return cm.hasAlpha();
+    }
+
+}
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/util/Outil.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/util/Outil.java	(revision 9387)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/util/Outil.java	(revision 9387)
@@ -0,0 +1,303 @@
+package fr.mael.jiwigo.transverse.util;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.security.MessageDigest;
+import java.util.ArrayList;
+
+import org.apache.sanselan.Sanselan;
+import org.apache.sanselan.common.IImageMetadata;
+import org.apache.sanselan.formats.jpeg.JpegImageMetadata;
+import org.apache.sanselan.formats.jpeg.JpegPhotoshopMetadata;
+import org.apache.sanselan.formats.jpeg.exifRewrite.ExifRewriter;
+import org.apache.sanselan.formats.jpeg.iptc.JpegIptcRewriter;
+import org.apache.sanselan.formats.jpeg.iptc.PhotoshopApp13Data;
+import org.apache.sanselan.formats.tiff.write.TiffOutputSet;
+import org.jdom.Document;
+import org.jdom.JDOMException;
+import org.jdom.input.SAXBuilder;
+import org.jdom.output.XMLOutputter;
+
+/*
+Copyright (c) 2010, Mael
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+ * Neither the name of jiwigo nor the
+   names of its contributors may be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL Mael BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+/**
+
+ * @author mael
+ *
+ */
+public class Outil {
+    /**
+     * Logger
+     */
+    public static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory.getLog(Outil.class);
+
+    /**
+     * Transformation of an inpustream into string.<br/>
+     * useful to read the result of the webservice
+     * @param input the stream
+     * @return the string
+     * @throws IOException
+     */
+    public static String readInputStreamAsString(InputStream input) throws IOException {
+	StringWriter writer = new StringWriter();
+	InputStreamReader streamReader = new InputStreamReader(input);
+	BufferedReader buffer = new BufferedReader(streamReader);
+	String line = "";
+	while (null != (line = buffer.readLine())) {
+	    writer.write(line);
+	}
+	return writer.toString();
+    }
+
+    /**
+     * String to document
+     * @param string the string
+     * @return the corresponding document
+     * @throws JDOMException
+     * @throws IOException
+     */
+    public static Document stringToDocument(String string) throws JDOMException, IOException {
+	SAXBuilder sb = new SAXBuilder();
+	Document doc = sb.build(new StringReader(string));
+	return doc;
+
+    }
+
+    /**
+     * Inputstream to document
+     * @param input the inputStream
+     * @return the document
+     * @throws JDOMException
+     * @throws IOException
+     */
+    public static Document readInputStreamAsDocument(InputStream input) throws JDOMException, IOException {
+	return stringToDocument(readInputStreamAsString(input));
+    }
+
+    /**
+     * Document to string
+     * @param doc the document to transform
+     * @return the string
+     */
+    public static String documentToString(Document doc) {
+	return new XMLOutputter().outputString(doc);
+
+    }
+
+    /**
+     * Function that gets the url of a file
+     * Useful to get the images that are in the jar
+     * @param fileName the path of the file
+     * @return the url of the file
+     */
+    public static URL getURL(String fileName) {
+	URLClassLoader urlLoader = (URLClassLoader) Outil.class.getClassLoader();
+	URL fileLocation = urlLoader.findResource(fileName);
+	return fileLocation;
+    }
+
+    /**
+     * gets the md5 sum of a file
+     * @param filename the path of the file
+     * @return the checksum
+     * @throws Exception
+     */
+    public static String getMD5Checksum(String filename) throws Exception {
+	byte[] b = createChecksum(filename);
+	String result = "";
+	for (int i = 0; i < b.length; i++) {
+	    result += Integer.toString((b[i] & 0xff) + 0x100, 16).substring(1);
+	}
+	return result;
+    }
+
+    /**
+     * Creation of the checksum of a file
+     * @param filename the path of the file
+     * @return the checksum as array byte
+     * @throws Exception
+     */
+    private static byte[] createChecksum(String filename) throws Exception {
+	InputStream fis = new FileInputStream(filename);
+
+	byte[] buffer = new byte[1024];
+	MessageDigest complete = MessageDigest.getInstance("MD5");
+	int numRead;
+	do {
+	    numRead = fis.read(buffer);
+	    if (numRead > 0) {
+		complete.update(buffer, 0, numRead);
+	    }
+	} while (numRead != -1);
+	fis.close();
+	return complete.digest();
+    }
+
+    /**
+     * File to array bytes
+     * @param file the file
+     * @return the array bytes
+     * @throws IOException
+     */
+    public static byte[] getBytesFromFile(File file) throws IOException {
+	InputStream is = new FileInputStream(file);
+	long length = file.length();
+
+	byte[] bytes = new byte[(int) length];
+	int offset = 0;
+	int numRead = 0;
+	while (offset < bytes.length && (numRead = is.read(bytes, offset, bytes.length - offset)) >= 0) {
+	    offset += numRead;
+	}
+
+	if (offset < bytes.length) {
+	    throw new IOException("Could not completely read file " + file.getName());
+	}
+	is.close();
+	return bytes;
+    }
+
+    /**
+     * Function that checks if the webservice response is ok
+     * @param doc the document from the webservice
+     * @return true if ok
+     */
+    public static boolean checkOk(Document doc) {
+	if (doc.getRootElement().getAttributeValue("stat").equals("ok")) {
+	    return true;
+	} else {
+	    LOG.error("Resultat : " + doc.getRootElement().getAttributeValue("stat") + "\nDocument retourné : \n"
+		    + Outil.documentToString(doc));
+	    return false;
+	}
+
+    }
+
+    /**
+     * Exception to string
+     * @param aThrowable exception
+     * @return l'exception en string
+     */
+    public static String getStackTrace(Throwable aThrowable) {
+	final Writer result = new StringWriter();
+	final PrintWriter printWriter = new PrintWriter(result);
+	aThrowable.printStackTrace(printWriter);
+	return result.toString();
+    }
+
+    /**
+     * Function that splits a file
+     * @param fichier the file to split
+     * @param size the size of the resulting chunks
+     * @return the list of files
+     * @throws IOException
+     */
+    //feature:0001827
+    public static ArrayList<File> splitFile(File fichier, int size) throws IOException {
+	FileInputStream fis = new FileInputStream(fichier);
+	byte buffer[] = new byte[size];
+	ArrayList<File> listFichiers = new ArrayList<File>();
+	int count = 0;
+	while (true) {
+	    int i = fis.read(buffer, 0, size);
+	    if (i == -1)
+		break;
+	    File file = new File(System.getProperty("java.io.tmpdir") + "/tempcut" + count);
+	    listFichiers.add(file);
+	    FileOutputStream fos = new FileOutputStream(file);
+	    fos.write(buffer, 0, i);
+	    fos.flush();
+	    fos.close();
+
+	    ++count;
+	}
+	return listFichiers;
+    }
+
+    /**
+     * Function used to put the exif and iptc metadata from one image to another
+     * @param enriched original image where the metadata comes from
+     * @param naked image where to put metadata
+     * @return enriched image
+     * @throws Exception
+     */
+    public static byte[] enrich(byte[] enriched, byte[] naked) throws Exception {
+
+	// read IPTC metadata from the original enriched image
+	IImageMetadata metadata = Sanselan.getMetadata(enriched);
+	JpegImageMetadata jpegMetadata = (JpegImageMetadata) metadata;
+	JpegPhotoshopMetadata photoshopMetadata = jpegMetadata.getPhotoshop();
+	if (photoshopMetadata == null) {
+	    return naked;
+	}
+
+	PhotoshopApp13Data data = photoshopMetadata.photoshopApp13Data;
+
+	// read the EXIF metadata from the parsed JPEG metadata
+	TiffOutputSet outputSet = jpegMetadata.getExif().getOutputSet();
+
+	// enrich the naked byte[] with EXIF metadata
+	ExifRewriter writer = new ExifRewriter();
+	ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+	writer.updateExifMetadataLossless(naked, outputStream, outputSet);
+
+	// enrich the partially clothed byte[] with IPTC metadata
+	InputStream src = new ByteArrayInputStream(outputStream.toByteArray());
+	ByteArrayOutputStream dest = new ByteArrayOutputStream();
+	new JpegIptcRewriter().writeIPTC(src, dest, data);
+
+	// return the fully clothed image as a byte[]
+	return dest.toByteArray();
+    }
+
+    /**
+     * Bytes to file
+     * @param fichier the file path
+     * @param bytes the array bytes
+     * @throws IOException
+     */
+    public static void byteToFile(String fichier, byte[] bytes) throws IOException {
+	FileOutputStream fos = new FileOutputStream(fichier);
+	fos.write(bytes);
+	fos.flush();
+	fos.close();
+
+    }
+}
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/util/log4j/AbstractConcisePatternConverter.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/util/log4j/AbstractConcisePatternConverter.java	(revision 9387)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/util/log4j/AbstractConcisePatternConverter.java	(revision 9387)
@@ -0,0 +1,101 @@
+package fr.mael.jiwigo.transverse.util.log4j;
+
+import org.apache.log4j.helpers.FormattingInfo;
+import org.apache.log4j.helpers.PatternConverter;
+import org.apache.log4j.spi.LoggingEvent;
+
+/**
+ * @author mael
+ *
+ */
+public abstract class AbstractConcisePatternConverter extends PatternConverter {
+
+    /**
+     *
+     */
+    private int precision;
+
+    /**
+     * Constructeur de AbstractConcisePatternConverter.
+     * @param formattingInfo .
+     * @param precision .
+     */
+    public AbstractConcisePatternConverter(final FormattingInfo formattingInfo, final int precision) {
+	super(formattingInfo);
+
+	this.precision = precision;
+    }
+
+    /**
+     * @param paramLoggingEvent .
+     * @return le nom
+     */
+    protected abstract String getConciseName(LoggingEvent paramLoggingEvent);
+
+    /**.
+     * {@inheritDoc}
+     */
+    protected final String convert(final LoggingEvent event) {
+	final String n = getConciseName(event);
+
+	if (this.precision <= 0) {
+	    return n;
+	}
+
+	final int len = n.length();
+
+	int end = len - 1;
+	final int debut = 46;
+	for (int i = this.precision; i > 0; --i) {
+	    end = n.lastIndexOf(debut, end - 1);
+	    if (end == -1) {
+		return n;
+	    }
+	}
+	return n.substring(end + 1, len);
+    }
+
+    /**
+     * @param className le nom de la class
+     * @param maxLength la longueur
+     * @return la string
+     */
+    public static String simplify(final String className, final int maxLength) {
+	if (className.length() <= maxLength) {
+	    return className;
+	}
+
+	final StringBuffer result = new StringBuffer();
+
+	int index = -1;
+	while (true) {
+	    if (className.indexOf(".", index + 1) == -1) {
+		String remainingStr = className.substring(index + 1);
+
+		final int availableLength = maxLength - result.length();
+
+		if (remainingStr.length() > availableLength) {
+		    remainingStr = remainingStr.substring(0, availableLength - 1) + '~';
+		}
+
+		result.append(remainingStr);
+
+		break;
+	    }
+
+	    result.append(className.charAt(index + 1));
+
+	    if (result.length() + 1 == maxLength) {
+		result.append('~');
+
+		break;
+	    }
+
+	    result.append('.');
+
+	    index = className.indexOf(".", index + 1);
+	}
+
+	return result.toString();
+    }
+}
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/util/log4j/CategoryConcisePatternConverter.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/util/log4j/CategoryConcisePatternConverter.java	(revision 9387)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/util/log4j/CategoryConcisePatternConverter.java	(revision 9387)
@@ -0,0 +1,78 @@
+package fr.mael.jiwigo.transverse.util.log4j;
+
+import org.apache.log4j.helpers.FormattingInfo;
+import org.apache.log4j.spi.LoggingEvent;
+
+/**
+ * @author mael
+ *
+ */
+public class CategoryConcisePatternConverter extends AbstractConcisePatternConverter {
+
+    /**
+     *
+     */
+    private static final int ROLE_LENGTH = 30;
+    /**
+     *
+     */
+    private static final int HINT_LENGTH = 8;
+
+    /**
+     *
+     */
+    private static final int SIZE = 35;
+
+    /**
+     * Constructeur de CategoryConcisePatternConverter.
+     * @param formattingInfo .
+     * @param precision .
+     */
+    public CategoryConcisePatternConverter(final FormattingInfo formattingInfo, final int precision) {
+	super(formattingInfo, precision);
+    }
+
+    /**.
+     * {@inheritDoc}
+     */
+    protected final String getConciseName(final LoggingEvent event) {
+	final StringBuffer result = new StringBuffer();
+
+	appendConciseCategory(result, event.getLoggerName());
+
+	appendLeftSpaces(result);
+
+	return result.toString();
+    }
+
+    /**
+     * @param sb la string a modifier
+     * @param loggerName le nom du logger
+     */
+    private void appendConciseCategory(final StringBuffer sb, final String loggerName) {
+	final int colonIndex = loggerName.indexOf(58);
+
+	if (colonIndex == -1) {
+	    sb.append(simplify(loggerName, ROLE_LENGTH));
+
+	    return;
+	}
+
+	final String roleName = loggerName.substring(0, colonIndex);
+
+	final String hintName = loggerName.substring(colonIndex + 1);
+
+	// sb.append(simplify(roleName,
+	// 20)).append(":").append(simplify(hintName, 8));
+	sb.append(roleName).append(":").append(hintName);
+    }
+
+    /**
+     * @param sb la string a modifier
+     */
+    private void appendLeftSpaces(final StringBuffer sb) {
+	while (sb.length() < SIZE) {
+	    sb.append(" ");
+	}
+    }
+}
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/util/log4j/ClassNameConcisePatternConverter.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/util/log4j/ClassNameConcisePatternConverter.java	(revision 9387)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/util/log4j/ClassNameConcisePatternConverter.java	(revision 9387)
@@ -0,0 +1,32 @@
+package fr.mael.jiwigo.transverse.util.log4j;
+
+import org.apache.log4j.helpers.FormattingInfo;
+import org.apache.log4j.spi.LoggingEvent;
+
+/**
+ * @author mael
+ *
+ */
+public class ClassNameConcisePatternConverter extends AbstractConcisePatternConverter {
+
+    /**
+     *
+     */
+    private static final int CLASS_LENGTH = 30;
+
+    /**
+     * Constructeur de ClassNameConcisePatternConverter.
+     * @param formattingInfo .
+     * @param precision .
+     */
+    public ClassNameConcisePatternConverter(final FormattingInfo formattingInfo, final int precision) {
+	super(formattingInfo, precision);
+    }
+
+    /**.
+     * {@inheritDoc}
+     */
+    protected final String getConciseName(final LoggingEvent event) {
+	return simplify(event.getLocationInformation().getClassName(), CLASS_LENGTH);
+    }
+}
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/util/log4j/ConcisePatternLayout.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/util/log4j/ConcisePatternLayout.java	(revision 9387)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/util/log4j/ConcisePatternLayout.java	(revision 9387)
@@ -0,0 +1,18 @@
+package fr.mael.jiwigo.transverse.util.log4j;
+
+import org.apache.log4j.PatternLayout;
+import org.apache.log4j.helpers.PatternParser;
+
+/**
+ * @author mael
+ *
+ */
+public class ConcisePatternLayout extends PatternLayout {
+
+    /**.
+     * {@inheritDoc}
+     */
+    protected final PatternParser createPatternParser(final String pattern) {
+	return new ConcisePatternParser(pattern);
+    }
+}
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/util/log4j/ConcisePatternParser.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/util/log4j/ConcisePatternParser.java	(revision 9387)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/util/log4j/ConcisePatternParser.java	(revision 9387)
@@ -0,0 +1,41 @@
+package fr.mael.jiwigo.transverse.util.log4j;
+
+import org.apache.log4j.helpers.PatternConverter;
+import org.apache.log4j.helpers.PatternParser;
+
+/**
+ * @author mael
+ *
+ */
+public class ConcisePatternParser extends PatternParser {
+
+    /**
+     * Constructeur de ConcisePatternParser.
+     * @param pattern le pattern a appliquer
+     */
+    public ConcisePatternParser(final String pattern) {
+	super(pattern);
+    }
+
+    /**.
+     * {@inheritDoc}
+     */
+    protected final void finalizeConverter(final char c) {
+	PatternConverter patternConverter;
+	if (c == 'C') {
+	    patternConverter = new ClassNameConcisePatternConverter(this.formattingInfo, extractPrecisionOption());
+
+	    this.currentLiteral.setLength(0);
+
+	    addConverter(patternConverter);
+	} else if (c == 'l') {
+	    patternConverter = new CategoryConcisePatternConverter(this.formattingInfo, extractPrecisionOption());
+
+	    this.currentLiteral.setLength(0);
+
+	    addConverter(patternConverter);
+	} else {
+	    super.finalizeConverter(c);
+	}
+    }
+}
Index: /extensions/jiwigo-ws-api/src/main/resources/log4j.dtd
===================================================================
--- /extensions/jiwigo-ws-api/src/main/resources/log4j.dtd	(revision 9387)
+++ /extensions/jiwigo-ws-api/src/main/resources/log4j.dtd	(revision 9387)
@@ -0,0 +1,166 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<!-- Authors: Chris Taylor, Ceki Gulcu. -->
+
+<!-- Version: 1.2 -->
+
+<!-- A configuration element consists of optional renderer
+elements,appender elements, categories and an optional root
+element. -->
+
+<!ELEMENT log4j:configuration (renderer*, appender*,(category|logger)*,root?,
+                               categoryFactory?)>
+
+<!-- The "threshold" attribute takes a level value such that all -->
+<!-- logging statements with a level equal or below this value are -->
+<!-- disabled. -->
+
+<!-- Setting the "debug" enable the printing of internal log4j logging   -->
+<!-- statements.                                                         -->
+
+<!-- By default, debug attribute is "null", meaning that we not do touch -->
+<!-- internal log4j logging settings. The "null" value for the threshold -->
+<!-- attribute can be misleading. The threshold field of a repository	 -->
+<!-- cannot be set to null. The "null" value for the threshold attribute -->
+<!-- simply means don't touch the threshold field, the threshold field   --> 
+<!-- keeps its old value.                                                -->
+     
+<!ATTLIST log4j:configuration
+  xmlns:log4j              CDATA #FIXED "http://jakarta.apache.org/log4j/" 
+  threshold                (all|debug|info|warn|error|fatal|off|null) "null"
+  debug                    (true|false|null)  "null"
+>
+
+<!-- renderer elements allow the user to customize the conversion of  -->
+<!-- message objects to String.                                       -->
+
+<!ELEMENT renderer EMPTY>
+<!ATTLIST renderer
+  renderedClass  CDATA #REQUIRED
+  renderingClass CDATA #REQUIRED
+>
+
+<!-- Appenders must have a name and a class. -->
+<!-- Appenders may contain an error handler, a layout, optional parameters -->
+<!-- and filters. They may also reference (or include) other appenders. -->
+<!ELEMENT appender (errorHandler?, param*, layout?, filter*, appender-ref*)>
+<!ATTLIST appender
+  name 		ID 	#REQUIRED
+  class 	CDATA	#REQUIRED
+>
+
+<!ELEMENT layout (param*)>
+<!ATTLIST layout
+  class		CDATA	#REQUIRED
+>
+
+<!ELEMENT filter (param*)>
+<!ATTLIST filter
+  class		CDATA	#REQUIRED
+>
+
+<!-- ErrorHandlers can be of any class. They can admit any number of -->
+<!-- parameters. -->
+
+<!ELEMENT errorHandler (param*, root-ref?, logger-ref*,  appender-ref?)> 
+<!ATTLIST errorHandler
+   class        CDATA   #REQUIRED 
+>
+
+<!ELEMENT root-ref EMPTY>
+
+<!ELEMENT logger-ref EMPTY>
+<!ATTLIST logger-ref
+  ref IDREF #REQUIRED
+>
+
+<!ELEMENT param EMPTY>
+<!ATTLIST param
+  name		CDATA   #REQUIRED
+  value		CDATA	#REQUIRED
+>
+
+
+<!-- The priority class is org.apache.log4j.Level by default -->
+<!ELEMENT priority (param*)>
+<!ATTLIST priority
+  class   CDATA	#IMPLIED
+  value	  CDATA #REQUIRED
+>
+
+<!-- The level class is org.apache.log4j.Level by default -->
+<!ELEMENT level (param*)>
+<!ATTLIST level
+  class   CDATA	#IMPLIED
+  value	  CDATA #REQUIRED
+>
+
+
+<!-- If no level element is specified, then the configurator MUST not -->
+<!-- touch the level of the named category. -->
+<!ELEMENT category (param*,(priority|level)?,appender-ref*)>
+<!ATTLIST category
+  class         CDATA   #IMPLIED
+  name		CDATA	#REQUIRED
+  additivity	(true|false) "true"  
+>
+
+<!-- If no level element is specified, then the configurator MUST not -->
+<!-- touch the level of the named logger. -->
+<!ELEMENT logger (level?,appender-ref*)>
+<!ATTLIST logger
+  name		ID	#REQUIRED
+  additivity	(true|false) "true"  
+>
+
+
+<!ELEMENT categoryFactory (param*)>
+<!ATTLIST categoryFactory 
+   class        CDATA #REQUIRED>
+
+<!ELEMENT appender-ref EMPTY>
+<!ATTLIST appender-ref
+  ref IDREF #REQUIRED
+>
+
+<!-- If no priority element is specified, then the configurator MUST not -->
+<!-- touch the priority of root. -->
+<!-- The root category always exists and cannot be subclassed. -->
+<!ELEMENT root (param*, (priority|level)?, appender-ref*)>
+
+
+<!-- ==================================================================== -->
+<!--                       A logging event                                -->
+<!-- ==================================================================== -->
+<!ELEMENT log4j:eventSet (log4j:event*)>
+<!ATTLIST log4j:eventSet
+  xmlns:log4j             CDATA #FIXED "http://jakarta.apache.org/log4j/" 
+  version                (1.1|1.2) "1.2" 
+  includesLocationInfo   (true|false) "true"
+>
+
+
+
+<!ELEMENT log4j:event (log4j:message, log4j:NDC?, log4j:throwable?, 
+                       log4j:locationInfo?) >
+
+<!-- The timestamp format is application dependent. -->
+<!ATTLIST log4j:event
+    logger     CDATA #REQUIRED
+    level      CDATA #REQUIRED
+    thread     CDATA #REQUIRED
+    timestamp  CDATA #REQUIRED
+>
+
+<!ELEMENT log4j:message (#PCDATA)>
+<!ELEMENT log4j:NDC (#PCDATA)>
+
+<!ELEMENT log4j:throwable (#PCDATA)>
+
+<!ELEMENT log4j:locationInfo EMPTY>
+<!ATTLIST log4j:locationInfo
+  class  CDATA	#REQUIRED
+  method CDATA	#REQUIRED
+  file   CDATA	#REQUIRED
+  line   CDATA	#REQUIRED
+>
Index: /extensions/jiwigo-ws-api/src/main/resources/log4j.xml
===================================================================
--- /extensions/jiwigo-ws-api/src/main/resources/log4j.xml	(revision 9387)
+++ /extensions/jiwigo-ws-api/src/main/resources/log4j.xml	(revision 9387)
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration debug="false" xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+	<!-- Déclaration Appenders -->
+	<appender name="console" class="org.apache.log4j.ConsoleAppender">
+		<layout class="fr.mael.jiwigo.transverse.util.log4j.ConcisePatternLayout">
+			<param name="ConversionPattern" value="[Jiwigo] %4d{yyyy-MM-dd HH:mm:ss} %-5p - %l - %m%n" />
+		</layout>
+	</appender>
+	
+	<appender name="fichier" class="org.apache.log4j.DailyRollingFileAppender">
+		<param name="File" value="logs/jiwigo.log" />
+		<param name="datePattern" value="'.'dd-MM-yyyy" />
+		<param name="Threshold" value="INFO" />
+		<layout class="fr.mael.jiwigo.transverse.util.log4j.ConcisePatternLayout">
+			<param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c] %m%n" />
+		</layout>
+	</appender>	
+
+
+	<!-- Déclaration loggers -->
+	<logger name="fr.mael.jiwigo" additivity="false">
+		<level value="DEBUG" />
+		<appender-ref ref="console" />
+		<appender-ref ref="fichier" />
+	</logger>
+	
+
+
+	<root>
+		<level value="INFO" />
+		<appender-ref ref="console" />
+	</root>
+
+</log4j:configuration>
Index: /extensions/jiwigo-ws-api/src/main/resources/temp.xml
===================================================================
--- /extensions/jiwigo-ws-api/src/main/resources/temp.xml	(revision 9387)
+++ /extensions/jiwigo-ws-api/src/main/resources/temp.xml	(revision 9387)
@@ -0,0 +1,40 @@
+<rsp stat="ok">
+	<image id="20" file="20100919131731-692df26f.jpg" date_available="2010-09-19 13:17:31"
+		tn_ext="jpg" author="mael" hit="0" filesize="48" width="450" height="475"
+		date_metadata_update="2010-09-19" level="0"
+		md5sum="692df26f3800cc1aab00421d7c29ff4c"
+		tn_url="http://mael.piwigo.com/uploads/y/c/a/ycajh4petv/2010/09/19/thumbnail/TN-20100919131731-692df26f.jpg"
+		element_url="http://mael.piwigo.com/uploads/y/c/a/ycajh4petv/2010/09/19/20100919131731-692df26f.jpg">
+		<name>10</name>
+		<rates count="0" average="" />
+		<categories>
+			<category id="3"
+				url="http://mael.piwigo.com/index?/category/3-test_de_test_do_not_delete"
+				page_url="http://mael.piwigo.com/picture?/20/category/3-test_de_test_do_not_delete">
+				<name>test de test do not delete</name>
+				<uppercats>1,3</uppercats>
+				<global_rank>1.1</global_rank>
+			</category>
+		</categories>
+		<tags>
+			<tag id="1" name="Tag1" url_name="tag1"
+				url="http://mael.piwigo.com/index?/tags/1-tag1" page_url="http://mael.piwigo.com/picture?/20/tags/1-tag1" />
+		</tags>
+		<comment_post author="mael"
+			key="1284919810:82b32b18c9b16d34295f586cd88855f3" />
+		<comments page="0" per_page="10" count="3" nb_comments="3">
+			<comment id="1" date="2010-09-19 15:12:22">
+				<author>mael</author>
+				<content>comment test</content>
+			</comment>
+			<comment id="2" date="2010-09-19 15:13:26">
+				<author>mael</author>
+				<content>comment test</content>
+			</comment>
+			<comment id="3" date="2010-09-19 15:14:33">
+				<author>mael</author>
+				<content>comment test</content>
+			</comment>
+		</comments>
+	</image>
+</rsp>
