Phone sales support +39 0575 05077
  Phone technical support +39 0575 0508
 

9.1 Personal Templates

By using the Aruba WsEndUser method GetAvailablePersonalTemplates it is possible to recuperate the list of the active customized Templates created by the user.
In the case of users with administrative role it provides in output information on the sale status in the templateSellingStatus field.

Returns
The method returns a WsResultOfArrayOfPersonalTemplate item with information on the result of the call to the method and customized Templates.
//BaseWsEndUser.GetAvailablePersonalTemplates Method (c# .NET) 
private static string GetAvailablePersonalTemplates(WsEndUserClient client)
{ 
    //a StringBuilder class item is created
    StringBuilder sb = new StringBuilder();

    try
    {
        //call method GetAvailablePersonalTemplates,
        //obtaining a WsResultOfArrayOfPersonalTemplate item
        WsResultOfArrayOfPersonalTemplate result = 
            client.GetAvailablePersonalTemplates();

        //if the call is not successful, re-run the error indicating the message
        if (result.Success)
        {
            //browse the list of the templates and print certain values
            foreach (var template in result.Value)
            {
                sb.AppendLine(String.Format("TemplateID: {0}",
                    template.TemplateID));
                sb.AppendLine(String.Format("TemplateName: {0}",
                    template.TemplateName));
                sb.AppendLine(String.Format("TemplateDescription: {0}",
                    template.TemplateDescription));
                sb.AppendLine(String.Format("OSVersion: {0}",
                    template.OSVersion));
                sb.AppendLine(String.Format("TemplateStatus: {0}",
                    template.TemplateStatus));
            }
        }
        else
        {
            throw new ApplicationException(result.ResultMessage);
        }
    }
    catch (Exception ex)
    {
        //re-run the generic error
        Console.WriteLine(ex.Message);
    }

    return sb.ToString();
}	
//BaseWsEndUser.getAvailablePersonalTemplates Method (JAVA) 
private static String getAvailablePersonalTemplates(IWsEndUser client)
{
    //a StringBuilder class item is created
    StringBuilder sb = new StringBuilder();

    try
    {
        //call method getAvailablePersonalTemplates,
        //obtaining a WsResultOfArrayOfPersonalTemplate item
        WsResultOfArrayOfPersonalTemplate result = 
            client.getAvailablePersonalTemplates();

        //if the call is not successful, re-run the error indicating the message
        if (result.isSuccess())
        {
            //browse the list of the templates and print certain values
            for (PersonalTemplate template : result.getValue().getPersonalTemplate())
            {
                sb.append(String.format("TemplateID: {%s}\n",
                    template.getTemplateID()));
                sb.append(String.format("TemplateName: {%s}\n",
                    template.getTemplateName()));
                sb.append(String.format("TemplateDescription: {%s}\n",
                    template.getTemplateDescription()));
                sb.append(String.format("OSVersion: {%s}\n",
                    template.getOSVersion()));
                sb.append(String.format("TemplateStatus: {%s}\n",
                    template.getTemplateStatus()));
            }
        }
        else
        {
            throw new Exception(result.getResultMessage());
        }
    }
    catch (Exception ex)
    {
        //re-run the generic error
        System.out.println(ex);
    }

    return sb.toString();
}
Version
API: v2.8 URL: https://api.dc1.computing.cloud.it/WsEndUser/v2.8/WsEndUser.svc?wsdl
See also




Bookmark and Share