com.jaspersoft.jasperserver.ws.axis2
Class ManagementService

java.lang.Object
  extended by org.springframework.remoting.jaxrpc.ServletEndpointSupport
      extended by com.jaspersoft.jasperserver.ws.axis2.ManagementService
All Implemented Interfaces:
RepositoryServiceContext, javax.xml.rpc.server.ServiceLifecycle

public class ManagementService
extends org.springframework.remoting.jaxrpc.ServletEndpointSupport
implements RepositoryServiceContext


Field Summary
protected static java.lang.String BEAN_NAME_ENGINE_SERVICE
           
protected static java.lang.String BEAN_NAME_HANDLER_REGISTRY
           
protected static java.lang.String BEAN_NAME_REPOSITORY_SERVICE
           
protected static java.lang.String BEAN_NAME_RUN_REPORT_ENGINE_SERVICE
           
protected static java.lang.String END_TOKEN
           
protected static org.apache.commons.logging.Log log
           
protected static java.lang.String REPORT_UNIT
           
protected static java.lang.String START_TOKEN
           
protected static java.lang.String WS_VERSION
           
 
Fields inherited from class org.springframework.remoting.jaxrpc.ServletEndpointSupport
logger
 
Constructor Summary
ManagementService()
           
 
Method Summary
protected  ExecutionContext createExecutionContext()
           
 ResourceDescriptor createResourceDescriptor(Resource resource)
          the same as createResourceDescriptor( resource, false)
 ResourceDescriptor createResourceDescriptor(Resource resource, java.util.Map specialOptions)
          Create a ResourceDescriptor from a Resource.
 ResourceDescriptor createResourceDescriptor(java.lang.String uri)
          This method uses the repo.getResource(null, uri) to get a reference to the resource, and then uses createResourceDescriptor to return the descriptor.
protected  ResourceDescriptor createResourceDescriptor(java.lang.String uri, java.util.Map specialOptions)
          This method uses the repo.getResource(null, uri) to get a reference to the resource, and then uses createResourceDescriptor to return the descriptor.
 java.lang.String delete(java.lang.String requestXmlString)
          This method delete a resource identified by an URI.
 java.lang.String get(java.lang.String requestXmlString)
          This method get a resource identified by an URI.
protected  java.lang.String getArgumentValue(java.lang.String argumentName, java.util.List arguments)
           
 java.lang.String getContentType(java.lang.String type)
           
 EngineService getEngine()
           
 net.sf.jasperreports.engine.JRExporter getExporter(java.lang.String type, java.util.Map exportParameters)
           
 ResourceHandlerRegistry getHandlerRegistry()
           
 java.util.Locale getLocale()
           
 java.lang.String getMessage(java.lang.String messageCode, java.lang.Object[] args)
           
 org.apache.axis.attachments.AttachmentPart[] getMessageAttachments()
          Function to get attachments from an Axis message
protected  org.springframework.context.MessageSource getMessageSource()
           
 RepositoryService getRepository()
           
 RepositoryHelper getRepositoryHelper()
           
 java.lang.String list(java.lang.String requestXmlString)
           
 java.util.List listResources(java.lang.String uri)
          Return a list of ResourceDescriptor(s)
protected  EngineService loadEngineService()
           
protected  ResourceHandlerRegistry loadHandlerRegistry()
           
protected  RepositoryService loadRepository()
           
protected  RepositoryHelper loadRepositoryHelper()
           
protected  EngineService loadRunReportEngineService()
           
protected  Resource locateResource(java.lang.String uri)
           
protected  ServiceRequest makeServiceRequest(Request request, OperationResult operationResult)
           
protected static java.lang.String marshalResponse(OperationResult or, ResultAttachments attachments)
           
protected  void onInit()
           
protected  java.util.Map processDescriptorOptions(java.util.Map specialOptions)
           
 java.lang.String put(java.lang.String requestXmlString)
          This method put a resource identified by an URI.
 java.lang.String runReport(java.lang.String requestXmlString)
          This method run a report.
 void setLocale(java.util.Locale locale)
           
 
