Pages enfant
  • Faire un lien direct vers une Iframe dans l'ENT

Vous regardez une version antérieure (v. /wiki/display/ESUPMU/Faire+un+lien+direct+vers+une+Iframe+dans+l%27ENT) de cette page.

afficher les différences afficher l'historique de la page

« Afficher la version précédente Vous regardez la version actuelle de cette page. (v. 3) afficher la version suivante »

Le but de cette modification est de permettre le passage de paramètres à une iframe dans l'ENT plaçant ainsi l'utilisateur qu'il soit connecté ou non dans un contexte donné.

L'URL finale est du type
https://cas.univ.fr/cas?service=https://portail.univ.fr/uPortal/Login?uP_fname%3dIntranet%26uP_args%3darticle40

et permet de passer l'argument à l'URL connue par le portail.

--- custom/uPortal/source/org/jasig/portal/channels/CInlineFrame.java.ori    2009-06-22 09:59:55.000000000 +0200
+++ custom/uPortal/source/org/jasig/portal/channels/CInlineFrame.java    2009-06-22 11:59:54.000000000 +0200
@@ -8,6 +8,8 @@
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
 
+import java.util.Enumeration;
+
 import org.jasig.portal.ChannelCacheKey;
 import org.jasig.portal.GeneralRenderingException;
 import org.jasig.portal.ICacheable;
@@ -47,9 +49,24 @@
    *
    */
   public void renderXML (ContentHandler out) throws PortalException {
+    String targetArgs = "";
+    Enumeration runtimeEnu = runtimeData.getParameterNames();
+    while ( runtimeEnu.hasMoreElements() ) {
+           String runtimeP = runtimeEnu.nextElement();
+           if(runtimeP.equals("uP_args"))
{
\+               targetArgs \+= runtimeData.getParameter(runtimeP);
\+           }
+    }
+    String srcUrl = staticData.getParameter("url");
+
+    if ( srcUrl.matches(".http.?.*"))
{
\+    srcUrl \+= "&" + targetArgs;
\+    }
 else
{
\+    srcUrl \+= "?" + targetArgs; // the url for the IFrame content
\+    }
 
     // Obtain url and height, both static parameters
-    String srcUrl = staticData.getParameter("url"); // the url for the IFrame content
+    // String srcUrl = staticData.getParameter("url"); // the url for the IFrame content
     String frameHeight = staticData.getParameter("height"); // the height of the IFrame in pixels
     String iFrameName = staticData.getParameter("iFrameName"); // the name of the IFrame in pixels
  • Aucune étiquette