All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.liferay.document.library.kernel.service.DLAppLocalService Maven / Gradle / Ivy

There is a newer version: 7.4.3.112-ga112
Show newest version
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.liferay.document.library.kernel.service;

import aQute.bnd.annotation.ProviderType;

import com.liferay.document.library.kernel.model.DLFileRank;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.repository.model.FileEntry;
import com.liferay.portal.kernel.repository.model.FileShortcut;
import com.liferay.portal.kernel.repository.model.FileVersion;
import com.liferay.portal.kernel.repository.model.Folder;
import com.liferay.portal.kernel.service.BaseLocalService;
import com.liferay.portal.kernel.service.ServiceContext;
import com.liferay.portal.kernel.transaction.Isolation;
import com.liferay.portal.kernel.transaction.Propagation;
import com.liferay.portal.kernel.transaction.Transactional;

import java.io.File;
import java.io.InputStream;

import java.util.List;

/**
 * Provides the local service interface for DLApp. Methods of this
 * service will not have security checks based on the propagated JAAS
 * credentials because this service can only be accessed from within the same
 * VM.
 *
 * @author Brian Wing Shun Chan
 * @see DLAppLocalServiceUtil
 * @generated
 */
@ProviderType
@Transactional(
	isolation = Isolation.PORTAL,
	rollbackFor = {PortalException.class, SystemException.class}
)
public interface DLAppLocalService extends BaseLocalService {

	/*
	 * NOTE FOR DEVELOPERS:
	 *
	 * Never modify or reference this interface directly. Always use {@link DLAppLocalServiceUtil} to access the dl app local service. Add custom service methods to com.liferay.portlet.documentlibrary.service.impl.DLAppLocalServiceImpl and rerun ServiceBuilder to automatically copy the method declarations to this interface.
	 */
	public FileEntry addFileEntry(
			long userId, long repositoryId, long folderId,
			String sourceFileName, String mimeType, byte[] bytes,
			ServiceContext serviceContext)
		throws PortalException;

