Package org.gatein.management.api.binding

Examples of org.gatein.management.api.binding.BindingProvider


      return this;
   }

   public <T> Marshaller<T> getMarshaller(Class<T> type, ContentType contentType, String componentName)
   {
      BindingProvider bp = service.getBindingProvider(componentName);
      if (bp == null) return null;

      return bp.getMarshaller(type, contentType);
   }
View Full Code Here


* @author <a href="mailto:nscavell@redhat.com">Nick Scavelli</a>
* @version $Revision$
*/
public class FilteredNavigationExportResource {
    protected void execute(OperationContext operationContext, ResultHandler resultHandler, PathTemplateFilter filter) {
        BindingProvider bindingProvider = operationContext.getBindingProvider();
        Marshaller<PageNavigation> marshaller = bindingProvider.getMarshaller(PageNavigation.class, ContentType.XML);

        final ManagedResource resource = operationContext.getManagedResource();
        final PathAddress address = operationContext.getAddress();
        final String operationName = operationContext.getOperationName();

View Full Code Here

            NodeContext<?> context = NavigationUtils.loadNode(navigationService, navigationService.loadNavigation(siteKey),
                    navigationKey.getNavUri());
            if (context == null)
                throw new ResourceNotFoundException("Navigation node not found for navigation uri '" + navUri + "'");

            BindingProvider bindingProvider = operationContext.getBindingProvider();
            Marshaller<PageNavigation> marshaller = bindingProvider.getMarshaller(PageNavigation.class, ContentType.XML);

            NavigationExportTask exportTask = new NavigationExportTask(navigationKey, navigationService, descriptionService,
                    marshaller);

            resultHandler.completed(new ExportResourceModel(exportTask));
View Full Code Here

* @author <a href="mailto:nscavell@redhat.com">Nick Scavelli</a>
* @version $Revision$
*/
public class FilteredNavigationExportResource {
    protected void execute(OperationContext operationContext, ResultHandler resultHandler, PathTemplateFilter filter) {
        BindingProvider bindingProvider = operationContext.getBindingProvider();
        Marshaller<PageNavigation> marshaller = bindingProvider.getMarshaller(PageNavigation.class, ContentType.XML);

        final ManagedResource resource = operationContext.getManagedResource();
        final PathAddress address = operationContext.getAddress();
        final String operationName = operationContext.getOperationName();

View Full Code Here

*/
public class SiteLayoutExportResource extends AbstractSiteOperationHandler {
    @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))));
    }
View Full Code Here

            throws ResourceNotFoundException, OperationException {
        SiteKey siteKey = getSiteKey(pages.getSite());

        DataStorage dataStorage = operationContext.getRuntimeContext().getRuntimeComponent(DataStorage.class);
        PageService pageService = operationContext.getRuntimeContext().getRuntimeComponent(PageService.class);
        BindingProvider bindingProvider = operationContext.getBindingProvider();

        Collection<Page> pagesList = pages.getChildren();
        List<ExportTask> tasks = new ArrayList<ExportTask>(pagesList.size());

        PageExportTask pageExportTask = new PageExportTask(siteKey, dataStorage, pageService, bindingProvider.getMarshaller(
                org.exoplatform.portal.config.model.Page.PageSet.class, ContentType.XML));

        String pageName = operationContext.getAddress().resolvePathTemplate("page-name");
        for (Page page : pagesList) {
            if (pageName == null) {
View Full Code Here

   }

   @Override
   public BindingProvider getBindingProvider(final String componentName)
   {
      return new BindingProvider()
      {
         @Override
         public <T> Marshaller<T> getMarshaller(Class<T> type, ContentType contentType) throws BindingException
         {
            Marshaller<T> marshaller = null;
            BindingProvider bp = bindingProviders.get(componentName);
            if (bp != null)
            {
               marshaller = bp.getMarshaller(type, contentType);
            }
            if (marshaller == null)
            {
               marshaller = globalBindingProvider.getMarshaller(type, contentType);
            }
View Full Code Here

      OperationHandler operationHandler = root.getOperationHandler(address, operationName);
      if (operationHandler != null)
      {
         // Obtain binding provider given managed component.
         String componentName = (address.size() >= 1) ? address.get(0) : null;
         BindingProvider bindingProvider = managementService.getBindingProvider(componentName);

         // Execute operation for given registered operation handler
         BasicResultHandler resultHandler = new BasicResultHandler();
         operationHandler.execute(new OperationContextImpl(request, root, runtimeContext, bindingProvider), resultHandler);
View Full Code Here

         String navUri = operationContext.getAddress().resolvePathTemplate("nav-uri");
         SiteKey siteKey = getSiteKey(site);

         DescriptionService descriptionService = operationContext.getRuntimeContext().getRuntimeComponent(DescriptionService.class);
         NavigationService navigationService = operationContext.getRuntimeContext().getRuntimeComponent(NavigationService.class);
         BindingProvider bindingProvider = operationContext.getBindingProvider();
         Marshaller<PageNavigation> marshaller = bindingProvider.getMarshaller(PageNavigation.class, ContentType.XML);

         NavigationExportTask exportTask = new NavigationExportTask(new NavigationKey(siteKey, navUri), navigationService, descriptionService, marshaller);

         resultHandler.completed(new ExportResourceModel(exportTask));
      }
View Full Code Here

*/
public class FilteredNavigationExportResource
{
   protected void execute(OperationContext operationContext, ResultHandler resultHandler, PathTemplateFilter filter)
   {
      BindingProvider bindingProvider = operationContext.getBindingProvider();
      Marshaller<PageNavigation> marshaller = bindingProvider.getMarshaller(PageNavigation.class, ContentType.XML);

      final ManagedResource resource = operationContext.getManagedResource();
      final PathAddress address = operationContext.getAddress();
      final String operationName = operationContext.getOperationName();

View Full Code Here

TOP

Related Classes of org.gatein.management.api.binding.BindingProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.