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


Java DLFileEntry类代码示例

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


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


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