当前位置: 首页>>代码示例>>Java>>正文


Java PortalUtil.getDate方法代码示例

本文整理汇总了Java中com.liferay.portal.util.PortalUtil.getDate方法的典型用法代码示例。如果您正苦于以下问题:Java PortalUtil.getDate方法的具体用法?Java PortalUtil.getDate怎么用?Java PortalUtil.getDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.liferay.portal.util.PortalUtil的用法示例。


在下文中一共展示了PortalUtil.getDate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: editInscriptionDates

import com.liferay.portal.util.PortalUtil; //导入方法依赖的package包/类
public void editInscriptionDates(ActionRequest actionRequest,
		ActionResponse actionResponse) throws Exception 
{

	long courseId = ParamUtil.getLong(actionRequest, "courseId", 0);
	long userId = ParamUtil.getLong(actionRequest, "userId", 0);
	User user = UserLocalServiceUtil.getUser(userId);
	Course course = CourseLocalServiceUtil.getCourse(courseId);
	int startMonth = ParamUtil.getInteger(actionRequest, "startMon");
	int startYear = ParamUtil.getInteger(actionRequest, "startYear");
	int startDay = ParamUtil.getInteger(actionRequest, "startDay");
	int stopMonth = ParamUtil.getInteger(actionRequest, "stopMon");
	int stopYear = ParamUtil.getInteger(actionRequest, "stopYear");
	int stopDay = ParamUtil.getInteger(actionRequest, "stopDay");
	boolean startDateEnabled=ParamUtil.getBoolean(actionRequest,"startdate-enabled",false);
	boolean stopDateEnabled=ParamUtil.getBoolean(actionRequest,"stopdate-enabled",false);
	Date allowStartDate = PortalUtil.getDate(startMonth, startDay, startYear,
			0, 0, user.getTimeZone(),
			new EntryDisplayDateException());
	
	if(!startDateEnabled)
    {
		allowStartDate=null;
    }
	
	Date allowFinishDate = PortalUtil.getDate(stopMonth, stopDay, stopYear,
			0, 0, user.getTimeZone(),
			new EntryDisplayDateException());
	if(!stopDateEnabled)
    {
		allowFinishDate=null;
    }
	CourseServiceUtil.editUserInscriptionDates(courseId,userId,allowStartDate,allowFinishDate);
	actionResponse.setRenderParameters(actionRequest.getParameterMap());
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:36,代码来源:CourseAdmin.java

示例2: getNewApplications

import com.liferay.portal.util.PortalUtil; //导入方法依赖的package包/类
public List<List> getNewApplications(long companyId, int year, int month, int day, int count) throws SystemException {	

	List<List> result  = new ArrayList<List>();
	
	Date modifiedDate = PortalUtil.getDate(month, day, year);
	Date now = new Date();

	List<Application> applications = applicationPersistence.findAll();
	List<Application> applications2 = new ArrayList<Application>();
	for (Application app: applications) {
		applications2.add(app);
	}
	
	OrderByComparator orderByComparator = CustomComparatorUtil.getApplicationOrderByComparator("modifiedDate",  "desc");
	
       Collections.sort(applications2, orderByComparator);
       applications2 = applications2.subList(0, count);
	
	for (Application application: applications2) {
		if (application.getLifeCycleStatus() >= 4) {
			List toAdd = new ArrayList();
			toAdd.add(application);
					
			DLFileEntry fe;
			try {
				fe = DLFileEntryLocalServiceUtil.getDLFileEntry(application.getLogoImageId());
				String iconUrl = "http://localhost/documents/10180/0/" + 
					HttpUtil.encodeURL(HtmlUtil.unescape(fe.getTitle())) + 
					StringPool.SLASH + 
					fe.getUuid() +
					"?version=" + fe.getVersion() +
					"&t=" + fe.getModifiedDate().getTime() +
					"&imageThumbnail=1";
						
				toAdd.add(iconUrl);
			} catch (PortalException e) {
				_log.error(e.getMessage());
			}
					
			result.add(toAdd);				
		}
	}			
	return result;		
}
 
开发者ID:fraunhoferfokus,项目名称:govapps,代码行数:45,代码来源:ApplicationLocalServiceImpl.java

示例3: getNewApplications

import com.liferay.portal.util.PortalUtil; //导入方法依赖的package包/类
public List<List> getNewApplications(long companyId, int year, int month, int day, int count) throws SystemException {	
	_log.debug("getNewApplications2: ");
	List<List> result  = new ArrayList<List>();
	try {
		Date modifiedDate = PortalUtil.getDate(month, day, year);
		Date now = new Date();
		
		DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(Application.class);
		Criterion criterion = null;
		
		criterion = RestrictionsFactoryUtil.between("modifiedDate",modifiedDate,now);

		dynamicQuery.add(criterion);
		dynamicQuery.add(PropertyFactoryUtil.forName("lifeCycleStatus").eq(E_Stati.APPLICATION_STATUS_VERIFIED.getIntStatus()));
		
		Order defaultOrder = OrderFactoryUtil.desc("modifiedDate");
		dynamicQuery.addOrder(defaultOrder); 
				
		dynamicQuery.setLimit(0, count);
		
		List<Application> applications = ApplicationLocalServiceUtil.dynamicQuery(dynamicQuery);
		
	
		for (Application application: applications) {
			List toAdd = new ArrayList();
			toAdd.add(application);
						
			if (application.getLogoImageId() != 0) {
				DLFileEntry fe;
				fe = DLFileEntryLocalServiceUtil.getDLFileEntry(application.getLogoImageId());
							//String iconUrl = "http://localhost/documents/10180/0/" + HttpUtil.encodeURL(fe.getTitle(), true);
				String iconUrl = "http://localhost/documents/10180/0/" + 
					HttpUtil.encodeURL(HtmlUtil.unescape(fe.getTitle())) + 
					StringPool.SLASH + 
					fe.getUuid() +
					"?version=" + fe.getVersion() +
					"&t=" + fe.getModifiedDate().getTime() +
					"&imageThumbnail=1";
								
				toAdd.add(iconUrl);
			}
					
			result.add(toAdd);				
		}
	} catch (Exception e) {
		_log.error(e.getMessage());
		e.printStackTrace();
	}
	return result;		
}
 
开发者ID:fraunhoferfokus,项目名称:govapps,代码行数:51,代码来源:ApplicationServiceImpl.java


注:本文中的com.liferay.portal.util.PortalUtil.getDate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。