@Override protected void execute(OperationContext operationContext, ResultHandler resultHandler, Site site) throws ResourceNotFoundException, OperationException { BindingProvider bindingProvider = operationContext.getBindingProvider(); DataStorage dataStorage = operationContext.getRuntimeContext().getRuntimeComponent(DataStorage.class); SiteKey siteKey = getSiteKey(site); resultHandler.completed( new ExportResourceModel( new SiteLayoutExportTask( siteKey, dataStorage, bindingProvider.getMarshaller(PortalConfig.class, ContentType.XML)))); }
@Override protected void execute(OperationContext operationContext, ResultHandler resultHandler, Site site) throws ResourceNotFoundException, OperationException { DataStorage dataStorage = operationContext.getRuntimeContext().getRuntimeComponent(DataStorage.class); SiteKey siteKey = getSiteKey(site); try { PortalConfig portalConfig = dataStorage.getPortalConfig(siteKey.getTypeName(), siteKey.getName()); resultHandler.completed(portalConfig); } catch (Exception e) { throw new OperationException( operationContext.getOperationName(), "Could not retrieve site layout for site " + site, e); } }