locked
Adding functions to the Self-Service Portal RRS feed

  • Question

  • Is it possible to the Self-Service Portal home.aspx page to include functionality such as javascript functions?

    We are interested in displaying to each visitor his/her IP Address on the Portal page. There is a small javascript function to do this, and we'd like to know if it will be harmful to edit the home.aspx page to include this function.


    Adam Bryer
    Wednesday, January 12, 2011 1:28 PM

Answers

  • Hi,

    Other then some minor things (change logo, remove 'reset password' link...) no customization to the out of the box portal is supported. However, if choosing between making your own self service portal (which also will be unsupported) and trying to get this to work on the original portal, I would definatly try to do the later first. Just take a backup of the files your about to modify, so you can restore them if something goes wrong.

    Regards
    //Anders


    Anders Asp | Lumagate | www.lumagate.com
    • Marked as answer by Adam Bryer Thursday, January 13, 2011 3:44 PM
    Thursday, January 13, 2011 7:28 AM

All replies

  • Hi,

    Other then some minor things (change logo, remove 'reset password' link...) no customization to the out of the box portal is supported. However, if choosing between making your own self service portal (which also will be unsupported) and trying to get this to work on the original portal, I would definatly try to do the later first. Just take a backup of the files your about to modify, so you can restore them if something goes wrong.

    Regards
    //Anders


    Anders Asp | Lumagate | www.lumagate.com
    • Marked as answer by Adam Bryer Thursday, January 13, 2011 3:44 PM
    Thursday, January 13, 2011 7:28 AM
  • Thank you. Good advice.

    We were successfull in inserting the following code into the Portal body of the home page:

    <div style="color:#FF0000">
       &nbsp; IP Address: <% =HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"] %>
     </div>

     


    Adam Bryer
    Thursday, January 13, 2011 3:43 PM
  • Hello Adam..

    Could you detail your solution?

    tks.


    Aurélio Alves
    Monday, February 28, 2011 7:16 PM
  • Please see the bolded text in the listing below.

     

    <%@ Page Language="C#" ValidateRequest="False" %>

    <%@ Register Assembly="Microsoft.EnterpriseManagement.ServiceManager.WebParts" Namespace="Microsoft.EnterpriseManagement.ServiceManager.WebParts"
        TagPrefix="SM_WebParts" %>
    <%@ Register Assembly="Microsoft.EnterpriseManagement.ServiceManager.Portal.Common"
        Namespace="Microsoft.EnterpriseManagement.ServiceManager.Portal.Common" TagPrefix="SM_Portal_Common" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Service Manager Self-Service Portal</title>
        <link href="MasterPages/style.css" rel="stylesheet" type="text/css" />

        <script runat="server">   
           
            private void Page_Load(object sender, EventArgs e)
            {
                GlobalSearch.Search += new SearchEventHandler(GlobalSearch_Search);
            }

            protected override void InitializeCulture()
            {
                base.InitializeCulture();
                Microsoft.EnterpriseManagement.ServiceManager.Portal.Common.Utils.AdjustCulture();
            }

            protected void GlobalSearch_Search(object sender, SearchEventArgs e)
            {
                if (!string.IsNullOrEmpty(e.SearchText))
                {
                    Response.Redirect(Page.ResolveClientUrl(string.Format(System.Globalization.CultureInfo.InvariantCulture,
                                        @"{0}?{1}={2}",
                                        Configurations.ViewAllKnowledgeArticlesPage,
                                        Constants.SearchText, HttpUtility.UrlEncode(e.SearchText))), true);
                }
            }


            protected override void OnPreRender(EventArgs e)
            {
                base.OnPreRender(e);

                // set the search control text
                this.GlobalSearch.SearchText = Utils.GetGlobalSearchText(this.ChildControlsCreated);
            }
           
        </script>

    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:WebPartManager ID="WebPartManager1" runat="server" Personalization-Enabled="false">
            </asp:WebPartManager>
            <table border="0" cellpadding="0" cellspacing="0" style="height: 100%; width: 100%;">
                <tr>
                    <td style="height: 31px;">
                        &nbsp;
                    </td>
                    <td colspan="2" class="graytext">
                        <asp:Label ID="LabelYourAreHere" runat="server" CssClass="graytext" Text="<%$ Resources:EndUserPortalResources, YouAreHereText %>" />
                        <asp:Label ID="LabelHome" runat="server" CssClass="graytext" Font-Bold="true" Text="<%$ Resources:EndUserPortalResources, Home %>" />
                    </td>
                    <td colspan="2" align="right" valign="middle">
                        <table border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                <td align="right" colspan="3">
                                    <asp:WebPartZone ID="WebPartZone1" runat="server" BorderWidth="0px" BorderStyle="None"
                                        PartTitleStyle-CssClass="orangletitle" Width="100%" PartChromeType="None">
                                        <PartTitleStyle CssClass="orangeTitleLeftAligned"></PartTitleStyle>
                                        <ZoneTemplate>
                                            <SM_WebParts:GlobalLinks ID="GlobalPortalLinks" runat="server" Title="   " />
                                        </ZoneTemplate>
                                        <CloseVerb Text="<%$ Resources:EndUserPortalResources, CloseWebPart %>" />
                                        <MinimizeVerb Text="<%$ Resources:EndUserPortalResources, MinimizeWebPart %>" />
                                        <EditVerb Text="<%$ Resources:EndUserPortalResources, EditWebPart %>" />
                                    </asp:WebPartZone>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td style="background-image: MasterPages/images/bg_topbar.png">
                        &nbsp;
                    </td>
                    <td style="background-image: MasterPages/images/bg_topbar.png">
                        <table style="width:100%; height:100%;" id="TableBanner">
                            <tr>
                                <td valign="middle" style="width: 146px;">
                                    <img src="MasterPages/images/SCSM_logo.png" border="0" alt="" />
                                </td>
                                <td valign="middle">
                                    <asp:Label ID="LabelBanner" class="bannertext" runat="server"
                                        Text="<%$ Resources:EndUserPortalResources, EndUserPortalHeader %>"
                                        style="margin-top: 0px; margin-left: 10px" />
                                </td>
                            </tr>
                        </table>
                    </td>
                    <td width="52" height="61" style="background-image: MasterPages/images/bg_topbar.png">
                        &nbsp;
                    </td>
                    <td width="273" height="61" align="center" valign="middle" style="background-image: MasterPages/images/bg_topbar.png">
                        <table width="100%" border="0">
                            <tr>
                                <td>
                                    <SM_Portal_Common:SearchControl ID="GlobalSearch" runat="server" />
                                </td>
                            </tr>
                        </table>
                    </td>
                    <td width="43" height="61" style="background-image: MasterPages/images/bg_topbar.png">
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td height="30">
                        &nbsp;
                    </td>
                    <td height="30">
                        &nbsp;
                    </td>
                    <td height="30">
                        &nbsp;
                    </td>
                    <td width="273" height="30" style="background-image: MasterPages/images/bg_rightbar.png">
                        &nbsp;
                    </td>
                    <td height="30">
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                    <td valign="top">
                        <asp:WebPartZone ID="AnnouncementsWebPartZone" runat="server" PartTitleStyle-CssClass="orangletitle"
                            Width="100%" PartChromeType="None">
                            <PartTitleStyle CssClass="orangeTitleLeftAligned"></PartTitleStyle>
                            <ZoneTemplate>
                                <SM_WebParts:Announcements ID="AnnouncementsWebPart" runat="server" BorderStyle="None"
                                    ChromeType="None" Width="100%" Title=" " />
                            </ZoneTemplate>
                        </asp:WebPartZone>
                    </td>
                    <td width="52">
                        &nbsp;
                    </td>
                    <td width="273" rowspan="3" align="center" valign="top" background="MasterPages/images/bg_rightbar.png"
                        style="background-image: MasterPages/images/bg_topbar.png">
                        <asp:WebPartZone ID="UserIdentificationWebPartZone" runat="server" BorderWidth="0px"
                            BorderStyle="None" PartTitleStyle-CssClass="orangletitle" Width="100%" PartChromeType="None">
                            <PartTitleStyle CssClass="orangeTitleLeftAligned"></PartTitleStyle>
                            <ZoneTemplate>
                                <SM_Portal_Common:UserIdentification ID="UserIdentificationWebPart" runat="server"
                                    Title="      " />
                            </ZoneTemplate>
                        </asp:WebPartZone>
                        <br />
                        <br />
                        <asp:WebPartZone ID="RecentRequestsWebPartZone" runat="server" PartTitleStyle-CssClass="orangletitle"
                            Width="100%" ShowTitleIcons="False">
                            <PartTitleStyle CssClass="orangeTitleLeftAligned"></PartTitleStyle>
                            <ZoneTemplate>
                                <SM_WebParts:RecentRequests ID="RecentRequestsWebPart" runat="server" BorderStyle="None"
                                    ChromeType="None" Width="100%" Title="    " />
                            </ZoneTemplate>
                        </asp:WebPartZone>
                        <%--<br />
                        <br />--%>
                        <p>
                        </p>
                        <asp:WebPartZone ID="WebPartZoneHomePageTasks" runat="server" PartChromeType="None"
                            Width="100%">
                            <PartTitleStyle CssClass="orangeTitleLeftAligned"></PartTitleStyle>
                            <ZoneTemplate>
                                <SM_WebParts:HomePageTasks ID="HomePageTasksWebPart" runat="server" Title="     " ResetPasswordUrl="http://password.tribune.com/" ShowRequestSoftwareLink="false" />
                            </ZoneTemplate>
                        </asp:WebPartZone>
                    </td>
                    <td width="43">
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td width="36">
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td width="52">
                        &nbsp;
                    </td>
                    <td width="43">
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td width="36">
                        &nbsp;
                    </td>
                    <td valign="top">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td height="33" colspan="5" valign="top">
                                    <asp:WebPartZone ID="KnowledgeArticleWebPartZone" runat="server" PartTitleStyle-CssClass="orangletitle"
                                        Width="100%" PartChromeType="None">
                                        <PartTitleStyle CssClass="orangeTitleLeftAligned"></PartTitleStyle>
                                        <ZoneTemplate>
                                            <SM_WebParts:KnowledgeArticlePart ID="KnowledgeArticlePart" runat="server" BorderStyle="None"
                                                ChromeType="None" Width="100%" Title="          " />
                                        </ZoneTemplate>
                                    </asp:WebPartZone>
                                </td>
                            </tr>
                        </table>
    <div style="color:#FF0000">
       &nbsp; IP Address: <% =HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"] %>
     </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td width="150" height="46" align="right" style="background-image: MasterPages/images/bg_rightbar.png">
                        <img src="Masterpages/images/SCSM_logo.png" alt="System Center Service Manager" hspace="10" />
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
            </table>
        </div>
        </form>
    </body>
    </html>


    Adam Bryer
    Tuesday, March 1, 2011 3:28 PM