ChooseServerGroup.csp


<%@ Language=JavaScript%>

<%

// This page is the first page in the example. If provides a form

// that shows all server groups on the APS with buttons that allows

// the user to add, delete, or modify the members in a server group.

// It calls ManageServerGroup.csp to do these things.

%>

<!-- #include file="RetrieveIStore.csp" -->

<!-- #include file=helper_js.csp -->


<html>

<body>

<%

    

function GetServerGroups(IStore)

// Retrieve a list of all ServerGroups on the APS.  Return the list

// in an HTML string that will draw a drop down box.

// Parameters:

// IStore - The InfoStore object.

{

    try{

        // Query for all server groups.

        var ServerGroups = IStore.Query

        ("SELECT SI_SERVER_GROUP, SI_ID, SI_NAME FROM CI_SYSTEMOBJECTS WHERE SI_PROGID='CrystalEnterprise.ServerGroup'");

        if (ServerGroups.Count == 0)

        {    

            return "";

        }

        var k;

        var HTMLTable="<select name=ServerGroupId>";

        // Iterate through all groups and build the drop down box.

        for (k=1;k<=ServerGroups.Count;k++)

        {

            HTMLTable = HTMLTable + "<option value='"+ServerGroups.Item(k).Id+"'>"+ServerGroups.Item(k).Title;

        }

        HTMLTable= HTMLTable + "</select>";

        return HTMLTable;

    }

    catch (e){

        Response.Write("Error");

        return;

    };

}



function Main()

{

    IStore = RetrieveIStore();

    if (IStore == null)

    {

        Response.Redirect ("Start.csp");

        return;

    }

    Response.Write ("<H2>Server group administration</H2>");

    Response.Write ("<form action='ManageServerGroup.csp' method=post name='ServerGroup'>");

    Response.Write ("<H4>Remove or manage group</H4>");

    Response.Write ("Choose the server group that you want to manage.<BR>");

    Response.Write ("Server group: <BR>");

    Response.Write (GetServerGroups(IStore));

    

    Response.Write ("<BR><input type=submit name='Remove' value='Remove'> ");

    Response.Write ("<input type=submit name='ManageMembers' value='ManageMembers'><HR>");

    Response.Write ("<H4>Add a group</H4>");

    Response.Write ("New group name:");

    Response.Write ("<BR><input type=text name='NewGroupName'>");

    Response.Write ("<BR>New group description:");

    Response.Write ("<BR><input type=text name='NewGroupDescription'>");

    Response.Write ("<BR><input type=submit name='Add' value='Add'><HR>");

    Response.Write ("</FORM>");

}


Main();

    

%>

</body>

</html>




Crystal Decisions, Inc.
http://www.crystaldecisions.com
Support services:
http://support.crystaldecisions.com