Search in sources :

Example 1 with TaskResponse

use of org.danann.cernunnos.TaskResponse in project uPortal by Jasig.

the class CernunnosDataExporter method exportDataElement.

@Override
protected Element exportDataElement(String id) {
    final RuntimeRequestResponse request = new RuntimeRequestResponse();
    request.setAttribute(this.idAttributeName, id);
    final ReturnValueImpl result = new ReturnValueImpl();
    final TaskResponse response = new RuntimeRequestResponse(Collections.<String, Object>singletonMap("Attributes.RETURN_VALUE", result));
    task.perform(request, response);
    return (Element) result.getValue();
}
Also used : RuntimeRequestResponse(org.danann.cernunnos.runtime.RuntimeRequestResponse) ReturnValueImpl(org.danann.cernunnos.ReturnValueImpl) Element(org.dom4j.Element) TaskResponse(org.danann.cernunnos.TaskResponse)

Example 2 with TaskResponse

use of org.danann.cernunnos.TaskResponse in project uPortal by Jasig.

the class CernunnosDataImporter method importDataElement.

/* (non-Javadoc)
     * @see org.apereo.portal.io.xml.crn.AbstractDom4jImporter#importDataNode(org.apereo.portal.utils.Tuple)
     */
@Override
protected void importDataElement(Tuple<String, Element> data) {
    final RuntimeRequestResponse request = new RuntimeRequestResponse();
    request.setAttribute(Attributes.NODE, data.second);
    request.setAttribute(Attributes.LOCATION, StringUtils.trimToEmpty(data.first));
    final ReturnValueImpl result = new ReturnValueImpl();
    final TaskResponse response = new RuntimeRequestResponse(Collections.<String, Object>singletonMap("Attributes.RETURN_VALUE", result));
    this.task.perform(request, response);
}
Also used : RuntimeRequestResponse(org.danann.cernunnos.runtime.RuntimeRequestResponse) ReturnValueImpl(org.danann.cernunnos.ReturnValueImpl) TaskResponse(org.danann.cernunnos.TaskResponse)

Aggregations

ReturnValueImpl (org.danann.cernunnos.ReturnValueImpl)2 TaskResponse (org.danann.cernunnos.TaskResponse)2 RuntimeRequestResponse (org.danann.cernunnos.runtime.RuntimeRequestResponse)2 Element (org.dom4j.Element)1