	/**
	 * Adds a file entry and associated metadata based on a byte array.
	 *
	 * 

* This method takes two file names, the sourceFileName and the * title. The sourceFileName corresponds to the * name of the actual file being uploaded. The title * corresponds to a name the client wishes to assign this file after it has * been uploaded to the portal. If it is null, the * sourceFileName will be used. *

* * @param userId the primary key of the file entry's creator/owner * @param repositoryId the primary key of the file entry's repository * @param folderId the primary key of the file entry's parent folder * @param sourceFileName the original file's name * @param mimeType the file's MIME type * @param title the name to be assigned to the file (optionally null ) * @param description the file's description * @param changeLog the file's version change log * @param bytes the file's data (optionally null) * @param serviceContext the service context to be applied. Can set the asset category IDs, asset tag names, and expando bridge attributes for the file entry. In a Liferay repository, it may include:
  • fileEntryTypeId - ID for a custom file entry type
  • fieldsMap - mapping for fields associated with a custom file entry type
* @return the file entry */ public FileEntry addFileEntry( long userId, long repositoryId, long folderId, String sourceFileName, String mimeType, String title, String description, String changeLog, byte[] bytes, ServiceContext serviceContext) throws PortalException; /** * Adds a file entry and associated metadata based on a {@link File} object. * *

* This method takes two file names, the sourceFileName and the * title. The sourceFileName corresponds to the * name of the actual file being uploaded. The title * corresponds to a name the client wishes to assign this file after it has * been uploaded to the portal. If it is null, the * sourceFileName will be used. *

* * @param userId the primary key of the file entry's creator/owner * @param repositoryId the primary key of the repository * @param folderId the primary key of the file entry's parent folder * @param sourceFileName the original file's name * @param mimeType the file's MIME type * @param title the name to be assigned to the file (optionally null ) * @param description the file's description * @param changeLog the file's version change log * @param file the file's data (optionally null) * @param serviceContext the service context to be applied. Can set the asset category IDs, asset tag names, and expando bridge attributes for the file entry. In a Liferay repository, it may include:
  • fileEntryTypeId - ID for a custom file entry type
  • fieldsMap - mapping for fields associated with a custom file entry type
* @return the file entry */ public FileEntry addFileEntry( long userId, long repositoryId, long folderId, String sourceFileName, String mimeType, String title, String description, String changeLog, File file, ServiceContext serviceContext) throws PortalException; /** * Adds a file entry and associated metadata based on an {@link InputStream} * object. * *

* This method takes two file names, the sourceFileName and the * title. The sourceFileName corresponds to the * name of the actual file being uploaded. The title * corresponds to a name the client wishes to assign this file after it has * been uploaded to the portal. If it is null, the * sourceFileName will be used. *

* * @param userId the primary key of the file entry's creator/owner * @param repositoryId the primary key of the repository * @param folderId the primary key of the file entry's parent folder * @param sourceFileName the original file's name * @param mimeType the file's MIME type * @param title the name to be assigned to the file (optionally null ) * @param description the file's description * @param changeLog the file's version change log * @param is the file's data (optionally null) * @param size the file's size (optionally 0) * @param serviceContext the service context to be applied. Can set the asset category IDs, asset tag names, and expando bridge attributes for the file entry. In a Liferay repository, it may include:
  • fileEntryTypeId - ID for a custom file entry type
  • fieldsMap - mapping for fields associated with a custom file entry type
* @return the file entry */ public FileEntry addFileEntry( long userId, long repositoryId, long folderId, String sourceFileName, String mimeType, String title, String description, String changeLog, InputStream is, long size, ServiceContext serviceContext) throws PortalException; /** * Adds the file rank to the existing file entry. This method is only * supported by the Liferay repository. * * @param repositoryId the primary key of the repository * @param companyId the primary key of the company * @param userId the primary key of the file rank's creator/owner * @param fileEntryId the primary key of the file entry * @param serviceContext the service context to be applied * @return the file rank * @deprecated As of Judson (7.1.x), replaced by {@link com.liferay.document.library.file.rank.service.DLFileRankLocalService#addFileRank} */ @Deprecated public DLFileRank addFileRank( long repositoryId, long companyId, long userId, long fileEntryId, ServiceContext serviceContext); /** * Adds the file shortcut to the existing file entry. This method is only * supported by the Liferay repository. * * @param userId the primary key of the file shortcut's creator/owner * @param repositoryId the primary key of the repository * @param folderId the primary key of the file shortcut's parent folder * @param toFileEntryId the primary key of the file entry to point to * @param serviceContext the service context to be applied. Can set the asset category IDs, asset tag names, and expando bridge attributes for the file entry. * @return the file shortcut */ public FileShortcut addFileShortcut( long userId, long repositoryId, long folderId, long toFileEntryId, ServiceContext serviceContext) throws PortalException; /** * Adds a folder. * * @param userId the primary key of the folder's creator/owner * @param repositoryId the primary key of the repository * @param parentFolderId the primary key of the folder's parent folder * @param name the folder's name * @param description the folder's description * @param serviceContext the service context to be applied. In a Liferay repository, it may include mountPoint which is a boolean specifying whether the folder is a facade for mounting a third-party repository * @return the folder */ public Folder addFolder( long userId, long repositoryId, long parentFolderId, String name, String description, ServiceContext serviceContext) throws PortalException; /** * Delete all data associated to the given repository. This method is only * supported by the Liferay repository. * * @param repositoryId the primary key of the data's repository */ public void deleteAll(long repositoryId) throws PortalException; public void deleteAllRepositories(long groupId) throws PortalException; /** * Deletes the file entry. * * @param fileEntryId the primary key of the file entry */ public void deleteFileEntry(long fileEntryId) throws PortalException; /** * Deletes the file ranks associated to a given file entry. This method is * only supported by the Liferay repository. * * @param fileEntryId the primary key of the file entry * @deprecated As of Judson (7.1.x), replaced by {@link com.liferay.document.library.file.rank.service.DLFileRankLocalService#deleteFileRanksByFileEntryId} */ @Deprecated public void deleteFileRanksByFileEntryId(long fileEntryId); /** * Deletes the file ranks associated to a given user. This method is only * supported by the Liferay repository. * * @param userId the primary key of the user * @deprecated As of Judson (7.1.x), replaced by {@link com.liferay.document.library.file.rank.service.DLFileRankLocalService#deleteFileRanksByUserId} */ @Deprecated public void deleteFileRanksByUserId(long userId); /** * Deletes the file shortcut. This method is only supported by the Liferay * repository. * * @param fileShortcut the file shortcut */ public void deleteFileShortcut(FileShortcut fileShortcut) throws PortalException; /** * Deletes the file shortcut. This method is only supported by the Liferay * repository. * * @param fileShortcutId the primary key of the file shortcut */ public void deleteFileShortcut(long fileShortcutId) throws PortalException; /** * Deletes all file shortcuts associated to the file entry. This method is * only supported by the Liferay repository. * * @param toFileEntryId the primary key of the associated file entry */ public void deleteFileShortcuts(long toFileEntryId) throws PortalException; /** * Deletes the folder and all of its subfolders and file entries. * * @param folderId the primary key of the folder */ public void deleteFolder(long folderId) throws PortalException; /** * Returns the file entry with the primary key. * * @param fileEntryId the primary key of the file entry * @return the file entry with the primary key */ @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public FileEntry getFileEntry(long fileEntryId) throws PortalException; /** * Returns the file entry with the title in the folder. * * @param groupId the primary key of the file entry's group * @param folderId the primary key of the file entry's folder * @param title the file entry's title * @return the file entry with the title in the folder */ @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public FileEntry getFileEntry(long groupId, long folderId, String title) throws PortalException; /** * Returns the file entry with the UUID and group. * * @param uuid the file entry's UUID * @param groupId the primary key of the file entry's group * @return the file entry with the UUID and group */ @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public FileEntry getFileEntryByUuidAndGroupId(String uuid, long groupId) throws PortalException; /** * Returns the file ranks from the user. This method is only supported by * the Liferay repository. * * @param repositoryId the primary key of the repository * @param userId the primary key of the user * @return the file ranks from the user * @deprecated As of Judson (7.1.x), replaced by {@link com.liferay.document.library.file.rank.service.DLFileRankLocalService#getFileRanks} */ @Deprecated @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public List getFileRanks(long repositoryId, long userId); /** * Returns the file shortcut with the primary key. This method is only * supported by the Liferay repository. * * @param fileShortcutId the primary key of the file shortcut * @return the file shortcut with the primary key */ @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public FileShortcut getFileShortcut(long fileShortcutId) throws PortalException; /** * Returns the file version with the primary key. * * @param fileVersionId the primary key of the file version * @return the file version with the primary key */ @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public FileVersion getFileVersion(long fileVersionId) throws PortalException; /** * Returns the folder with the primary key. * * @param folderId the primary key of the folder * @return the folder with the primary key */ @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public Folder getFolder(long folderId) throws PortalException; /** * Returns the folder with the name in the parent folder. * * @param repositoryId the primary key of the folder's repository * @param parentFolderId the primary key of the folder's parent folder * @param name the folder's name * @return the folder with the name in the parent folder */ @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public Folder getFolder(long repositoryId, long parentFolderId, String name) throws PortalException; /** * Returns the mount folder of the repository with the primary key. This * method is only supported by the Liferay repository. * * @param repositoryId the primary key of the repository * @return the folder used for mounting third-party repositories */ @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public Folder getMountFolder(long repositoryId) throws PortalException; /** * Returns the OSGi service identifier. * * @return the OSGi service identifier */ public String getOSGiServiceIdentifier(); /** * Moves the file entry to the new folder. * * @param userId the primary key of the user * @param fileEntryId the primary key of the file entry * @param newFolderId the primary key of the new folder * @param serviceContext the service context to be applied * @return the file entry */ public FileEntry moveFileEntry( long userId, long fileEntryId, long newFolderId, ServiceContext serviceContext) throws PortalException; public Folder moveFolder( long userId, long folderId, long parentFolderId, ServiceContext serviceContext) throws PortalException; /** * Subscribe the user to changes in documents of the file entry type. This * method is only supported by the Liferay repository. * * @param userId the primary key of the user * @param groupId the primary key of the file entry type's group * @param fileEntryTypeId the primary key of the file entry type */ public void subscribeFileEntryType( long userId, long groupId, long fileEntryTypeId) throws PortalException; /** * Subscribe the user to document changes in the folder. This method is only * supported by the Liferay repository. * * @param userId the primary key of the user * @param groupId the primary key of the folder's group * @param folderId the primary key of the folder */ public void subscribeFolder(long userId, long groupId, long folderId) throws PortalException; /** * Unsubscribe the user from changes in documents of the file entry type. * This method is only supported by the Liferay repository. * * @param userId the primary key of the user * @param groupId the primary key of the file entry type's group * @param fileEntryTypeId the primary key of the file entry type */ public void unsubscribeFileEntryType( long userId, long groupId, long fileEntryTypeId) throws PortalException; /** * Unsubscribe the user from document changes in the folder. This method is * only supported by the Liferay repository. * * @param userId the primary key of the user * @param groupId the primary key of the folder's group * @param folderId the primary key of the folder */ public void unsubscribeFolder(long userId, long groupId, long folderId) throws PortalException; /** * Updates the file entry's asset replacing its asset categories, tags, and * links. * * @param userId the primary key of the user * @param fileEntry the file entry to update * @param fileVersion the file version to update * @param assetCategoryIds the primary keys of the new asset categories * @param assetTagNames the new asset tag names * @param assetLinkEntryIds the primary keys of the new asset link entries */ public void updateAsset( long userId, FileEntry fileEntry, FileVersion fileVersion, long[] assetCategoryIds, String[] assetTagNames, long[] assetLinkEntryIds) throws PortalException; /** * Updates a file entry and associated metadata based on a byte array * object. If the file data is null, then only the associated * metadata (i.e., title, description, and * parameters in the serviceContext) will be updated. * *

* This method takes two file names, the sourceFileName and the * title. The sourceFileName corresponds to the * name of the actual file being uploaded. The title * corresponds to a name the client wishes to assign this file after it has * been uploaded to the portal. *

* * @param userId the primary key of the user * @param fileEntryId the primary key of the file entry * @param sourceFileName the original file's name (optionally null) * @param mimeType the file's MIME type (optionally null) * @param title the new name to be assigned to the file (optionally null) * @param description the file's new description * @param changeLog the file's version change log (optionally null) * @param majorVersion whether the new file version is a major version * @param bytes the file's data (optionally null) * @param serviceContext the service context to be applied. Can set the asset category IDs, asset tag names, and expando bridge attributes for the file entry. In a Liferay repository, it may include:
  • fileEntryTypeId - ID for a custom file entry type
  • fieldsMap - mapping for fields associated with a custom file entry type
* @return the file entry */ public FileEntry updateFileEntry( long userId, long fileEntryId, String sourceFileName, String mimeType, String title, String description, String changeLog, boolean majorVersion, byte[] bytes, ServiceContext serviceContext) throws PortalException; /** * Updates a file entry and associated metadata based on a {@link File} * object. If the file data is null, then only the associated * metadata (i.e., title, description, and * parameters in the serviceContext) will be updated. * *

* This method takes two file names, the sourceFileName and the * title. The sourceFileName corresponds to the * name of the actual file being uploaded. The title * corresponds to a name the client wishes to assign this file after it has * been uploaded to the portal. *

* * @param userId the primary key of the user * @param fileEntryId the primary key of the file entry * @param sourceFileName the original file's name (optionally null) * @param mimeType the file's MIME type (optionally null) * @param title the new name to be assigned to the file (optionally null) * @param description the file's new description * @param changeLog the file's version change log (optionally null) * @param majorVersion whether the new file version is a major version * @param file the file's data (optionally null) * @param serviceContext the service context to be applied. Can set the asset category IDs, asset tag names, and expando bridge attributes for the file entry. In a Liferay repository, it may include:
  • fileEntryTypeId - ID for a custom file entry type
  • fieldsMap - mapping for fields associated with a custom file entry type
* @return the file entry */ public FileEntry updateFileEntry( long userId, long fileEntryId, String sourceFileName, String mimeType, String title, String description, String changeLog, boolean majorVersion, File file, ServiceContext serviceContext) throws PortalException; /** * Updates a file entry and associated metadata based on an {@link * InputStream} object. If the file data is null, then only the * associated metadata (i.e., title, description, * and parameters in the serviceContext) will be updated. * *

* This method takes two file names, the sourceFileName and the * title. The sourceFileName corresponds to the * name of the actual file being uploaded. The title * corresponds to a name the client wishes to assign this file after it has * been uploaded to the portal. *

* * @param userId the primary key of the user * @param fileEntryId the primary key of the file entry * @param sourceFileName the original file's name (optionally null) * @param mimeType the file's MIME type (optionally null) * @param title the new name to be assigned to the file (optionally null) * @param description the file's new description * @param changeLog the file's version change log (optionally null) * @param majorVersion whether the new file version is a major version * @param is the file's data (optionally null) * @param size the file's size (optionally 0) * @param serviceContext the service context to be applied. Can set the asset category IDs, asset tag names, and expando bridge attributes for the file entry. In a Liferay repository, it may include:
  • fileEntryTypeId - ID for a custom file entry type
  • fieldsMap - mapping for fields associated with a custom file entry type
* @return the file entry */ public FileEntry updateFileEntry( long userId, long fileEntryId, String sourceFileName, String mimeType, String title, String description, String changeLog, boolean majorVersion, InputStream is, long size, ServiceContext serviceContext) throws PortalException; /** * Updates a file rank to the existing file entry. This method is only * supported by the Liferay repository. * * @param repositoryId the primary key of the file rank's repository * @param companyId the primary key of the file rank's company * @param userId the primary key of the file rank's creator/owner * @param fileEntryId the primary key of the file rank's file entry * @param serviceContext the service context to be applied * @return the file rank * @deprecated As of Judson (7.1.x), replaced by {@link com.liferay.document.library.file.rank.service.DLFileRankLocalService#updateFileRank} */ @Deprecated public DLFileRank updateFileRank( long repositoryId, long companyId, long userId, long fileEntryId, ServiceContext serviceContext); /** * Updates a file shortcut to the existing file entry. This method is only * supported by the Liferay repository. * * @param userId the primary key of the file shortcut's creator/owner * @param fileShortcutId the primary key of the file shortcut * @param folderId the primary key of the file shortcut's parent folder * @param toFileEntryId the primary key of the file shortcut's file entry * @param serviceContext the service context to be applied. Can set the asset category IDs, asset tag names, and expando bridge attributes for the file entry. * @return the file shortcut */ public FileShortcut updateFileShortcut( long userId, long fileShortcutId, long folderId, long toFileEntryId, ServiceContext serviceContext) throws PortalException; /** * Updates all file shortcuts to the existing file entry to the new file * entry. This method is only supported by the Liferay repository. * * @param oldToFileEntryId the primary key of the old file entry pointed to * @param newToFileEntryId the primary key of the new file entry to point to */ public void updateFileShortcuts( long oldToFileEntryId, long newToFileEntryId) throws PortalException; /** * @deprecated As of Wilberforce (7.0.x), replaced by {@link #updateFileShortcuts(long, long)} */ @Deprecated public void updateFileShortcuts( long toRepositoryId, long oldToFileEntryId, long newToFileEntryId) throws PortalException; /** * Updates the folder. * * @param folderId the primary key of the folder * @param parentFolderId the primary key of the folder's new parent folder * @param name the folder's new name * @param description the folder's new description * @param serviceContext the service context to be applied. In a Liferay repository, it may include:
  • defaultFileEntryTypeId - the file entry type to default all Liferay file entries to
  • dlFileEntryTypesSearchContainerPrimaryKeys - a comma-delimited list of file entry type primary keys allowed in the given folder and all descendants
  • restrictionType - specifying restriction type of file entry types allowed
  • workflowDefinitionXYZ - the workflow definition name specified per file entry type. The parameter name must be the string workflowDefinition appended by the fileEntryTypeId (optionally 0).
* @return the folder */ public Folder updateFolder( long folderId, long parentFolderId, String name, String description, ServiceContext serviceContext) throws PortalException; }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy