04-22-2008 12:34 PM
04-22-2008 01:30 PM
08-26-2008 07:05 AM
05-14-2010 09:09 AM
06-07-2010 06:40 AM
08-06-2010 06:09 AM
08-06-2010 08:38 PM
08-09-2010 01:56 AM
The missing part as i think while using web services in current format is the creation of a custom aspect setting approver group details or any other details required, in your custom content model & set it while workflow is executing either in java script or in actionhandler.Once set, you can get it anywhere you want including custom web service.
Create a SOAP based wrapper around a REST based web script to expose such functionalities which are not provided in web services as below.
public class AlfCustomWebService{
private static final long serialVersionUID = 1L;
private String ticket;
private HttpURLConnection conn = null;
public String getUserList() {
//Getting property from alfresco-global.properties file.
WsPropertyReader propertyReader = new WsPropertyReader();
String adminUsername = propertyReader.getProperty("admin.username");
String adminPassword = propertyReader.getProperty("admin.password");
String wsEndPoint = propertyReader.getProperty("alfresco.ws.endpoint");
String webScriptUrl = propertyReader.getProperty("webscripturl");
String webScriptMethod = propertyReader.getProperty("webscriptmethod");
try {
//Startting session & setting endpoint.
AuthenticationUtils.startSession(adminUsername, adminPassword);
WebServiceFactory.setEndpointAddress(wsEndPoint);
setTicket(AuthenticationUtils.getTicket());
//Creating URL for web script.
URL scriptUrl = (new URI(webScriptUrl)).toURL();
logger.debug("Invoking Web Script : " + scriptUrl);
//Getting connection & setting properties for same.
conn = (HttpURLConnection) scriptUrl.openConnection();
conn.setRequestMethod(webScriptMethod);
conn.setRequestProperty("Authorization", "Basic "+ Base64.encodeBytes((getTicket()).getBytes()));
conn.connect();
//Checking for response from web script.
logger.debug("Response code : " + conn.getResponseCode());
//Getting response as a string.
BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8"));
StringBuffer buffer = new StringBuffer();
String line;
while ((line = in.readLine()) != null) {
buffer.append(line);
}
String result = buffer.toString();
}
}
Alfresco 3.4 or whatever it will be called, contains far more of a workflow API.
08-22-2010 05:54 AM
08-22-2010 08:21 AM
Also, Alfresco put great stress on web scripts but in real time implementation , web services are very much needed , both from client requirement perspective & for integrating two heterogeneous systems.If user tries to invoke web scripts from third party systems, it require that users write some kind of invoker classes & use them on other system than Alfresco where Alfresco needs to be accessed but web services provide WSDLs which can be used independently.Also, if i try to access web script on a third party system, i need to put dependency jars on other system making it a bit complex, which i think , can be avoided using web service.Correct me if i am wrong here.
Do you guys planning to give more powers to web services in future?
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.