Alfresco Javascript API Reference error 'docum

2019-09-10 12:35发布

My apologies for being a newbie. I have configured javascript api amps and I can access java script console via admin tools. My challenge is that for 'document', 'search', logger and 'companyhome' I am an receiving reference error e.g reference error 'document' is not defined. I have been reading alfresco documentation and they show that you have to access it using javascript server side. how can i do that in alfresco or how can overcome these errors

1条回答
爷的心禁止访问
2楼-- · 2019-09-10 13:07

If you are using javascript console. There will be action available on each of the documents "open in javascript console" If you click on that it will open up javascript console for you with context set with selected document.

Now "document" object points to current document on which you have clicked that action. You should also be able to see all API's associated with it by just adding dot after document.

Point is those root objects like "companyhome","document" etc.. are available on server side javascript.

You can find server side javascript two places.

  1. Under company home>Data dictionary> Script (From here you can associate them with rule) .
  2. Controller of any javascript based webscript.
查看更多
登录 后发表回答