Guest User

Untitled

a guest
May 2nd, 2017
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.19 KB | None | 0 0
  1. // service
  2.  
  3. define(["dojo/_base/declare",
  4. "alfresco/core/Core",
  5. "dojo/_base/lang",
  6. "alfresco/core/CoreXhr",
  7. "service/constants/Default"],
  8. function(declare, Core, lang, CoreXhr, AlfConstants) {
  9.  
  10. return declare([Core, CoreXhr], {
  11.  
  12. constructor: function agiCustomizations_UserAuditService__constructor(args) {
  13. lang.mixin(this, args);
  14. this.alfSubscribe("UPDATE_AUDIT", lang.hitch(this, this.updateAudit));
  15. },
  16.  
  17. postMixInProperties: function agiCustomizations_UserAuditService__postMixInProperties() {
  18. this.inherited(arguments);
  19. this.alfSubscribe("AUDIT_LIST_VIEW", lang.hitch(this, this.updateAudit));
  20. },
  21. updateAudit: function agiCustomizations_UpdateAuditService__updateAudit(payload) {
  22. this.serviceXhr({
  23. url: AlfConstants.PROXY_URI + payload.application + "&value=" +payload.valuefilter,
  24. method: "GET",
  25. successCallback: this.onSuccess,
  26. callbackScope: this
  27. });
  28. },
  29. onSuccess: function agiCustomizations_UpdateAuditService__onSuccess(response, originalRequestConfig) {
  30. this.alfPublish("ALF_DOCLIST_RELOAD_DATA", {});
  31. }
  32. });
  33. });
  34.  
  35. // alflist js file
  36.  
  37. function auditDataDisaply() {
  38. var model = {
  39. name : 'alfresco/core/ProcessWidgets',
  40. id : 'DASHBOARD_COMPONENTS_PANEL',
  41. config : {
  42. widgets : [
  43. {
  44. name : "alfresco/buttons/AlfButton",
  45. config : {
  46. label : msg.get("audit-data.configureaudit"),
  47. publishTopic : "ALF_CREATE_FORM_DIALOG_REQUEST",
  48. publishPayload : {
  49. dialogTitle : msg
  50. .get("audit-data.configureaudit"),
  51. dialogConfirmationButtonTitle : "Submit",
  52. dialogCancellationButtonTitle : "Cancel",
  53. formSubmissionTopic : "UPDATE_AUDIT",
  54. fixedWidth : true,
  55. widgets : [ {
  56. name : "alfresco/forms/controls/TextBox",
  57. config : {
  58. fieldId : "application",
  59. label : "Application",
  60. name : "application"
  61. }
  62. }, {
  63. name : "alfresco/forms/controls/TextBox",
  64. config : {
  65. fieldId : "valuefilter",
  66. label : "Value Filter",
  67. name : "valuefilter"
  68. }
  69. } ]
  70. }
  71. },
  72. },
  73. {
  74. name: "alfresco/lists/AlfList",
  75. config: {
  76. //pubSubScope : 'COMPONENT_LIST/',
  77. // linkPublishTopic: "AUDIT_LIST_VIEW",
  78. reloadDataTopic : "ALF_DOCLIST_RELOAD_DATA",
  79. loadDataPublishTopic: "ALF_CRUD_GET_ALL",
  80. loadDataPublishPayload: {
  81. url: "api/audit/query/AuditLogin1?verbose=true&limit=10&forward=true"
  82. },
  83. itemsProperty: "entries",
  84. widgets: [{
  85. name : 'alfresco/lists/views/AlfListView',
  86. config : {
  87. additionalCssClasses : 'bordered',
  88. widgetsForHeader : [
  89. {
  90. name : 'alfresco/lists/views/layouts/HeaderCell',
  91. config : {
  92. label : msg.get('audit-data.dbid'),
  93. sortable: true,
  94. sortValue:'id'
  95. }
  96. },
  97. {
  98. name : 'alfresco/lists/views/layouts/HeaderCell',
  99. config : {
  100. label : msg.get('audit-data.username'),
  101. sortable: true,
  102. sortValue:'user'
  103. }
  104. },
  105. {
  106. name : 'alfresco/lists/views/layouts/HeaderCell',
  107. config : {
  108. label : msg.get('audit-data.timestamp'),
  109. sortable: true,
  110. sortValue:'time'
  111. }
  112. },
  113. {
  114. name : 'alfresco/lists/views/layouts/HeaderCell',
  115. config : {
  116. label : msg.get('audit-data.auditedvalues'),
  117. sortable: true,
  118. sortValue:'values'
  119. }
  120. } ],
  121. widgets : [ {
  122. name : 'alfresco/lists/views/layouts/Row',
  123. config : {
  124. additionalCssClasses : 'zebra-striping',
  125. widgets : [
  126. {
  127. name : 'alfresco/lists/views/layouts/Cell',
  128. config : {
  129. additionalCssClasses : 'mediumpad',
  130. widgets : [ {
  131. name : "alfresco/renderers/Property",
  132. config : {
  133. propertyToRender : "id"
  134. }
  135. } ]
  136. }
  137. },
  138. {
  139. name : 'alfresco/lists/views/layouts/Cell',
  140. config : {
  141. additionalCssClasses : 'mediumpad',
  142. widgets : [ {
  143. name : 'alfresco/renderers/Property',
  144. config : {
  145. propertyToRender : 'user'
  146. }
  147. } ]
  148. }
  149. },
  150. {
  151. name : 'alfresco/lists/views/layouts/Cell',
  152. config : {
  153. additionalCssClasses : 'mediumpad',
  154. widgets : [ {
  155. name : 'alfresco/renderers/Date',
  156. config : {
  157. simple : true,
  158. format : "yyyy-MM-dd'T'HH:mm:ss.SSSX",
  159. propertyToRender : 'time'
  160. }
  161. } ]
  162. }
  163. },
  164. {
  165. name : 'alfresco/lists/views/layouts/Cell',
  166. config : {
  167. additionalCssClasses : 'mediumpad',
  168. widgets : [ {
  169. name : 'alfresco/renderers/Property',
  170. config : {
  171. propertyToRender : 'values./auditlogin1/login/no-error/user'
  172. }
  173. } ]
  174. }
  175. } ]
  176. }
  177. } ]
  178. }
  179. }]
  180. }
  181. } ]
  182. }
  183. }
  184. return model;
  185. }
  186.  
  187. model.jsonModel = {
  188. services : [ 'alfresco/services/CrudService',
  189. 'alfresco/services/DialogService',
  190. 'agi-customizations/UpdateAuditService'],
  191. widgets : [ {
  192. id : 'SET_PAGE_TITLE',
  193. name : 'alfresco/header/SetTitle',
  194. config : {
  195. title : 'tool.audit-data.label'
  196. }
  197. }, {
  198. name : 'alfresco/html/Label',
  199. config : {
  200. label : 'audit-data.intro-text',
  201. style : 'display: block; margin-bottom: 2ex;'
  202. }
  203. }, auditDataDisaply() ]
  204. };
Add Comment
Please, Sign In to add comment