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


Java HttpUtil.encodeURL方法代码示例

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


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

示例1: getIconURL

import com.liferay.portal.kernel.util.HttpUtil; //导入方法依赖的package包/类
public String getIconURL(long applicationId) throws Exception {
		String result = "";		
		try {
//			_log.debug("getIconURL(applicationId " + applicationId + ")");	
			Application application = applicationLocalService.getApplication(applicationId);
			if (application.getLogoImageId() != 0) {
				DLFileEntry fe = DLFileEntryLocalServiceUtil.getDLFileEntry(application.getLogoImageId());
				result = "http://localhost/documents/10180/0/" + 
						HttpUtil.encodeURL(HtmlUtil.unescape(fe.getTitle())) + 
						StringPool.SLASH + 
						fe.getUuid() +
						"?version=" + fe.getVersion() +
						"&t=" + fe.getModifiedDate().getTime() +
						"&imageThumbnail=1";				
			}
					
		} catch (SystemException se) {
			_log.error("applicationId: " + applicationId);				
			_log.error(se.getMessage());		
		} catch (PortalException pe) {
			_log.error("applicationId: " + applicationId);				
			_log.error(pe.getMessage());				
		}
		return result;		
	}
 
开发者ID:fraunhoferfokus,项目名称:govapps,代码行数:26,代码来源:ApplicationServiceImpl.java

示例2: getExternIconURL

import com.liferay.portal.kernel.util.HttpUtil; //导入方法依赖的package包/类
private String getExternIconURL(Application application) throws Exception {
	String result = "";		
	try {
		if (application.getLogoImageId() != 0) {
			DLFileEntry fe = DLFileEntryLocalServiceUtil.getDLFileEntry(application.getLogoImageId());
			result = "http://" +  AppConstants.COMPANY_VIRTUAL_HOST + "/documents/10180/0/" + 
					HttpUtil.encodeURL(HtmlUtil.unescape(fe.getTitle())) + 
					StringPool.SLASH + 
					fe.getUuid() +
					"?version=" + fe.getVersion() +
					"&t=" + fe.getModifiedDate().getTime() +
					"&imageThumbnail=1";				
		}
				
	} catch (SystemException se) {
		_log.error(se.getMessage());				
	} catch (PortalException pe) {
		_log.error(pe.getMessage());				
	}
	return result;		
}
 
开发者ID:fraunhoferfokus,项目名称:govapps,代码行数:22,代码来源:ApplicationServiceImpl.java

示例3: getNewApplications

import com.liferay.portal.kernel.util.HttpUtil; //导入方法依赖的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

示例4: getNewApplications

import com.liferay.portal.kernel.util.HttpUtil; //导入方法依赖的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

示例5: run

import com.liferay.portal.kernel.util.HttpUtil; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
    @Override
    public void run(HttpServletRequest request, HttpServletResponse response) throws ActionException {
	Map<String, Object> vmVariables = null;

	if (request.getAttribute(WebKeys.VM_VARIABLES) == null) {
	    vmVariables = new HashMap<String, Object>();
	    request.setAttribute(WebKeys.VM_VARIABLES, vmVariables);
	} else {
	    vmVariables = (Map<String,Object>) request.getAttribute(WebKeys.VM_VARIABLES);
	}
	
	String urlImagem = "/e-democracia-theme/images/custom/simbol-edemocracia.png";
	String urlImagemThumb = urlImagem;
	
	try {
	    ThemeDisplay td = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
	    FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(td.getScopeGroupId(), 0, "icone");
	    if (fileEntry != null) {
		FileVersion versaoAtual = fileEntry.getFileVersion();
		if (versaoAtual != null) {
		    String nomeImage = HttpUtil.encodeURL(HtmlUtil.unescape(fileEntry.getTitle()), true);
		    urlImagem = td.getPortalURL() + td.getPathContext() + "/documents/" + fileEntry.getRepositoryId() + "/" + fileEntry.getFolderId() + "/" + nomeImage + "?version=" + versaoAtual.getVersion() + "&t=" + versaoAtual.getModifiedDate().getTime();
		    urlImagemThumb = urlImagem + "&imageThumbnail=1";
		}
	    }
	} catch (Exception e) {
	}

/*	#set($caminhoImg = )
	#set($dlService = $serviceLocator.findService("com.liferay.portlet.documentlibrary.service.DLAppLocalService"))
	#set($imageEntry = $dlService.getFileEntry($themeDisplay.scopeGroupId, 0, "icone"))
	#if ($imageEntry)
	 #set($fileVersion = $imageEntry.fileVersion)
	 #if ($fileVersion)
	  #set($imageName = $httpUtil.encodeURL($htmlUtil.unescape($imageEntry.title),true))
	  #set($caminhoImg = $themeDisplay.portalURL + $themeDisplay.pathContext + "/documents/" + $imageEntry.repositoryId + "/" + $imageEntry.folderId + "/" + $imageName + "?version=" + $fileVersion.version + "&t=" + $fileVersion.modifiedDate.time + "&imageThumbnail=1")
	 #end
	#end
*/
	
	vmVariables.put("caminho_img", urlImagemThumb);
	vmVariables.put("caminho_img_orig", urlImagem);
    }
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:45,代码来源:ImagemComunidadeAction.java

示例6: fromBuddyDetails

import com.liferay.portal.kernel.util.HttpUtil; //导入方法依赖的package包/类
/**
 * Factory method which creates new Buddy object from BuddyDetails
 *
 * @param buddyDetails BuddyDetails
 * @return User
 */
public static Buddy fromBuddyDetails(BuddyDetails buddyDetails) {
    // Create new buddy
    Buddy buddy = new Buddy();
    // Map data to user details
    buddy.buddyId = buddyDetails.getBuddyId();
    buddy.companyId = buddyDetails.getCompanyId();
    buddy.fullName = buddyDetails.getFullName();
    buddy.screenName = buddyDetails.getScreenName();
    buddy.password = buddyDetails.getPassword();

    // Add additional info from local service util if it's not set in buddy details
    if (buddyDetails.getBuddyId() != null) {
        try {
            User user = UserLocalServiceUtil.getUserById(buddyDetails.getBuddyId());
            if (buddy.screenName == null) {
                buddy.screenName = user.getScreenName();
            }

            if (buddy.companyId == null) {
                buddy.companyId = user.getCompanyId();
            }

            if (buddy.fullName == null) {
                buddy.fullName = user.getFullName();
            }

            buddy.male = user.getMale();
            buddy.portraitId = user.getPortraitId();
            buddy.portraitImageToken = HttpUtil.encodeURL(DigesterUtil.digest(user.getUserUuid()));
            buddy.portraitToken = WebServerServletTokenUtil.getToken(user.getPortraitId());
            buddy.fullName = user.getFullName();

        } catch (Exception e) {
            // Just log
            if (log.isDebugEnabled()) {
                log.debug(e);
            }
        }
    }

    // Relations
    if (buddyDetails.getPresenceDetails() != null) {
        buddy.presence = Presence.fromPresenceDetails(buddyDetails.getPresenceDetails());
    }

    if (buddyDetails.getSettingsDetails() != null) {
        buddy.settings = Settings.fromSettingsDetails(buddyDetails.getSettingsDetails());
    }

    return buddy;
}
 
开发者ID:marcelmika,项目名称:lims,代码行数:58,代码来源:Buddy.java


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