您的位置:首页 > 其它

How to use cref links redirect to external content ?

2014-11-29 15:58 423 查看

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, add
PORTAL=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.


                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  redirect function
相关文章推荐