PicketLinkIDMOrganizationServiceImpl getOrganizationService() { return (PicketLinkIDMOrganizationServiceImpl) ExoContainerContext.getCurrentContainer().getComponentInstanceOfType( OrganizationService.class); } }
PicketLinkIDMOrganizationServiceImpl getOrganizationService() { return (PicketLinkIDMOrganizationServiceImpl) ExoContainerContext.getCurrentContainer().getComponentInstanceOfType( OrganizationService.class); } }
@Override public void start() { nodeCreator = (NodeHierarchyCreator) ExoContainerContext.getCurrentContainer().getComponentInstanceOfType(NodeHierarchyCreator.class); }
public BrandingDataStorageService() { repositoryService = (RepositoryService) ExoContainerContext.getCurrentContainer() .getComponentInstanceOfType(RepositoryService.class); }
PicketLinkIDMService getIDMService() { return ExoContainerContext.getCurrentContainer().getComponentInstanceOfType(PicketLinkIDMService.class); }
PicketLinkIDMService getIDMService() { return ExoContainerContext.getCurrentContainer().getComponentInstanceOfType(PicketLinkIDMService.class); }
public List<Node> getAllFavoritesByUser(String workspace, String repository, Node userNode) throws Exception { List<Node> ret = new ArrayList<Node>(); LinkManager linkManager = (LinkManager)ExoContainerContext.getCurrentContainer().getComponentInstanceOfType(LinkManager.class); NodeHierarchyCreator nodeHierarchyCreator = (NodeHierarchyCreator)ExoContainerContext.getCurrentContainer().getComponentInstanceOfType(NodeHierarchyCreator.class); String favoritePath = nodeHierarchyCreator.getJcrPath("userPrivateFavorites"); Node favoriteFolder= userNode.getNode(favoritePath); NodeIterator nodeIter = favoriteFolder.getNodes(); while (nodeIter.hasNext()) { Node childNode = nodeIter.nextNode(); String primaryType = childNode.getProperty("jcr:primaryType").getString(); if (linkManager.isLink(childNode) || primaryType.contains("nt:file")) { ret.add(childNode); } } return ret; }
public AbstractSessionLifeCycle() { try { ExoContainer container = ExoContainerContext.getCurrentContainer(); RepositoryService repoService = (RepositoryService) container.getComponentInstanceOfType(RepositoryService.class); repository = repoService.getRepository(REPOSITORY_NAME); } catch (Exception e) { throw new RuntimeException(e); } }
private ExoContainer getContainer() throws Exception { // TODO set correct current container ExoContainer container = ExoContainerContext.getCurrentContainer(); if (container instanceof RootContainer) { container = RootContainer.getInstance().getPortalContainer( portalContainerName); } return container; }
private ExoContainer getContainer() throws Exception { ExoContainer container = ExoContainerContext.getCurrentContainer(); if (container instanceof RootContainer) { container = RootContainer.getInstance().getPortalContainer(portalContainerName); } return container; }
private ExoContainer getContainer() throws Exception { ExoContainer container = ExoContainerContext.getCurrentContainer(); if (container instanceof RootContainer) { container = RootContainer.getInstance().getPortalContainer("portal"); } return container; } }
/** * {@inheritDoc} */ public Object getInstance(ApplicationContext context) { Class<?> clazz = model.getObjectClass(); return ExoContainerContext.getCurrentContainer().getComponentInstanceOfType(clazz); }
private ResourceBundle getResourceBundle(Locale locale) throws Exception { ExoContainer appContainer = ExoContainerContext.getCurrentContainer(); ResourceBundleService service = (ResourceBundleService)appContainer.getComponentInstanceOfType(ResourceBundleService.class); ResourceBundle res = service.getResourceBundle("locale.portal.webui", locale); return res; }
private ResourceBundle getResourceBundle(Locale locale) throws Exception { ExoContainer appContainer = ExoContainerContext.getCurrentContainer(); ResourceBundleService service = (ResourceBundleService)appContainer.getComponentInstanceOfType(ResourceBundleService.class); ResourceBundle res = service.getResourceBundle("locale.portal.webui", locale); return res; }
@GET @Path("spaces/{userId}/pending") public Response invited(@PathParam("userId") String userId){ SpaceService spaceService = (SpaceService) ExoContainerContext.getCurrentContainer().getComponentInstanceOfType(SpaceService.class); List<Space> spaces = new ArrayList<Space>(); try{ spaces = spaceService.getInvitedSpaces(userId); }catch (Exception e) { // TODO: handle exception LOG.error("cannot get invited spaces ", e); } List<Object> listData= new ArrayList<Object>(); for (Space space : spaces) { listData.add(space); } return renderJSON(listData); }
@SuppressWarnings("deprecation") private boolean hasSpaces(String userId) { try { SpaceService spaceService = (SpaceService) ExoContainerContext.getCurrentContainer() .getComponentInstanceOfType(SpaceService.class); Space[] spaces = spaceService.getAccessibleSpacesWithListAccess(userId).load(0, 1); return spaces != null && spaces.length > 0; } catch (Exception e) { LOG.debug("Error in gettingStarted REST service: " + e.getMessage(), e); return false; } }
@SuppressWarnings("deprecation") private boolean hasContacts(String userId) { try { IdentityManager identityManager = (IdentityManager) ExoContainerContext.getCurrentContainer() .getComponentInstanceOfType(IdentityManager.class); RelationshipManager relationshipManager = (RelationshipManager) ExoContainerContext.getCurrentContainer() .getComponentInstanceOfType(RelationshipManager.class); Identity identity = identityManager.getOrCreateIdentity(OrganizationIdentityProvider.NAME, userId); ListAccess<Identity> confirmedContacts = relationshipManager.getConnections(identity); return confirmedContacts.getSize() > 0; } catch (Exception e) { LOG.debug("Error in gettingStarted REST service: " + e.getMessage(), e); return false; } }
private String getUserFullName(String userId) { try { OrganizationService service = (OrganizationService) ExoContainerContext.getCurrentContainer() .getComponentInstanceOfType(OrganizationService.class); return service.getUserHandler().findUserByName(userId).getFullName(); } catch (Exception e) { return userId; } }
@SuppressWarnings("deprecation") private boolean hasAvatar(String userId) { try { IdentityManager identityManager = (IdentityManager) ExoContainerContext.getCurrentContainer() .getComponentInstanceOfType(IdentityManager.class); Identity identity = identityManager.getOrCreateIdentity(OrganizationIdentityProvider.NAME, userId); Profile profile = identity.getProfile(); if (profile.getAvatarUrl() != null) return true; else return false; } catch (Exception e) { LOG.debug("Error in gettingStarted REST service: " + e.getMessage(), e); return false; } }
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; }