public OrganizationIntegrationService getOrganizationIntegrationService() { if (this.organizationIntegrationService == null) { organizationIntegrationService = CommonsUtils.getService(OrganizationIntegrationService.class); } return this.organizationIntegrationService; } }
private boolean isIgnoredRequest(ServletContext context, String url) { String fileName = url.substring(url.indexOf("/")); String mimeType = context.getMimeType(fileName); return (mimeType != null || url.contains(CommonsUtils.getRestContextName())); } }
private Session getJCRSession(SessionProvider sProvider, String wpName) { Session session = null; try { session = sProvider.getSession(wpName, CommonsUtils.getRepository()); } catch (RepositoryException e) { LOG.error(e); } return session; } /**
@View public Response index(ApplicationContext applicationContext, UserContext userContext){ //Redirect yo the home's page when the feature is off if (! CommonsUtils.isFeatureActive(NotificationUtils.FEATURE_NAME)) { return redirectToHomePage(); } this.locale = userContext.getLocale(); ResourceBundle rs = applicationContext.resolveBundle(this.locale); Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("_ctx", new Context(rs)); List<GroupProvider> groups = pluginSettingService.getGroupPlugins(); parameters.put("groups", groups); // parameters.put("channels", getChannels()); //try to get sender name and email from database. If fail, get default value from properties file SettingValue<?> senderName = settingService.get(org.exoplatform.commons.api.settings.data.Context.GLOBAL, Scope.GLOBAL, NotificationPluginUtils.NOTIFICATION_SENDER_NAME); SettingValue<?> senderEmail = settingService.get(org.exoplatform.commons.api.settings.data.Context.GLOBAL, Scope.GLOBAL, NotificationPluginUtils.NOTIFICATION_SENDER_EMAIL); parameters.put("senderName", senderName != null ? (String)senderName.getValue() : System.getProperty("exo.notifications.portalname", "eXo")); parameters.put("senderEmail", senderEmail != null ? (String)senderEmail.getValue() : System.getProperty("gatein.email.smtp.from", "noreply@exoplatform.com")); return index.ok(parameters); }
public Boolean hasDocuments(Node node, String userId) { SessionProvider sProvider = null; try { sProvider = SessionProvider.createSystemProvider(); String pathCondition = node == null ? "" : new StringBuilder(" AND jcr:path like ").append(node.getPath()).append("/%").toString(); String fileQueryStatement = new StringBuilder("SELECT * FROM nt:file WHERE exo:owner='"). append(userId).append("'").append(pathCondition).toString(); String ws = CommonsUtils.getRepository().getConfiguration().getDefaultWorkspaceName(); QueryImpl query = (QueryImpl)sProvider.getSession(ws, CommonsUtils.getRepository()). getWorkspace().getQueryManager().createQuery(fileQueryStatement, Query.SQL); query.setLimit(1); return (query.execute().getNodes().hasNext()); } catch (RepositoryException e) { LOG.error("Getting started Service : cannot check uploaded documents " + e.getLocalizedMessage(), e); return false; } finally { if (sProvider !=null) { sProvider.close(); } } }
public OrganizationIntegrationService getOrganizationIntegrationService() { if (this.organizationIntegrationService == null) { organizationIntegrationService = CommonsUtils.getService(OrganizationIntegrationService.class); } return this.organizationIntegrationService; } }
public OrganizationIntegrationService getOrganizationIntegrationService() { if (this.organizationIntegrationService == null) { organizationIntegrationService = CommonsUtils.getService(OrganizationIntegrationService.class); } return this.organizationIntegrationService; } }
public OrganizationIntegrationService getOrganizationIntegrationService() { if (this.organizationIntegrationService == null) { organizationIntegrationService = CommonsUtils.getService(OrganizationIntegrationService.class); } return this.organizationIntegrationService; } }
public OrganizationIntegrationService getOrganizationIntegrationService() { if (this.organizationIntegrationService == null) { organizationIntegrationService = CommonsUtils.getService(OrganizationIntegrationService.class); } return this.organizationIntegrationService; } }
/** * Gets the channels what is using for Active setting. * * @return */ private String loadActiveValue() { if (this.activeChannelList == null) { ChannelManager channelManager = CommonsUtils.getService(ChannelManager.class); List<String> channelIds = new ArrayList<String> (); for (AbstractChannel channel : channelManager.getChannels()) { channelIds.add(channel.getId()); } activeChannelList = StringUtils.join(channelIds, ','); } return activeChannelList; }
private static void registerNodeTypes(String nodeTypeFilesName, int alreadyExistsBehaviour) throws Exception { ConfigurationManager configurationService = CommonsUtils.getService(ConfigurationManager.class); InputStream isXml = configurationService.getInputStream(nodeTypeFilesName); RepositoryService repositoryService = CommonsUtils.getService(RepositoryService.class); ExtendedNodeTypeManager ntManager = repositoryService.getCurrentRepository().getNodeTypeManager(); ntManager.registerNodeTypes(isXml, alreadyExistsBehaviour, NodeTypeDataManager.TEXT_XML); }
@Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String redirectURI = "/portal/"; String value = request.getParameter("value"); // make sure PortalContainer is created PortalContainer.getInstance(); SoftwareRegistrationService softwareRegistrationService = CommonsUtils.getService(SoftwareRegistrationService.class); if(StringUtils.equals("skip", value)) { softwareRegistrationService.setRequestSkip(true); softwareRegistrationService.updateSkippedNumber(); } if(StringUtils.equals("notReachable", value)){ request.getSession().setAttribute("notReachable", "true"); redirectURI+="?"+SoftwareRegisterFilter.NOT_REACHABLE; } response.sendRedirect(redirectURI); }
/** * Loads the channel list with default active plugins except Mail channel */ private void loadChannels() { if (this.channelProperties == null || channelProperties.size() == 0) { PluginContainer container = CommonsUtils.getService(PluginContainer.class); ChannelManager channelManager = CommonsUtils.getService(ChannelManager.class); for (AbstractChannel channel : channelManager.getChannels()) { if (!MailChannel.ID.equals(channel.getId())) { channelProperties.put(channel.getId(), NotificationUtils.listToString(container.getDefaultActivePlugins(), AbstractService.VALUE_PATTERN)); } } } }
/** * If user setting is inactive (Never Notify Me). Mail Channel is disable, others is enable * * @return */ private String loadInactiveValue() { if (this.inactiveChannelList == null) { ChannelManager channelManager = CommonsUtils.getService(ChannelManager.class); List<String> channelIds = new ArrayList<String> (); for (AbstractChannel channel : channelManager.getChannels()) { if (!MailChannel.ID.equals(channel.getId())) { channelIds.add(channel.getId()); } } inactiveChannelList = StringUtils.join(channelIds, ','); } return inactiveChannelList; }
public UpgradeUserNotificationSettingPlugin(InitParams initParams, ChromatticManager manager) { super(initParams); NotificationConfiguration configuration = CommonsUtils.getService(NotificationConfiguration.class); this.workspace = configuration != null ? configuration.getWorkspace() : null; this.socialWorkspace = manager.getLifeCycle(SocialChromatticLifeCycle.SOCIAL_LIFECYCLE_NAME).getWorkspaceName(); this.settingWorkspace = manager.getLifeCycle(SETTING_LIFE_CYCLE_NAME).getWorkspaceName(); this.channelProperties = new HashMap<String, String>(); }
ExoFeatureService featureService = CommonsUtils.getService(ExoFeatureService.class); featureService.saveActiveFeature(featureName, isActive);