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é.
La modification permet de passer le(s) argument(s) à l'URL connue par le portail ; le lien communiqué aux utilisateurs est du type :
https://cas.univ.fr/cas?service=https://portail.univ.fr/uPortal/Login?uP_fname%3dIntranet%26uP_args%3darticle40
--- 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
2 commentaires
Pascal Rigaux dit :
NB : ne fonctionne pas en portail 3.2.4 (CInlineFrame.java n'étant plus utilisé)
Pascal Rigaux dit :
Voici une solution similaire qui fonctionne en portail 3.2.4.
Elle permet de passer des URLs du type :
https://cas.univ.fr/cas/index.jsp?service=https://esup.univ.fr/Login?uP_fname=XXXX%26uP_args=https://glpi.univ.fr/index.php%3Fredirect%3Dticket_17227
(nb : c'est une solution plus souple car permettant une variété d'url pour une application donnée, sans toucher à l'appli en question)