Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // service
- define(["dojo/_base/declare",
- "alfresco/core/Core",
- "dojo/_base/lang",
- "alfresco/core/CoreXhr",
- "service/constants/Default"],
- function(declare, Core, lang, CoreXhr, AlfConstants) {
- return declare([Core, CoreXhr], {
- constructor: function agiCustomizations_UserAuditService__constructor(args) {
- lang.mixin(this, args);
- this.alfSubscribe("UPDATE_AUDIT", lang.hitch(this, this.updateAudit));
- },
- postMixInProperties: function agiCustomizations_UserAuditService__postMixInProperties() {
- this.inherited(arguments);
- this.alfSubscribe("AUDIT_LIST_VIEW", lang.hitch(this, this.updateAudit));
- },
- updateAudit: function agiCustomizations_UpdateAuditService__updateAudit(payload) {
- this.serviceXhr({
- url: AlfConstants.PROXY_URI + payload.application + "&value=" +payload.valuefilter,
- method: "GET",
- successCallback: this.onSuccess,
- callbackScope: this
- });
- },
- onSuccess: function agiCustomizations_UpdateAuditService__onSuccess(response, originalRequestConfig) {
- this.alfPublish("ALF_DOCLIST_RELOAD_DATA", {});
- }
- });
- });
- // alflist js file
- function auditDataDisaply() {
- var model = {
- name : 'alfresco/core/ProcessWidgets',
- id : 'DASHBOARD_COMPONENTS_PANEL',
- config : {
- widgets : [
- {
- name : "alfresco/buttons/AlfButton",
- config : {
- label : msg.get("audit-data.configureaudit"),
- publishTopic : "ALF_CREATE_FORM_DIALOG_REQUEST",
- publishPayload : {
- dialogTitle : msg
- .get("audit-data.configureaudit"),
- dialogConfirmationButtonTitle : "Submit",
- dialogCancellationButtonTitle : "Cancel",
- formSubmissionTopic : "UPDATE_AUDIT",
- fixedWidth : true,
- widgets : [ {
- name : "alfresco/forms/controls/TextBox",
- config : {
- fieldId : "application",
- label : "Application",
- name : "application"
- }
- }, {
- name : "alfresco/forms/controls/TextBox",
- config : {
- fieldId : "valuefilter",
- label : "Value Filter",
- name : "valuefilter"
- }
- } ]
- }
- },
- },
- {
- name: "alfresco/lists/AlfList",
- config: {
- //pubSubScope : 'COMPONENT_LIST/',
- // linkPublishTopic: "AUDIT_LIST_VIEW",
- reloadDataTopic : "ALF_DOCLIST_RELOAD_DATA",
- loadDataPublishTopic: "ALF_CRUD_GET_ALL",
- loadDataPublishPayload: {
- url: "api/audit/query/AuditLogin1?verbose=true&limit=10&forward=true"
- },
- itemsProperty: "entries",
- widgets: [{
- name : 'alfresco/lists/views/AlfListView',
- config : {
- additionalCssClasses : 'bordered',
- widgetsForHeader : [
- {
- name : 'alfresco/lists/views/layouts/HeaderCell',
- config : {
- label : msg.get('audit-data.dbid'),
- sortable: true,
- sortValue:'id'
- }
- },
- {
- name : 'alfresco/lists/views/layouts/HeaderCell',
- config : {
- label : msg.get('audit-data.username'),
- sortable: true,
- sortValue:'user'
- }
- },
- {
- name : 'alfresco/lists/views/layouts/HeaderCell',
- config : {
- label : msg.get('audit-data.timestamp'),
- sortable: true,
- sortValue:'time'
- }
- },
- {
- name : 'alfresco/lists/views/layouts/HeaderCell',
- config : {
- label : msg.get('audit-data.auditedvalues'),
- sortable: true,
- sortValue:'values'
- }
- } ],
- widgets : [ {
- name : 'alfresco/lists/views/layouts/Row',
- config : {
- additionalCssClasses : 'zebra-striping',
- widgets : [
- {
- name : 'alfresco/lists/views/layouts/Cell',
- config : {
- additionalCssClasses : 'mediumpad',
- widgets : [ {
- name : "alfresco/renderers/Property",
- config : {
- propertyToRender : "id"
- }
- } ]
- }
- },
- {
- name : 'alfresco/lists/views/layouts/Cell',
- config : {
- additionalCssClasses : 'mediumpad',
- widgets : [ {
- name : 'alfresco/renderers/Property',
- config : {
- propertyToRender : 'user'
- }
- } ]
- }
- },
- {
- name : 'alfresco/lists/views/layouts/Cell',
- config : {
- additionalCssClasses : 'mediumpad',
- widgets : [ {
- name : 'alfresco/renderers/Date',
- config : {
- simple : true,
- format : "yyyy-MM-dd'T'HH:mm:ss.SSSX",
- propertyToRender : 'time'
- }
- } ]
- }
- },
- {
- name : 'alfresco/lists/views/layouts/Cell',
- config : {
- additionalCssClasses : 'mediumpad',
- widgets : [ {
- name : 'alfresco/renderers/Property',
- config : {
- propertyToRender : 'values./auditlogin1/login/no-error/user'
- }
- } ]
- }
- } ]
- }
- } ]
- }
- }]
- }
- } ]
- }
- }
- return model;
- }
- model.jsonModel = {
- services : [ 'alfresco/services/CrudService',
- 'alfresco/services/DialogService',
- 'agi-customizations/UpdateAuditService'],
- widgets : [ {
- id : 'SET_PAGE_TITLE',
- name : 'alfresco/header/SetTitle',
- config : {
- title : 'tool.audit-data.label'
- }
- }, {
- name : 'alfresco/html/Label',
- config : {
- label : 'audit-data.intro-text',
- style : 'display: block; margin-bottom: 2ex;'
- }
- }, auditDataDisaply() ]
- };
Add Comment
Please, Sign In to add comment