PageRenderTime 48ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/1.31/src/Platform/Services/IOrganizationService.cs

#
C# | 100 lines | 44 code | 5 blank | 51 comment | 0 complexity | a6f2fc2662c480f5250dabda30d6aa7a MD5 | raw file
Possible License(s): AGPL-1.0, LGPL-2.1
  1. /****************************************************************************************************
  2. Copyright (C) 2010 RapidWebDev Organization (http://rapidwebdev.org)
  3. Author: Eunge, Legal Name: Jian Liu, Email: eunge.liu@RapidWebDev.org
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. ****************************************************************************************************/
  15. using System;
  16. using System.IO;
  17. using System.Data;
  18. using System.Collections;
  19. using System.Collections.Generic;
  20. using System.Collections.ObjectModel;
  21. using System.Collections.Specialized;
  22. using System.Configuration;
  23. using System.Linq;
  24. using System.Linq.Expressions;
  25. using System.ServiceModel;
  26. using System.ServiceModel.Activation;
  27. using System.ServiceModel.Web;
  28. using System.Web;
  29. using System.Web.SessionState;
  30. using System.Web.Security;
  31. using System.Web.UI;
  32. using System.Web.UI.HtmlControls;
  33. using System.Web.UI.WebControls;
  34. using System.Web.UI.WebControls.WebParts;
  35. using System.Xml.Linq;
  36. using BaoJianSoft.Common;
  37. using BaoJianSoft.Common.Caching;
  38. using BaoJianSoft.Common.Web;
  39. using BaoJianSoft.Platform.Linq;
  40. namespace BaoJianSoft.Platform.Services
  41. {
  42. /// <summary>
  43. /// The service to operate organizations for the authenticated user.
  44. /// </summary>
  45. [ServiceContract(Name = "OrganizationService", Namespace = ServiceNamespaces.Membership, SessionMode = SessionMode.Allowed)]
  46. public interface IOrganizationService
  47. {
  48. /// <summary>
  49. /// Search organizations by a collection of criterias for the authenticated user of request.
  50. /// </summary>
  51. /// <param name="domain">Which domain of the searching organizations.</param>
  52. /// <param name="orgTypeId">Which organization type the searching organizations should belong to.</param>
  53. /// <param name="q">Keywords for searching.</param>
  54. /// <param name="sortField">Sorting field name, the default sorting field is LastUpdatedDate.</param>
  55. /// <param name="sortOrder">Sorting order, DESC or ASC, the default sorting order is DESC.</param>
  56. /// <param name="start">The start organization index of hit to return.</param>
  57. /// <param name="limit">The limit of returned organizations.</param>
  58. /// <returns>The query results object includes total hit count, returned records, start and limit.</returns>
  59. [OperationContract]
  60. [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, UriTemplate = "json/search?domain={domain}&q={q}&start={start}&limit={limit}&sortfield={sortField}&sortDirection={sortDirection}&orgTypeId={orgTypeId}")]
  61. QueryResultObject SearchJson(string domain, string orgTypeId, string q, string sortField, string sortDirection, int start, int limit);
  62. /// <summary>
  63. /// Get first organization matching the specified query.
  64. /// The matching algorithm is to try to search organizations in following order. Once an organization is found, it's returned as the result.
  65. /// 1) completely match organization code;
  66. /// 2) completely match organization name;
  67. /// 3) match whether there has organizations with code starts with specified query;
  68. /// 4) match whether there has organizations with name starts with specified query;
  69. /// </summary>
  70. /// <param name="domain"></param>
  71. /// <param name="q"></param>
  72. /// <returns></returns>
  73. [OperationContract]
  74. [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, UriTemplate = "json/get?domain={domain}&q={q}")]
  75. OrganizationObject GetJson(string domain, string q);
  76. /// <summary>
  77. /// Find organization types in specified domain.
  78. /// </summary>
  79. /// <param name="domain"></param>
  80. /// <returns></returns>
  81. [OperationContract]
  82. [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, UriTemplate = "json/FindOrganizationTypes/{domain}")]
  83. QueryResultObject FindOrganizationTypesJson(string domain);
  84. /// <summary>
  85. /// Lists all available organization domains.
  86. /// </summary>
  87. /// <returns></returns>
  88. [OperationContract]
  89. [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, UriTemplate = "json/ListDomains")]
  90. Collection<OrganizationDomainObject> ListDomainsJson();
  91. }
  92. }