Package org.exoplatform.container

Examples of org.exoplatform.container.ExoContainer


     * @param updateState the state update
     * @throws Exception any exception
     */
    public void update(C updateState) throws Exception {
        WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
        ExoContainer container = context.getApplication().getApplicationServiceContainer();
        state.setApplicationState(adapter.update(container, updateState, state.getApplicationState()));
        setState(state);
    }
View Full Code Here


        this.pageSize = pageSize;
    }

    public boolean hasNext() {
        if (hasNext && currentIndex == 0) {
            ExoContainer container = PortalContainer.getInstance();
            PageService pageService = (PageService) container.getComponentInstance(PageService.class);
            QueryResult<PageContext> result = pageService.findPages(0, 1, SiteType.valueOf(ownerType.toUpperCase()), ownerId,
                    name, title);

            hasNext = result.getSize() > 0;
        }
View Full Code Here

    /**
     *
     * @return Returns a list of pages or returns null if has not any page.
     */
    public List<PageModel> next() {
        ExoContainer container = PortalContainer.getInstance();
        PageService pageService = (PageService) container.getComponentInstance(PageService.class);
        QueryResult<PageContext> result = pageService.findPages(currentIndex, pageSize + 1,
                SiteType.valueOf(ownerType.toUpperCase()), ownerId, name, title);

        int size = result.getSize();
        hasNext = size > pageSize;
View Full Code Here

    private static String cachedGroupLabel;

    public static String getGroupLabel(String groupId) throws Exception {
        WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
        ExoContainer container = context.getApplication().getApplicationServiceContainer();
        OrganizationService orgService = (OrganizationService) container.getComponentInstanceOfType(OrganizationService.class);
        Group group = orgService.getGroupHandler().findGroupById(groupId);
        if (group == null) {
            return cachedGroupLabel;
        }
        String label = group.getLabel();
View Full Code Here

        return cachedGroupLabel;
    }

    public static String getGroupDescription(String groupId) throws Exception {
        WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
        ExoContainer container = context.getApplication().getApplicationServiceContainer();
        OrganizationService orgService = (OrganizationService) container.getComponentInstanceOfType(OrganizationService.class);
        String description = "";
        Group group = orgService.getGroupHandler().findGroupById(groupId);
        if (group != null) {
            description = group.getDescription();
        }
View Full Code Here

        result.replace(0, 1, result.substring(0, 1).toUpperCase());
        return result.toString();
    }

    private ResourceBundle getResourceBundle(Locale locale) {
        ExoContainer appContainer = ExoContainerContext.getCurrentContainer();
        ResourceBundleService service = (ResourceBundleService) appContainer
                .getComponentInstanceOfType(ResourceBundleService.class);
        ResourceBundle res = service.getResourceBundle("locale.portal.webui", locale);
        return res;
    }
View Full Code Here

      datasourceName = config.getDatasourceName();
   }

   private DataSourceProvider getDataSourceProvider()
   {
      ExoContainer container = ExoContainerContext.getCurrentContainer();
      if (container == null)
      {
         LOG.warn("The current container cannot be found which prevents to retrieve the DataSourceProvider");
         return null;
      }
      DataSourceProvider dsProvider =
         (DataSourceProvider)container.getComponentInstanceOfType(DataSourceProvider.class);
      if (dsProvider == null)
      {
         LOG.warn("The DataSourceProvider cannot be found in the container " + container.getContext().getName()
            + ", it will be considered as non managed ");
      }
      return dsProvider;
   }
View Full Code Here

      }
   }

   private ConversationState getConversationState() throws Exception
   {
      ExoContainer container = ExoContainerContext.getCurrentContainer();
      Authenticator authenticator = (Authenticator)container.getComponentInstanceOfType(Authenticator.class);

      IdentityRegistry identityRegistry =
         (IdentityRegistry)container.getComponentInstanceOfType(IdentityRegistry.class);

      if (authenticator == null)
         throw new LoginException("No Authenticator component found, check your configuration");

      Credential[] credentials =
View Full Code Here

   private void unRegistrateIdentity()
   {
      ConversationState.setCurrent(null);

      ExoContainer container = ExoContainerContext.getCurrentContainer();
      IdentityRegistry identityRegistry =
         (IdentityRegistry)container.getComponentInstanceOfType(IdentityRegistry.class);

      // The check need for case when login failed
      if (this.userId != null)
      {
         identityRegistry.unregister(this.userId);
View Full Code Here

         synchronized (JCRStatisticsManager.class)
         {
            if (!STARTED)
            {
               addTriggers();
               ExoContainer container = ExoContainerContext.getTopContainer();
               ManagementContext ctx = null;
               if (container != null)
               {
                  ctx = container.getManagementContext();
               }
               if (ctx == null)
               {
                  LOG.warn("Cannot register the statistics");
               }
View Full Code Here

TOP

Related Classes of org.exoplatform.container.ExoContainer

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.