How to use cref links redirect to external content ?

1 Creat Iscript function,you can take advantage the follow code.

Declare Function SpecifyPortalOpen PeopleCode FUNCLIB_PTPP.PTPP_PORTALR FieldFormula;

Function IScript_ContentRedirect()
   Local ApiObject &portal;
   Local ApiObject &cref;
   Local string &url = "";
   Local string &portalName = %Request.GetParameter("PORTAL");
   Local string &crefName = %Request.GetParameter("CREF");
   
   &portal = SpecifyPortalOpen(&portalName);
   &cref = &portal.FindCREFByName(&crefName);
   
   If (&cref <> Null) Then
      If (&cref.Authorized) Then
         &url = &cref.AbsoluteContentURL;
      End-If;
   End-If;
   
   %Response.RedirectURL(&url);
End-Function;


2 Create a new CREF for the iScript. In the additional parameters section of the CREF, addPORTAL=EMPLOYEE&CREF=YOUR_CREF_NAME

3 Create a CREF for your external URL

4Update the new iScript CREF's security to match the external content CREF's security.


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章