com.wewebu.ow.server.ecmimpl.cmis.alfresco
Class OwCMISALBasicAspectRetriever

java.lang.Object
  extended by com.wewebu.ow.server.ecmimpl.cmis.alfresco.OwCMISALBasicAspectRetriever
All Implemented Interfaces:
OwCMISALAspectRetriever

public class OwCMISALBasicAspectRetriever
extends Object
implements OwCMISALAspectRetriever

Mandatory Aspects Retrieve with Basic HTTP Authentication. Password and user name will be base64 encoded and provided in a HTTP Authorization header value.
Implementation is based on the Alfresco Rest-API http://<server>/alfresco/service/api/classes/

Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.

For licensing information read the license.txt file or
go to: http://wiki.alfresco.com

Since:
3.2.0.0

Field Summary
 
Fields inherited from interface com.wewebu.ow.server.ecmimpl.cmis.alfresco.OwCMISALAspectRetriever
PREFIX_ASPECT, RETRIEVER_CLASS, RETRIEVER_URL
 
Constructor Summary
OwCMISALBasicAspectRetriever()
           
 
Method Summary
protected  String createAuthValue(OwCMISNetwork network)
          Create the Value for the HTTP "Authorization" header, which will be attached during retrieve REST-call.
protected  String getRequestTypeId(OwCMISNetwork network, String classId)
          Transform the class Id into a representation which can be used for the service call.
protected  URL getURL(OwCMISNetwork network, String classId)
          Read connection URL from network configuration, if not available use RepositoryService WSDL definition and extract location depending on that setting.
protected  List<String> processInputStream(InputStream stream, OwCMISNetwork network)
          Process input stream and retrieve only the id's which are defined as "defaultAspects"
 List<String> retrieveAspectIds(OwCMISNetwork network, OwCMISObjectClass clazz)
          Will return a list of Id's which must not conform with the Alfresco CMIS Id representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OwCMISALBasicAspectRetriever

public OwCMISALBasicAspectRetriever()
Method Detail

retrieveAspectIds

public List<String> retrieveAspectIds(OwCMISNetwork network,
                                      OwCMISObjectClass clazz)
                               throws IOException,
                                      com.wewebu.ow.server.exceptions.OwException
Description copied from interface: OwCMISALAspectRetriever
Will return a list of Id's which must not conform with the Alfresco CMIS Id representation. The requester/caller must handle/check the id regarding it's needs.

Specified by:
retrieveAspectIds in interface OwCMISALAspectRetriever
Parameters:
network - OwCMISNetwork to get configuration
clazz - OwCMISObjectClass for which the list of mandatory aspect Id's should be retrieved.
Returns:
List of Strings representing the Id's
Throws:
IOException - If could not communicate with server (could not create connection)
com.wewebu.ow.server.exceptions.OwException - if could not retrieve configuration from network instance

getURL

protected URL getURL(OwCMISNetwork network,
                     String classId)
              throws MalformedURLException,
                     com.wewebu.ow.server.exceptions.OwException
Read connection URL from network configuration, if not available use RepositoryService WSDL definition and extract location depending on that setting.

Parameters:
network - OwCMISNetwork to read configuration
classId - String representing the OwObjectClass.getClassName() Id
Returns:
URL from where to retrieve Mandatory Aspect definition
Throws:
MalformedURLException - if URL could not be created/constructed
com.wewebu.ow.server.exceptions.OwException - problem retrieving configuration from network

getRequestTypeId

protected String getRequestTypeId(OwCMISNetwork network,
                                  String classId)
Transform the class Id into a representation which can be used for the service call. Will transform every "cmis:" specific namespace into the following types: In case of other namespace the leading prefix will be removed to represent native definition. At the end By default all colon (:) occurrence will be removed by an underscore (_) and the String returned.

Parameters:
network - OwCMISNetwork
classId - String
Returns:
String which should be used to request Aspect information

createAuthValue

protected String createAuthValue(OwCMISNetwork network)
                          throws com.wewebu.ow.server.exceptions.OwException
Create the Value for the HTTP "Authorization" header, which will be attached during retrieve REST-call.

Parameters:
network - OwCMISNetwork
Returns:
String representing the authorization information
Throws:
com.wewebu.ow.server.exceptions.OwException - if could not retrieve the credentials

processInputStream

protected List<String> processInputStream(InputStream stream,
                                          OwCMISNetwork network)
                                   throws IOException,
                                          com.wewebu.ow.server.exceptions.OwException
Process input stream and retrieve only the id's which are defined as "defaultAspects"

Parameters:
stream - InputStream from service call
network - OwCMISNetwork instance for localization or other information
Returns:
List of String's representing the Id's
Throws:
IOException - in case of error while reading input stream
com.wewebu.ow.server.exceptions.OwException - if parsing of service answer was not successful/ could not proceed


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.