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

Java DLFileEntry类代码示例

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

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



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

示例1: addDocTemplate

import com.liferay.portlet.documentlibrary.model.DLFileEntry; //导入依赖的package包/类
public void addDocTemplate(ActionRequest actionRequest,
		ActionResponse actionResponse) throws PortletException {
	ServiceContext serviceContext = ServiceContextThreadLocal.getServiceContext();
	try {
		String templateNo = ParamUtil.getString(actionRequest, "templateNo");
		String title = ParamUtil.getString(actionRequest, "title");
		String enTitle = ParamUtil.getString(actionRequest, "enTitle");
		String _uuid = ParamUtil.getString(actionRequest, "fileEntryUuid");
		DLFileEntry fileEntry = DLFileEntryLocalServiceUtil.getFileEntryByUuidAndGroupId(_uuid, serviceContext.getScopeGroupId());
		DocTemplate docTemplate = DocTemplateLocalServiceUtil.addDocTemplate(templateNo, title, enTitle, fileEntry.getFileEntryId(), serviceContext);
		
		if (docTemplate != null) {
			SessionMessages.add(actionRequest.getPortletSession(), DocTemplateKeys.SuccessMessageKeys.ORG_OEP_CORE_UTILITIES_DOSSIERMGT_PORTLET_DOCTEMPLATE_SUCCESS_ADDNEW);
			_log.info("doc template have been added successfylly");
		} else {
			_log.error("There is an Erron in adding doc template");
		}
		actionResponse.setRenderParameter("mvcPath",
				"/html/dossiermgt/portlet/doctemplate/edit_doctemplate.jsp");
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:24,代码来源:DocTemplatePortlet.java


示例2: getExternImageURLs

import com.liferay.portlet.documentlibrary.model.DLFileEntry; //导入依赖的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


示例3: getOpenDataEntitiesForWidget

import com.liferay.portlet.documentlibrary.model.DLFileEntry; //导入依赖的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


示例4: getIconURL

import com.liferay.portlet.documentlibrary.model.DLFileEntry; //导入依赖的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


示例5: getExternIconURL

import com.liferay.portlet.documentlibrary.model.DLFileEntry; //导入依赖的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


示例6: getImageURLs

import com.liferay.portlet.documentlibrary.model.DLFileEntry; //导入依赖的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


示例7: getExternImageURLs

import com.liferay.portlet.documentlibrary.model.DLFileEntry; //导入依赖的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


示例8: getImageBytes

import com.liferay.portlet.documentlibrary.model.DLFileEntry; //导入依赖的package包/类
private byte[] getImageBytes(long imgId) {
	byte[] result = null;

	try {
		DLFileEntry fe = DLFileEntryLocalServiceUtil.getDLFileEntry(imgId);
		InputStream in = fe.getContentStream();
		// BufferedReader br = new BufferedReader(new
		// InputStreamReader(in));
		ByteArrayOutputStream bout = new ByteArrayOutputStream();
		// BufferedWriter bw = new BufferedWriter(new
		// OutputStreamWriter(bout));
		byte[] buffer = new byte[1024];
		int len;
		while ((len = in.read(buffer)) != -1) {
			bout.write(buffer, 0, len);
		}
		result = bout.toByteArray();
	} catch (Throwable t) {
	}
	return result;
}
 
开发者ID:fraunhoferfokus,项目名称:govapps,代码行数:22,代码来源:ApplicationPortlet.java


示例9: getFileContent

import com.liferay.portlet.documentlibrary.model.DLFileEntry; //导入依赖的package包/类
private byte[] getFileContent(DLFileEntry dfile) {
	m_objLog.debug("getFileContent::start()");
	byte[] result = null;
	
	if (dfile != null) {
		try {
			InputStream stream = DLFileEntryLocalServiceUtil.getFileAsStream(
					dfile.getUserId(), dfile.getFileEntryId(),
					dfile.getVersion());
			result = IOUtils.toByteArray(stream);
		} catch (Throwable t) {
			m_objLog.error("Error retrieving file contents",t);
		}
	}
	m_objLog.debug("getFileContent::end()");
	return result;
}
 
开发者ID:fraunhoferfokus,项目名称:particity,代码行数:18,代码来源:ExportWriter.java


示例10: addRelatedEntryFields

import com.liferay.portlet.documentlibrary.model.DLFileEntry; //导入依赖的package包/类
@Override
public void addRelatedEntryFields(Document document, Object obj)
	throws Exception {

	if (obj instanceof DLFileEntry) {
		DLFileEntry dlFileEntry = (DLFileEntry)obj;

		Song song = SongLocalServiceUtil.getSong(dlFileEntry.getClassPK());

		document.addKeyword(
			Field.CLASS_NAME_ID,
			PortalUtil.getClassNameId(Song.class.getName()));
		document.addKeyword(Field.CLASS_PK, song.getSongId());
		document.addKeyword(Field.RELATED_ENTRY, true);
	}
}
 
开发者ID:juliocamarero,项目名称:jukebox-portlet,代码行数:17,代码来源:SongIndexer.java


示例11: addRelatedEntryFields

import com.liferay.portlet.documentlibrary.model.DLFileEntry; //导入依赖的package包/类
@Override
public void addRelatedEntryFields(Document document, Object obj)
	throws Exception {

	if (obj instanceof DLFileEntry) {
		DLFileEntry dlFileEntry = (DLFileEntry)obj;

		Artist artist = ArtistLocalServiceUtil.getArtist(
			GetterUtil.getLong(dlFileEntry.getTitle()));

		document.addKeyword(
			Field.CLASS_NAME_ID,
			PortalUtil.getClassNameId(Artist.class.getName()));
		document.addKeyword(Field.CLASS_PK, artist.getArtistId());
		document.addKeyword(Field.RELATED_ENTRY, true);
	}
}
 
开发者ID:juliocamarero,项目名称:jukebox-portlet,代码行数:18,代码来源:ArtistIndexer.java


示例12: addRelatedEntryFields

import com.liferay.portlet.documentlibrary.model.DLFileEntry; //导入依赖的package包/类
@Override
public void addRelatedEntryFields(Document document, Object obj)
	throws Exception {

	if (obj instanceof DLFileEntry) {
		DLFileEntry dlFileEntry = (DLFileEntry)obj;

		Album album = AlbumLocalServiceUtil.getAlbum(
			GetterUtil.getLong(dlFileEntry.getTitle()));

		document.addKeyword(
			Field.CLASS_NAME_ID,
			PortalUtil.getClassNameId(Album.class.getName()));
		document.addKeyword(Field.CLASS_PK, album.getAlbumId());
		document.addKeyword(Field.RELATED_ENTRY, true);
	}
}
 
开发者ID:juliocamarero,项目名称:jukebox-portlet,代码行数:18,代码来源:AlbumIndexer.java


示例13: addRelatedEntryFields

import com.liferay.portlet.documentlibrary.model.DLFileEntry; //导入依赖的package包/类
@Override
public void addRelatedEntryFields(Document document, Object obj)
		throws Exception {

	if (obj instanceof DLFileEntry) {
		DLFileEntry dlFileEntry = (DLFileEntry)obj;

		Song song = SongLocalServiceUtil.getSong(
			GetterUtil.getLong(dlFileEntry.getTitle()));

		document.addKeyword(
			Field.CLASS_NAME_ID,
			PortalUtil.getClassNameId(Song.class.getName()));
		document.addKeyword(Field.CLASS_PK, song.getSongId());
		document.addKeyword(Field.RELATED_ENTRY, true);
	}
}
 
开发者ID:juliocamarero,项目名称:jukebox,代码行数:18,代码来源:SongIndexer.java


示例14: addRelatedEntryFields

import com.liferay.portlet.documentlibrary.model.DLFileEntry; //导入依赖的package包/类
@Override
public void addRelatedEntryFields(Document document, Object obj)
		throws Exception {

	if (obj instanceof DLFileEntry) {
		DLFileEntry dlFileEntry = (DLFileEntry)obj;

		Album album = AlbumLocalServiceUtil.getAlbum(
			GetterUtil.getLong(dlFileEntry.getTitle()));

		document.addKeyword(
			Field.CLASS_NAME_ID,
			PortalUtil.getClassNameId(Album.class.getName()));
		document.addKeyword(Field.CLASS_PK, album.getAlbumId());
		document.addKeyword(Field.RELATED_ENTRY, true);
	}
}
 
开发者ID:juliocamarero,项目名称:jukebox,代码行数:18,代码来源:AlbumIndexer.java


示例15: getUploadedFiles

import com.liferay.portlet.documentlibrary.model.DLFileEntry; //导入依赖的package包/类
public List<Document> getUploadedFiles(Long id) {

		Field field = getField(id);

		List<Document> documents = new ArrayList<Document>();

		if (field.getTempValue() != null) {
			String[] fields = field.getTempValue().split("\\,");
			for (String fileEntryId : fields) {
				try {
					if (!fileEntryId.isEmpty()) {
						DLFileEntry dlFileEntry = DLFileEntryLocalServiceUtil.getDLFileEntry(new Long(fileEntryId));
						documents.add(new Document("" + dlFileEntry.getFileEntryId(), dlFileEntry.getTitle(), dlFileEntry.getMimeType()));
					}
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		}

		return documents;
	}
 
开发者ID:mahytom,项目名称:liferay-webforms,代码行数:23,代码来源:WebFormBean.java


示例16: updateDocTemplate

import com.liferay.portlet.documentlibrary.model.DLFileEntry; //导入依赖的package包/类
public void updateDocTemplate(ActionRequest actionRequest,
		ActionResponse actionResponse) throws PortletException {
	try {
		ServiceContext serviceContext = ServiceContextThreadLocal.getServiceContext();
		long docTemplateId = ParamUtil.getLong(actionRequest, "docTemplateId");
		String templateNo = ParamUtil.getString(actionRequest, "templateNo");
		String title = ParamUtil.getString(actionRequest, "title");
		String enTitle = ParamUtil.getString(actionRequest, "enTitle");
		String _uuid = ParamUtil.getString(actionRequest, "fileEntryUuid", "");
		DLFileEntry fileEntry = null;
		if (!"".equals(_uuid)) {
			fileEntry = DLFileEntryLocalServiceUtil.getFileEntryByUuidAndGroupId(_uuid, serviceContext.getScopeGroupId());				
		}
		DocTemplate docTemplate = DocTemplateLocalServiceUtil.getDocTemplate(docTemplateId);
		if (docTemplate != null) {
			if (fileEntry != null) {
				docTemplate = DocTemplateLocalServiceUtil.updateDocTemplate(docTemplateId, templateNo, title, enTitle, fileEntry.getFileEntryId(), serviceContext);					
			}
			else {
				docTemplate = DocTemplateLocalServiceUtil.updateDocTemplate(docTemplateId, templateNo, title, enTitle, docTemplate.getFileEntryId(), serviceContext);										
			}
			if (docTemplate != null) {
				SessionMessages.add(actionRequest.getPortletSession(), DocTemplateKeys.SuccessMessageKeys.ORG_OEP_CORE_UTILITIES_DOSSIERMGT_PORTLET_DOCTEMPLATE_SUCCESS_UPDATE);
				_log.info("doc template have been updated successfylly");
			} else {
				_log.error("There is an error in update doc template");
			}
		} else {
			_log.error("Could not find doc template.");
		}
		actionResponse.setRenderParameter("mvcPath",
				"/html/dossiermgt/portlet/doctemplate/list_doctemplate.jsp");
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:37,代码来源:DocTemplatePortlet.java


示例17: getRegionEntitiesForWidget

import com.liferay.portlet.documentlibrary.model.DLFileEntry; //导入依赖的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


示例18: getEntryPath

import com.liferay.portlet.documentlibrary.model.DLFileEntry; //导入依赖的package包/类
private static String getEntryPath(PortletDataContext context, DLFileEntry file) {
	
	StringBundler sb = new StringBundler(4);
	sb.append(context.getPortletPath("resourceactivity_WAR_liferaylmsportlet"));
	sb.append("/moduleentries/");
	sb.append(file.getFileEntryId());
	sb.append(".xml");
	return sb.toString();
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:10,代码来源:BaseLearningActivityType.java


示例19: getFilePath

import com.liferay.portlet.documentlibrary.model.DLFileEntry; //导入依赖的package包/类
private static String getFilePath(PortletDataContext context,DLFileEntry file, long actId) {
	
	StringBundler sb = new StringBundler(4);
	sb.append(context.getPortletPath("moduleportlet_WAR_liferaylmsportlet"));
	sb.append("/moduleentries/activities/"+String.valueOf(actId)+"/");
	return sb.toString();
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:8,代码来源:BaseLearningActivityType.java


示例20: updateIGImagePermissions

import com.liferay.portlet.documentlibrary.model.DLFileEntry; //导入依赖的package包/类
protected void updateIGImagePermissions() throws Exception {
	if (PropsValues.PERMISSIONS_USER_CHECK_ALGORITHM != 6) {
		return;
	}

	deleteConflictingIGPermissions(
		_IG_IMAGE_CLASS_NAME, DLFileEntry.class.getName());

	runSQL(
		"update ResourcePermission set name = '" +
			DLFileEntry.class.getName() + "' where name = '" +
				_IG_IMAGE_CLASS_NAME + "'");
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:14,代码来源:UpgradeImageGallery.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java ObjectKeyFactory类代码示例发布时间:2022-05-22
下一篇:
Java ConsumerStrategies类代码示例发布时间: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