Methods inherited from class org.springframework.remoting.jaxrpc.ServletEndpointSupport
destroy, getApplicationContext, getMessageSourceAccessor, getServletContext, getServletEndpointContext, getTempDir, getWebApplicationContext, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.commons.logging.Log log

START_TOKEN

protected static final java.lang.String START_TOKEN
See Also:
Constant Field Values

END_TOKEN

protected static final java.lang.String END_TOKEN
See Also:
Constant Field Values

REPORT_UNIT

protected static final java.lang.String REPORT_UNIT
See Also:
Constant Field Values

WS_VERSION

protected static final java.lang.String WS_VERSION
See Also:
Constant Field Values

BEAN_NAME_REPOSITORY_SERVICE

protected static final java.lang.String BEAN_NAME_REPOSITORY_SERVICE
See Also:
Constant Field Values

BEAN_NAME_ENGINE_SERVICE

protected static final java.lang.String BEAN_NAME_ENGINE_SERVICE
See Also:
Constant Field Values

BEAN_NAME_RUN_REPORT_ENGINE_SERVICE

protected static final java.lang.String BEAN_NAME_RUN_REPORT_ENGINE_SERVICE
See Also:
Constant Field Values

BEAN_NAME_HANDLER_REGISTRY

protected static final java.lang.String BEAN_NAME_HANDLER_REGISTRY
See Also:
Constant Field Values
Constructor Detail

ManagementService

public ManagementService()
Method Detail

onInit

protected void onInit()
Overrides:
onInit in class org.springframework.remoting.jaxrpc.ServletEndpointSupport

loadRepository

protected RepositoryService loadRepository()

loadEngineService

protected EngineService loadEngineService()

loadRunReportEngineService

protected EngineService loadRunReportEngineService()

loadRepositoryHelper

protected RepositoryHelper loadRepositoryHelper()

loadHandlerRegistry

protected ResourceHandlerRegistry loadHandlerRegistry()

marshalResponse

protected static java.lang.String marshalResponse(OperationResult or,
                                                  ResultAttachments attachments)

list

public java.lang.String list(java.lang.String requestXmlString)

listResources

public java.util.List listResources(java.lang.String uri)
                             throws WSException
Return a list of ResourceDescriptor(s)

Throws:
WSException

get

public java.lang.String get(java.lang.String requestXmlString)
This method get a resource identified by an URI. If the resource is a FileResource, the data is attached to the response as attachment. Only one attachment is permitted by now. WS Input: A resourceDescriptor in XML format. Only the uri is really used. WS output: The WS returns the complete descriptor for the resource (incapsulated in an OperationResult). The resource data can be in attachment. In this case the resourceDescriptor has the attrobute HasData set to true. To get a control filled with the query data, call this WS with the argument IC_GET_QUERY_DATA set to the datasource URI used to get the data. Operation result Codes: 0 - Success 1 - Generic error 2 - Resource not found


createResourceDescriptor

public ResourceDescriptor createResourceDescriptor(java.lang.String uri)
                                            throws WSException
This method uses the repo.getResource(null, uri) to get a reference to the resource, and then uses createResourceDescriptor to return the descriptor. In the resource is a ReportUnit, all resources of this ReportUnit will be present as well. If res is not found, the method returns null.

Specified by:
createResourceDescriptor in interface RepositoryServiceContext
Throws:
WSException

createResourceDescriptor

protected ResourceDescriptor createResourceDescriptor(java.lang.String uri,
                                                      java.util.Map specialOptions)
                                               throws WSException
This method uses the repo.getResource(null, uri) to get a reference to the resource, and then uses createResourceDescriptor to return the descriptor. In the resource is a ReportUnit, all resources of this ReportUnit will be present as well. If res is not found, the method returns null.

Throws:
WSException

processDescriptorOptions

protected java.util.Map processDescriptorOptions(java.util.Map specialOptions)

locateResource

protected Resource locateResource(java.lang.String uri)
                           throws WSException
Throws:
WSException

