keensoft/alfresco-myfiles-quota

Cannot locate template processor for template es\/keensoft\/folder\/quota.post.json

Opened this issue · 4 comments

Hi,

I've downloaded the AMPs v2.0.0 from "Releases" to our Alfresco 5.0.d and applied it via apply_amps.sh.

I've set the following options in alfresco-global.properties:

system.usages.enabled=true
user.creation.default.quota=1048576
folder.quota.core.pool.size=10
folder.quota.maximum.pool.size=20
folder.quota.thread.priority=10

I tried getting and setting the quota for a specific user via the curl commands.
While getting the quota did work, setting did not.

The command was:

curl -u "$USER" "http://localhost:8080/alfresco/service/keensoft/myfiles/quota/$USER"

curl just showed me a 500 Internal Server Error with the following messages:

  "message" : "09130003 Cannot locate template processor for template es\/keensoft\/folder\/quota.post.json",
  "exception" : "org.springframework.extensions.webscripts.WebScriptException - 09130003 Cannot locate template processor for template es\/keensoft\/folder\/quota.post.json",
  "callstack" :
  [
          ""      ,"org.springframework.extensions.webscripts.WebScriptException: 09130003 Cannot locate template processor for template es\/keensoft\/folder\/quota.post.json"
      ,"org.springframework.extensions.webscripts.AbstractWebScript.renderTemplate(AbstractWebScript.java:963)"
      ,"org.springframework.extensions.webscripts.DeclarativeWebScript.renderFormatTemplate(DeclarativeWebScript.java:267)"
      ,"org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:147)"

Also Alfresco logged the following messages when starting up Tomcat:

Unable to register script classpath:alfresco/extension/templates/webs
cripts/es/keensoft/myfiles/quota.post.desc.xml due to error: 09130000 Web Script document es/keensoft/myfiles/quota.post.desc.xml is attempting to define the url '/keensoft/myfiles/quota/
(.*?):POST' already defined by es/keensoft/folder/quota.post.desc.xml

Unable to register script classpath:alfresco/extension/templates/webscripts/es/keensoft
/myfiles/quota.post.desc.xml due to error: 09130001 Web Script document es/keensoft/myfiles/quota.post.desc.xml is attempting to define the url '/keensoft/myfiles/quota/(.*?):POST' alread
y defined by es/keensoft/folder/quota.post.desc.xml

Unable to register script classpath:alfresco/extension/templates/webs
cripts/es/keensoft/myfiles/quota.post.desc.xml due to error: 09130002 Web Script document es/keensoft/myfiles/quota.post.desc.xml is attempting to define the url '/keensoft/myfiles/quota/
(.*?):POST' already defined by es/keensoft/folder/quota.post.desc.xml

What did I do wrong?
Did I miss something?

Thank you in advance!

Kind regards,
Anna Christina Naß

I've updated compiled AMPs in distro v2.0.0.

Please, download it again, try with these two new AMPs and let me know your results.

Now I get the following message while trying to set the quota:

  "message" : "Unexpected token END OF FILE at position 0.",
  "exception" : "java.io.IOException - Unexpected token END OF FILE at position 0.",
  "callstack" :
  [
          ""      ,"Unexpected token END OF FILE at position 0."
      ,"org.json.simple.parser.JSONParser.parse(JSONParser.java:257)"
      ,"org.json.simple.parser.JSONParser.parse(JSONParser.java:81)"
      ,"org.json.simple.parser.JSONParser.parse(JSONParser.java:75)"
      ,"es.keensoft.alfresco.action.webscript.MyFilesQuotaPost.execute(MyFilesQuotaPost.java:42)"
      ,"org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:437)"
      ,"org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:619)"

My command was this:

curl -v -u "$USER" 'Content-Type: application/json' -d '{"quota":"1024000"}' "http://localhost:8080/alfresco/service/keensoft/myfiles/quota/$1"

$USER and $1 have been set...

Kind regards,
Anna

It's working fine for me now.

curl -v -u admin:admin -H 'Content-Type: application/json' -d '{"quota":"204857600"}' "http://localhost:8080/alfresco/service/keensoft/myfiles/quota/test"
{"result":"ok"}

curl -v -u admin:admin "http://localhost:8080/alfresco/service/keensoft/myfiles/quota/test"
{"quota":204857600,"currentSize":0}

Okay, it seems to work now from the command line.
Thank you!