0

I want to know hotname params in javascript webscript. Informations i need are :

  1. url protocol (http|https)
  2. server port
  3. hostname

Is there a way to find these information in a share or alfresco webscript ?

Thank you.

Krutik Jayswal
  • 3,165
  • 1
  • 15
  • 38
soung
  • 1,411
  • 16
  • 33
  • What language are you writing your webscript in - Java or JavaScript? (The easiest way to get the details differs between the two is all) – Gagravarr Jul 06 '15 at 11:27

1 Answers1

1

If you're writing a Java webscript, then your best bet is probably to inject the SysAdminParams bean to the webscript as a spring dependency. It is available as a bean with ID sysAdminParams

If you're writing a JavaScript webscript running on the Repository (Alfresco), then there's the ScriptUrl object available as the urls base script object, which you can use to fetch the details.

If you're writing something on the Share side, often the simplest option is to call the org/alfresco/repository/site/site-share-view-url.get at something like http://localhost:8080/alfresco/service/api/sites/shareUrl?nodeRef={nodeRef}. The will return you the fully-qualified URL to view that node in Share, saving you the trouble of building it yourself!

Gagravarr
  • 47,320
  • 10
  • 111
  • 156