Merge pull request #2 from subhasukumaran/master

UMP-9108- Added API v4.0 and v5.0
This commit is contained in:
venkatesan-r-1509 2019-04-17 14:12:18 +05:30 коммит произвёл GitHub
Родитель 5c0a119d83 cb358c7e74
Коммит 50b3ce2bd9
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
22 изменённых файлов: 2614 добавлений и 889 удалений

Просмотреть файл

@ -135,6 +135,23 @@
<Compile Include="V3\Models\ApiYearlyScheduleCustomRecurrence.cs" />
<Compile Include="V3\Models\ApiYearlyScheduleMonthRecurrence.cs" />
<Compile Include="V3\ServerClientV3.cs" />
<Compile Include="V4\EndPoints\ScheduleEndPointV4.cs" />
<Compile Include="V4\Models\ApiReportParameter.cs" />
<Compile Include="V4\Models\ApiReportParameters.cs" />
<Compile Include="V4\Models\ApiScheduleItemDetail.cs" />
<Compile Include="V4\Models\ApiScheduleRequestV4.cs" />
<Compile Include="V4\Models\ApiUpdateScheduleRequestV4.cs" />
<Compile Include="V4\ServerClientV4.cs" />
<Compile Include="V5\EndPoints\ItemsEndPoint.cs" />
<Compile Include="V5\Models\ApiItemDetailV5.cs" />
<Compile Include="V5\Models\ApiReportAddV5.cs" />
<Compile Include="V5\Models\ApiReportDataSetAddV5.cs" />
<Compile Include="V5\Models\ApiReportDataSetUpdateV5.cs" />
<Compile Include="V5\Models\ApiReportDataSourceUpdateV5.cs" />
<Compile Include="V5\Models\ApiReportUpdateV5.cs" />
<Compile Include="V5\Models\DataSetMappingInfoV5.cs" />
<Compile Include="V5\Models\DataSourceMappingInfoV5.cs" />
<Compile Include="V5\ServerClientV5.cs" />
</ItemGroup>
<ItemGroup>
<Compile Include="V1\Models\UserStatus.cs" />

Просмотреть файл

@ -1,301 +1,205 @@
namespace Syncfusion.Report.Server.Api.Helper.V2.Models
{
using System;
using System.Xml.Serialization;
/// <summary>
/// Set the type of credentials to secure data
/// Prompt: Credentials should be supplied by the user while running the report,
/// Store: Credentials that stored securely in the report server,
/// Integrated: Use the Windows credentials of the current user to access the data source,
/// None: Credentials are not required.
/// </summary>
public enum CredentialRetrieval
{
Prompt,
Store,
Integrated,
None,
}
#region property used in api
/// <summary>
/// Select the server type to make datasource connection
/// </summary>
public enum ServerType
{
None,
SQL,
SQLCE,
OLEDB,
ODBC,
Oracle,
XML,
SSAS,
OData,
PostgreSQL
}
#endregion
/// <summary>
/// Datasource definition
/// </summary>
[Serializable]
public class DataSourceDefinition
{
private string connectStringField;
private CredentialRetrieval credentialRetrievalField;
private bool enabledField;
private bool enabledFieldSpecified;
private string extensionField;
private bool impersonateUserField;
private bool impersonateUserFieldSpecified;
private bool originalConnectStringExpressionBasedField;
private string passwordField;
private string promptField;
private bool useOriginalConnectStringField;
private string userNameField;
private bool windowsCredentialsField;
private bool windowsCredentialsFieldSpecified;
/// <summary>
/// Datasource connection string
/// </summary>
public string ConnectString
{
get
{
return this.connectStringField;
}
set
{
this.connectStringField = value;
}
}
/// <summary>
/// Set the type of credentials to secure data
/// </summary>
public CredentialRetrieval CredentialRetrieval
{
get
{
return this.credentialRetrievalField;
}
set
{
this.credentialRetrievalField = value;
}
}
/// <summary>
/// Set true if modifying the datasource connection details
/// </summary>
public bool Enabled
{
get
{
return this.enabledField;
}
set
{
this.enabledField = Convert.ToBoolean(value.ToString().ToLower());
}
}
/// <summary>
/// Set true to save the propoerty - (Enabled) in xml file
/// </summary>
[XmlIgnore]
public bool EnabledSpecified
{
get
{
return this.enabledFieldSpecified;
}
set
{
this.enabledFieldSpecified = value;
}
}
/// <summary>
/// Specify the Server type
/// </summary>
public string Extension
{
get
{
return this.extensionField;
}
set
{
this.extensionField = value;
}
}
/// <summary>
/// Set to true to impersonate the authenticated user after a connection has been made to the datasource
/// </summary>
public bool ImpersonateUser
{
get
{
return this.impersonateUserField;
}
set
{
this.impersonateUserField = value;
}
}
/// <summary>
/// Set true to save the impersonate user in xml file
/// </summary>
[XmlIgnore]
public bool ImpersonateUserSpecified
{
get
{
return this.impersonateUserFieldSpecified;
}
set
{
this.impersonateUserFieldSpecified = value;
}
}
/// <summary>
/// Specifies the original connection string
/// </summary>
public bool OriginalConnectStringExpressionBased
{
get
{
return this.originalConnectStringExpressionBasedField;
}
set
{
this.originalConnectStringExpressionBasedField = value;
}
}
/// <summary>
/// Specifies the password of connection credentials
/// </summary>
public string Password
{
get
{
return this.passwordField;
}
set
{
this.passwordField = value;
}
}
/// <summary>
/// Specifies the text that prompts users for a username and password
/// </summary>
public string Prompt
{
get
{
return this.promptField;
}
set
{
this.promptField = value;
}
}
/// <summary>
/// Specifies whether to use origingal connection string
/// </summary>
public bool UseOriginalConnectString
{
get
{
return this.useOriginalConnectStringField;
}
set
{
this.useOriginalConnectStringField = value;
}
}
/// <summary>
/// Specifies the username of connection credentials
/// </summary>
public string UserName
{
get
{
return this.userNameField;
}
set
{
this.userNameField = value;
}
}
/// <summary>
/// Set to true to use Windows credentials when connecting to the datasource
/// </summary>
public bool WindowsCredentials
{
get
{
return this.windowsCredentialsField;
}
set
{
this.windowsCredentialsField = value;
}
}
/// <summary>
/// Set true to save the windows credentials in xml file
/// </summary>
[XmlIgnore]
public bool WindowsCredentialsSpecified
{
get
{
return this.windowsCredentialsFieldSpecified;
}
set
{
this.windowsCredentialsFieldSpecified = value;
}
}
#region property used in api
/// <summary>
/// Specify the server type
/// </summary>
[XmlIgnore]
public ServerType ServerType
{
get;
set;
}
#endregion
}
using System;
using System.Runtime.Serialization;
using System.Xml.Serialization;
/// <summary>
/// Set the type of credentials to secure data
/// Prompt: Credentials should be supplied by the user while running the report,
/// Store: Credentials that stored securely in the report server,
/// Integrated: Use the Windows credentials of the current user to access the data source,
/// None: Credentials are not required.
/// </summary>
public enum CredentialRetrieval
{
Prompt,
Store,
Integrated,
None,
}
#region property used in api
/// <summary>
/// Select the server type to make datasource connection
/// </summary>
public enum ServerType
{
None,
SQL,
SQLCE,
OLEDB,
ODBC,
Oracle,
XML,
SSAS,
OData,
PostgreSQL
}
#endregion
/// <summary>
/// Datasource definition
/// </summary>
[Serializable]
[DataContract]
public class DataSourceDefinition
{
/// <summary>
/// Datasource connection string
/// </summary>
[DataMember]
public string ConnectString
{
get;
set;
}
/// <summary>
/// Set the type of credentials to secure data
/// </summary>
[DataMember]
public CredentialRetrieval CredentialRetrieval
{
get;
set;
}
/// <summary>
/// Set true if modifying the datasource connection details
/// </summary>
[DataMember]
public bool Enabled
{
get;
set;
}
/// <summary>
/// Set true to save the propoerty - (Enabled) in xml file
/// </summary>
[XmlIgnore]
[DataMember]
public bool EnabledSpecified
{
get;
set;
}
/// <summary>
/// Specify the Server type
/// </summary>
[DataMember]
public string Extension
{
get;
set;
}
/// <summary>
/// Set to true to impersonate the authenticated user after a connection has been made to the datasource
/// </summary>
[DataMember]
public bool ImpersonateUser
{
get;
set;
}
/// <summary>
/// Set true to save the impersonate user in xml file
/// </summary>
[XmlIgnore]
[DataMember]
public bool ImpersonateUserSpecified
{
get;
set;
}
/// <summary>
/// Specifies the original connection string
/// </summary>
[DataMember]
public bool OriginalConnectStringExpressionBased
{
get;
set;
}
/// <summary>
/// Specifies the password of connection credentials
/// </summary>
[DataMember]
public string Password
{
get;
set;
}
/// <summary>
/// Specifies the text that prompts users for a username and password
/// </summary>
[DataMember]
public string Prompt
{
get;
set;
}
/// <summary>
/// Specifies whether to use origingal connection string
/// </summary>
[DataMember]
public bool UseOriginalConnectString
{
get;
set;
}
/// <summary>
/// Specifies the username of connection credentials
/// </summary>
[DataMember]
public string UserName
{
get;
set;
}
/// <summary>
/// Set to true to use Windows credentials when connecting to the datasource
/// </summary>
[DataMember]
public bool WindowsCredentials
{
get;
set;
}
/// <summary>
/// Set true to save the windows credentials in xml file
/// </summary>
[XmlIgnore]
[DataMember]
public bool WindowsCredentialsSpecified
{
get;
set;
}
#region property used in api
/// <summary>
/// Specify the server type
/// </summary>
[XmlIgnore]
[DataMember]
public ServerType ServerType
{
get;
set;
}
#endregion
}
}

