How to use cref links redirect to external content ?

来源:互联网 发布:oracle数据库设计工具 编辑:程序博客网 时间:2024/06/06 20:58

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.


0 0