cancel
Showing results for 
Search instead for 
Did you mean: 

[SOLVED] WebScriptStatus - Deprecated type?

Not applicable
Hi community!!!

I'm currently reading Alfresco Developer Guide. In chapter 7 (advanced workflow), page 328, a webscript is given with a method:

import org.alfresco.web.scripts.WebScriptStatus;

   protected Map<String, Object> executeImpl(WebScriptRequest req, WebScriptStatus status) {

      String id = req.getParameter("id");
      String action = req.getParameter("action");

      if (id == null || action == null) {
         logger.debug("Email, ID, action, or secret not set");
         status.setCode(400);         
         status.setMessage("Required data has not been provided");
         status.setRedirect(true);
      }

But the type WebScriptStatus seems to be deprecated (using Alfresco Stable 3d), so I've got a warning for every call to the object status.
It doesn't really matter, but is there another type or another way to do the method with "up-to-date" type? I don't really want the script to be broken when an update of alfresco is available…It's not critical, but I think it deserves a little attention ^^

Have a good day!

Benoit
2 REPLIES 2

rogier_oudshoor
Champ in-the-making
Champ in-the-making
This will be better:
protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache){

Status replaces WebScriptStatus, and Cache allows you to toggle cache headers.

Not applicable
Good tip thanks!
By the way as it extends the class DeclarativeWebscript (sorry I didn't mentioned that earlier Smiley Happy) the method should be:

executeImpl(WebScriptRequest req, WebScriptStatus status, WebScriptCache cache)
(cache is a WebScriptCache type and not a Cache type, for the org.alfresco.repo.web.scripts.content.StreamContent class)
As mentioned in the javadoc:
http://dev.alfresco.com/resource/docs/java/web-client/org/alfresco/web/scripts/DeclarativeWebScript....

What's more I can simply use:

executeImpl(WebScriptRequest req, WebScriptStatus status)
as described in the javadoc. For the moment I don't quite know what is the WebScriptCache…Smiley Surprised

But thanks for the very very quick answer Smiley Happy Really helped ^^
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.