List of usage examples for com.liferay.portal.kernel.plugin PluginPackage getVersion
public String getVersion();
From source file:com.liferay.exportimport.resources.importer.internal.util.ImporterFactory.java
License:Open Source License
protected void configureImporter(long companyId, Importer importer, ServletContext servletContext, PluginPackageProperties pluginPackageProperties) throws Exception { importer.setAppendVersion(pluginPackageProperties.isAppendVersion()); importer.setCompanyId(companyId);//from w ww. j a v a 2 s . c om importer.setDeveloperModeEnabled(pluginPackageProperties.isDeveloperModeEnabled()); importer.setIndexAfterImport(pluginPackageProperties.indexAfterImport()); importer.setServletContext(servletContext); importer.setServletContextName(servletContext.getServletContextName()); importer.setTargetClassName(pluginPackageProperties.getTargetClassName()); String targetValue = pluginPackageProperties.getTargetValue(); if (Validator.isNull(targetValue)) { targetValue = TextFormatter.format(servletContext.getServletContextName(), TextFormatter.J); } importer.setTargetValue(targetValue); importer.setUpdateModeEnabled(pluginPackageProperties.isUpdateModeEnabled()); PluginPackage pluginPackage = DeployManagerUtil .getInstalledPluginPackage(servletContext.getServletContextName()); importer.setVersion(pluginPackage.getVersion()); importer.afterPropertiesSet(); }
From source file:com.liferay.marketplace.service.impl.AppLocalServiceImpl.java
License:Open Source License
@Override public List<App> getInstalledApps() { if (_installedApps != null) { return _installedApps; }/* ww w .j a v a 2 s. c om*/ List<App> installedApps = new ArrayList<App>(); // Core app App coreApp = appPersistence.create(0); coreApp.setTitle("Liferay Core"); coreApp.setDescription("Plugins bundled with Liferay Portal."); coreApp.setVersion(ReleaseInfo.getVersion()); coreApp.addContextName(PortalUtil.getPathContext()); installedApps.add(coreApp); // Deployed apps List<PluginPackage> pluginPackages = DeployManagerUtil.getInstalledPluginPackages(); for (PluginPackage pluginPackage : pluginPackages) { List<Module> modules = modulePersistence.findByContextName(pluginPackage.getContext()); boolean installedApp = false; for (Module module : modules) { App app = appPersistence.fetchByPrimaryKey(module.getAppId()); if ((app != null) && app.isInstalled()) { installedApp = true; break; } } if (installedApp) { continue; } App app = appPersistence.create(0); app.setTitle(pluginPackage.getName()); app.setDescription(pluginPackage.getLongDescription()); app.setVersion(pluginPackage.getVersion()); app.addContextName(pluginPackage.getContext()); installedApps.add(app); } // Marketplace apps List<App> apps = appPersistence.findAll(); for (App app : apps) { if (app.isInstalled()) { installedApps.add(app); } } installedApps = ListUtil.sort(installedApps, new AppTitleComparator()); _installedApps = installedApps; return _installedApps; }
From source file:com.liferay.resourcesimporter.util.ImporterFactory.java
License:Open Source License
protected void configureImporter(long companyId, Importer importer, ServletContext servletContext, PluginPackageProperties pluginPackageProperties) throws Exception { importer.setAppendVersion(pluginPackageProperties.isAppendVersion()); importer.setCompanyId(companyId);// w w w . j a va2 s . c o m importer.setDeveloperModeEnabled(pluginPackageProperties.isDeveloperModeEnabled()); importer.setServletContext(servletContext); importer.setServletContextName(servletContext.getServletContextName()); importer.setTargetClassName(pluginPackageProperties.getTargetClassName()); String targetValue = pluginPackageProperties.getTargetValue(); if (Validator.isNull(targetValue)) { targetValue = TextFormatter.format(servletContext.getServletContextName(), TextFormatter.J); } importer.setTargetValue(targetValue); importer.setUpdateModeEnabled(pluginPackageProperties.isUpdateModeEnabled()); PluginPackage pluginPackage = DeployManagerUtil .getInstalledPluginPackage(servletContext.getServletContextName()); importer.setVersion(pluginPackage.getVersion()); importer.afterPropertiesSet(); }
From source file:com.liferay.sync.service.impl.SyncDLObjectServiceImpl.java
License:Open Source License
@AccessControlled(guestAccessEnabled = true) @Override/*from w ww . j a va 2s . c om*/ public SyncContext getSyncContext(String uuid) throws PortalException { try { User user = getGuestOrUser(); SyncContext syncContext = new SyncContext(); PluginPackage syncWebPluginPackage = DeployManagerUtil.getInstalledPluginPackage("sync-web"); syncContext.setPluginVersion(syncWebPluginPackage.getVersion()); if (!user.isDefaultUser()) { syncContext.setPortalBuildNumber(ReleaseInfo.getBuildNumber()); PluginPackage soPortletPluginPackage = DeployManagerUtil.getInstalledPluginPackage("so-portlet"); syncContext.setPortletPreferencesMap(getPortletPreferencesMap()); if (soPortletPluginPackage != null) { syncContext.setSocialOfficeInstalled(true); } else { syncContext.setSocialOfficeInstalled(false); } syncContext.setUser(user); syncContext.setUserSitesGroups(getUserSitesGroups()); } return syncContext; } catch (PortalException pe) { throw new PortalException(SyncUtil.buildExceptionMessage(pe), pe); } }