Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/CHANGES.txt
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/CHANGES.txt	(revision 5274)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/CHANGES.txt	(revision 5275)
@@ -30,2 +30,6 @@
 May 15, 2014. Added validation (via the schem on SCHEMAcat) of the xmls sent by client. Refactoring.
 fixing busg with escape symbols and URL encoding of them.
+
+May 22, 2014. Resored automated prinicpal record generation for a fresh shibbolized user, update
+principal is fixed (both issues have appeared after eralier refactoring). Jsp pages are updated,
+dynamical logout adress is generated.
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/README.txt
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/README.txt	(revision 5274)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/README.txt	(revision 5275)
@@ -22,5 +22,5 @@
 === Logging in ===
 
-Shibbolized authentication is implemented for lux16 and lux17, and basic tomcat works for localhost.
+Authentication is possible for lux16 and lux17 for 2 settings: vi ashibboleth and as spring basic.
 
 
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/UPDATE.txt
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/UPDATE.txt	(revision 5274)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/UPDATE.txt	(revision 5275)
@@ -1,10 +1,17 @@
-1. Placing tarball: as always, take the tar-ball of the new  version 1.4, and follow the 
+1. Placing tarball: as always, take the tar-ball of the new  version 1.4.1, and follow the 
 standard MPI deployment procedure.  Consult the instructions from INSTALL.txt 
 about placing war file if you have forgotten.
 
-2. Adjusting shhaa.xml, database, web.xml this time are not necessary. OR if you want to reuse
-this tarball to deploy shibbolized version you need to change web.xml
+2. Adjusting shhaa.xml: as always, if it is deloyment on lux17 (or production), set
+ <sso action="lI">  and <slo action="lO">
 
-2.1. Comment  <filter>
+3. This time the databse stays intact.
+
+4. web.xml differs for ds/webannotator (shibboleth authentication)
+and ds/webannotator-basic (basic spring authentication).
+
+4.1. Filter. For the ds/webannotator use
+
+ <filter>
         <filter-name>AAIFilter</filter-name>
         <filter-class>de.mpg.aai.shhaa.AuthFilter</filter-class>
@@ -15,5 +22,5 @@
     </filter-mapping>
     
-    and uncomment 
+  and for the ds/webannotator-basic use
     
      <filter>
