bmdhaker / share-extras

Automatically exported from code.google.com/p/share-extras
0 stars 0 forks source link

Audit dashlet does not work in 4.2.c #129

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Add the dashlet to your dashboard
2. click Configure

What is the expected output? What do you see instead?
Error in Google Chrome inspector console:
"Uncaught TypeError: undefined is not a function 
audit-application_d03183c0e6e5bc2e43f8d4822466c195.js:1
AuditApplication_onConfigClick 
audit-application_d03183c0e6e5bc2e43f8d4822466c195.js:1
e yui-common_84ca7eecae18d3abf59034e15736d3a5.js:1
"

What version of the add-on are you using? Please provide version of the
downloaded package, or Subversion revision number.
0.45

What version of Alfresco are you using? On what application server?
4.2.c tomcat7

What web browser are you using? Please supply browser name and version.
Google Chrome latest

Please provide any additional information below.

Original issue reported on code.google.com by bille...@gmail.com on 4 Feb 2013 at 12:48

Attachments:

GoogleCodeExporter commented 8 years ago
Hi, 

Can you try clearing your browser cache and then refresh the page with ctrl+f5, 
then click again ?

Did it work for you in a previous release ? 

If i get the chance, i will try to reproduce on 4.2c. Other versions i tested 
on recently did not have this issue . 

Original comment by romaingu...@gmail.com on 6 Feb 2013 at 2:09

GoogleCodeExporter commented 8 years ago
I did a browser refresh with f5 multiple times. It worked perfectly in the 
4.0-releases and in Enterprise 4.1 as well.

Thanks
/Erik

Original comment by bille...@gmail.com on 6 Feb 2013 at 2:43

GoogleCodeExporter commented 8 years ago
OK, I have reproduced and identified the issue. The dashlet does not currently 
use the "new" resource resolving scheme for the config dialog. 

It's a simple URL fix. I also have another feature for the audit API geeks i 
plan to add in. I will then roll these 2 changes into the next build so that i 
don't have to do all the release steps / updates twice. I am hoping this can 
happen this week, depending on other constraints. 

In the meantime, there is a simple workaround : 

- add another dashlet that has a configure dialog, such as for example the RSS 
feed. 
- click on the configure dialog for that RSS dashlet. 
- This will make the dialog available. 
- Click again on the configure dialog for the audit dashlet. The config dialog 
will now show up. The resolving for this server side resource needs to happen 
only once, so if you try subsequently on another browser, it will work too. May 
need to do it again upon server restart though. 
- You may remove the other dashlet if you do not need it.

Let me know if that works for you.

Original comment by romaingu...@gmail.com on 6 Feb 2013 at 3:06

GoogleCodeExporter commented 8 years ago
FYI, If you want to fix it locally pending the next build, this is the required 
change : 

--- 
config/alfresco/site-webscripts/org/sharextras/components/dashlets/audit-applica
tion.get.head.ftl    2011-12-02 19:57:15.000000000 +0100
+++ 
config/alfresco/site-webscripts/org/sharextras/components/dashlets/audit-applica
tion.get.head.ftl     2013-02-06 15:52:35.573988776 +0100
@@ -1,5 +1,5 @@
 <#include "/org/alfresco/components/component.head.inc">
 <!-- Audit Application dashlet -->
-<@script type="text/javascript" 
src="${page.url.context}/modules/simple-dialog.js"></@script>
+<@script type="text/javascript" 
src="${page.url.context}/res/modules/simple-dialog.js"></@script>
 <@link rel="stylesheet" type="text/css" href="${page.url.context}/res/extras/components/dashlets/audit-application.css" />
 <@script type="text/javascript" src="${page.url.context}/res/extras/components/dashlets/audit-application.js"></@script>

Original comment by romaingu...@gmail.com on 6 Feb 2013 at 3:11

GoogleCodeExporter commented 8 years ago
Thanks Romain,

I'll try this soon.

/Erik

Original comment by bille...@gmail.com on 7 Feb 2013 at 7:58

GoogleCodeExporter commented 8 years ago
Hi Romain,

Your solution solves one problem, but I stumbled upon a new one directly. It 
seems like there are som changes in the json delivered from the Audit API. I 
compared the two with the Chrome inspector and one obvious discrepancy is that 
the data of the id now contains a separator (a comma). The dashlet shows the 
(now familiar) "Data Error", my guess is that its a formatting issue in the 
datatable?

Below follows an excerpt of the response from a 4.2.c installation:

{
   "count": "100",
   "entries":
   [
      {
         "id": 81,666,
         "application": "alfresco-access",
         "user": "admin",
         "time": "2013-02-07T15:49:50.359+01:00",
         "values":
         {
           "action":"readContent"
            ,
           "user":"admin"
            ,
           "path":"/app:company_home/app:dictionary/cm:AlertMessages/cm:systemmeddelande"
            ,
           "from":"{{http://www.alfresco.org/model/content/1.0}lastThumbnailModification=[webpreview:1360248582814]}"
            ,
           "to":"{{http://www.alfresco.org/model/content/1.0}lastThumbnailModification=[webpreview:1360248582814, doclib:1360248588313]}"
            ,
           "type":"cm:content"
            ,
           "sub-actions":"readContent updateNodeProperties"

         }
      },...]

In my 4.1-Enterprise-installation a similar json looks like this:
{
    "count": "100",
    "entries":
    [
    {
        "id": "81755",
        "application": "alfresco-access",
        "user": "admin",
        "time": "2013-02-07T15:50:57.441+01:00",
        "values":
        {
            "path":"/app:company_home/app:dictionary/cm:AlertMessages/cm:systemmeddelande"
            ,
            "action":"READ"
            ,
            "type":"cm:content"
            ,
            "sub-actions":"readContent"
            ,
            "user":"admin"

        }
    },

Original comment by bille...@gmail.com on 7 Feb 2013 at 3:08

GoogleCodeExporter commented 8 years ago
Hi, 

The IDs are unquoted, so comma separators are invalid in JSON. 
It should be a simple fix. In audit-application-data.get.json.ftl, can you try 
replacing         

"id": ${e.id},

with

"id": ${e.id?c},

That should fix it. Let me know if it works out for you.
I'll include this in the next build.

Original comment by romaingu...@gmail.com on 8 Feb 2013 at 8:13

GoogleCodeExporter commented 8 years ago
Thank you very much for your help, now its working as expected. 

Original comment by bille...@gmail.com on 8 Feb 2013 at 9:11

GoogleCodeExporter commented 8 years ago

Original comment by romaingu...@gmail.com on 8 Feb 2013 at 3:00