cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "angeloimm" <angelo...@libero.it>
Subject Login coplet in cocoon portal
Date Thu, 26 May 2005 16:36:17 GMT
Hi all; i have a my login cocoon application that does some steps in order to login some users;
it is described by this sitemap.xmap:

<?xml version="1.0"?>
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">

  <map:flow language="javascript">
     <map:script src="flow/controls.js"/>
  </map:flow>

  <!-- =========================== Pipelines ================================= -->
  <map:pipelines>

    <map:component-configurations>
      <authentication-manager>
        <handlers>
          <!-- Handler di autenticazione su file di testo -->
          <!--
          <handler name="PMMhandler">
            <redirect-to uri="cocoon:/login"/>
            <authentication uri="cocoon:raw:/authenticate"/>
          </handler>
          -->
          <!-- Handler di autenticazione su Porfile Manager -->
          <handler name="PMMhandlerCD">
            <map:redirect-to uri="cocoon:/loginCD"/>
            <authentication uri="cocoon:raw:/authenticateCD"/>
          </handler>
        </handlers>
      </authentication-manager>

    <map:selectors>

      <map:selector name="exception" src="org.apache.cocoon.selection.ExceptionSelector">
        <!-- exception name="processing" class="ProcessingException" unroll="true"/ -->
        <exception name="processing" class="ProcessingException"/>
        <exception name="sax" class="SAXException"/>
        <exception name="application" class="ApplicationException"/>
      </map:selector>

    </map:selectors>

    </map:component-configurations>

    <map:pipeline>

      <!-- registrazione -->
      <map:match pattern="register/**">
         <map:mount check-reload="yes"
                      reload-method="synchron"
                      src="register/sitemap.xmap"
                      uri-prefix="register"/>
      </map:match>

      <!-- File dell'applicazione visura anagrafica -->
      <map:match pattern="visanag/**">
         <map:mount check-reload="yes"
                      reload-method="synchron"
                      src="visanag/sitemap.xmap"
                      uri-prefix="visanag"/>
      </map:match>

      <!-- File dell'applicazione Gestione account -->
      <map:match pattern="gstaccount/**">
         <map:mount check-reload="yes"
                      reload-method="synchron"
                      src="gstaccount/sitemap.xmap"
                      uri-prefix="gstaccount"/>
      </map:match>

      <map:match pattern="">
        <map:redirect-to uri="loginCD"/>
      </map:match>

      <map:match pattern="*.css">
        <map:read mime-type="text/css" src="css/{1}.css"/>
      </map:match>

      <map:match pattern="*.gif">
        <map:read mime-type="image/gif" src="images/{1}.gif"/>
      </map:match>

      <map:match pattern="*.png">
        <map:read mime-type="image/png" src="img/{1}.png"/>
      </map:match>

      <!-- ================= -->
      <!-- Form di login ad una risorsa protetta -->
      <!-- ================= -->
      <!--
      <map:match pattern="login">
        <map:act type="auth-loggedIn">
          <map:parameter name="handler" value="PMMhandler"/>
          <map:redirect-to uri="protected"/>
        </map:act>
        <map:generate src="docs/login.xml"/>
        <map:transform src="stylesheets/simple-page2html.xsl"/>
        <map:transform type="encodeURL"/>
        <map:serialize/>
      </map:match>
      -->

      <!-- ========================================= -->
      <!-- Form di login all' applicazione cambio domicilio  -->
      <!-- ========================================= -->
      <map:match pattern="loginCD">
      <!--map:match pattern=""-->
        <map:act type="auth-loggedIn">
          <map:parameter name="handler" value="PMMhandlerCD"/>

          <map:select type="parameter">
            <map:parameter name="parameter-selector-test" value="{request-param:application}"/>
            <map:when test="CAMBIODOMICILIO">
              <map:redirect-to uri="cambiodomicilio?application={request-param:application}"/>
            </map:when>
            <map:when test="VISURAANAGRAFICA">
              <map:redirect-to uri="visuraanagrafica?application={request-param:application}"/>
            </map:when>
            <map:when test="CDU">
              <map:redirect-to uri="certificatourbanistica?application={request-param:application}"/>
            </map:when>
            <map:when test="GAU">
              <map:redirect-to uri="gestioneaccount?application={request-param:application}"/>
            </map:when>
            <map:otherwise>
              <map:redirect-to uri="do-logout"/>
            </map:otherwise>
          </map:select>
        </map:act>

        <map:generate src="docs/loginCD.xml"/>
        <map:transform type="encodeURL"/>
        <map:transform src="stylesheets/simple-page2html.xsl">
          <map:parameter name="application" value="CDU"/>
          <map:parameter name="use-request-parameters" value="true"/>
        </map:transform>
        <map:serialize/>

      </map:match>

      <!-- ========================================= -->
      <!-- Post del servizio login  -->
      <!-- ========================================= -->
      <!--
      <map:match pattern="do-login">
        <map:act type="auth-login">
          <map:parameter name="handler" value="PMMhandler"/>
          <map:parameter name="parameter_name" value="{request-param:name}"/>
          <map:redirect-to uri="protected"/>
        </map:act>
        <map:redirect-to uri="login"/>
      </map:match>
      -->

      <!-- ========================================= -->
      <!-- Post del servizio loginCD  -->
      <!-- ========================================= -->
      <map:match pattern="do-loginCD">
        <map:act type="auth-login">
          <map:parameter name="handler" value="PMMhandlerCD"/>
          <map:parameter name="parameter_username" value="{request-param:username}"/>
          <map:parameter name="parameter_password" value="{request-param:password}"/>
          <map:parameter name="parameter_application" value="{request-param:application}"/>

          <map:select type="parameter">
            <map:parameter name="parameter-selector-test" value="{request-param:application}"/>
            <map:when test="CAMBIODOMICILIO">
              <map:redirect-to uri="cambiodomicilio?application=CAMBIODOMICILIO"/>
            </map:when>
            <map:when test="VISURAANAGRAFICA">
              <map:redirect-to uri="visuraanagrafica?application=VISURAANAGRAFICA"/>
            </map:when>
            <map:when test="CDU">
              <map:redirect-to uri="certificatourbanistica?application=CDU"/>
            </map:when>
            <map:when test="GAU">
              <map:redirect-to uri="gestioneaccount?application={request-param:application}"/>
            </map:when>
            <map:otherwise>
              <map:redirect-to uri="loginCD"/>
            </map:otherwise>
          </map:select>
          <!-- map:redirect-to uri="cambiodomicilio"/ -->

        </map:act>
        <!-- something was wrong, try it again -->
        <map:redirect-to uri="cocoon:/loginCD"/>
      </map:match>

      <!-- ================ -->
      <!-- Protected area   -->
      <!-- ================ -->
      <!--
      <map:match pattern="protected">
        <map:act type="auth-protect">
          <map:parameter name="handler" value="PMMhandler"/>
          <map:generate src="docs/protected.xml"/>
          <map:transform type="session"/>
          <map:transform src="stylesheets/simple-page2html.xsl"/>
          <map:transform type="encodeURL"/>
          <map:serialize/>
        </map:act>
        <map:redirect-to uri="login"/>
      </map:match>
      -->

      <!-- Document di accesso applicazione cambiodomicilio  -->
      <map:match pattern="cambiodomicilio">
        <map:act type="auth-protect">
          <map:parameter name="handler" value="PMMhandlerCD"/>
          <map:generate src="docs/cambiodomicilio.xml"/>
          <map:transform type="session"/>
          <map:transform src="stylesheets/simple-page2html.xsl">
            <map:parameter name="use-request-parameters" value="true"/>
          </map:transform>
          <map:transform type="encodeURL"/>
          <map:serialize/>
        </map:act>
        <!-- something was wrong, redirect to login page -->
        <map:redirect-to uri="cocoon:/loginCD"/>
      </map:match>

      <!-- Document di accesso applicazione Visura Anagrafica  -->
      <map:match pattern="visuraanagrafica">
        <map:act type="auth-protect">
          <map:parameter name="handler" value="PMMhandlerCD"/>
          <map:generate src="docs/visuraanagrafica.xml"/>
          <map:transform type="session"/>
          <map:transform src="stylesheets/simple-page2html.xsl">
            <map:parameter name="use-request-parameters" value="true"/>
          </map:transform>
          <map:transform type="encodeURL"/>
          <map:serialize/>
        </map:act>
        <!-- something was wrong, redirect to login page -->
        <map:redirect-to uri="cocoon:/loginCD"/>
      </map:match>

      <!-- Document di accesso applicazione Certificato Destinazione Urbanistica -->
      <map:match pattern="certificatourbanistica">
        <map:act type="auth-protect">
          <map:parameter name="handler" value="PMMhandlerCD"/>
          <map:generate src="docs/cdu.xml"/>
          <map:transform type="session"/>
          <map:transform src="stylesheets/simple-page2html.xsl">
              <map:parameter name="use-request-parameters" value="true"/>
          </map:transform>
          <map:transform type="encodeURL"/>
          <map:serialize/>
        </map:act>
        <!-- something was wrong, redirect to login page -->
        <map:redirect-to uri="cocoon:/loginCD"/>
      </map:match>

      <!-- Document di accesso applicazione Gestione Account Utente -->
      <map:match pattern="gestioneaccount">
        <map:act type="auth-protect">
          <map:parameter name="handler" value="PMMhandlerCD"/>
          <map:generate src="gstaccount/docs/gau.xml"/>
          <map:transform type="session"/>
          <map:transform src="stylesheets/simple-page2html.xsl">
              <map:parameter name="use-request-parameters" value="true"/>
          </map:transform>
          <map:transform type="encodeURL"/>
          <map:serialize/>
        </map:act>
        <!-- something was wrong, redirect to login page -->
        <map:redirect-to uri="cocoon:/loginCD"/>
      </map:match>


			<map:match pattern="menu">
        <map:act type="auth-protect">
          <map:parameter name="handler" value="PMMhandlerCD"/>
          <map:generate src="docs/menu.xml"/>
          <map:serialize type="xml"/>
        </map:act>
        <!-- something was wrong, redirect to login page -->
        <map:redirect-to uri="cocoon:/loginCD"/>
			</map:match>

      <!-- ========================================= -->
      <!-- Effettua il logout su tutte le applicazioni -->
      <!-- ========================================= -->
      <map:match pattern="do-logout">
        <!--
        <map:select type="parameter">
          <map:parameter name="parameter-selector-test" value="{request-param:logout}"/>
          <map:when test="rp">
            <map:act type="auth-protect">
                <map:parameter name="handler" value="PMMhandler"/>
                <map:act type="auth-logout"/>
            </map:act>
            <map:redirect-to uri="cocoon:/login"/>
          </map:when>
          <map:when test="cd">
            <map:act type="auth-protect">
              <map:parameter name="handler" value="PMMhandlerCD"/>
              <map:act type="auth-logout"/>
            </map:act>
            <map:redirect-to uri="cocoon:/loginCD"/>
          </map:when>
          <map:otherwise>
            <map:redirect-to uri="cocoon:/loginCD"/>
          </map:otherwise>
        </map:select>
        -->

        <map:act type="auth-protect">
          <map:parameter name="handler" value="PMMhandlerCD"/>
          <map:act type="auth-logout"/>
        </map:act>
        <map:redirect-to uri="loginCD"/>

      </map:match>

      <map:handle-errors>
        <map:select type="exception">
          <map:when test="processing">
              <map:generate src="error.xml"/>
              <map:serialize type="xml"/>
          </map:when>
          <map:when test="sax">
             <map:generate src="error.xml"/>
             <map:serialize type="xml"/>
          </map:when>
          <map:when test="application">
              <map:generate src="error.xml"/>
             <map:serialize type="xml"/>
          </map:when>
        </map:select>
      </map:handle-errors>

    </map:pipeline>

    <!-- pipeline di accesso -->
    <map:pipeline internal-only="true">
      <!-- This is the authentication resource -->
      <!--
      <map:match pattern="authenticate">
        <map:generate src="docs/userlist.xml"/>
        <map:transform src="stylesheets/authenticate.xsl">
          <map:parameter name="use-request-parameters" value="true"/>
        </map:transform>
        <map:serialize type="xml"/>
      </map:match>
      -->

      <map:match pattern="authenticateCD">
        <!-- map:generate src="docs/userlist.xml"/ -->
        <map:generate src="http://caruso:8080//PMMAuth//ConnectorForPM?userid={request-param:username}&amp;password={request-param:password}&amp;appl={request-param:application}"/>
        <map:transform src="stylesheets/authenticateCD.xsl">
          <map:parameter name="use-request-parameters" value="true"/>
        </map:transform>
        <map:serialize type="xml"/>
      </map:match>

      <map:handle-errors>
        <map:select type="exception">
          <map:when test="processing">
              <map:generate src="error.xml"/>
             <map:serialize type="xml"/>
          </map:when>
          <map:when test="sax">
             <map:generate src="error.xml"/>
             <map:serialize type="xml"/>
          </map:when>
          <map:when test="application">
              <map:generate src="error.xml"/>
             <map:serialize type="xml"/>
          </map:when>
        </map:select>
      </map:handle-errors>

    </map:pipeline>

Now i have inserted this application in cocoon portal; if i try to use this application alone
without the portal all works well; if i use the application in the portal framework the application
doesn't work; i have seen that the form-action is no longer the one in that appears in the
application stand alone, but it's "portal"... now i agree this fact.. the portal framework
must handle this link but why doesn't work?
Thanks to all

  </map:pipelines>
</map:sitemap>




____________________________________________________________
6X velocizzare la tua navigazione a 56k? 6X Web Accelerator di Libero!
Scaricalo su INTERNET GRATIS 6X http://www.libero.it



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message