cancel
Showing results for 
Search instead for 
Did you mean: 

'Master' Webscript

alfrescot3ster
Champ in-the-making
Champ in-the-making
Hello!

I have a question related to webscripts of the Alfresco backend repository.

Does it make sense to make just 1 webscript like:

<webscript>
    <shortname>Base Webscript</shortname>
    <description>Base Webscript</description>
    <url>/base/{method}</url>
  <authentication>user</authentication>
</webscript>


In this webscript, I will 'route' to the methods, which are gonna to be used.
So I have just 1 interface and prepare all things (parameters, error handling, etc.) in just 1 place.

Is this a good or bad idea?
3 REPLIES 3

mitpatoliya
Star Collaborator
Star Collaborator
You could certainly do that, it always depends on how you want to maintain that. If you have common interface which has related set of APIs then you could certainly implement in this manner.

You might run into few issues related to maintenance when number of APIs will be more because you will have to change filter each time you add new method support. Other challenge will be parameter handling.

Thanks for your fast answer!

You might run into few issues related to maintenance when number of APIs will be more because you will have to change filter each time you add new method support

Of course, I have to maintain the 'filter' to support more methods. But it is less work than creating webscripts, modify the *.xml-mapping, creating Java-Backed-Webscripts, …

Other challenge will be parameter handling.

Yes, I have to make a concept by myself to handle GET and POST parameters, but it's not that hard I think.

Thanks for your statement!

mitpatoliya
Star Collaborator
Star Collaborator
You will not be able to handle GET and POST both in single webscript.

What I meant by parameter handling was parameters which you need to pass from user could be different for different APIs.