• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java HttpUtil类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



HttpUtil类属于com.liferay.portal.kernel.util包,在下文中一共展示了HttpUtil类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getExternImageURLs

import com.liferay.portal.kernel.util.HttpUtil; //导入依赖的package包/类
private JSONArray getExternImageURLs(Application application) {
	JSONArray result = JSONFactoryUtil.createJSONArray();		
	try {
		List<MultiMedia> allMultiMedias = applicationLocalService.getMultiMedias(application.getApplicationId());
		_log.debug("allMultiMedias.size(): " + allMultiMedias.size());
		for (MultiMedia multiMedia : allMultiMedias) {
			_log.debug("multiMedia.getImageId(): " + multiMedia.getImageId());
			if (multiMedia.getImageId() != 0) {
				DLFileEntry fe = DLFileEntryLocalServiceUtil.getDLFileEntry(multiMedia.getImageId());
				result.put("http://" +  AppConstants.COMPANY_VIRTUAL_HOST + "/documents/10180/0/" + HttpUtil.encodeURL(fe.getTitle(), true));
			}
		}
	} catch (SystemException se) {
		_log.error(se.getMessage());		
	} catch (PortalException pe) {
		_log.error(pe.getMessage());				
	}
	return result;		
}
 
开发者ID:fraunhoferfokus,项目名称:govapps,代码行数:20,代码来源:OGPD_EntityLocalServiceImpl.java


示例2: getOpenDataEntitiesForWidget

import com.liferay.portal.kernel.util.HttpUtil; //导入依赖的package包/类
public JSONArray getOpenDataEntitiesForWidget() {
	JSONArray result = JSONFactoryUtil.createJSONArray();
	try {
		List<Application> apps = applicationPersistence.findByuseOpenData(Constants.USE_OPEN_DATA);
		for (Application app: apps) {

			JSONObject _ogpd_Entity = JSONFactoryUtil.createJSONObject();

			_ogpd_Entity.put("id", app.getApplicationId());
			_ogpd_Entity.put("name", app.getName());
			_ogpd_Entity.put("beschreibung", app.getDescription());

			if (app.getLogoImageId() != 0) {
				DLFileEntry fe = DLFileEntryLocalServiceUtil.getDLFileEntry(app.getLogoImageId());
				_ogpd_Entity.put("icon", "http://" +  AppConstants.COMPANY_VIRTUAL_HOST + "/documents/10180/0/" + HttpUtil.encodeURL(fe.getTitle(), true));
			}				
			_ogpd_Entity.put("plattform", app.getTargetOS());
			result.put(_ogpd_Entity);								
		}
		
	} catch (Exception e) {
		e.printStackTrace();
	}
	return result;
}
 
开发者ID:fraunhoferfokus,项目名称:govapps,代码行数:26,代码来源:OGPD_EntityLocalServiceImpl.java


示例3: 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


示例4: 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


示例5: getImageURLs

import com.liferay.portal.kernel.util.HttpUtil; //导入依赖的package包/类
public List<String> getImageURLs(long applicationId) {
	List<String> result = new ArrayList<String>();		
	try {
		List<MultiMedia> allMultiMedias = applicationLocalService.getMultiMedias(applicationId);
		
		for (MultiMedia multiMedia : allMultiMedias) {			
			DLFileEntry fe = DLFileEntryLocalServiceUtil.getDLFileEntry(multiMedia.getImageId());
			result.add("http://localhost/documents/10180/0/" + HttpUtil.encodeURL(fe.getTitle(), true));
		}
	} catch (SystemException se) {
		_log.error(se.getMessage());		
	} catch (PortalException pe) {
		_log.error(pe.getMessage());				
	}
	return result;		
}
 
开发者ID:fraunhoferfokus,项目名称:govapps,代码行数:17,代码来源:ApplicationServiceImpl.java


示例6: getExternImageURLs

