AnsweredAssumed Answered

Using JS api to import filesystem permissions : JS File API ?

Question asked by ermantis on Feb 18, 2014
Latest reply on Feb 18, 2014 by mrogers
Hello everyone,
I'm trying to import a filesystem's permissions into alfresco, so it fits my current configuration.
To do that, i'm planning to use the javascript API. To do this, I want to get access to my filesystem using the File API implemented in javascript.
Thing is, it doesn't seem to be implemented ?
<!–break–>
Here is the base I use to check if it could work on alfresco :


// Check for the various File API support.
if (window.File && window.FileReader && window.FileList && window.Blob) {
  // Great success! All the File APIs are supported.
   alert("OK!");
} else {
  alert('The File APIs are not fully supported in this browser.');
}


This turns me that error :


org.alfresco.error.AlfrescoRuntimeException: 01181160 Error during command servlet processing: 01181159 Failed to execute script 'workspace://SpacesStore/b08ea900-d60c-48b1-bd62-a240a2a2c4e9': 01181158 ReferenceError: "window" n'est pas défini (workspace://SpacesStore/b08ea900-d60c-48b1-bd62-a240a2a2c4e9#3)
causé par :
org.alfresco.scripts.ScriptException: 01181159 Failed to execute script 'workspace://SpacesStore/b08ea900-d60c-48b1-bd62-a240a2a2c4e9': 01181158 ReferenceError: "window" n'est pas défini (workspace://SpacesStore/b08ea900-d60c-48b1-bd62-a240a2a2c4e9#3)
causé par :
org.alfresco.error.AlfrescoRuntimeException: 01181158 ReferenceError: "window" n'est pas défini (workspace://SpacesStore/b08ea900-d60c-48b1-bd62-a240a2a2c4e9#3)
causé par :
org.mozilla.javascript.EcmaError: ReferenceError: "window" n'est pas défini (workspace://SpacesStore/b08ea900-d60c-48b1-bd62-a240a2a2c4e9#3)


It's french, but the main error in english would be : "ReferenceError : "window" is not defined".

Sooo… what ? I think i'm missing something, but it seems like the script has to get through some alfresco's compilation or something, so it doesn't successfully brings up the "window" object that is supposed to be managed by the web browser.
Am I right ? Is there any workaround ? Should I drop javascript and try something else ?
Thanks in advance !

Outcomes