@@ -27,4 +34,15 @@
     
     
-    2.2. Comment  <param-value>/ds/webannotator/j_spring_security_logout</param-value> and uncomment
-    <param-value>/ds/webannotator?shhaaDo=lO</param-value>
+    4.2. Settting  <param-name>eu.dasish.annotation.backend.logout</param-name>.
+    For the ds/webannotator 
+    (if shibboleth's logout address is of the form http://lux17.mpi.nl/Shibboleth.sso/Logout)
+    
+    <param-value>/../../Shibboleth.sso/Logout</param-value>
+    
+    The "../../" is necessary to climb from http://lux17.mpi.nl/ds/webannotator to
+     http://lux17.mpi.nl. 
+    
+    and for ds/webannotator-basic use
+    
+    <param-value>/j_spring_security_logout</param-value>
+    
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/AutheticationResource.java
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/AutheticationResource.java	(revision 5274)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/AutheticationResource.java	(revision 5275)
@@ -78,5 +78,8 @@
     public void logout() throws IOException, ServletException {
         httpServletRequest.getSession().invalidate();
-        httpServletResponse.sendRedirect(uriInfo.getBaseUri().toString() + ".."+context.getInitParameter("eu.dasish.annotation.backend.logout"));
+        boolean isShibboleth = Boolean.parseBoolean(context.getInitParameter("eu.dasish.annotation.backend.isShibbolethSession"));
+        String redirect = isShibboleth ? context.getInitParameter("eu.dasish.annotation.backend.logout") : 
+                uriInfo.getBaseUri().toString() + ".."+context.getInitParameter("eu.dasish.annotation.backend.logout");        
+        httpServletResponse.sendRedirect(redirect);
     }
 }
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/webapp/WEB-INF/web-basic.xml
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/webapp/WEB-INF/web-basic.xml	(revision 5275)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/webapp/WEB-INF/web-basic.xml	(revision 5275)
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright (C) 2013 DASISH
+
+    This program is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    as published by the Free Software Foundation; either version 2
+    of the License, or (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+-->
+<!-- This web.xml file is not required when using Servlet 3.0 container, 
+see implementation details http://jersey.java.net/nonav/documentation/latest/jax-rs.html#d4e194 -->
+<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+    <context-param>
+        <param-name>ShhaaConfigLocation</param-name>
+        <param-value>/WEB-INF/shhaa.xml</param-value>
+    </context-param>
+    
+    
+    <context-param>
+        <param-name>contextConfigLocation</param-name>
+        <param-value>classpath*:spring-config/**/*.xml</param-value>
+    </context-param>
+    <context-param>
+        <param-name>eu.dasish.annotation.backend.schemaLocation</param-name>
+        <param-value>http://lux17.mpi.nl/schemacat/schemas/s15/files/dwan.xsd</param-value>
+    </context-param>
+    <context-param>
+        <param-name>eu.dasish.annotation.backend.logDatabaseLocation</param-name>
+        <param-value>${catalina.base}/logs/dasishDatabase.log</param-value>
+    </context-param>
+    <context-param>
+        <param-name>eu.dasish.annotation.backend.logServerLocation</param-name>
+        <param-value>${catalina.base}/logs/dasishServer.log</param-value>
+    </context-param>
+    <context-param>
+        <param-name>eu.dasish.annotation.backend.isShibbolethSession</param-name>
+        <param-value>false</param-value>
+    </context-param>
+    <context-param>
+        <param-name>eu.dasish.annotation.backend.logout</param-name>
+        <param-value>/j_spring_security_logout</param-value> 
+    </context-param>
+    
+    
+    <listener>
+        <listener-class>
+            org.springframework.web.context.ContextLoaderListener
+        </listener-class>
+    </listener>
+    <servlet>
+        <servlet-name>annotator-backend</servlet-name>
+        <servlet-class>
+            com.sun.jersey.spi.spring.container.servlet.SpringServlet
+        </servlet-class>
+        <init-param>
+            <param-name>com.sun.jersey.config.property.packages</param-name>
+            <param-value>eu.dasish.annotation.backend</param-value>
+        </init-param>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+    <servlet>
+        <servlet-name>ServletAdaptor</servlet-name>
+        <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+    <servlet-mapping>
+        <servlet-name>annotator-backend</servlet-name>
+        <url-pattern>/api/*</url-pattern>
+    </servlet-mapping>
+    
+    <servlet-mapping>
+        <servlet-name>ServletAdaptor</servlet-name>
+        <url-pattern>/webresources/*</url-pattern>
+    </servlet-mapping>
+    
+    <!--   <security-constraint>
+        <display-name>Protected backend localhost</display-name>
+        <web-resource-collection>
+            <web-resource-name> Protected backend rest service</web-resource-name>
+            <description />
+            <url-pattern>/*</url-pattern> 
+            <http-method>GET</http-method>
+            <http-method>DELETE</http-method>
+            <http-method>PUT</http-method>
+            <http-method>POST</http-method>
+        </web-resource-collection>
+        <auth-constraint>
+            <role-name>tomcat</role-name>
+        </auth-constraint>
+    </security-constraint>
+    <login-config>
+        <auth-method>BASIC</auth-method>
+    </login-config>
+    <security-role>
+        <description> The role that is required to log in to the Application
+        </description>
+        <role-name>tomcat</role-name>
+    </security-role> -->
+   
+    <!-- Spring security -->
+    <filter>
+        <filter-name>springSecurityFilterChain</filter-name>
+        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
+    </filter>
+    <filter-mapping>
+        <filter-name>springSecurityFilterChain</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+       
+</web-app>
+
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/webapp/WEB-INF/web-shibboleth.xml
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/webapp/WEB-INF/web-shibboleth.xml	(revision 5275)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/webapp/WEB-INF/web-shibboleth.xml	(revision 5275)
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright (C) 2013 DASISH
+
+    This program is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    as published by the Free Software Foundation; either version 2
+    of the License, or (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+-->
+<!-- This web.xml file is not required when using Servlet 3.0 container, 
+see implementation details http://jersey.java.net/nonav/documentation/latest/jax-rs.html#d4e194 -->
+<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+    <context-param>
+        <param-name>ShhaaConfigLocation</param-name>
+        <param-value>/WEB-INF/shhaa.xml</param-value>
+    </context-param>
+    
+    
+    <context-param>
+        <param-name>contextConfigLocation</param-name>
+        <param-value>classpath*:spring-config/**/*.xml</param-value>
+    </context-param>
+    <context-param>
+        <param-name>eu.dasish.annotation.backend.schemaLocation</param-name>
+        <param-value>http://lux17.mpi.nl/schemacat/schemas/s15/files/dwan.xsd</param-value>
+    </context-param>
+    <context-param>
+        <param-name>eu.dasish.annotation.backend.logDatabaseLocation</param-name>
+        <param-value>${catalina.base}/logs/dasishDatabase.log</param-value>
+    </context-param>
+    <context-param>
+        <param-name>eu.dasish.annotation.backend.logServerLocation</param-name>
+        <param-value>${catalina.base}/logs/dasishServer.log</param-value>
+    </context-param>
+    <context-param>
+        <param-name>eu.dasish.annotation.backend.isShibbolethSession</param-name>
+        <param-value>true</param-value>
+    </context-param>
+    <context-param>
+        <param-name>eu.dasish.annotation.backend.logout</param-name>
+        <param-value>?shhaaDo=lO</param-value>
+    </context-param>
+    
+    
+    <listener>
+        <listener-class>
+            org.springframework.web.context.ContextLoaderListener
+        </listener-class>
+    </listener>
+    <servlet>
+        <servlet-name>annotator-backend</servlet-name>
+        <servlet-class>
+            com.sun.jersey.spi.spring.container.servlet.SpringServlet
+        </servlet-class>
+        <init-param>
+            <param-name>com.sun.jersey.config.property.packages</param-name>
+            <param-value>eu.dasish.annotation.backend</param-value>
+        </init-param>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+    <servlet>
+        <servlet-name>ServletAdaptor</servlet-name>
+        <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+    <servlet-mapping>
+        <servlet-name>annotator-backend</servlet-name>
+        <url-pattern>/api/*</url-pattern>
+    </servlet-mapping>
+    
+    <servlet-mapping>
+        <servlet-name>ServletAdaptor</servlet-name>
+        <url-pattern>/webresources/*</url-pattern>
+    </servlet-mapping>
+    
+    
+    
+       
+    <!--  Shibboleth filter -->
+   <filter>
+        <filter-name>AAIFilter</filter-name>
+        <filter-class>de.mpg.aai.shhaa.AuthFilter</filter-class>
+    </filter>
+    <filter-mapping>
+        <filter-name>AAIFilter</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+    
+   
+</web-app>
+
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/webapp/WEB-INF/web.xml
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/webapp/WEB-INF/web.xml	(revision 5274)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/webapp/WEB-INF/web.xml	(revision 5275)
@@ -45,8 +45,9 @@
     </context-param>
     <context-param>
+        <param-name>eu.dasish.annotation.backend.isShibbolethSession</param-name>
+        <param-value>false</param-value>
+    </context-param>
+    <context-param>
         <param-name>eu.dasish.annotation.backend.logout</param-name>
-<!--        <param-value>/ds/webannotator?shhaaDo=lO</param-value>-->
-<!--        <param-value>/ds/webannotatornonshibb/j_spring_security_logout</param-value>-->
-<!--        <param-value>/ds/webannotator-basic/j_spring_security_logout</param-value>-->       
         <param-value>/j_spring_security_logout</param-value> 
     </context-param>
@@ -117,15 +118,5 @@
         <url-pattern>/*</url-pattern>
     </filter-mapping>
+    
+  </web-app>  
        
-    <!--  Shibboleth filter -->
-<!--    <filter>
-        <filter-name>AAIFilter</filter-name>
-        <filter-class>de.mpg.aai.shhaa.AuthFilter</filter-class>
-    </filter>
-    <filter-mapping>
-        <filter-name>AAIFilter</filter-name>
-        <url-pattern>/*</url-pattern>
-    </filter-mapping> -->
-    
-   
-</web-app>
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/web-shibboleth.xml
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/web-shibboleth.xml	(revision 5275)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/web-shibboleth.xml	(revision 5275)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (C) 2014 DASISH
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+-->
+
+
+<root>
+    
+</root>