import com.liferay.portal.kernel.util.HttpUtil; //导入依赖的package包/类
public List<String> getExternImageURLs(Application application) {
	List<String> result = new ArrayList<String>();		
	try {
		List<MultiMedia> allMultiMedias = applicationLocalService.getMultiMedias(application.getApplicationId());
		
		for (MultiMedia multiMedia : allMultiMedias) {			
			DLFileEntry fe = DLFileEntryLocalServiceUtil.getDLFileEntry(multiMedia.getImageId());
			result.add("http://" +  AppConstants.COMPANY_VIRTUAL_HOST + "/documents/10180/0/" + HttpUtil.encodeURL(fe.getTitle(), true));
		}
	} catch (SystemException se) {
		_log.error(se.getMessage());		
	} catch (PortalException pe) {
		_log.error(pe.getMessage());				
	}
	return result;		
}
 
开发者ID:fraunhoferfokus,项目名称:govapps,代码行数:17,代码来源:ApplicationServiceImpl.java


示例7: editactivity

import com.liferay.portal.kernel.util.HttpUtil; //导入依赖的package包/类
public void editactivity(ActionRequest actionRequest, ActionResponse actionResponse)
	throws PortalException, SystemException, Exception {
	long actId = ParamUtil.getInteger(actionRequest, "resId");

	// LearningActivity learnact =
	// com.liferay.lms.service.LearningActivityServiceUtil.getLearningActivity(actId);
	LearningActivityAssetRendererFactory laf = new LearningActivityAssetRendererFactory();
	if (laf != null) {
		AssetRenderer assetRenderer = laf.getAssetRenderer(actId, 0);
		String urlEdit = assetRenderer.getURLEdit((LiferayPortletRequest) actionRequest, (LiferayPortletResponse) actionResponse).toString();			
		Portlet urlEditPortlet =PortletLocalServiceUtil.getPortletById(HttpUtil.getParameter(urlEdit, "p_p_id",false));
		
		if(urlEditPortlet!=null) {
			PublicRenderParameter actIdPublicParameter = urlEditPortlet.getPublicRenderParameter("actId");
			if(actIdPublicParameter!=null) {
				urlEdit=HttpUtil.removeParameter(urlEdit,PortletQNameUtil.getPublicRenderParameterName(actIdPublicParameter.getQName()));
			}
			urlEdit=HttpUtil.addParameter(urlEdit, StringPool.UNDERLINE+urlEditPortlet.getPortletId()+StringPool.UNDERLINE+"resId", actId);
			urlEdit=HttpUtil.removeParameter(urlEdit, StringPool.UNDERLINE+urlEditPortlet.getPortletId()+StringPool.UNDERLINE+"actionEditingDetails");
			urlEdit=HttpUtil.addParameter(urlEdit, StringPool.UNDERLINE+urlEditPortlet.getPortletId()+StringPool.UNDERLINE+"actionEditingDetails", true);
		}
	
		actionResponse.sendRedirect(urlEdit);
	}
	SessionMessages.add(actionRequest, "asset-renderer-not-defined");
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:27,代码来源:LmsActivitiesList.java


示例8: verificaRedirecionamentoParaHttp

import com.liferay.portal.kernel.util.HttpUtil; //导入依赖的package包/类
private String verificaRedirecionamentoParaHttp(HttpServletRequest request,
		HttpServletResponse response, String retorno) throws IOException {
	if ("portal.update_password".equals(retorno) && !Validator.isNull(ParamUtil.getString(request, Constants.CMD))) {
		String ticketKey = ParamUtil.getString(request, "ticketKey");
		String plid = ParamUtil.getString(request, "p_l_id");
		String doAsUserId = ParamUtil.getString(request, "doAsUserId");
		String urlHttp = PortalUtil.getPortalURL(request, false) + Portal.PATH_MAIN + "/portal/update_password";
		if (!Validator.isNull(ticketKey))
			urlHttp = HttpUtil.addParameter(urlHttp, "ticketKey", ticketKey);
		if (!Validator.isNull(plid))
			urlHttp = HttpUtil.addParameter(urlHttp, "p_l_id", plid);
		if (!Validator.isNull(doAsUserId))
			urlHttp = HttpUtil.addParameter(urlHttp, "doAsUserId", doAsUserId);
		response.sendRedirect(urlHttp);
		return null;
	} else {
		return retorno;
	}
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:20,代码来源:CDUpdatePasswordAction.java


示例9: getRegionEntitiesForWidget

import com.liferay.portal.kernel.util.HttpUtil; //导入依赖的package包/类
public JSONArray getRegionEntitiesForWidget(String regionID) {
	JSONArray result = JSONFactoryUtil.createJSONArray();
	try {
		long regionId = 1;
		if (regionID.trim().length() > 0) {
			regionId = Long.valueOf(regionID);
		}
		List<Application> apps = regionLocalService.getApplications(regionId);
		for (Application app: apps) {

			JSONObject _ogpd_Entity = JSONFactoryUtil.createJSONObject();

			_ogpd_Entity.put("id", app.getApplicationId());
			_ogpd_Entity.put("name", app.getName());
			_ogpd_Entity.put("beschreibung", app.getDescription());

			if (app.getLogoImageId() != 0) {
				DLFileEntry fe = DLFileEntryLocalServiceUtil.getDLFileEntry(app.getLogoImageId());
				_ogpd_Entity.put("icon", "http://" +  AppConstants.COMPANY_VIRTUAL_HOST + "/documents/10180/0/" + HttpUtil.encodeURL(fe.getTitle(), true));
			}				
			_ogpd_Entity.put("plattform", app.getTargetOS());
			result.put(_ogpd_Entity);
		}
		
	} catch (Exception e) {
		e.printStackTrace();
	}
	return result;
}
 
开发者ID:fraunhoferfokus,项目名称:govapps,代码行数:30,代码来源:OGPD_EntityLocalServiceImpl.java


示例10: redirecionaParaEscolhaUf

import com.liferay.portal.kernel.util.HttpUtil; //导入依赖的package包/类
private void redirecionaParaEscolhaUf(ActionResponse response, ThemeDisplay td, String currentUrl, Company company) throws PortalException,
		SystemException, IOException {
	Group guestGroup = GroupLocalServiceUtil.getGroup(company.getCompanyId(), GroupConstants.GUEST);
	Layout layout = LayoutLocalServiceUtil.getFriendlyURLLayout(guestGroup.getGroupId(), false, "/uf");
	String url = PortalUtil.getLayoutFriendlyURL(layout, td);
	url = HttpUtil.addParameter(url, "lp", currentUrl);
	response.sendRedirect(url);
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:9,代码来源:LoginPortlet.java


示例11: getPath

import com.liferay.portal.kernel.util.HttpUtil; //导入依赖的package包/类
@Override
protected String getPath(SocialActivity activity, ServiceContext serviceContext) throws Exception {

    _log.info("getPath");

    AssetRendererFactory<?> assetRendererFactory = AssetRendererFactoryRegistryUtil
            .getAssetRendererFactoryByClassName(TaskRecord.class.getName());

    AssetRenderer<?> assetRenderer = assetRendererFactory.getAssetRenderer(activity.getClassPK());

    _log.info(assetRenderer);

    String path = assetRenderer.getURLViewInContext(serviceContext.getLiferayPortletRequest(),
            serviceContext.getLiferayPortletResponse(), null);

    path = HttpUtil.addParameter(path, "redirect", serviceContext.getCurrentURL());

    return path;
}
 
开发者ID:inofix,项目名称:ch-inofix-timetracker,代码行数:20,代码来源:TaskRecordActivityInterpreter.java


示例12: readConfiguration

import com.liferay.portal.kernel.util.HttpUtil; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private static Map<String, Object> readConfiguration(
		String configurationURL) {

	Map<String, Object> tempConfiguration;

	try {
		String configurationContent = HttpUtil.URLtoString(
			configurationURL);

		Yaml yaml = new Yaml();

		tempConfiguration = (Map<String, Object>)yaml.load(
			configurationContent);
	}
	catch (Exception e) {
		_log.error(e, e);

		tempConfiguration =
			(Map<String, Object>)ConfigurationUtil.getConfigurationEntry(
				"remoteConfigurationBackup");
	}

	if (Validator.isNull(tempConfiguration)) {
		return Collections.emptyMap();
	}

	int liferayBuildNumber = ReleaseInfo.getBuildNumber();

	if (tempConfiguration.containsKey(liferayBuildNumber)) {
		return (Map<String, Object>)tempConfiguration.get(
			liferayBuildNumber);
	}

	int liferayVersion = liferayBuildNumber / 100;

	if (tempConfiguration.containsKey(liferayVersion)) {
		return (Map<String, Object>)tempConfiguration.get(liferayVersion);
	}

	return Collections.emptyMap();
}
 
开发者ID:jorgediaz-lr,项目名称:staging-checker,代码行数:43,代码来源:RemoteConfigurationUtil.java


示例13: 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


示例14: getOGPD_Entities

import com.liferay.portal.kernel.util.HttpUtil; //导入依赖的package包/类
public JSONArray getOGPD_Entities() {
//		JSONFactoryUtil _jsonFactoryUtil = new JSONFactoryUtil();
		JSONArray result = JSONFactoryUtil.createJSONArray();
		try {			
			
			List<Application> apps = applicationPersistence.findByuseOpenData(Constants.USE_OPEN_DATA);
			for (Application app: apps) {

				List<Link> links = applicationPersistence.getLinks(app.getApplicationId());
				String url = "";
				for (Link link: links) {
					if (link.getType() == Constants.TARGET_LINK) {
						url = link.getUrl();
					}
				}
				_log.debug("url: " + url);

				JSONObject _ogpd_Entity = JSONFactoryUtil.createJSONObject();

				_ogpd_Entity.put("name", "govapps_" + String.valueOf(app.getApplicationId()));
				_ogpd_Entity.put("title", app.getName());
				_ogpd_Entity.put("author", app.getLegalDetails());
				_ogpd_Entity.put("notes", app.getDescription());

				String categoryString = app.getCategoryString();
				String[] categoryArray = categoryString.split(",");
				
				JSONArray groups = JSONFactoryUtil.createJSONArray();
				for (int i=0; i<categoryArray.length ; i++) {
					groups.put(categoryArray[i].trim());
				}				
				_ogpd_Entity.put("groups", groups);
				_ogpd_Entity.put("type", "app");
				
				JSONArray resources = JSONFactoryUtil.createJSONArray();
				JSONObject resource = JSONFactoryUtil.createJSONObject();
				resource.put("url", url);
				resource.put("format", "application/octet-stream");
				resources.put(resource);
				_ogpd_Entity.put("resources", resources);
				
				_ogpd_Entity.put("license_id", app.getLicense());
								
				JSONObject extra = JSONFactoryUtil.createJSONObject();				
				
				JSONArray dates = JSONFactoryUtil.createJSONArray();
				JSONObject date = JSONFactoryUtil.createJSONObject();
				date.put("role", "erstellt");
				date.put("date", app.getCreateDate());				
				dates.put(date);
				extra.put("dates", dates);

				JSONObject terms_of_use = JSONFactoryUtil.createJSONObject();				
				extra.put("terms_of_use", terms_of_use);
				
				
				extra.put("used_datasets", getUsedDatasets(app));
				extra.put("sector", app.getSector());
				JSONArray images = 	getExternImageURLs(app);
				if (app.getLogoImageId() != 0) {
					DLFileEntry fe = DLFileEntryLocalServiceUtil.getDLFileEntry(app.getLogoImageId());
					images.put("http://" +  AppConstants.COMPANY_VIRTUAL_HOST + "/documents/10180/0/" + HttpUtil.encodeURL(fe.getTitle(), true));
				}				
				extra.put("images", images);
				extra.put("ogd_version", "v1.0");
				
				
				_ogpd_Entity.put("extras", extra);
				result.put(_ogpd_Entity);								
			}
			
		} catch (Exception e) {
			e.printStackTrace();
		}
		return result;
	}
 
开发者ID:fraunhoferfokus,项目名称:govapps,代码行数:77,代码来源:OGPD_EntityLocalServiceImpl.java


示例15: 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


示例16: doRun

import com.liferay.portal.kernel.util.HttpUtil; //导入依赖的package包/类
protected void doRun(HttpServletRequest request, HttpServletResponse response) throws Exception {

	Company company = PortalUtil.getCompany(request);

	// Apenas para a comunidade default (e-democracia)
	String defaultWebId = PropsUtil.get(PropsKeys.COMPANY_DEFAULT_WEB_ID);
	if (!company.getWebId().equals(defaultWebId)) {
	    return;
	}

	// Verifica se realmente está autenticado
	User user = PortalUtil.getUser(request);
	if (user.isDefaultUser())
	    return;

	Country brazil = CountryServiceUtil.getCountryByA2("BR");

	// Verirfica se tem endereço no brasil
	for (Address address : user.getAddresses()) {
	    if (address.getCountryId() == brazil.getCountryId()) {
		try {
		    Region region = RegionServiceUtil.getRegion(address.getRegionId());
		    if (region.getCountryId() == brazil.getCountryId())
			return;
		} catch (PortalException e) {
		    // Ignore: Região não encontrada
		}
	    }
	}

	HttpSession session = request.getSession();
	LastPath oldLastPath = (LastPath) session.getAttribute(WebKeys.LAST_PATH);

	// Vai para a página principal
	if (oldLastPath == null) {
	    oldLastPath = new LastPath("", "/principal", new HashMap<String, String[]>());
	}

	HashMap<String, String[]> params = new HashMap<String, String[]>();
	params.put("lp", new String[] { oldLastPath.getContextPath() + oldLastPath.getPath() });
	LastPath newLastPath = new LastPath("", "/web/public/uf", params);
	session.setAttribute(WebKeys.LAST_PATH, newLastPath);
	_log.info("User logged in, redirect to page:" + newLastPath);
	if (session.getAttribute("FACEBOOK_USER_ID") != null && !"/login/login_redirect".equals(request.getParameter("_58_struts_action"))) {
	    String lastPath = newLastPath.getPath();
	    lastPath = HttpUtil.addParameter(lastPath, "lp", params.get("lp")[0]);
	    response.sendRedirect(lastPath);
	    _log.debug("Usuário do facebook redirecionado para cadastro de UF");
	}
    }
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:51,代码来源:UFLandingPageAction.java


示例17: 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


示例18: 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


示例19: getPath

import com.liferay.portal.kernel.util.HttpUtil; //导入依赖的package包/类
@Override
protected String getPath(SocialActivity activity, ServiceContext serviceContext) throws Exception {

    AssetRendererFactory<?> assetRendererFactory = AssetRendererFactoryRegistryUtil
            .getAssetRendererFactoryByClassName(Contact.class.getName());

    AssetRenderer<?> assetRenderer = assetRendererFactory.getAssetRenderer(activity.getClassPK());

    String path = assetRenderer.getURLViewInContext(serviceContext.getLiferayPortletRequest(),
            serviceContext.getLiferayPortletResponse(), null);

    path = HttpUtil.addParameter(path, "redirect", serviceContext.getCurrentURL());

    return path;
}
 
开发者ID:inofix,项目名称:ch-inofix-contact-manager,代码行数:16,代码来源:ContactActivityInterpreter.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java XmlString类代码示例发布时间:2022-05-22
下一篇:
Java HTableUtil类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap