List of usage examples for com.liferay.portal.kernel.util ReleaseInfo getVersion
public static final String getVersion()
From source file:com.liferay.calendar.util.CalendarICalDataHandler.java
License:Open Source License
protected net.fortuna.ical4j.model.Calendar toICalCalendar(List<CalendarBooking> calendarBookings) throws Exception { net.fortuna.ical4j.model.Calendar iCalCalendar = new net.fortuna.ical4j.model.Calendar(); PropertyList propertiesList = iCalCalendar.getProperties(); ProdId prodId = new ProdId("-//Liferay Inc//Liferay Portal " + ReleaseInfo.getVersion() + "//EN"); propertiesList.add(prodId);//from w w w .j a v a2s. com propertiesList.add(Version.VERSION_2_0); propertiesList.add(CalScale.GREGORIAN); propertiesList.add(Method.PUBLISH); List<VEvent> vEvents = iCalCalendar.getComponents(); for (CalendarBooking calendarBooking : calendarBookings) { vEvents.add(toICalEvent(calendarBooking)); } return iCalCalendar; }
From source file:com.liferay.ide.server.core.support.ReleaseInfoGetVersion.java
License:Open Source License
@Override void writeOutput(FileWriter writer) throws IOException { writer.write(ReleaseInfo.getVersion()); }
From source file:com.liferay.marketplace.service.impl.AppLocalServiceImpl.java
License:Open Source License
@Override public List<App> getInstalledApps() { if (_installedApps != null) { return _installedApps; }/*from w w w . j a va 2 s .c o m*/ 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.portlet.calendar.service.impl.CalEventLocalServiceImpl.java
License:Open Source License
protected net.fortuna.ical4j.model.Calendar toICalCalendar(long userId, List<CalEvent> events) throws PortalException, SystemException { net.fortuna.ical4j.model.Calendar iCal = new net.fortuna.ical4j.model.Calendar(); ProdId prodId = new ProdId("-//Liferay Inc//Liferay Portal " + ReleaseInfo.getVersion() + "//EN"); PropertyList propertiesList = iCal.getProperties(); propertiesList.add(prodId);//ww w . ja va 2s .co m propertiesList.add(Version.VERSION_2_0); propertiesList.add(CalScale.GREGORIAN); // LPS-6058 propertiesList.add(Method.PUBLISH); User user = userPersistence.findByPrimaryKey(userId); TimeZone timeZone = user.getTimeZone(); List<VEvent> components = iCal.getComponents(); Iterator<CalEvent> itr = events.iterator(); while (itr.hasNext()) { CalEvent event = itr.next(); components.add(toICalVEvent(event, timeZone)); } return iCal; }
From source file:com.liferay.testpacl.util.TestPACLUtil.java
License:Open Source License
public static String translateFileName(String fileName) { if (fileName.startsWith("../webapps")) { String installedDir = StringPool.BLANK; try {//from ww w . ja v a 2s . c o m installedDir = DeployManagerUtil.getInstalledDir(); } catch (Exception e) { _log.error(e, e); } fileName = StringUtil.replace(fileName, "../webapps", installedDir); if (ServerDetector.isGeronimo()) { String geronimoHome = System.getProperty("org.apache.geronimo.home.dir"); String version = ReleaseInfo.getVersion(); fileName = StringUtil.replace(fileName, installedDir + "/chat-portlet/", geronimoHome + "/repository/liferay/chat-portlet/" + version + ".1/chat-portlet-" + version + ".1.car/"); } else if (ServerDetector.isGlassfish()) { fileName = StringUtil.replace(fileName, "autodeploy", "applications"); } else if (ServerDetector.isJBoss()) { fileName = StringUtil.replace(fileName, "/chat-portlet/", "/chat-portlet.war/"); } else if (ServerDetector.isWebSphere()) { String serverRoot = System.getProperty("server.root"); String cellName = System.getenv("WAS_CELL"); fileName = StringUtil.replace(fileName, installedDir + "/chat-portlet/", serverRoot + "/installedApps/" + cellName + "/chat-portlet.ear/chat-portlet.war/"); } } return fileName; }
From source file:com.liferay.tools.sourceformatter.BaseSourceProcessor.java
License:Open Source License
protected String getMainReleaseVersion() { if (_mainReleaseVersion != null) { return _mainReleaseVersion; }//from w w w. j a v a 2s.co m String releaseVersion = ReleaseInfo.getVersion(); int pos = releaseVersion.lastIndexOf(StringPool.PERIOD); _mainReleaseVersion = releaseVersion.substring(0, pos) + ".0"; return _mainReleaseVersion; }
From source file:com.liferay.vldap.server.directory.ldap.RootDirectory.java
License:Open Source License
public RootDirectory() { addAttribute("namingcontexts", "o=Liferay"); addAttribute("objectclass", "extensibleObject"); addAttribute("objectclass", "top"); addAttribute("supportedfeatures", OIDConstants.ALL_OPERATIONAL_ATTRIBUTES); addAttribute("supportedldapversion", "3"); addAttribute("supportedsaslmechanisms", BindLdapHandler.DIGEST_MD5); addAttribute("vendorname", "Liferay, Inc."); addAttribute("vendorversion", ReleaseInfo.getVersion()); }
From source file:com.liferay.vldap.server.directory.RootDirectory.java
License:Open Source License
@Override protected void initAttributes() { addAttribute("namingcontexts", "o=Liferay"); addAttribute("objectclass", "extensibleObject"); addAttribute("objectclass", "top"); addAttribute("supportedfeatures", OIDConstants.ALL_OPERATIONAL_ATTRIBUTES); addAttribute("supportedldapversion", "3"); addAttribute("supportedsaslmechanisms", BindLdapHandler.DIGEST_MD5); addAttribute("vendorname", "Liferay, Inc."); addAttribute("vendorversion", ReleaseInfo.getVersion()); }
From source file:it.smc.calendar.sync.caldav.CalendarPropsProcessor.java
License:Open Source License
@Override protected void processCalDAVCalendarTimeZone() { TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry(); TimeZone timeZone = registry.getTimeZone("GMT"); VTimeZone vTimeZone = timeZone.getVTimeZone(); net.fortuna.ical4j.model.Calendar iCalCalendar = new net.fortuna.ical4j.model.Calendar(); PropertyList propertiesList = iCalCalendar.getProperties(); ProdId prodId = new ProdId("-//Liferay Inc//Liferay Portal " + ReleaseInfo.getVersion() + "//EN"); propertiesList.add(prodId);// w ww. j av a 2 s . com propertiesList.add(Version.VERSION_2_0); iCalCalendar.getComponents().add(vTimeZone); Element calendarTimeZoneElement = DocUtil.add(successPropElement, CalDAVProps.CALDAV_CALENDAR_TIMEZONE); try { calendarTimeZoneElement.addCDATA(vTimeZoneToString(iCalCalendar)); } catch (Exception e) { _log.error(e, e); } }
From source file:org.dihedron.strutlets.containers.portlet.liferay.Liferay.java
License:Open Source License
/** * Returns a string describing the version of the current Liferay instance. * // ww w.ja v a 2s.co m * @return * a string describing the version of the current Liferay instance. */ public String getServerVersion() { return ReleaseInfo.getVersion(); }