createResourceDescriptor

public ResourceDescriptor createResourceDescriptor(Resource resource)
                                            throws WSException
the same as createResourceDescriptor( resource, false)

Specified by:
createResourceDescriptor in interface RepositoryServiceContext
Throws:
WSException

createResourceDescriptor

public ResourceDescriptor createResourceDescriptor(Resource resource,
                                                   java.util.Map specialOptions)
                                            throws WSException
Create a ResourceDescriptor from a Resource. The real type of this resource is saved in WsType

Specified by:
createResourceDescriptor in interface RepositoryServiceContext
Throws:
WSException

put

public java.lang.String put(java.lang.String requestXmlString)
This method put a resource identified by an URI. If the resource is a FileResource, the data should be attached to the response as attachment (if hasData is set to true). Only one attachment is permitted by now. If the resource is new, the isNew flag must be set. otherwise the put is trated as a modify. To modify a resource that belong to REPORT_UNIT, you need to specify the argument Argument.MODIFY_REPORTUNIT with the URI of the reportUnit parent. If the resource is not local to the reportUnit, this URI is ignored but still mandatory. WS Input: A resourceDescriptor in XML format. The modify affect by now only label, description and file data if present. WS output: The WS returns the complete new descriptor for the resource (incapsulated in an OperationResult). No data is attachment. Operation result Codes: 0 - Success 1 - Generic error 2 - Resource not found (in case of a modify)


makeServiceRequest

protected ServiceRequest makeServiceRequest(Request request,
                                            OperationResult operationResult)

getArgumentValue

protected java.lang.String getArgumentValue(java.lang.String argumentName,
                                            java.util.List arguments)

delete

public java.lang.String delete(java.lang.String requestXmlString)
This method delete a resource identified by an URI. To delete a resource that belongs to a REPORT_UNIT, you need to specify the argument Argument.MODIFY_REPORTUNIT with the URI of the reportUnit parent. If the resource is not local to the reportUnit, this URI is ignored but still mandatory. You can not delete a MainReport Operation result Codes: 0 - Success 1 - Generic error


runReport

public java.lang.String runReport(java.lang.String requestXmlString)
This method run a report. The return is an OperationResult. If the result is succesfull, the message contains a set of strings (one for each row) with the list of files attached complete of the relative path. I.e. main_report.html images/logo1.jpg images/chartxyz.jpg Arguments: The request must contains the descriptor of the report to execute (only the URI is used). Arguments can be attached to the descriptor as childs. Each argument is a ListItem, with the parameter name as Name and the object rapresenting the value as Value. Operation result Codes: 0 - Success 1 - Generic error


createExecutionContext

protected ExecutionContext createExecutionContext()

getExporter

public net.sf.jasperreports.engine.JRExporter getExporter(java.lang.String type,
                                                          java.util.Map exportParameters)

getContentType

public java.lang.String getContentType(java.lang.String type)

getMessageAttachments

public org.apache.axis.attachments.AttachmentPart[] getMessageAttachments()
Function to get attachments from an Axis message

Specified by:
getMessageAttachments in interface RepositoryServiceContext

getLocale

public java.util.Locale getLocale()

setLocale

public void setLocale(java.util.Locale locale)

getMessageSource

protected org.springframework.context.MessageSource getMessageSource()

getMessage

public java.lang.String getMessage(java.lang.String messageCode,
                                   java.lang.Object[] args)
Specified by:
getMessage in interface RepositoryServiceContext

getRepository

public RepositoryService getRepository()
Specified by:
getRepository in interface RepositoryServiceContext

getEngine

public EngineService getEngine()
Specified by:
getEngine in interface RepositoryServiceContext

getHandlerRegistry

public ResourceHandlerRegistry getHandlerRegistry()
Specified by:
getHandlerRegistry in interface RepositoryServiceContext

getRepositoryHelper

public RepositoryHelper getRepositoryHelper()
Specified by:
getRepositoryHelper in interface RepositoryServiceContext


Copyright © 2007. All Rights Reserved.