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


Java DLFolderConstants类代码示例

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


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

示例1: getCustomImage

import com.liferay.portlet.documentlibrary.model.DLFolderConstants; //导入依赖的package包/类
public FileEntry getCustomImage() {
	Repository repository =
		PortletFileRepositoryUtil.fetchPortletRepository(
			getGroupId(), Constants.JUKEBOX_PORTLET_REPOSITORY);

	if (repository == null) {
		return null;
	}

	try {
		return PortletFileRepositoryUtil.getPortletFileEntry(
			repository.getRepositoryId(),
			DLFolderConstants.DEFAULT_PARENT_FOLDER_ID,
			String.valueOf(getAlbumId()));
	}
	catch (Exception e) {
		return null;
	}
}
 
开发者ID:juliocamarero,项目名称:jukebox-portlet,代码行数:20,代码来源:AlbumImpl.java

示例2: getCustomImage

import com.liferay.portlet.documentlibrary.model.DLFolderConstants; //导入依赖的package包/类
public FileEntry getCustomImage() {
	Repository repository =
		PortletFileRepositoryUtil.fetchPortletRepository(
		getGroupId(), Constants.JUKEBOX_PORTLET_REPOSITORY);

	if (repository == null) {
		return null;
	}

	try {
		return PortletFileRepositoryUtil.getPortletFileEntry(
			repository.getRepositoryId(),
			DLFolderConstants.DEFAULT_PARENT_FOLDER_ID,
			String.valueOf(getArtistId()));
	}
	catch (Exception e) {
		return null;
	}
}
 
开发者ID:juliocamarero,项目名称:jukebox-portlet,代码行数:20,代码来源:ArtistImpl.java

示例3: deleteAlbum

import com.liferay.portlet.documentlibrary.model.DLFolderConstants; //导入依赖的package包/类
@Indexable(type = IndexableType.DELETE)
public Album deleteAlbum(long albumId) throws PortalException {
	Album album = albumPersistence.findByPrimaryKey(albumId);

	List<Song> songs = songLocalService.getSongsByAlbumId(albumId);

	for (Song song : songs) {
		songLocalService.deleteSong(song.getSongId());
	}

	try {
		PortletFileRepositoryUtil.deletePortletFileEntry(
			album.getGroupId(), DLFolderConstants.DEFAULT_PARENT_FOLDER_ID,
			String.valueOf(albumId));
	}
	catch (Exception e) {
	}

	return albumPersistence.remove(albumId);
}
 
开发者ID:juliocamarero,项目名称:jukebox-portlet,代码行数:21,代码来源:AlbumLocalServiceImpl.java

示例4: deleteSong

import com.liferay.portlet.documentlibrary.model.DLFolderConstants; //导入依赖的package包/类
@Indexable(type = IndexableType.DELETE)
public Song deleteSong(long songId) throws PortalException {
	Song song = songPersistence.findByPrimaryKey(songId);

	Repository repository =
		PortletFileRepositoryUtil.fetchPortletRepository(
			song.getGroupId(), Constants.JUKEBOX_PORTLET_REPOSITORY);

	if (repository != null) {
		try {
			Folder folder = PortletFileRepositoryUtil.getPortletFolder(
				0, repository.getRepositoryId(),
				DLFolderConstants.DEFAULT_PARENT_FOLDER_ID,
				String.valueOf(songId), null);

			PortletFileRepositoryUtil.deleteFolder(folder.getFolderId());
		}
		catch (Exception e) {
		}
	}

	return songPersistence.remove(songId);
}
 
开发者ID:juliocamarero,项目名称:jukebox-portlet,代码行数:24,代码来源:SongLocalServiceImpl.java

示例5: deleteArtist

import com.liferay.portlet.documentlibrary.model.DLFolderConstants; //导入依赖的package包/类
@Indexable(type = IndexableType.DELETE)
public Artist deleteArtist(long artistId) throws PortalException {
	Artist artist = artistPersistence.findByPrimaryKey(artistId);

	List<Album> albums = albumLocalService.getAlbumsByArtistId(artistId);

	for (Album album : albums) {
		albumLocalService.deleteAlbum(album.getAlbumId());
	}

	try {
		PortletFileRepositoryUtil.deletePortletFileEntry(
			artist.getGroupId(), DLFolderConstants.DEFAULT_PARENT_FOLDER_ID,
			String.valueOf(artistId));
	}
	catch (Exception e) {
	}

	return artistPersistence.remove(artistId);
}
 
开发者ID:juliocamarero,项目名称:jukebox-portlet,代码行数:21,代码来源:ArtistLocalServiceImpl.java

示例6: addDLFileEntries

import com.liferay.portlet.documentlibrary.model.DLFolderConstants; //导入依赖的package包/类
protected void addDLFileEntries(String fileEntriesDirName)
	throws Exception {

	Set<String> resourcePaths = servletContext.getResourcePaths(
		resourcesDir.concat(fileEntriesDirName));

	if (resourcePaths == null) {
		return;
	}

	for (String resourcePath : resourcePaths) {
		if (resourcePath.endsWith(StringPool.SLASH)) {
			addDLFolder(
				DLFolderConstants.DEFAULT_PARENT_FOLDER_ID, resourcePath);
		}
		else {
			addDLFileEntry(resourcePath);
		}
	}
}
 
开发者ID:rivetlogic,项目名称:liferay-evernote,代码行数:21,代码来源:ResourceImporter.java

示例7: addDLFileEntries

import com.liferay.portlet.documentlibrary.model.DLFolderConstants; //导入依赖的package包/类
protected void addDLFileEntries(String fileEntriesDirName)
	throws Exception {

	File dlDocumentsDir = new File(_resourcesDir, fileEntriesDirName);

	if (!dlDocumentsDir.isDirectory()|| !dlDocumentsDir.canRead()) {
		return;
	}

	File[] files = dlDocumentsDir.listFiles();

	if (ArrayUtil.isEmpty(files)) {
		return;
	}

	for (File file : files) {
		if (file.isDirectory()) {
			addDLFolder(DLFolderConstants.DEFAULT_PARENT_FOLDER_ID, file);
		}
		else {
			addDLFileEntry(
				DLFolderConstants.DEFAULT_PARENT_FOLDER_ID, file);
		}
	}
}
 
开发者ID:rivetlogic,项目名称:liferay-evernote,代码行数:26,代码来源:FileSystemImporter.java

示例8: addDLFileEntries

import com.liferay.portlet.documentlibrary.model.DLFolderConstants; //导入依赖的package包/类
protected void addDLFileEntries(String dirName) throws Exception {
	Set<String> resourcePaths = servletContext.getResourcePaths(
		resourcesDir.concat(dirName));

	if (resourcePaths == null) {
		return;
	}

	for (String resourcePath : resourcePaths) {
		if (resourcePath.endsWith(StringPool.SLASH)) {
			addDLFolder(
				DLFolderConstants.DEFAULT_PARENT_FOLDER_ID, resourcePath);
		}
		else {
			addDLFileEntry(resourcePath);
		}
	}
}
 
开发者ID:rivetlogic,项目名称:liferay-voice-command,代码行数:19,代码来源:ResourceImporter.java

示例9: addDLFileEntries

import com.liferay.portlet.documentlibrary.model.DLFolderConstants; //导入依赖的package包/类
protected void addDLFileEntries(String dirName) throws Exception {
	File dir = new File(_resourcesDir, dirName);

	if (!dir.isDirectory()|| !dir.canRead()) {
		return;
	}

	File[] files = dir.listFiles();

	if (ArrayUtil.isEmpty(files)) {
		return;
	}

	for (File file : files) {
		if (file.isDirectory()) {
			addDLFolder(DLFolderConstants.DEFAULT_PARENT_FOLDER_ID, file);
		}
		else {
			addDLFileEntry(
				DLFolderConstants.DEFAULT_PARENT_FOLDER_ID, file);
		}
	}
}
 
开发者ID:rivetlogic,项目名称:liferay-voice-command,代码行数:24,代码来源:FileSystemImporter.java

示例10: getCustomImage

import com.liferay.portlet.documentlibrary.model.DLFolderConstants; //导入依赖的package包/类
public FileEntry getCustomImage() throws SystemException {
	Repository repository =
		PortletFileRepositoryUtil.fetchPortletRepository(
		getGroupId(), Constants.JUKEBOX_PORTLET_REPOSITORY);

	if (repository == null) {
		return null;
	}

	try {
		return PortletFileRepositoryUtil.getPortletFileEntry(
			repository.getRepositoryId(),
			DLFolderConstants.DEFAULT_PARENT_FOLDER_ID,
			String.valueOf(getAlbumId()));
	}
	catch (Exception e) {
		return null;
	}
}
 
开发者ID:juliocamarero,项目名称:jukebox,代码行数:20,代码来源:AlbumImpl.java

示例11: getCustomImage

import com.liferay.portlet.documentlibrary.model.DLFolderConstants; //导入依赖的package包/类
public FileEntry getCustomImage() throws SystemException {
	Repository repository =
		PortletFileRepositoryUtil.fetchPortletRepository(
		getGroupId(), Constants.JUKEBOX_PORTLET_REPOSITORY);

	if (repository == null) {
		return null;
	}

	try {
		return PortletFileRepositoryUtil.getPortletFileEntry(
			repository.getRepositoryId(),
			DLFolderConstants.DEFAULT_PARENT_FOLDER_ID,
			String.valueOf(getArtistId()));
	}
	catch (Exception e) {
		return null;
	}
}
 
开发者ID:juliocamarero,项目名称:jukebox,代码行数:20,代码来源:ArtistImpl.java

示例12: deleteAlbum

import com.liferay.portlet.documentlibrary.model.DLFolderConstants; //导入依赖的package包/类
@Indexable(type = IndexableType.DELETE)
public Album deleteAlbum(long albumId)
	throws PortalException, SystemException {

	Album album = albumPersistence.findByPrimaryKey(albumId);

	List<Song> songs = songLocalService.getSongsByAlbumId(albumId);

	for (Song song : songs) {
		songLocalService.deleteSong(song.getSongId());
	}

	try {
		PortletFileRepositoryUtil.deletePortletFileEntry(
			album.getGroupId(), DLFolderConstants.DEFAULT_PARENT_FOLDER_ID,
			String.valueOf(albumId));
	}
	catch (Exception e) {
	}

	return albumPersistence.remove(albumId);
}
 
开发者ID:juliocamarero,项目名称:jukebox,代码行数:23,代码来源:AlbumLocalServiceImpl.java

示例13: deleteSong

import com.liferay.portlet.documentlibrary.model.DLFolderConstants; //导入依赖的package包/类
@Indexable(type = IndexableType.DELETE)
public Song deleteSong(long songId)
	throws PortalException, SystemException {

	Song song = songPersistence.findByPrimaryKey(songId);

	Repository repository =
		PortletFileRepositoryUtil.fetchPortletRepository(
			song.getGroupId(), Constants.JUKEBOX_PORTLET_REPOSITORY);

	if (repository != null) {
		try {
			Folder folder = PortletFileRepositoryUtil.getPortletFolder(
				0, repository.getRepositoryId(),
				DLFolderConstants.DEFAULT_PARENT_FOLDER_ID,
				String.valueOf(songId), null);

			PortletFileRepositoryUtil.deleteFolder(folder.getFolderId());
		}
		catch (Exception e) {
		}
	}

	return songPersistence.remove(songId);
}
 
开发者ID:juliocamarero,项目名称:jukebox,代码行数:26,代码来源:SongLocalServiceImpl.java

示例14: deleteArtist

import com.liferay.portlet.documentlibrary.model.DLFolderConstants; //导入依赖的package包/类
@Indexable(type = IndexableType.DELETE)
public Artist deleteArtist(long artistId)
	throws PortalException, SystemException {

	Artist artist = artistPersistence.findByPrimaryKey(artistId);

	List<Album> albums = albumLocalService.getAlbumsByArtistId(artistId);

	for (Album album : albums) {
		albumLocalService.deleteAlbum(album.getAlbumId());
	}

	try {
		PortletFileRepositoryUtil.deletePortletFileEntry(
			artist.getGroupId(), DLFolderConstants.DEFAULT_PARENT_FOLDER_ID,
			String.valueOf(artistId));
	}
	catch (Exception e) {
	}

	return artistPersistence.remove(artistId);
}
 
开发者ID:juliocamarero,项目名称:jukebox,代码行数:23,代码来源:ArtistLocalServiceImpl.java

示例15: importQuestionAnswers

import com.liferay.portlet.documentlibrary.model.DLFolderConstants; //导入依赖的package包/类
@Override
public void importQuestionAnswers(PortletDataContext context, Element entryElement, long questionId, long userId, ServiceContext serviceContext) throws SystemException, PortalException{
	for(Element aElement:entryElement.elements("questionanswer")){
		String patha = aElement.attributeValue("path");
		TestAnswer oldanswer=(TestAnswer)context.getZipEntryAsObject(patha);
		TestAnswer answer = TestAnswerLocalServiceUtil.addTestAnswer(questionId, oldanswer.getAnswer(), oldanswer.getFeedbackCorrect(), oldanswer.getFeedbacknocorrect(), oldanswer.isIsCorrect());
		
		//Si tenemos ficheros en las descripciones de las respuestas.
		for (Element actElementFile : aElement.elements("descriptionfile")) {
			FileEntry oldFile = (FileEntry)context.getZipEntryAsObject(actElementFile.attributeValue("path"));
			ModuleDataHandlerImpl m = new ModuleDataHandlerImpl();
			FileEntry newFile;
			long folderId=0;
			String description = "";
			
			try {
				InputStream input = context.getZipEntryAsInputStream(actElementFile.attributeValue("file"));
				long repositoryId = DLFolderConstants.getDataRepositoryId(context.getScopeGroupId(), DLFolderConstants.DEFAULT_PARENT_FOLDER_ID);
				folderId = DLFolderUtil.createDLFoldersForLearningActivity(userId,repositoryId,serviceContext).getFolderId();
				newFile = DLAppLocalServiceUtil.addFileEntry(userId, repositoryId , folderId , oldFile.getTitle(), "contentType", oldFile.getTitle(), StringPool.BLANK, StringPool.BLANK, IOUtils.toByteArray(input), serviceContext );
				description = ImportUtil.descriptionFileParserLarToDescription(answer.getAnswer(), oldFile, newFile);
			} catch(DuplicateFileException dfl){
				FileEntry existingFile = DLAppLocalServiceUtil.getFileEntry(context.getScopeGroupId(), folderId, oldFile.getTitle());
				description = ImportUtil.descriptionFileParserLarToDescription(answer.getAnswer(), oldFile, existingFile);
			} catch (Exception e) {
				e.printStackTrace();
			}
			answer.setAnswer(description);
			TestAnswerLocalServiceUtil.updateTestAnswer(answer);
		}
	}
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:33,代码来源:BaseQuestionType.java


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