Просмотреть файл

@ -1,60 +1,82 @@
using Newtonsoft.Json;
using Syncfusion.Report.Server.Api.Helper.V2.Models;
using Syncfusion.Report.Server.Api.Helper.V3.Models;
using Syncfusion.Report.Server.API.Helper.V3;
using System;
using System.Web.Http;
namespace Syncfusion.Report.Server.Api.Helper.V3.EndPoints
{
public class ScheduleEndPoint
{
private readonly ServerClientV3 _serverClientV3;
private readonly string _baseUrl;
public ScheduleEndPoint(ServerClientV3 serverClientV3)
{
_serverClientV3 = serverClientV3;
_baseUrl = _serverClientV3.BaseUrl;
private readonly ServerClientV3 _serverClientV3;
private readonly string _baseUrl;
public ScheduleEndPoint(ServerClientV3 serverClientV3)
{
_serverClientV3 = serverClientV3;
_baseUrl = _serverClientV3.BaseUrl;
}
/// <summary>
/// This method is used to create new schedules.
/// </summary>
/// <param name="apiScheduleRequest">Schedule details.</param>
/// <returns>Status of adding schedule in server.</returns>
/// <summary>
/// This method is used to create new schedules.
/// </summary>
/// <param name="apiScheduleRequest">Schedule details.</param>
/// <returns>Status of adding schedule in server.</returns>
public ApiScheduleResponse AddSchedule(ApiScheduleRequest apiScheduleRequest)
{
var result = _serverClientV3.Post(apiScheduleRequest, _baseUrl + "/reports/schedule");
var response = new ApiScheduleResponse();
if (result != null)
{
return JsonConvert.DeserializeObject<ApiScheduleResponse>(result.Content);
}
else
{
return response;
}
public ApiScheduleResponse AddSchedule(ApiScheduleRequest apiScheduleRequest)
{
var result = _serverClientV3.Post(apiScheduleRequest, _baseUrl + "/reports/schedule");
var response = new ApiScheduleResponse();
if (result != null)
{
return JsonConvert.DeserializeObject<ApiScheduleResponse>(result.Content);
}
else
{
return response;
}
}
/// <summary>
/// This method is used to create new schedules.
/// </summary>
/// <param name="scheduleid">Schedule Id </param>
/// <param name="apiScheduleRequest">Schedule details.</param>
/// <returns>Status of adding schedule in server.</returns>
/// <summary>
/// This method is used to create new schedules.
/// </summary>
/// <param name="scheduleid">Schedule Id </param>
/// <param name="apiScheduleRequest">Schedule details.</param>
/// <returns>Status of adding schedule in server.</returns>
public ApiScheduleResponse UpdateSchedule(Guid scheduleid, ApiScheduleRequest apiScheduleRequest)
{
var result = _serverClientV3.Put(apiScheduleRequest, _baseUrl + "/reports/schedule/" + scheduleid);
var response = new ApiScheduleResponse();
if (result != null)
{
return JsonConvert.DeserializeObject<ApiScheduleResponse>(result.Content);
}
else
{
return response;
}
public ApiScheduleResponse UpdateSchedule(Guid scheduleid, ApiScheduleRequest apiScheduleRequest)
{
var result = _serverClientV3.Put(apiScheduleRequest, _baseUrl + "/reports/schedule/" + scheduleid);
var response = new ApiScheduleResponse();
if (result != null)
{
return JsonConvert.DeserializeObject<ApiScheduleResponse>(result.Content);
}
else
{
return response;
}
}
/// <summary>
/// This method is used to export the reports with filterparameters for the users who have read access for reports.
/// </summary>
/// <param name="apiExportReport">Report details (Report Id, Server path, Export type).</param>
/// <returns>Status of exporting the report.</returns>
public ApiExportReportResponse ExportReportWithFilter(Guid reportId, string exportType, [FromUri]string filterParameters = null)
{
var result = _serverClientV3.Post(reportId, _baseUrl + "/reports/" + reportId + "/" + exportType + "/export-filter?filterParameters=" + filterParameters);
var response = new ApiExportReportResponse();
if (result != null)
{
return JsonConvert.DeserializeObject<ApiExportReportResponse>(result.Content);
}
else
{
return response;
}
}
}
}

Просмотреть файл

@ -1,18 +1,18 @@
using Syncfusion.Report.Server.Api.Helper.V3.EndPoints;
namespace Syncfusion.Report.Server.API.Helper.V3
{
public sealed class ServerClientV3 : ServerApiHelper
{
public ServerClientV3()
using Syncfusion.Report.Server.Api.Helper.V3.EndPoints;
namespace Syncfusion.Report.Server.API.Helper.V3
{
public sealed class ServerClientV3 : ServerApiHelper
{
public ServerClientV3()
{
BaseUrl = BaseUrl + "/api/v3.0";
BaseUrl = BaseUrl + "/api/v3.0";
}
public ScheduleEndPoint ScheduleEndPoint3()
{
return new ScheduleEndPoint(this);
}
}
public ScheduleEndPoint ScheduleEndPoint3()
{
return new ScheduleEndPoint(this);
}
}
}

Просмотреть файл

@ -0,0 +1,102 @@
namespace Syncfusion.Report.Server.Api.Helper.V4.EndPoints
{
using System;
using Newtonsoft.Json;
using Syncfusion.Report.Server.Api.Helper.V3.Models;
using Syncfusion.Report.Server.Api.Helper.V4.Models;
public class ScheduleEndPointV4
{
private readonly ServerClientV4 _serverClientV4;
private readonly string _baseUrl;
public ScheduleEndPointV4(ServerClientV4 serverClientV4)
{
_serverClientV4 = serverClientV4;
_baseUrl = _serverClientV4.BaseUrl;
}
/// <summary>
/// This method is used to create new schedules.
/// </summary>
/// <param name="apiScheduleRequest">Schedule details.</param>
/// <returns>Status of adding schedule in server.</returns>
public ApiScheduleResponse AddSchedule(ApiScheduleRequestV4 apiScheduleRequest)
{
var result = _serverClientV4.Post(apiScheduleRequest, _baseUrl + "/reports/schedule");
var response = new ApiScheduleResponse();
if (result != null)
{
return JsonConvert.DeserializeObject<ApiScheduleResponse>(result.Content);
}
else
{
return response;
}
}
/// <summary>
/// This method is used to create new schedules.
/// </summary>
/// <param name="scheduleid">Schedule Id </param>
/// <param name="apiScheduleRequest">Schedule details.</param>
/// <returns>Status of adding schedule in server.</returns>
public ApiScheduleResponse UpdateSchedule(Guid scheduleid, ApiUpdateScheduleRequestV4 apiScheduleRequest)
{
var result = _serverClientV4.Put(apiScheduleRequest, _baseUrl + "/reports/schedule/" + scheduleid);
var response = new ApiScheduleResponse();
if (result != null)
{
return JsonConvert.DeserializeObject<ApiScheduleResponse>(result.Content);
}
else
{
return response;
}
}
/// <summary>
/// This method returns item details for the values Schedule Id.
/// </summary>
/// <param name="scheduleId">The id values should be valid Schedule Id.</param>
/// <returns>Item details for the values.</returns>
public ApiScheduleItemDetail GetScheduleDetail(Guid scheduleId)
{
var overrideUrl = _baseUrl + "/reports/schedule/" + scheduleId;
var scheduleDetail = new ApiScheduleItemDetail();
var result = _serverClientV4.Get(scheduleDetail, overrideUrl);
if (result != null)
{
return JsonConvert.DeserializeObject<ApiScheduleItemDetail>(result.Content);
}
else
{
return scheduleDetail;
}
}
/// <summary>
/// This method returns report parameter details
/// </summary>
/// <param name="repotId">The id values should be valid report Id.</param>
/// <returns>Parameter details for the values.</returns>
public ApiReportParameters GetReportParameters(Guid repotId)
{
var overrideUrl = _baseUrl + "/reports/parameters/" + repotId;
var reportParameters = new ApiReportParameters();
var result = _serverClientV4.Get(reportParameters, overrideUrl);
if (result != null)
{
return JsonConvert.DeserializeObject<ApiReportParameters>(result.Content);
}
else
{
return reportParameters;
}
}
}
}

Просмотреть файл

@ -0,0 +1,17 @@
namespace Syncfusion.Report.Server.Api.Helper.V4.Models
{
using Syncfusion.Report.Server.Api.Helper.V3.Models;
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
[Serializable]
[DataContract]
public class ApiReportParameter
{
[DataMember]
public string Name { get; set; }
[DataMember]
public List<string> Values { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,19 @@
namespace Syncfusion.Report.Server.Api.Helper.V4.Models
{
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
[Serializable]
[DataContract]
public class ApiReportParameters
{
[DataMember]
public List<ApiReportParameter> ReportParameter
{
get;
set;
}
}
}

Просмотреть файл

@ -0,0 +1,271 @@
namespace Syncfusion.Report.Server.Api.Helper.V4.Models
{
using Syncfusion.Report.Server.Api.Helper.V3.Models;
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
[Serializable]
[DataContract]
public class ApiScheduleItemDetail
{
/// <summary>
/// Specifies the user ID of the item creator.
/// </summary>
[DataMember]
public int CreatedById
{
get;
set;
}
/// <summary>
/// Date created of item in date format.
/// </summary>
[DataMember]
public DateTime CreatedDate
{
get;
set;
}
/// <summary>
/// Specifies the report export type.
/// </summary>
[DataMember]
public string ExportType
{
get;
set;
}
/// <summary>
/// Specifies the the end date of the schedule.
/// </summary>
[DataMember]
public DateTime? EndDate
{
get;
set;
}
/// <summary>
/// Specifies the export type id of schedule.
/// </summary>
[DataMember]
public int ExportTypeId
{
get;
set;
}
/// <summary>
/// Returns true, if the Schedule is active.
/// </summary>
public bool IsActive
{
get;
set;
}
/// <summary>
/// Returns true, if the Schedule is enabled.
/// </summary>
[DataMember]
public bool IsEnabled
{
get;
set;
}
/// <summary>
/// Specifies the ItemType.
/// </summary>
[DataMember]
public string ItemType
{
get;
set;
}
/// <summary>
/// Date modified of item in date format.
/// </summary>
[DataMember]
public DateTime ModifiedDate
{
get;
set;
}
/// <summary>
/// Specifies the user ID of the item modifier.
/// </summary>
[DataMember]
public int ModifiedById
{
get;
set;
}
/// <summary>
/// Specifies the Next scheduled date and time.
/// </summary>
[DataMember]
public DateTime? NextSchedule
{
get;
set;
}
/// <summary>
/// Specifies the recurrence information of the schedule.
/// </summary>
[DataMember]
public string RecurrenceInfo
{
get;
set;
}
/// <summary>
/// Specifies the recurrence Id of the schedule.
/// </summary>
[DataMember]
public int RecurrenceTypeId
{
get;
set;
}
/// <summary>
/// Specifies the recurrence type of the schedule.
/// </summary>
[DataMember]
public string RecurrenceType
{
get;
set;
}
/// <summary>
/// Item ID.
/// </summary>
[DataMember]
public Guid ReportId
{
get;
set;
}
/// <summary>
/// Item name.
/// </summary>
[DataMember]
public string ReportName
{
get;
set;
}
/// <summary>
/// Schedule ID.
/// </summary>
[DataMember]
public Guid ScheduleId
{
get;
set;
}
/// <summary>
/// Schedule name.
/// </summary>
[DataMember]
public string ScheduleName
{
get;
set;
}
/// <summary>
/// Specifies the start date of the schedule.
/// </summary>
[DataMember]
public DateTime StartDate
{
get;
set;
}
/// <summary>
/// Sets the schedule with no end when specified as true. \n\n Note: By default, the NeverEnd is set to true. To set the end time for the schedule, fill the properties of either EndAfterOccurrence or EndDate; otherwise remains empty.
/// </summary>
[DataMember]
public bool NeverEnd { get; set; }
/// <summary>
/// Specifies the number of occurrences after which the schedule will be completed. \n\n For example: If you provide 5, the schedule will end after the completion of 5 occurrences.
/// </summary>
[DataMember]
public int EndAfterOccurrence { get; set; }
/// <summary>
/// Provides the list of username, email, or user IDs to the recipients who will get the schedules.
/// </summary>
[DataMember]
public List<int> UserList { get; set; }
/// <summary>
/// Provides the list of group IDs to the recipients in the group list who will get the schedules.
/// </summary>
[DataMember]
public List<int?> GroupList { get; set; }
/// <summary>
/// Provides the list of email IDs to the email recipients who will get the schedules.
/// </summary>
[DataMember]
public List<string> ExternalRecipientsList { get; set; }
/// <summary>
/// Runs the schedules on an hourly basis.
/// </summary>
[DataMember]
public ApiHourlySchedule HourlySchedule { get; set; }
/// <summary>
/// Runs the schedules on a daily basis.
/// </summary>
[DataMember]
public ApiDailySchedule DailySchedule { get; set; }
/// <summary>
/// Runs the schedule on a weekly basis.
/// </summary>
[DataMember]
public ApiWeeklySchedule WeeklySchedule { get; set; }
/// <summary>
/// Runs the schedule on a monthly basis.
/// </summary>
[DataMember]
public ApiMonthlySchedule MonthlySchedule { get; set; }
/// <summary>
/// Runs the schedules on a yearly basis.
/// </summary>
[DataMember]
public ApiYearlySchedule YearlySchedule { get; set; }
/// <summary>
/// Specify the schedule parameter
/// </summary>
[DataMember]
public List<ApiReportParameter> ReportParameter
{
get;
set;
}
}
}

Просмотреть файл

@ -0,0 +1,130 @@
namespace Syncfusion.Report.Server.Api.Helper.V4.Models
{
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.ComponentModel.DataAnnotations;
using Syncfusion.Report.Server.Api.Helper.V3.Models;
/// <summary>
/// Details about the schedule passed will be added to the server.
/// </summary>
[Serializable]
[DataContract]
public class ApiScheduleRequestV4
{
/// <summary>
/// Schedule name.
/// </summary>
[DataMember]
[Required]
public string Name { get; set; }
/// <summary>
/// Report ID.
/// </summary>
[DataMember]
[Required]
public Guid ReportId { get; set; }
/// <summary>
/// Specifies the export type to schedule the report. Valid values: `Excel` `Html` `Pdf` `Word` `PPT` `CSV`.
/// </summary>
[DataMember]
[Required]
public string ExportType { get; set; }
/// <summary>
/// Specifies the UTC start date-time of schedule. The format should be ISO 8601 i.e. `yyyy-mm-ddTHH:mm:ssZ`.
/// </summary>
[DataMember]
[Required]
public string StartTime { get; set; }
/// <summary>
/// Sets the schedule with no end when specified as true. \n\n Note: By default, the NeverEnd is set to true. To set the end time for the schedule, fill the properties of either EndAfterOccurrence or EndDate; otherwise remains empty.
/// </summary>
[DataMember]
public bool NeverEnd { get; set; }
/// <summary>
/// Specifies the number of occurrences after which the schedule will be completed. \n\n For example: If you provide 5, the schedule will end after the completion of 5 occurrences.
/// </summary>
[DataMember]
public int EndAfterOccurrence { get; set; }
/// <summary>
/// Specifies the UTC end date-time of schedule after which schedule will be completed. The format should be ISO 8601 i.e. `yyyy-mm-ddTHH:mm:ssZ`. \n\n For example: If you provide the end date-time, the schedule will end once the end date-time is reached.
/// </summary>
[DataMember]
public string EndDate { get; set; }
/// <summary>
/// Provides the list of username, email, or user IDs to the recipients who will get the schedules.
/// </summary>
[DataMember]
public List<string> UserList { get; set; }
/// <summary>
/// Provides the list of group IDs to the recipients in the group list who will get the schedules.
/// </summary>
[DataMember]
public List<int> GroupList { get; set; }
/// <summary>
/// Provides the list of email IDs to the email recipients who will get the schedules.
/// </summary>
[DataMember]
public List<string> ExternalRecipientsList { get; set; }
/// <summary>
/// Specifies the schedule type to schedule the report. Valid values: `Hourly` `Daily` `Weekly` `Monthly` `Yearly`. \n\n Note: If you chose the schedule type as `Monthly`, provide a values to the MonthlySchedule property, and leave the (HourlySchedule, DailySchedule, WeeklySchedule and YearlySchedule) property empty.
/// </summary>
[DataMember]
[Required]
public string ScheduleType { get; set; }
/// <summary>
/// Runs the schedules on an hourly basis.
/// </summary>
[DataMember]
public ApiHourlySchedule HourlySchedule { get; set; }
/// <summary>
/// Runs the schedules on a daily basis.
/// </summary>
[DataMember]
public ApiDailySchedule DailySchedule { get; set; }
/// <summary>
/// Runs the schedule on a weekly basis.
/// </summary>
[DataMember]
public ApiWeeklySchedule WeeklySchedule { get; set; }
/// <summary>
/// Runs the schedule on a monthly basis.
/// </summary>
[DataMember]
public ApiMonthlySchedule MonthlySchedule { get; set; }
/// <summary>
/// Runs the schedules on a yearly basis.
/// </summary>
[DataMember]
public ApiYearlySchedule YearlySchedule { get; set; }
[DataMember]
public bool Enabled { get; set; }
/// <summary>
/// Specify the schedule parameter
/// </summary>
[DataMember]
public List<ApiReportParameter> ReportParameter
{
get;
set;
}
}
}

Просмотреть файл

@ -0,0 +1,145 @@
namespace Syncfusion.Report.Server.Api.Helper.V4.Models
{
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.ComponentModel.DataAnnotations;
using Syncfusion.Report.Server.Api.Helper.V3.Models;
/// <summary>
/// Details about the schedule passed will be added to the server.
/// </summary>
[Serializable]
[DataContract]
public class ApiUpdateScheduleRequestV4
{
/// <summary>
/// Schedule name.
/// </summary>
[DataMember]
public string Name { get; set; }
/// <summary>
/// Report ID.
/// </summary>
[DataMember]
[Required]
public Guid ReportId { get; set; }
/// <summary>
/// Specifies the export type to schedule the report. Valid values: `Excel` `Html` `Pdf` `Word` `PPT` `CSV`.
/// </summary>
[DataMember]
public string ExportType { get; set; }
/// <summary>
/// Specifies the UTC start date-time of schedule. The format should be ISO 8601 i.e. `yyyy-mm-ddTHH:mm:ssZ`.
/// </summary>
[DataMember]
public string StartTime { get; set; }
/// <summary>
/// Sets the schedule with no end when specified as true. \n\n Note: By default, the NeverEnd is set to true. To set the end time for the schedule, fill the properties of either EndAfterOccurrence or EndDate; otherwise remains empty.
/// </summary>
[DataMember]
public bool NeverEnd { get; set; }
/// <summary>
/// Specifies the number of occurrences after which the schedule will be completed. \n\n For example: If you provide 5, the schedule will end after the completion of 5 occurrences.
/// </summary>
[DataMember]
public int EndAfterOccurrence { get; set; }
/// <summary>
/// Specifies the UTC end date-time of schedule after which schedule will be completed. The format should be ISO 8601 i.e. `yyyy-mm-ddTHH:mm:ssZ`. \n\n For example: If you provide the end date-time, the schedule will end once the end date-time is reached.
/// </summary>
[DataMember]
public string EndDate { get; set; }
/// <summary>
/// Provides the list of username, email, or user IDs to the recipients who will get the schedules.
/// </summary>
[DataMember]
public List<string> UserList { get; set; }
/// <summary>
/// Provides the list of group IDs to the recipients in the group list who will get the schedules.
/// </summary>
[DataMember]
public List<int> GroupList { get; set; }
/// <summary>
/// Provides the list of email IDs to the email recipients who will get the schedules.
/// </summary>
[DataMember]
public List<string> ExternalRecipientsList { get; set; }
/// <summary>
/// Provides the list of username, email, or user IDs to remove recipients from the schedule subscriptions.
/// </summary>
[DataMember]
public List<string> RemoveUserList { get; set; }
/// <summary>
/// Provides the list of group IDs to remove groups from the schedule subscriptions.
/// </summary>
[DataMember]
public List<int> RemoveGroupList { get; set; }
/// <summary>
/// Provides the list of email IDs to remove email recipients from the schedule subscriptions.
/// </summary>
[DataMember]
public List<string> RemoveExternalRecipientsList { get; set; }
/// <summary>
/// Specifies the schedule type to schedule the report. Valid values: `Hourly` `Daily` `Weekly` `Monthly` `Yearly`. \n\n Note: If you chose the schedule type as `Monthly`, provide a values to the MonthlySchedule property, and leave the (HourlySchedule, DailySchedule, WeeklySchedule and YearlySchedule) property empty.
/// </summary>
[DataMember]
public string ScheduleType { get; set; }
/// <summary>
/// Runs the schedules on an hourly basis.
/// </summary>
[DataMember]
public ApiHourlySchedule HourlySchedule { get; set; }
/// <summary>
/// Runs the schedules on a daily basis.
/// </summary>
[DataMember]
public ApiDailySchedule DailySchedule { get; set; }
/// <summary>
/// Runs the schedule on a weekly basis.
/// </summary>
[DataMember]
public ApiWeeklySchedule WeeklySchedule { get; set; }
/// <summary>
/// Runs the schedule on a monthly basis.
/// </summary>
[DataMember]
public ApiMonthlySchedule MonthlySchedule { get; set; }
/// <summary>
/// Runs the schedules on a yearly basis.
/// </summary>
[DataMember]
public ApiYearlySchedule YearlySchedule { get; set; }
[DataMember]
public bool Enabled { get; set; }
/// <summary>
/// Specify the schedule parameter
/// </summary>
[DataMember]
public List<ApiReportParameter> ReportParameter
{
get;
set;
}
}
}

Просмотреть файл

@ -0,0 +1,24 @@
using Syncfusion.Report.Server.Api.Helper.V4.EndPoints;
using Syncfusion.Report.Server.API.Helper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Syncfusion.Report.Server.Api.Helper.V4
{
public sealed class ServerClientV4 : ServerApiHelper
{
public ServerClientV4()
{
BaseUrl = BaseUrl + "/api/v4.0";
}
public ScheduleEndPointV4 ScheduleEndPoint4()
{
return new ScheduleEndPointV4(this);
}
}
}

Просмотреть файл

@ -0,0 +1,148 @@
namespace Syncfusion.Report.Server.Api.Helper.V5.EndPoints
{
using System.Collections.Generic;
using System.Web.Http;
using Newtonsoft.Json;
using Syncfusion.Report.Server.Api.Helper.V2.Models;
using Syncfusion.Report.Server.Api.Helper.V5.Models;
public class ItemsEndPoint
{
private readonly ServerClientV5 _serverClientV5;
private readonly string _baseUrl;
public ItemsEndPoint(ServerClientV5 serverClientV5)
{
_serverClientV5 = serverClientV5;
_baseUrl = _serverClientV5.BaseUrl;
}
/// <summary>
/// This method is used to add new report to the server.
/// </summary>
/// <param name="apiReportAdd">Report details (Report name, Report description, IsPublic, Item in an array of bytes) to be added.</param>
/// <returns>Status of added report to the server.</returns>
public ApiItemResponse AddReport(ApiReportAddV5 apiReportAdd)
{
var result = _serverClientV5.Post(apiReportAdd, _baseUrl + "/reports");
var response = new ApiItemResponse();
if (result != null)
{
return JsonConvert.DeserializeObject<ApiItemResponse>(result.Content);
}
else
{
return response;
}
}
/// <summary>
/// This method is used to update the existing report on the server.
/// </summary>
/// <param name="apiReportUpdate">Report details (Report name, Report description, IsPublic, Item in an array of bytes) to be updated.</param>
/// <returns>Status of updating the report on the server.</returns>
public ApiItemResponse UpdateReport(ApiReportUpdateV5 apiReportUpdate)
{
var requestUrl = _baseUrl + "/reports";
var result = _serverClientV5.Put(apiReportUpdate, requestUrl);
var response = new ApiItemResponse();
if (result != null)
{
return JsonConvert.DeserializeObject<ApiItemResponse>(result.Content);
}
else
{
return response;
}
}
/// <summary>
/// This method is used to update the existing datasource on the server.
/// </summary>
/// <param name="apiDataSourceUpdate">Datasource details(Datasource name, Datasource description and item in an array of bytes) to be updated.</param>
/// <returns>Status of updating the datasource on the server.</returns>
public ApiResponse UpdateDataSource(ApiReportDataSourceUpdateV5 apiReportDataSourceUpdate)
{
var requestUrl = _baseUrl + "/reports/data-sources";
var result = _serverClientV5.Put(apiReportDataSourceUpdate, requestUrl);
var response = new ApiResponse();
if (result != null)
{
return JsonConvert.DeserializeObject<ApiResponse>(result.Content);
}
else
{
return response;
}
}
/// <summary>
/// This method is used to add new dataset to the server.
/// </summary>
/// <param name="apiReportDatasetAdd">Dataset details(Dataset name, Datasource Details and item in an array of bytes) to be added.</param>
/// <returns>Status of adding dataset to the server.</returns>
public ApiItemResponse AddDataset(ApiReportDataSetAddV5 apiReportDatasetAdd)
{
var result = _serverClientV5.Post(apiReportDatasetAdd, _baseUrl + "/reports/datasets");
var response = new ApiItemResponse();
if (result != null)
{
return JsonConvert.DeserializeObject<ApiItemResponse>(result.Content);
}
else
{
return response;
}
}
/// <summary>
/// This method is used to update the existing dataset on the server.
/// </summary>
/// <param name="apiWidgetUpdate">Dataset details(Dataset name, Datasource Details and item in an array of bytes) to be updated.</param>
/// <returns>Status of updating the dataset on the server.</returns>
public ApiItemResponse UpdateDataset(ApiReportDataSetUpdateV5 apiReportDatasetUpdate)
{
var requestUrl = _baseUrl + "/reports/datasets";
var result = _serverClientV5.Put(apiReportDatasetUpdate, requestUrl);
var response = new ApiItemResponse();
if (result != null)
{
return JsonConvert.DeserializeObject<ApiItemResponse>(result.Content);
}
else
{
return response;
}
}
/// <summary>
/// This method returns list of items for the itemtype category, report, datasource, dataset, file and schedule with webdesignercompatible property.
/// </summary>
/// <param name="itemType">Item type (category, report, datasource, dataset, file and schedule)</param>
/// <param name="serverPath">Category path</param>
/// <returns>List of items for the itemtype.</returns>
public List<ApiItemDetailV5> GetItems([FromUri] ItemType itemType, [FromUri] string serverPath = null)
{
var requestUrl = _baseUrl + "/items";
var items = new List<ApiItemDetailV5>();
var param = new Dictionary<string, object>();
param.Add("itemtype", itemType);
var result = _serverClientV5.Get(items, requestUrl, param);
if (result != null)
{
return JsonConvert.DeserializeObject<List<ApiItemDetailV5>>(result.Content);
}
else
{
return items;
}
}
}
}

Просмотреть файл

@ -0,0 +1,172 @@
namespace Syncfusion.Report.Server.Api.Helper.V5.Models
{
using Syncfusion.Report.Server.Api.Helper.V2.Models;
using System;
using System.Runtime.Serialization;
/// <summary>
/// Item details
/// </summary>
public class ApiItemDetailV5
{
/// <summary>
/// Specifies the read permission of the item
/// </summary>
[DataMember]
public bool CanRead { get; set; }
/// <summary>
/// Specifies the write permission of the item
/// </summary>
[DataMember]
public bool CanWrite { get; set; }
/// <summary>
/// Specifies the delete permission of the item
/// </summary>
[DataMember]
public bool CanDelete { get; set; }
/// <summary>
/// Specifies the download permission of the item
/// </summary>
[DataMember]
public bool CanDownload { get; set; }
/// <summary>
/// Specifies the schedule permission of the item
/// </summary>
[DataMember]
public bool CanSchedule { get; set; }
/// <summary>
/// Specifies the open permission of the item
/// </summary>
[DataMember]
public bool CanOpen { get; set; }
/// <summary>
/// Specifies the move permission of the item
/// </summary>
[DataMember]
public bool CanMove { get; set; }
/// <summary>
/// Specifies the copy permission of the item
/// </summary>
[DataMember]
public bool CanCopy { get; set; }
/// <summary>
/// Specifies the clone permission of the item
/// </summary>
[DataMember]
public bool CanClone { get; set; }
/// <summary>
/// Specifies the create permission of the item
/// </summary>
[DataMember]
public bool CanCreateItem { get; set; }
/// <summary>
/// Item ID
/// </summary>
[DataMember]
public Guid Id { get; set; }
/// <summary>
/// Item type
/// </summary>
[DataMember]
public ItemType ItemType { get; set; }
/// <summary>
/// Item name
/// </summary>
[DataMember]
public string Name { get; set; }
/// <summary>
/// Item description
/// </summary>
[DataMember]
public string Description { get; set; }
/// <summary>
/// Item location
/// </summary>
[DataMember]
public string ItemLocation
{
get;
set;
}
/// <summary>
/// Specifies the user ID of the item creator
/// </summary>
[DataMember]
public int CreatedById { get; set; }
/// <summary>
/// Specifies the display name of the user who created the item
/// </summary>
[DataMember]
public string CreatedByDisplayName { get; set; }
/// <summary>
/// Specifies the user ID of the item modifier
/// </summary>
[DataMember]
public int ModifiedById { get; set; }
/// <summary>
/// Specifies the full name of the user who modified the item
/// </summary>
[DataMember]
public string ModifiedByFullName { get; set; }
/// <summary>
/// Category ID
/// </summary>
[DataMember]
public Guid? CategoryId { get; set; }
/// <summary>
/// Category name
/// </summary>
[DataMember]
public string CategoryName { get; set; }
/// <summary>
/// Date created of item in string format
/// </summary>
[DataMember]
public string CreatedDate { get; set; }
/// <summary>
/// Date modified of item in string format
/// </summary>
[DataMember]
public string ModifiedDate { get; set; }
/// <summary>
/// Date modified of item in date format
/// </summary>
[DataMember]
public DateTime ItemModifiedDate { get; set; }
/// <summary>
/// Date created of item in date format
/// </summary>
[DataMember]
public DateTime ItemCreatedDate { get; set; }
/// <summary>
/// Web designer compatability of the reports
/// </summary>
[DataMember]
public bool IsWebDesignerCompatible { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,98 @@
namespace Syncfusion.Report.Server.Api.Helper.V5.Models
{
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
/// <summary>
/// Report details
/// </summary>
[Serializable]
[DataContract]
public class ApiReportAddV5
{
/// <summary>
/// Report name
/// </summary>
[DataMember]
[Required]
public string Name
{
get;
set;
}
/// <summary>
/// Report description
/// </summary>
[DataMember]
public string Description
{
get;
set;
}
/// <summary>
/// Category ID
/// </summary>
[DataMember]
[Required]
public Guid CategoryId
{
get;
set;
}
/// <summary>
/// Specify the relative Path of the item
/// </summary>
[DataMember]
public string ServerPath
{
get;
set;
}
/// <summary>
/// Specify true to set the item as a public
/// </summary>
[DataMember]
public bool IsPublic
{
get;
set;
}
/// <summary>
/// Mapping information of dataset
/// </summary>
[DataMember]
public List<DataSetMappingInfoV5> DataSetMappingInfo
{
get;
set;
}
/// <summary>
/// Mapping information of datasource
/// </summary>
[DataMember]
public List<DataSourceMappingInfoV5> DataSourceMappingInfo
{
get;
set;
}
/// <summary>
/// Provide items in an array of bytes
/// </summary>
[DataMember]
[Required]
public byte[] ItemContent
{
get;
set;
}
}
}

Просмотреть файл

@ -0,0 +1,57 @@
namespace Syncfusion.Report.Server.Api.Helper.V5.Models
{
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
/// <summary>
/// Dataset details
/// </summary>
[Serializable]
[DataContract]
public class ApiReportDataSetAddV5
{
/// <summary>
/// Dataset name
/// </summary>
[DataMember]
[Required]
public string Name
{
get;
set;
}
/// <summary>
/// Dataset description
/// </summary>
[DataMember]
public string Description
{
get;
set;
}
/// <summary>
/// Datasource mapping information
/// </summary>
[DataMember]
public List<DataSourceMappingInfoV5> DataSourceMappingInfo
{
get;
set;
}
/// <summary>
/// Provide items in an array of bytes
/// </summary>
[DataMember]
[Required]
public byte[] ItemContent
{
get;
set;
}
}
}

Просмотреть файл

@ -0,0 +1,86 @@
namespace Syncfusion.Report.Server.Api.Helper.V5.Models
{
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
/// <summary>
/// Dataset details
/// </summary>
[Serializable]
[DataContract]
public class ApiReportDataSetUpdateV5
{
/// <summary>
/// Item ID
/// </summary>
[DataMember]
[Required]
public Guid ItemId
{
get;
set;
}
/// <summary>
/// Dataset name
/// </summary>
[DataMember]
public string DataSetName
{
get;
set;
}
/// <summary>
/// Dataset name
/// </summary>
[DataMember]
public string Name
{
get;
set;
}
/// <summary>
/// Dataset description
/// </summary>
[DataMember]
public string Description
{
get;
set;
}
/// <summary>
/// Comments about update
/// </summary>
[DataMember]
public string VersionComment
{
get;
set;
}
/// <summary>
/// Datasource mapping information
/// </summary>
[DataMember]
public List<DataSourceMappingInfoV5> DataSourceMappingInfo
{
get;
set;
}
/// <summary>
/// Provide items in an array of bytes
/// </summary>
[DataMember]
public byte[] ItemContent
{
get;
set;
}
}
}

Просмотреть файл

@ -0,0 +1,76 @@
namespace Syncfusion.Report.Server.Api.Helper.V5.Models
{
using Syncfusion.Report.Server.Api.Helper.V2.Models;
using System;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
/// <summary>
/// Datasource details
/// </summary>
[Serializable]
[DataContract]
public class ApiReportDataSourceUpdateV5
{
/// <summary>
/// Item ID
/// </summary>
[DataMember]
[Required]
public Guid ItemId
{
get;
set;
}
/// <summary>
/// Current Datasource name
/// </summary>
[DataMember]
public string DataSourceName
{
get;
set;
}
/// <summary>
/// Updating Datasource name
/// </summary>
[DataMember]
public string Name
{
get;
set;
}
/// <summary>
/// Datasource description
/// </summary>
[DataMember]
public string Description
{
get;
set;
}
/// <summary>
/// Comments about update
/// </summary>
[DataMember]
public string VersionComment
{
get;
set;
}
/// <summary>
/// Datasource definition
/// </summary>
[DataMember]
public DataSourceDefinition DataSourceDefinition
{
get;
set;
}
}
}

Просмотреть файл

@ -0,0 +1,117 @@
namespace Syncfusion.Report.Server.Api.Helper.V5.Models
{
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
/// <summary>
/// Report details
/// </summary>
[Serializable]
[DataContract]
public class ApiReportUpdateV5
{
/// <summary>
/// Item ID
/// </summary>
[DataMember]
[Required]
public Guid ItemId
{
get;
set;
}
/// <summary>
/// Report name
/// </summary>
[DataMember]
public string Name
{
get;
set;
}
/// <summary>
/// Report description
/// </summary>
[DataMember]
public string Description
{
get;
set;
}
/// <summary>
/// Category ID
/// </summary>
[DataMember]
[Required]
public Guid CategoryId
{
get;
set;
}
/// <summary>
/// Comments about update
/// </summary>
[DataMember]
public string VersionComment
{
get;
set;
}
/// <summary>
/// Specify the relative Path of the item
/// </summary>
[DataMember]
public string ServerPath
{
get;
set;
}
/// <summary>
/// Specify true to set item as public
/// </summary>
[DataMember]
public bool IsPublic
{
get;
set;
}
/// <summary>
/// Dataset mapping information
/// </summary>
[DataMember]
public List<DataSetMappingInfoV5> DataSetMappingInfo
{
get;
set;
}
/// <summary>
/// Datasource mapping information
/// </summary>
[DataMember]
public List<DataSourceMappingInfoV5> DataSourceMappingInfo
{
get;
set;
}
/// <summary>
/// Provide items in an array of bytes
/// </summary>
[DataMember]
public byte[] ItemContent
{
get;
set;
}
}
}

Просмотреть файл

@ -0,0 +1,37 @@
namespace Syncfusion.Report.Server.Api.Helper.V5.Models
{
using System;
/// <summary>
/// Mapping information of dataset
/// </summary>
public class DataSetMappingInfoV5
{
/// <summary>
/// Name
/// </summary>
public string Name
{
get;
set;
}
/// <summary>
/// Dataset ID
/// </summary>
public Guid DataSetId
{
get;
set;
}
/// <summary>
/// Dataset name
/// </summary>
public string DataSetName
{
get;
set;
}
}
}

Просмотреть файл

@ -0,0 +1,37 @@
namespace Syncfusion.Report.Server.Api.Helper.V5.Models
{
using System;
/// <summary>
/// Mapping information of datasource
/// </summary>
public class DataSourceMappingInfoV5
{
/// <summary>
/// Name
/// </summary>
public string Name
{
get;
set;
}
/// <summary>
/// Datasource ID
/// </summary>
public Guid DataSourceId
{
get;
set;
}
/// <summary>
/// Datasource name
/// </summary>
public string DataSourceName
{
get;
set;
}
}
}

Просмотреть файл

@ -0,0 +1,18 @@
namespace Syncfusion.Report.Server.Api.Helper.V5
{
using Syncfusion.Report.Server.Api.Helper.V5.EndPoints;
using Syncfusion.Report.Server.API.Helper;
public sealed class ServerClientV5 : ServerApiHelper
{
public ServerClientV5()
{
BaseUrl = BaseUrl + "/api/v5.0";
}
public ItemsEndPoint ItemsEndPoint()
{
return new ItemsEndPoint(this);
}
}
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу