本文整理汇总了Java中com.liferay.portlet.documentlibrary.model.DLFolderConstants类的典型用法代码示例。如果您正苦于以下问题:Java DLFolderConstants类的具体用法?Java DLFolderConstants怎么用?Java DLFolderConstants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DLFolderConstants类属于com.liferay.portlet.documentlibrary.model包,在下文中一共展示了DLFolderConstants类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: createDLFolders
import com.liferay.portlet.documentlibrary.model.DLFolderConstants; //导入依赖的package包/类
private long createDLFolders(Long userId,Long repositoryId,PortletRequest portletRequest,long actId) throws PortalException, SystemException{
//Variables for folder ids
Long dlMainFolderId = 0L;
//Search for folder in Document Library
boolean dlMainFolderFound = false;
//Get main folder
try {
//Get main folder
Folder dlFolderMain = DLAppLocalServiceUtil.getFolder(repositoryId,DLFolderConstants.DEFAULT_PARENT_FOLDER_ID,DOCUMENTLIBRARY_MAINFOLDER+actId);
dlMainFolderId = dlFolderMain.getFolderId();
dlMainFolderFound = true;
//Get portlet folder
} catch (Exception ex){
}
ServiceContext serviceContext= ServiceContextFactory.getInstance( DLFolder.class.getName(), portletRequest);
//Damos permisos al archivo para usuarios de comunidad.
serviceContext.setAddGroupPermissions(true);
//Create main folder if not exist
if(!dlMainFolderFound){
Folder newDocumentMainFolder = DLAppLocalServiceUtil.addFolder(userId, repositoryId,DLFolderConstants.DEFAULT_PARENT_FOLDER_ID, DOCUMENTLIBRARY_MAINFOLDER+actId, DOCUMENTLIBRARY_MAINFOLDER+actId, serviceContext);
dlMainFolderFound = true;
dlMainFolderId = newDocumentMainFolder.getFolderId();
}
//Create portlet folder if not exist
return dlMainFolderId;
}
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:29,代码来源:ResourceExternalLearningActivityType.java
示例17: createDLFolders
import com.liferay.portlet.documentlibrary.model.DLFolderConstants; //导入依赖的package包/类
private long createDLFolders(Long userId,Long repositoryId,PortletRequest portletRequest) throws PortalException, SystemException{
//Variables for folder ids
Long dlMainFolderId = 0L;
//Search for folder in Document Library
boolean dlMainFolderFound = false;
//Get main folder
try {
//Get main folder
Folder dlFolderMain = DLAppLocalServiceUtil.getFolder(repositoryId,DLFolderConstants.DEFAULT_PARENT_FOLDER_ID,DOCUMENTLIBRARY_MAINFOLDER);
dlMainFolderId = dlFolderMain.getFolderId();
dlMainFolderFound = true;
//Get portlet folder
} catch (Exception ex){
}
ServiceContext serviceContext= ServiceContextFactory.getInstance( DLFolder.class.getName(), portletRequest);
//Damos permisos al archivo para usuarios de comunidad.
serviceContext.setAddGroupPermissions(true);
//Create main folder if not exist
if(!dlMainFolderFound){
Folder newDocumentMainFolder = DLAppLocalServiceUtil.addFolder(userId, repositoryId,DLFolderConstants.DEFAULT_PARENT_FOLDER_ID, DOCUMENTLIBRARY_MAINFOLDER, DOCUMENTLIBRARY_MAINFOLDER, serviceContext);
dlMainFolderFound = true;
dlMainFolderId = newDocumentMainFolder.getFolderId();
}
//Create portlet folder if not exist
return dlMainFolderId;
}
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:31,代码来源:ResourceInternalActivity.java
示例18: getFileEntry
import com.liferay.portlet.documentlibrary.model.DLFolderConstants; //导入依赖的package包/类
protected FileEntry getFileEntry(
ThemeDisplay themeDisplay, String folderName) {
Repository repository =
PortletFileRepositoryUtil.fetchPortletRepository(
getGroupId(), Constants.JUKEBOX_PORTLET_REPOSITORY);
if (repository == null) {
return null;
}
try {
Folder folder = PortletFileRepositoryUtil.getPortletFolder(
0, repository.getRepositoryId(),
DLFolderConstants.DEFAULT_PARENT_FOLDER_ID,
String.valueOf(getSongId()), null);
Folder songFolder = PortletFileRepositoryUtil.getPortletFolder(
0, repository.getRepositoryId(), folder.getFolderId(),
folderName, null);
List<FileEntry> fileEntries =
PortletFileRepositoryUtil.getPortletFileEntries(
themeDisplay.getScopeGroupId(), songFolder.getFolderId());
if (fileEntries.isEmpty()) {
return null;
}
return fileEntries.get(0);
}
catch (Exception e) {
return null;
}
}
开发者ID:juliocamarero,项目名称:jukebox-portlet,代码行数:36,代码来源:SongImpl.java
示例19: getFileEntry
import com.liferay.portlet.documentlibrary.model.DLFolderConstants; //导入依赖的package包/类
protected FileEntry getFileEntry(
ThemeDisplay themeDisplay, String folderName)
throws SystemException {
Repository repository =
PortletFileRepositoryUtil.fetchPortletRepository(
getGroupId(), Constants.JUKEBOX_PORTLET_REPOSITORY);
if (repository == null) {
return null;
}
try {
Folder folder = PortletFileRepositoryUtil.getPortletFolder(
0, repository.getRepositoryId(),
DLFolderConstants.DEFAULT_PARENT_FOLDER_ID,
String.valueOf(getSongId()), null);
Folder songFolder = PortletFileRepositoryUtil.getPortletFolder(
0, repository.getRepositoryId(), folder.getFolderId(),
folderName, null);
List<FileEntry> fileEntries =
PortletFileRepositoryUtil.getPortletFileEntries(
themeDisplay.getScopeGroupId(), songFolder.getFolderId());
if (fileEntries.isEmpty()) {
return null;
}
return fileEntries.get(0);
}
catch (Exception e) {
return null;
}
}
开发者ID:juliocamarero,项目名称:jukebox,代码行数:37,代码来源:SongImpl.java
示例20: cloneFile
import com.liferay.portlet.documentlibrary.model.DLFolderConstants; //导入依赖的package包/类
private long cloneFile(long entryId, LearningActivity actNew, long userId, ServiceContext serviceContext){
long assetEntryId = 0;
boolean addGroupPermissions = serviceContext.isAddGroupPermissions();
try {
if(log.isDebugEnabled()){log.debug("EntryId: "+entryId);}
AssetEntry docAsset = AssetEntryLocalServiceUtil.getAssetEntry(entryId);
//docAsset.getUrl()!=""
//DLFileEntryLocalServiceUtil.getDLFileEntry(fileEntryId)
if(log.isDebugEnabled()){log.debug(docAsset.getClassPK());}
DLFileEntry docfile = DLFileEntryLocalServiceUtil.getDLFileEntry(docAsset.getClassPK());
InputStream is = DLFileEntryLocalServiceUtil.getFileAsStream(userId, docfile.getFileEntryId(), docfile.getVersion());
//Crear el folder
DLFolder dlFolder = DLFolderUtil.createDLFoldersForLearningActivity(userId, serviceContext.getScopeGroupId(), serviceContext);
long repositoryId = DLFolderConstants.getDataRepositoryId(actNew.getGroupId(), DLFolderConstants.DEFAULT_PARENT_FOLDER_ID);
String ficheroStr = docfile.getTitle();
if(!docfile.getTitle().endsWith(docfile.getExtension())){
ficheroStr = ficheroStr +"."+ docfile.getExtension();
}
serviceContext.setAddGroupPermissions(true);
FileEntry newFile = DLAppLocalServiceUtil.addFileEntry(
serviceContext.getUserId(), repositoryId , dlFolder.getFolderId() , ficheroStr, docfile.getMimeType(),
docfile.getTitle(), StringPool.BLANK, StringPool.BLANK, is, docfile.getSize() , serviceContext ) ;
AssetEntry asset = AssetEntryLocalServiceUtil.getEntry(DLFileEntry.class.getName(), newFile.getPrimaryKey());
if(log.isDebugEnabled()){log.debug(" asset : " + asset.getEntryId());};
assetEntryId = asset.getEntryId();
} catch (NoSuchEntryException nsee) {
log.error(" asset not exits ");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
serviceContext.setAddGroupPermissions(addGroupPermissions);
}
return assetEntryId;
}
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:48,代码来源:CourseCopyUtil.java
注:本文中的com.liferay.portlet.documentlibrary.model.DLFolderConstants类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论