
com.liferay.headless.delivery.internal.resource.v1_0.BaseDocumentFolderResourceImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of com.liferay.headless.delivery.impl
Show all versions of com.liferay.headless.delivery.impl
Liferay Headless Delivery Implementation
The newest version!
/**
* SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
* SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
*/
package com.liferay.headless.delivery.internal.resource.v1_0;
import com.liferay.headless.delivery.dto.v1_0.DefaultValue;
import com.liferay.headless.delivery.dto.v1_0.DocumentFolder;
import com.liferay.headless.delivery.dto.v1_0.Rating;
import com.liferay.headless.delivery.resource.v1_0.DocumentFolderResource;
import com.liferay.petra.function.UnsafeBiConsumer;
import com.liferay.petra.function.UnsafeConsumer;
import com.liferay.petra.function.UnsafeFunction;
import com.liferay.petra.function.transform.TransformUtil;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.model.Resource;
import com.liferay.portal.kernel.model.ResourceAction;
import com.liferay.portal.kernel.model.ResourceConstants;
import com.liferay.portal.kernel.model.ResourcePermission;
import com.liferay.portal.kernel.security.permission.ActionKeys;
import com.liferay.portal.kernel.security.permission.resource.ModelResourcePermission;
import com.liferay.portal.kernel.service.GroupLocalService;
import com.liferay.portal.kernel.service.PermissionServiceUtil;
import com.liferay.portal.kernel.service.ResourceActionLocalService;
import com.liferay.portal.kernel.service.ResourceLocalServiceUtil;
import com.liferay.portal.kernel.service.ResourcePermissionLocalService;
import com.liferay.portal.kernel.service.RoleLocalService;
import com.liferay.portal.kernel.service.permission.ModelPermissions;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.GroupThreadLocal;
import com.liferay.portal.kernel.util.HashMapBuilder;
import com.liferay.portal.kernel.util.LocaleUtil;
import com.liferay.portal.kernel.util.SetUtil;
import com.liferay.portal.kernel.util.StringUtil;
import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.odata.entity.EntityModel;
import com.liferay.portal.odata.filter.ExpressionConvert;
import com.liferay.portal.odata.filter.FilterParser;
import com.liferay.portal.odata.filter.FilterParserProvider;
import com.liferay.portal.odata.sort.SortField;
import com.liferay.portal.odata.sort.SortParser;
import com.liferay.portal.odata.sort.SortParserProvider;
import com.liferay.portal.vulcan.accept.language.AcceptLanguage;
import com.liferay.portal.vulcan.batch.engine.VulcanBatchEngineTaskItemDelegate;
import com.liferay.portal.vulcan.batch.engine.resource.VulcanBatchEngineExportTaskResource;
import com.liferay.portal.vulcan.batch.engine.resource.VulcanBatchEngineImportTaskResource;
import com.liferay.portal.vulcan.crud.VulcanCRUDItemDelegate;
import com.liferay.portal.vulcan.pagination.Page;
import com.liferay.portal.vulcan.pagination.Pagination;
import com.liferay.portal.vulcan.permission.ModelPermissionsUtil;
import com.liferay.portal.vulcan.permission.Permission;
import com.liferay.portal.vulcan.resource.EntityModelResource;
import com.liferay.portal.vulcan.util.ActionUtil;
import com.liferay.portal.vulcan.util.UriInfoUtil;
import jakarta.annotation.Generated;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.ws.rs.NotSupportedException;
import jakarta.ws.rs.core.MultivaluedHashMap;
import jakarta.ws.rs.core.MultivaluedMap;
import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.core.UriInfo;
import java.io.Serializable;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
/**
* @author Javier Gamarra
* @generated
*/
@Generated("")
@jakarta.ws.rs.Path("/v1.0")
public abstract class BaseDocumentFolderResourceImpl
implements DocumentFolderResource, EntityModelResource,
VulcanBatchEngineTaskItemDelegate,
VulcanCRUDItemDelegate {
/**
* Invoke this method with the command line:
*
* curl -X 'DELETE' 'http://localhost:8080/o/headless-delivery/v1.0/document-folders/{documentFolderId}' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Operation(
description = "Deletes the document folder and returns a 204 if the operation succeeds."
)
@io.swagger.v3.oas.annotations.Parameters(
value = {
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "documentFolderId"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(name = "DocumentFolder")
}
)
@jakarta.ws.rs.DELETE
@jakarta.ws.rs.Path("/document-folders/{documentFolderId}")
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@Override
public void deleteDocumentFolder(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("documentFolderId")
Long documentFolderId)
throws Exception {
}
/**
* Invoke this method with the command line:
*
* curl -X 'DELETE' 'http://localhost:8080/o/headless-delivery/v1.0/document-folders/batch' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Parameters(
value = {
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "callbackURL"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(name = "DocumentFolder")
}
)
@jakarta.ws.rs.Consumes("application/json")
@jakarta.ws.rs.DELETE
@jakarta.ws.rs.Path("/document-folders/batch")
@jakarta.ws.rs.Produces("application/json")
@Override
public Response deleteDocumentFolderBatch(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.ws.rs.QueryParam("callbackURL")
String callbackURL,
Object object)
throws Exception {
vulcanBatchEngineImportTaskResource.setContextAcceptLanguage(
contextAcceptLanguage);
vulcanBatchEngineImportTaskResource.setContextCompany(contextCompany);
vulcanBatchEngineImportTaskResource.setContextHttpServletRequest(
contextHttpServletRequest);
vulcanBatchEngineImportTaskResource.setContextUriInfo(contextUriInfo);
vulcanBatchEngineImportTaskResource.setContextUser(contextUser);
Response.ResponseBuilder responseBuilder = Response.accepted();
return responseBuilder.entity(
vulcanBatchEngineImportTaskResource.deleteImportTask(
DocumentFolder.class.getName(), callbackURL, object)
).build();
}
/**
* Invoke this method with the command line:
*
* curl -X 'DELETE' 'http://localhost:8080/o/headless-delivery/v1.0/document-folders/{documentFolderId}/my-rating' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Operation(
description = "Deletes the document folder's rating and returns a 204 if the operation succeeded."
)
@io.swagger.v3.oas.annotations.Parameters(
value = {
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "documentFolderId"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(name = "DocumentFolder")
}
)
@jakarta.ws.rs.DELETE
@jakarta.ws.rs.Path("/document-folders/{documentFolderId}/my-rating")
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@Override
public void deleteDocumentFolderMyRating(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("documentFolderId")
Long documentFolderId)
throws Exception {
}
/**
* Invoke this method with the command line:
*
* curl -X 'DELETE' 'http://localhost:8080/o/headless-delivery/v1.0/sites/{siteId}/documents-folder/by-external-reference-code/{externalReferenceCode}' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Operation(
description = "Deletes the site's document folder by external reference code returns a 204 if the operation succeeds."
)
@io.swagger.v3.oas.annotations.Parameters(
value = {
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "siteId"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "externalReferenceCode"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(name = "DocumentFolder")
}
)
@jakarta.ws.rs.DELETE
@jakarta.ws.rs.Path(
"/sites/{siteId}/documents-folder/by-external-reference-code/{externalReferenceCode}"
)
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@Override
public void deleteSiteDocumentsFolderByExternalReferenceCode(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("siteId")
Long siteId,
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("externalReferenceCode")
String externalReferenceCode)
throws Exception {
}
/**
* Invoke this method with the command line:
*
* curl -X 'GET' 'http://localhost:8080/o/headless-delivery/v1.0/asset-libraries/{assetLibraryId}/document-folders/permissions' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Parameters(
value = {
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "assetLibraryId"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "fields"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "nestedFields"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "restrictFields"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "roleNames"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(name = "DocumentFolder")
}
)
@jakarta.ws.rs.GET
@jakarta.ws.rs.Path(
"/asset-libraries/{assetLibraryId}/document-folders/permissions"
)
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@Override
public Page getAssetLibraryDocumentFolderPermissionsPage(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("assetLibraryId")
Long assetLibraryId,
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.ws.rs.QueryParam("roleNames")
String roleNames)
throws Exception {
String portletName = getPermissionCheckerPortletName(assetLibraryId);
PermissionServiceUtil.checkPermission(
assetLibraryId, portletName, assetLibraryId);
return toPermissionPage(
HashMapBuilder.put(
"get",
addAction(
ActionKeys.PERMISSIONS,
"getAssetLibraryDocumentFolderPermissionsPage", portletName,
assetLibraryId)
).put(
"replace",
addAction(
ActionKeys.PERMISSIONS,
"putAssetLibraryDocumentFolderPermissionsPage", portletName,
assetLibraryId)
).build(),
assetLibraryId, portletName, roleNames);
}
/**
* Invoke this method with the command line:
*
* curl -X 'GET' 'http://localhost:8080/o/headless-delivery/v1.0/asset-libraries/{assetLibraryId}/document-folders' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Parameters(
value = {
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "assetLibraryId"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "aggregationTerms"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "fields"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "filter"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "flatten"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "nestedFields"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "page"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "pageSize"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "restrictFields"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "search"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "sort"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(name = "DocumentFolder")
}
)
@jakarta.ws.rs.GET
@jakarta.ws.rs.Path("/asset-libraries/{assetLibraryId}/document-folders")
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@Override
public Page getAssetLibraryDocumentFoldersPage(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("assetLibraryId")
Long assetLibraryId,
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.ws.rs.QueryParam("flatten")
Boolean flatten,
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.ws.rs.QueryParam("search")
String search,
@jakarta.ws.rs.core.Context
com.liferay.portal.vulcan.aggregation.Aggregation aggregation,
@jakarta.ws.rs.core.Context
com.liferay.portal.kernel.search.filter.Filter filter,
@jakarta.ws.rs.core.Context Pagination pagination,
@jakarta.ws.rs.core.Context com.liferay.portal.kernel.search.Sort[]
sorts)
throws Exception {
return Page.of(Collections.emptyList());
}
/**
* Invoke this method with the command line:
*
* curl -X 'GET' 'http://localhost:8080/o/headless-delivery/v1.0/asset-libraries/{assetLibraryId}/document-folders/rated-by-me' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Operation(
description = "Retrieves the document folders rated by the user."
)
@io.swagger.v3.oas.annotations.Parameters(
value = {
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "assetLibraryId"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "page"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "pageSize"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(name = "DocumentFolder")
}
)
@jakarta.ws.rs.GET
@jakarta.ws.rs.Path(
"/asset-libraries/{assetLibraryId}/document-folders/rated-by-me"
)
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@Override
public Page getAssetLibraryDocumentFoldersRatedByMePage(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("assetLibraryId")
Long assetLibraryId,
@jakarta.ws.rs.core.Context Pagination pagination)
throws Exception {
return Page.of(Collections.emptyList());
}
/**
* Invoke this method with the command line:
*
* curl -X 'GET' 'http://localhost:8080/o/headless-delivery/v1.0/document-folders/{documentFolderId}' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Operation(
description = "Retrieves the document folder."
)
@io.swagger.v3.oas.annotations.Parameters(
value = {
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "documentFolderId"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "fields"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "nestedFields"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "restrictFields"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(name = "DocumentFolder")
}
)
@jakarta.ws.rs.GET
@jakarta.ws.rs.Path("/document-folders/{documentFolderId}")
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@Override
public DocumentFolder getDocumentFolder(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("documentFolderId")
Long documentFolderId)
throws Exception {
return new DocumentFolder();
}
/**
* Invoke this method with the command line:
*
* curl -X 'GET' 'http://localhost:8080/o/headless-delivery/v1.0/document-folders/{parentDocumentFolderId}/document-folders' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Operation(
description = "Retrieves the folder's subfolders. Results can be paginated, filtered, searched, and sorted."
)
@io.swagger.v3.oas.annotations.Parameters(
value = {
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "parentDocumentFolderId"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "aggregationTerms"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "fields"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "filter"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "flatten"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "nestedFields"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "page"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "pageSize"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "restrictFields"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "search"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "sort"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(name = "DocumentFolder")
}
)
@jakarta.ws.rs.GET
@jakarta.ws.rs.Path(
"/document-folders/{parentDocumentFolderId}/document-folders"
)
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@Override
public Page getDocumentFolderDocumentFoldersPage(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("parentDocumentFolderId")
Long parentDocumentFolderId,
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.ws.rs.QueryParam("flatten")
Boolean flatten,
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.ws.rs.QueryParam("search")
String search,
@jakarta.ws.rs.core.Context
com.liferay.portal.vulcan.aggregation.Aggregation aggregation,
@jakarta.ws.rs.core.Context
com.liferay.portal.kernel.search.filter.Filter filter,
@jakarta.ws.rs.core.Context Pagination pagination,
@jakarta.ws.rs.core.Context com.liferay.portal.kernel.search.Sort[]
sorts)
throws Exception {
return Page.of(Collections.emptyList());
}
/**
* Invoke this method with the command line:
*
* curl -X 'GET' 'http://localhost:8080/o/headless-delivery/v1.0/document-folders/{documentFolderId}/my-rating' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Operation(
description = "Retrieves the document folder's rating."
)
@io.swagger.v3.oas.annotations.Parameters(
value = {
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "documentFolderId"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "fields"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "restrictFields"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(name = "DocumentFolder")
}
)
@jakarta.ws.rs.GET
@jakarta.ws.rs.Path("/document-folders/{documentFolderId}/my-rating")
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@Override
public Rating getDocumentFolderMyRating(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("documentFolderId")
Long documentFolderId)
throws Exception {
return new Rating();
}
/**
* Invoke this method with the command line:
*
* curl -X 'GET' 'http://localhost:8080/o/headless-delivery/v1.0/document-folders/{documentFolderId}/permissions' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Parameters(
value = {
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "documentFolderId"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "fields"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "nestedFields"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "restrictFields"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "roleNames"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(name = "DocumentFolder")
}
)
@jakarta.ws.rs.GET
@jakarta.ws.rs.Path("/document-folders/{documentFolderId}/permissions")
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@Override
public Page getDocumentFolderPermissionsPage(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("documentFolderId")
Long documentFolderId,
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.ws.rs.QueryParam("roleNames")
String roleNames)
throws Exception {
String resourceName = getPermissionCheckerResourceName(
documentFolderId);
Long resourceId = getPermissionCheckerResourceId(documentFolderId);
PermissionServiceUtil.checkPermission(
getPermissionCheckerGroupId(documentFolderId), resourceName,
resourceId);
return toPermissionPage(
HashMapBuilder.put(
"get",
addAction(
ActionKeys.PERMISSIONS, "getDocumentFolderPermissionsPage",
resourceName, resourceId)
).put(
"replace",
addAction(
ActionKeys.PERMISSIONS, "putDocumentFolderPermissionsPage",
resourceName, resourceId)
).build(),
resourceId, resourceName, roleNames);
}
/**
* Invoke this method with the command line:
*
* curl -X 'GET' 'http://localhost:8080/o/headless-delivery/v1.0/sites/{siteId}/document-folders/permissions' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Parameters(
value = {
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "siteId"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "fields"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "nestedFields"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "restrictFields"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "roleNames"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(name = "DocumentFolder")
}
)
@jakarta.ws.rs.GET
@jakarta.ws.rs.Path("/sites/{siteId}/document-folders/permissions")
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@Override
public Page getSiteDocumentFolderPermissionsPage(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("siteId")
Long siteId,
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.ws.rs.QueryParam("roleNames")
String roleNames)
throws Exception {
String portletName = getPermissionCheckerPortletName(siteId);
PermissionServiceUtil.checkPermission(siteId, portletName, siteId);
return toPermissionPage(
HashMapBuilder.put(
"get",
addAction(
ActionKeys.PERMISSIONS,
"getSiteDocumentFolderPermissionsPage", portletName, siteId)
).put(
"replace",
addAction(
ActionKeys.PERMISSIONS,
"putSiteDocumentFolderPermissionsPage", portletName, siteId)
).build(),
siteId, portletName, roleNames);
}
/**
* Invoke this method with the command line:
*
* curl -X 'GET' 'http://localhost:8080/o/headless-delivery/v1.0/sites/{siteId}/document-folders' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Operation(
description = "Retrieves the site's document folders. Results can be paginated, filtered, searched, flattened, and sorted."
)
@io.swagger.v3.oas.annotations.Parameters(
value = {
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "siteId"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "aggregationTerms"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "fields"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "filter"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "flatten"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "nestedFields"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "page"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "pageSize"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "restrictFields"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "search"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "sort"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(name = "DocumentFolder")
}
)
@jakarta.ws.rs.GET
@jakarta.ws.rs.Path("/sites/{siteId}/document-folders")
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@Override
public Page getSiteDocumentFoldersPage(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("siteId")
Long siteId,
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.ws.rs.QueryParam("flatten")
Boolean flatten,
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.ws.rs.QueryParam("search")
String search,
@jakarta.ws.rs.core.Context
com.liferay.portal.vulcan.aggregation.Aggregation aggregation,
@jakarta.ws.rs.core.Context
com.liferay.portal.kernel.search.filter.Filter filter,
@jakarta.ws.rs.core.Context Pagination pagination,
@jakarta.ws.rs.core.Context com.liferay.portal.kernel.search.Sort[]
sorts)
throws Exception {
return Page.of(Collections.emptyList());
}
/**
* Invoke this method with the command line:
*
* curl -X 'GET' 'http://localhost:8080/o/headless-delivery/v1.0/sites/{siteId}/document-folders/rated-by-me' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Operation(
description = "Retrieves the document folders rated by the user."
)
@io.swagger.v3.oas.annotations.Parameters(
value = {
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "siteId"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "page"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "pageSize"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(name = "DocumentFolder")
}
)
@jakarta.ws.rs.GET
@jakarta.ws.rs.Path("/sites/{siteId}/document-folders/rated-by-me")
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@Override
public Page getSiteDocumentFoldersRatedByMePage(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("siteId")
Long siteId,
@jakarta.ws.rs.core.Context Pagination pagination)
throws Exception {
return Page.of(Collections.emptyList());
}
/**
* Invoke this method with the command line:
*
* curl -X 'GET' 'http://localhost:8080/o/headless-delivery/v1.0/sites/{siteId}/documents-folder/by-external-reference-code/{externalReferenceCode}' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Operation(
description = "Retrieves the site's document folder by external reference code."
)
@io.swagger.v3.oas.annotations.Parameters(
value = {
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "siteId"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "externalReferenceCode"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(name = "DocumentFolder")
}
)
@jakarta.ws.rs.GET
@jakarta.ws.rs.Path(
"/sites/{siteId}/documents-folder/by-external-reference-code/{externalReferenceCode}"
)
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@Override
public DocumentFolder getSiteDocumentsFolderByExternalReferenceCode(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("siteId")
Long siteId,
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("externalReferenceCode")
String externalReferenceCode)
throws Exception {
return new DocumentFolder();
}
/**
* Invoke this method with the command line:
*
* curl -X 'PATCH' 'http://localhost:8080/o/headless-delivery/v1.0/document-folders/{documentFolderId}' -d $'{"customFields": ___, "description": ___, "externalReferenceCode": ___, "name": ___, "parentDocumentFolderId": ___, "viewableBy": ___}' --header 'Content-Type: application/json' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Operation(
description = "Updates only the fields received in the request body. Any other fields are left untouched."
)
@io.swagger.v3.oas.annotations.Parameters(
value = {
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "documentFolderId"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(name = "DocumentFolder")
}
)
@jakarta.ws.rs.Consumes({"application/json", "application/xml"})
@jakarta.ws.rs.PATCH
@jakarta.ws.rs.Path("/document-folders/{documentFolderId}")
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@Override
public DocumentFolder patchDocumentFolder(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("documentFolderId")
Long documentFolderId,
DocumentFolder documentFolder)
throws Exception {
DocumentFolder existingDocumentFolder = getDocumentFolder(
documentFolderId);
if (documentFolder.getCustomFields() != null) {
existingDocumentFolder.setCustomFields(
documentFolder.getCustomFields());
}
if (documentFolder.getDescription() != null) {
existingDocumentFolder.setDescription(
documentFolder.getDescription());
}
if (documentFolder.getExternalReferenceCode() != null) {
existingDocumentFolder.setExternalReferenceCode(
documentFolder.getExternalReferenceCode());
}
if (documentFolder.getName() != null) {
existingDocumentFolder.setName(documentFolder.getName());
}
if (documentFolder.getParentDocumentFolderId() != null) {
existingDocumentFolder.setParentDocumentFolderId(
documentFolder.getParentDocumentFolderId());
}
if (documentFolder.getViewableBy() != null) {
existingDocumentFolder.setViewableBy(
documentFolder.getViewableBy());
}
preparePatch(documentFolder, existingDocumentFolder);
return putDocumentFolder(documentFolderId, existingDocumentFolder);
}
/**
* Invoke this method with the command line:
*
* curl -X 'POST' 'http://localhost:8080/o/headless-delivery/v1.0/asset-libraries/{assetLibraryId}/document-folders' -d $'{"customFields": ___, "description": ___, "externalReferenceCode": ___, "name": ___, "parentDocumentFolderId": ___, "viewableBy": ___}' --header 'Content-Type: application/json' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Parameters(
value = {
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "assetLibraryId"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(name = "DocumentFolder")
}
)
@jakarta.ws.rs.Consumes({"application/json", "application/xml"})
@jakarta.ws.rs.Path("/asset-libraries/{assetLibraryId}/document-folders")
@jakarta.ws.rs.POST
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@Override
public DocumentFolder postAssetLibraryDocumentFolder(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("assetLibraryId")
Long assetLibraryId,
DocumentFolder documentFolder)
throws Exception {
return new DocumentFolder();
}
/**
* Invoke this method with the command line:
*
* curl -X 'POST' 'http://localhost:8080/o/headless-delivery/v1.0/asset-libraries/{assetLibraryId}/document-folders/batch' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Parameters(
value = {
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "assetLibraryId"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "callbackURL"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(name = "DocumentFolder")
}
)
@jakarta.ws.rs.Consumes("application/json")
@jakarta.ws.rs.Path(
"/asset-libraries/{assetLibraryId}/document-folders/batch"
)
@jakarta.ws.rs.POST
@jakarta.ws.rs.Produces("application/json")
@Override
public Response postAssetLibraryDocumentFolderBatch(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("assetLibraryId")
Long assetLibraryId,
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.ws.rs.QueryParam("callbackURL")
String callbackURL,
Object object)
throws Exception {
vulcanBatchEngineImportTaskResource.setContextAcceptLanguage(
contextAcceptLanguage);
vulcanBatchEngineImportTaskResource.setContextCompany(contextCompany);
vulcanBatchEngineImportTaskResource.setContextHttpServletRequest(
contextHttpServletRequest);
vulcanBatchEngineImportTaskResource.setContextUriInfo(contextUriInfo);
vulcanBatchEngineImportTaskResource.setContextUser(contextUser);
Response.ResponseBuilder responseBuilder = Response.accepted();
return responseBuilder.entity(
vulcanBatchEngineImportTaskResource.postImportTask(
DocumentFolder.class.getName(), callbackURL, null, object)
).build();
}
/**
* Invoke this method with the command line:
*
* curl -X 'POST' 'http://localhost:8080/o/headless-delivery/v1.0/asset-libraries/{assetLibraryId}/document-folders/export-batch' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Parameters(
value = {
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "assetLibraryId"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "filter"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "search"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "sort"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "callbackURL"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "contentType"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "fieldNames"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(name = "DocumentFolder")
}
)
@jakarta.ws.rs.Consumes("application/json")
@jakarta.ws.rs.Path(
"/asset-libraries/{assetLibraryId}/document-folders/export-batch"
)
@jakarta.ws.rs.POST
@jakarta.ws.rs.Produces("application/json")
@Override
public Response postAssetLibraryDocumentFoldersPageExportBatch(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("assetLibraryId")
Long assetLibraryId,
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.ws.rs.QueryParam("search")
String search,
@jakarta.ws.rs.core.Context
com.liferay.portal.kernel.search.filter.Filter filter,
@jakarta.ws.rs.core.Context com.liferay.portal.kernel.search.Sort[]
sorts,
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.ws.rs.QueryParam("callbackURL")
String callbackURL,
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.ws.rs.DefaultValue("JSON")
@jakarta.ws.rs.QueryParam("contentType")
String contentType,
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.ws.rs.QueryParam("fieldNames")
String fieldNames)
throws Exception {
vulcanBatchEngineExportTaskResource.setContextAcceptLanguage(
contextAcceptLanguage);
vulcanBatchEngineExportTaskResource.setContextCompany(contextCompany);
vulcanBatchEngineExportTaskResource.setContextHttpServletRequest(
contextHttpServletRequest);
vulcanBatchEngineExportTaskResource.setContextUriInfo(contextUriInfo);
vulcanBatchEngineExportTaskResource.setContextUser(contextUser);
vulcanBatchEngineExportTaskResource.setGroupLocalService(
groupLocalService);
Response.ResponseBuilder responseBuilder = Response.accepted();
return responseBuilder.entity(
vulcanBatchEngineExportTaskResource.postExportTask(
DocumentFolder.class.getName(), callbackURL, contentType,
fieldNames)
).build();
}
/**
* Invoke this method with the command line:
*
* curl -X 'POST' 'http://localhost:8080/o/headless-delivery/v1.0/document-folders/{parentDocumentFolderId}/document-folders' -d $'{"customFields": ___, "description": ___, "externalReferenceCode": ___, "name": ___, "parentDocumentFolderId": ___, "viewableBy": ___}' --header 'Content-Type: application/json' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Operation(
description = "Creates a new folder in a folder identified by `parentDocumentFolderId`."
)
@io.swagger.v3.oas.annotations.Parameters(
value = {
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "parentDocumentFolderId"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(name = "DocumentFolder")
}
)
@jakarta.ws.rs.Consumes({"application/json", "application/xml"})
@jakarta.ws.rs.Path(
"/document-folders/{parentDocumentFolderId}/document-folders"
)
@jakarta.ws.rs.POST
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@Override
public DocumentFolder postDocumentFolderDocumentFolder(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("parentDocumentFolderId")
Long parentDocumentFolderId,
DocumentFolder documentFolder)
throws Exception {
return new DocumentFolder();
}
/**
* Invoke this method with the command line:
*
* curl -X 'POST' 'http://localhost:8080/o/headless-delivery/v1.0/document-folders/{documentFolderId}/my-rating' -d $'{"ratingValue": ___}' --header 'Content-Type: application/json' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Operation(
description = "Creates a new rating for the document folder, by the user who authenticated the request."
)
@io.swagger.v3.oas.annotations.Parameters(
value = {
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "documentFolderId"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(name = "DocumentFolder")
}
)
@jakarta.ws.rs.Consumes({"application/json", "application/xml"})
@jakarta.ws.rs.Path("/document-folders/{documentFolderId}/my-rating")
@jakarta.ws.rs.POST
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@Override
public Rating postDocumentFolderMyRating(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("documentFolderId")
Long documentFolderId,
Rating rating)
throws Exception {
return new Rating();
}
/**
* Invoke this method with the command line:
*
* curl -X 'POST' 'http://localhost:8080/o/headless-delivery/v1.0/sites/{siteId}/document-folders' -d $'{"customFields": ___, "description": ___, "externalReferenceCode": ___, "name": ___, "parentDocumentFolderId": ___, "viewableBy": ___}' --header 'Content-Type: application/json' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Operation(
description = "Creates a new document folder."
)
@io.swagger.v3.oas.annotations.Parameters(
value = {
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "siteId"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(name = "DocumentFolder")
}
)
@jakarta.ws.rs.Consumes({"application/json", "application/xml"})
@jakarta.ws.rs.Path("/sites/{siteId}/document-folders")
@jakarta.ws.rs.POST
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@Override
public DocumentFolder postSiteDocumentFolder(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("siteId")
Long siteId,
DocumentFolder documentFolder)
throws Exception {
return new DocumentFolder();
}
/**
* Invoke this method with the command line:
*
* curl -X 'POST' 'http://localhost:8080/o/headless-delivery/v1.0/sites/{siteId}/document-folders/batch' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Parameters(
value = {
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "siteId"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "callbackURL"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(name = "DocumentFolder")
}
)
@jakarta.ws.rs.Consumes("application/json")
@jakarta.ws.rs.Path("/sites/{siteId}/document-folders/batch")
@jakarta.ws.rs.POST
@jakarta.ws.rs.Produces("application/json")
@Override
public Response postSiteDocumentFolderBatch(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("siteId")
Long siteId,
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.ws.rs.QueryParam("callbackURL")
String callbackURL,
Object object)
throws Exception {
vulcanBatchEngineImportTaskResource.setContextAcceptLanguage(
contextAcceptLanguage);
vulcanBatchEngineImportTaskResource.setContextCompany(contextCompany);
vulcanBatchEngineImportTaskResource.setContextHttpServletRequest(
contextHttpServletRequest);
vulcanBatchEngineImportTaskResource.setContextUriInfo(contextUriInfo);
vulcanBatchEngineImportTaskResource.setContextUser(contextUser);
Response.ResponseBuilder responseBuilder = Response.accepted();
return responseBuilder.entity(
vulcanBatchEngineImportTaskResource.postImportTask(
DocumentFolder.class.getName(), callbackURL, null, object)
).build();
}
/**
* Invoke this method with the command line:
*
* curl -X 'POST' 'http://localhost:8080/o/headless-delivery/v1.0/sites/{siteId}/document-folders/export-batch' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Parameters(
value = {
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "siteId"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "filter"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "search"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "sort"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "callbackURL"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "contentType"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "fieldNames"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(name = "DocumentFolder")
}
)
@jakarta.ws.rs.Consumes("application/json")
@jakarta.ws.rs.Path("/sites/{siteId}/document-folders/export-batch")
@jakarta.ws.rs.POST
@jakarta.ws.rs.Produces("application/json")
@Override
public Response postSiteDocumentFoldersPageExportBatch(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("siteId")
Long siteId,
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.ws.rs.QueryParam("search")
String search,
@jakarta.ws.rs.core.Context
com.liferay.portal.kernel.search.filter.Filter filter,
@jakarta.ws.rs.core.Context com.liferay.portal.kernel.search.Sort[]
sorts,
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.ws.rs.QueryParam("callbackURL")
String callbackURL,
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.ws.rs.DefaultValue("JSON")
@jakarta.ws.rs.QueryParam("contentType")
String contentType,
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.ws.rs.QueryParam("fieldNames")
String fieldNames)
throws Exception {
vulcanBatchEngineExportTaskResource.setContextAcceptLanguage(
contextAcceptLanguage);
vulcanBatchEngineExportTaskResource.setContextCompany(contextCompany);
vulcanBatchEngineExportTaskResource.setContextHttpServletRequest(
contextHttpServletRequest);
vulcanBatchEngineExportTaskResource.setContextUriInfo(contextUriInfo);
vulcanBatchEngineExportTaskResource.setContextUser(contextUser);
vulcanBatchEngineExportTaskResource.setGroupLocalService(
groupLocalService);
Response.ResponseBuilder responseBuilder = Response.accepted();
return responseBuilder.entity(
vulcanBatchEngineExportTaskResource.postExportTask(
DocumentFolder.class.getName(), callbackURL, contentType,
fieldNames)
).build();
}
/**
* Invoke this method with the command line:
*
* curl -X 'PUT' 'http://localhost:8080/o/headless-delivery/v1.0/asset-libraries/{assetLibraryId}/document-folders/permissions' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Parameters(
value = {
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "assetLibraryId"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(name = "DocumentFolder")
}
)
@jakarta.ws.rs.Consumes({"application/json", "application/xml"})
@jakarta.ws.rs.Path(
"/asset-libraries/{assetLibraryId}/document-folders/permissions"
)
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@jakarta.ws.rs.PUT
@Override
public Page putAssetLibraryDocumentFolderPermissionsPage(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("assetLibraryId")
Long assetLibraryId,
Permission[] permissions)
throws Exception {
String portletName = getPermissionCheckerPortletName(assetLibraryId);
PermissionServiceUtil.checkPermission(
assetLibraryId, portletName, assetLibraryId);
ModelPermissions modelPermissions =
ModelPermissionsUtil.toModelPermissions(
contextCompany.getCompanyId(), permissions, assetLibraryId,
portletName, resourceActionLocalService,
resourcePermissionLocalService, roleLocalService);
Collection roleNames = modelPermissions.getRoleNames();
for (ResourcePermission resourcePermission :
resourcePermissionLocalService.getResourcePermissions(
contextCompany.getCompanyId(), portletName,
ResourceConstants.SCOPE_INDIVIDUAL,
String.valueOf(assetLibraryId))) {
com.liferay.portal.kernel.model.Role role =
roleLocalService.fetchRole(resourcePermission.getRoleId());
if ((role == null) || roleNames.contains(role.getName())) {
continue;
}
for (ResourceAction resourceAction :
resourceActionLocalService.getResourceActions(
portletName)) {
resourcePermissionLocalService.removeResourcePermission(
contextCompany.getCompanyId(), portletName,
ResourceConstants.SCOPE_INDIVIDUAL,
String.valueOf(assetLibraryId), role.getRoleId(),
resourceAction.getActionId());
}
}
resourcePermissionLocalService.updateResourcePermissions(
contextCompany.getCompanyId(), assetLibraryId, portletName,
String.valueOf(assetLibraryId), modelPermissions);
return toPermissionPage(
HashMapBuilder.put(
"get",
addAction(
ActionKeys.PERMISSIONS,
"getAssetLibraryDocumentFolderPermissionsPage", portletName,
assetLibraryId)
).put(
"replace",
addAction(
ActionKeys.PERMISSIONS,
"putAssetLibraryDocumentFolderPermissionsPage", portletName,
assetLibraryId)
).build(),
assetLibraryId, portletName, null);
}
/**
* Invoke this method with the command line:
*
* curl -X 'PUT' 'http://localhost:8080/o/headless-delivery/v1.0/document-folders/{documentFolderId}' -d $'{"customFields": ___, "description": ___, "externalReferenceCode": ___, "name": ___, "parentDocumentFolderId": ___, "viewableBy": ___}' --header 'Content-Type: application/json' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Operation(
description = "Replaces the document folder with the information sent in the request body. Any missing fields are deleted, unless they are required."
)
@io.swagger.v3.oas.annotations.Parameters(
value = {
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "documentFolderId"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(name = "DocumentFolder")
}
)
@jakarta.ws.rs.Consumes({"application/json", "application/xml"})
@jakarta.ws.rs.Path("/document-folders/{documentFolderId}")
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@jakarta.ws.rs.PUT
@Override
public DocumentFolder putDocumentFolder(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("documentFolderId")
Long documentFolderId,
DocumentFolder documentFolder)
throws Exception {
return new DocumentFolder();
}
/**
* Invoke this method with the command line:
*
* curl -X 'PUT' 'http://localhost:8080/o/headless-delivery/v1.0/document-folders/batch' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Parameters(
value = {
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY,
name = "callbackURL"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(name = "DocumentFolder")
}
)
@jakarta.ws.rs.Consumes("application/json")
@jakarta.ws.rs.Path("/document-folders/batch")
@jakarta.ws.rs.Produces("application/json")
@jakarta.ws.rs.PUT
@Override
public Response putDocumentFolderBatch(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.ws.rs.QueryParam("callbackURL")
String callbackURL,
Object object)
throws Exception {
vulcanBatchEngineImportTaskResource.setContextAcceptLanguage(
contextAcceptLanguage);
vulcanBatchEngineImportTaskResource.setContextCompany(contextCompany);
vulcanBatchEngineImportTaskResource.setContextHttpServletRequest(
contextHttpServletRequest);
vulcanBatchEngineImportTaskResource.setContextUriInfo(contextUriInfo);
vulcanBatchEngineImportTaskResource.setContextUser(contextUser);
Response.ResponseBuilder responseBuilder = Response.accepted();
return responseBuilder.entity(
vulcanBatchEngineImportTaskResource.putImportTask(
DocumentFolder.class.getName(), callbackURL, object)
).build();
}
/**
* Invoke this method with the command line:
*
* curl -X 'PUT' 'http://localhost:8080/o/headless-delivery/v1.0/document-folders/{documentFolderId}/my-rating' -d $'{"ratingValue": ___}' --header 'Content-Type: application/json' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Operation(
description = "Replaces the rating with the information sent in the request body. Any missing fields are deleted, unless they are required."
)
@io.swagger.v3.oas.annotations.Parameters(
value = {
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "documentFolderId"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(name = "DocumentFolder")
}
)
@jakarta.ws.rs.Consumes({"application/json", "application/xml"})
@jakarta.ws.rs.Path("/document-folders/{documentFolderId}/my-rating")
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@jakarta.ws.rs.PUT
@Override
public Rating putDocumentFolderMyRating(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("documentFolderId")
Long documentFolderId,
Rating rating)
throws Exception {
return new Rating();
}
/**
* Invoke this method with the command line:
*
* curl -X 'PUT' 'http://localhost:8080/o/headless-delivery/v1.0/document-folders/{documentFolderId}/permissions' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Parameters(
value = {
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "documentFolderId"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(name = "DocumentFolder")
}
)
@jakarta.ws.rs.Consumes({"application/json", "application/xml"})
@jakarta.ws.rs.Path("/document-folders/{documentFolderId}/permissions")
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@jakarta.ws.rs.PUT
@Override
public Page putDocumentFolderPermissionsPage(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("documentFolderId")
Long documentFolderId,
Permission[] permissions)
throws Exception {
String resourceName = getPermissionCheckerResourceName(
documentFolderId);
Long resourceId = getPermissionCheckerResourceId(documentFolderId);
PermissionServiceUtil.checkPermission(
getPermissionCheckerGroupId(documentFolderId), resourceName,
resourceId);
ModelPermissions modelPermissions =
ModelPermissionsUtil.toModelPermissions(
contextCompany.getCompanyId(), permissions, resourceId,
resourceName, resourceActionLocalService,
resourcePermissionLocalService, roleLocalService);
Collection roleNames = modelPermissions.getRoleNames();
for (ResourcePermission resourcePermission :
resourcePermissionLocalService.getResourcePermissions(
contextCompany.getCompanyId(), resourceName,
ResourceConstants.SCOPE_INDIVIDUAL,
String.valueOf(resourceId))) {
com.liferay.portal.kernel.model.Role role =
roleLocalService.fetchRole(resourcePermission.getRoleId());
if ((role == null) || roleNames.contains(role.getName())) {
continue;
}
for (ResourceAction resourceAction :
resourceActionLocalService.getResourceActions(
resourceName)) {
resourcePermissionLocalService.removeResourcePermission(
contextCompany.getCompanyId(), resourceName,
ResourceConstants.SCOPE_INDIVIDUAL,
String.valueOf(resourceId), role.getRoleId(),
resourceAction.getActionId());
}
}
resourcePermissionLocalService.updateResourcePermissions(
contextCompany.getCompanyId(),
getPermissionCheckerGroupId(documentFolderId), resourceName,
String.valueOf(resourceId), modelPermissions);
return toPermissionPage(
HashMapBuilder.put(
"get",
addAction(
ActionKeys.PERMISSIONS, "getDocumentFolderPermissionsPage",
resourceName, resourceId)
).put(
"replace",
addAction(
ActionKeys.PERMISSIONS, "putDocumentFolderPermissionsPage",
resourceName, resourceId)
).build(),
resourceId, resourceName, null);
}
/**
* Invoke this method with the command line:
*
* curl -X 'PUT' 'http://localhost:8080/o/headless-delivery/v1.0/document-folders/{documentFolderId}/subscribe' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Parameters(
value = {
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "documentFolderId"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(name = "DocumentFolder")
}
)
@jakarta.ws.rs.Path("/document-folders/{documentFolderId}/subscribe")
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@jakarta.ws.rs.PUT
@Override
public void putDocumentFolderSubscribe(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("documentFolderId")
Long documentFolderId)
throws Exception {
}
/**
* Invoke this method with the command line:
*
* curl -X 'PUT' 'http://localhost:8080/o/headless-delivery/v1.0/document-folders/{documentFolderId}/unsubscribe' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Parameters(
value = {
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "documentFolderId"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(name = "DocumentFolder")
}
)
@jakarta.ws.rs.Path("/document-folders/{documentFolderId}/unsubscribe")
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@jakarta.ws.rs.PUT
@Override
public void putDocumentFolderUnsubscribe(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("documentFolderId")
Long documentFolderId)
throws Exception {
}
/**
* Invoke this method with the command line:
*
* curl -X 'PUT' 'http://localhost:8080/o/headless-delivery/v1.0/sites/{siteId}/document-folders/permissions' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Parameters(
value = {
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "siteId"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(name = "DocumentFolder")
}
)
@jakarta.ws.rs.Consumes({"application/json", "application/xml"})
@jakarta.ws.rs.Path("/sites/{siteId}/document-folders/permissions")
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@jakarta.ws.rs.PUT
@Override
public Page putSiteDocumentFolderPermissionsPage(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("siteId")
Long siteId,
Permission[] permissions)
throws Exception {
String portletName = getPermissionCheckerPortletName(siteId);
PermissionServiceUtil.checkPermission(siteId, portletName, siteId);
ModelPermissions modelPermissions =
ModelPermissionsUtil.toModelPermissions(
contextCompany.getCompanyId(), permissions, siteId, portletName,
resourceActionLocalService, resourcePermissionLocalService,
roleLocalService);
Collection roleNames = modelPermissions.getRoleNames();
for (ResourcePermission resourcePermission :
resourcePermissionLocalService.getResourcePermissions(
contextCompany.getCompanyId(), portletName,
ResourceConstants.SCOPE_INDIVIDUAL,
String.valueOf(siteId))) {
com.liferay.portal.kernel.model.Role role =
roleLocalService.fetchRole(resourcePermission.getRoleId());
if ((role == null) || roleNames.contains(role.getName())) {
continue;
}
for (ResourceAction resourceAction :
resourceActionLocalService.getResourceActions(
portletName)) {
resourcePermissionLocalService.removeResourcePermission(
contextCompany.getCompanyId(), portletName,
ResourceConstants.SCOPE_INDIVIDUAL, String.valueOf(siteId),
role.getRoleId(), resourceAction.getActionId());
}
}
resourcePermissionLocalService.updateResourcePermissions(
contextCompany.getCompanyId(), siteId, portletName,
String.valueOf(siteId), modelPermissions);
return toPermissionPage(
HashMapBuilder.put(
"get",
addAction(
ActionKeys.PERMISSIONS,
"getSiteDocumentFolderPermissionsPage", portletName, siteId)
).put(
"replace",
addAction(
ActionKeys.PERMISSIONS,
"putSiteDocumentFolderPermissionsPage", portletName, siteId)
).build(),
siteId, portletName, null);
}
/**
* Invoke this method with the command line:
*
* curl -X 'PUT' 'http://localhost:8080/o/headless-delivery/v1.0/sites/{siteId}/documents-folder/by-external-reference-code/{externalReferenceCode}' -d $'{"customFields": ___, "description": ___, "externalReferenceCode": ___, "name": ___, "parentDocumentFolderId": ___, "viewableBy": ___}' --header 'Content-Type: application/json' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Operation(
description = "Replaces the document folder by external reference code with the information sent in the request body, or replaces it if it not exists."
)
@io.swagger.v3.oas.annotations.Parameters(
value = {
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "siteId"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "externalReferenceCode"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(name = "DocumentFolder")
}
)
@jakarta.ws.rs.Consumes({"application/json", "application/xml"})
@jakarta.ws.rs.Path(
"/sites/{siteId}/documents-folder/by-external-reference-code/{externalReferenceCode}"
)
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@jakarta.ws.rs.PUT
@Override
public DocumentFolder putSiteDocumentsFolderByExternalReferenceCode(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("siteId")
Long siteId,
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("externalReferenceCode")
String externalReferenceCode,
DocumentFolder documentFolder)
throws Exception {
return new DocumentFolder();
}
@Override
@SuppressWarnings("PMD.UnusedLocalVariable")
public void create(
Collection documentFolders,
Map parameters)
throws Exception {
UnsafeFunction
documentFolderUnsafeFunction = null;
String createStrategy = (String)parameters.getOrDefault(
"createStrategy", "INSERT");
if (StringUtil.equalsIgnoreCase(createStrategy, "INSERT")) {
if (parameters.containsKey("assetLibraryId")) {
documentFolderUnsafeFunction =
documentFolder -> postAssetLibraryDocumentFolder(
(Long)parameters.get("assetLibraryId"), documentFolder);
}
else if (parameters.containsKey("siteId")) {
documentFolderUnsafeFunction =
documentFolder -> postSiteDocumentFolder(
(Long)parameters.get("siteId"), documentFolder);
}
else {
throw new NotSupportedException(
"One of the following parameters must be specified: [assetLibraryId, siteId]");
}
}
if (documentFolderUnsafeFunction == null) {
throw new NotSupportedException(
"Create strategy \"" + createStrategy +
"\" is not supported for DocumentFolder");
}
if (contextBatchUnsafeBiConsumer != null) {
contextBatchUnsafeBiConsumer.accept(
documentFolders, documentFolderUnsafeFunction);
}
else if (contextBatchUnsafeConsumer != null) {
contextBatchUnsafeConsumer.accept(
documentFolders, documentFolderUnsafeFunction::apply);
}
else {
for (DocumentFolder documentFolder : documentFolders) {
documentFolderUnsafeFunction.apply(documentFolder);
}
}
}
@Override
public void delete(
Collection documentFolders,
Map parameters)
throws Exception {
UnsafeFunction
documentFolderUnsafeFunction = documentFolder -> {
deleteDocumentFolder(documentFolder.getId());
return documentFolder;
};
if (contextBatchUnsafeBiConsumer != null) {
contextBatchUnsafeBiConsumer.accept(
documentFolders, documentFolderUnsafeFunction);
}
else if (contextBatchUnsafeConsumer != null) {
contextBatchUnsafeConsumer.accept(
documentFolders, documentFolderUnsafeFunction::apply);
}
else {
for (DocumentFolder documentFolder : documentFolders) {
documentFolderUnsafeFunction.apply(documentFolder);
}
}
}
public Set getAvailableCreateStrategies() {
return SetUtil.fromArray("INSERT");
}
public Set getAvailableUpdateStrategies() {
return SetUtil.fromArray("PARTIAL_UPDATE", "UPDATE");
}
@Override
public EntityModel getEntityModel(Map> multivaluedMap)
throws Exception {
return getEntityModel(
new MultivaluedHashMap(multivaluedMap));
}
@Override
public EntityModel getEntityModel(MultivaluedMap multivaluedMap)
throws Exception {
return null;
}
public String getResourceName() {
return "DocumentFolder";
}
public String getVersion() {
return "v1.0";
}
@Override
public Page read(
com.liferay.portal.kernel.search.filter.Filter filter,
Pagination pagination,
com.liferay.portal.kernel.search.Sort[] sorts,
Map parameters, String search)
throws Exception {
if (parameters.containsKey("assetLibraryId")) {
return getAssetLibraryDocumentFoldersPage(
(Long)parameters.get("assetLibraryId"),
_parseBoolean((String)parameters.get("flatten")), search, null,
filter, pagination, sorts);
}
else if (parameters.containsKey("siteId")) {
return getSiteDocumentFoldersPage(
(Long)parameters.get("siteId"),
_parseBoolean((String)parameters.get("flatten")), search, null,
filter, pagination, sorts);
}
else {
throw new NotSupportedException(
"One of the following parameters must be specified: [assetLibraryId, siteId]");
}
}
@Override
public void setLanguageId(String languageId) {
this.contextAcceptLanguage = new AcceptLanguage() {
@Override
public List getLocales() {
return null;
}
@Override
public String getPreferredLanguageId() {
return languageId;
}
@Override
public Locale getPreferredLocale() {
return LocaleUtil.fromLanguageId(languageId);
}
};
}
@Override
public void update(
Collection documentFolders,
Map parameters)
throws Exception {
UnsafeFunction
documentFolderUnsafeFunction = null;
String updateStrategy = (String)parameters.getOrDefault(
"updateStrategy", "UPDATE");
if (StringUtil.equalsIgnoreCase(updateStrategy, "PARTIAL_UPDATE")) {
documentFolderUnsafeFunction =
documentFolder -> patchDocumentFolder(
documentFolder.getId(), documentFolder);
}
if (StringUtil.equalsIgnoreCase(updateStrategy, "UPDATE")) {
documentFolderUnsafeFunction = documentFolder -> putDocumentFolder(
documentFolder.getId(), documentFolder);
}
if (documentFolderUnsafeFunction == null) {
throw new NotSupportedException(
"Update strategy \"" + updateStrategy +
"\" is not supported for DocumentFolder");
}
if (contextBatchUnsafeBiConsumer != null) {
contextBatchUnsafeBiConsumer.accept(
documentFolders, documentFolderUnsafeFunction);
}
else if (contextBatchUnsafeConsumer != null) {
contextBatchUnsafeConsumer.accept(
documentFolders, documentFolderUnsafeFunction::apply);
}
else {
for (DocumentFolder documentFolder : documentFolders) {
documentFolderUnsafeFunction.apply(documentFolder);
}
}
}
private Boolean _parseBoolean(String value) {
if (value != null) {
return Boolean.parseBoolean(value);
}
return null;
}
@Override
public DocumentFolder getItem(Long id) throws Exception {
return getDocumentFolder(id);
}
protected String getPermissionCheckerActionsResourceName(Object id)
throws Exception {
return getPermissionCheckerResourceName(id);
}
protected Long getPermissionCheckerGroupId(Object id) throws Exception {
throw new UnsupportedOperationException(
"This method needs to be implemented");
}
protected String getPermissionCheckerPortletName(Object id)
throws Exception {
throw new UnsupportedOperationException(
"This method needs to be implemented");
}
protected Long getPermissionCheckerResourceId(Object id) throws Exception {
return GetterUtil.getLong(id);
}
protected String getPermissionCheckerResourceName(Object id)
throws Exception {
throw new UnsupportedOperationException(
"This method needs to be implemented");
}
protected Page toPermissionPage(
Map> actions, long id,
String resourceName, String roleNames)
throws Exception {
List resourceActions =
resourceActionLocalService.getResourceActions(resourceName);
if (Validator.isNotNull(roleNames)) {
return Page.of(
actions,
_getPermissions(
contextCompany.getCompanyId(), resourceActions, id,
resourceName, StringUtil.split(roleNames)));
}
return Page.of(
actions,
_getPermissions(
contextCompany.getCompanyId(), resourceActions, id,
resourceName, null));
}
/**
* @see com.liferay.portal.vulcan.permission.PermissionUtil#getPermissions(long, List, long, String, String[])
*/
private Collection _getPermissions(
long companyId, List resourceActions,
long resourceId, String resourceName, String[] roleNames)
throws Exception {
Map permissions = new HashMap<>();
int count = resourcePermissionLocalService.getResourcePermissionsCount(
companyId, resourceName, ResourceConstants.SCOPE_INDIVIDUAL,
String.valueOf(resourceId));
if (count == 0) {
ResourceLocalServiceUtil.addResources(
companyId, resourceId, 0, resourceName,
String.valueOf(resourceId), false, true, true);
}
List actionIds = transform(
resourceActions, resourceAction -> resourceAction.getActionId());
Set resourcePermissions = new HashSet<>();
resourcePermissions.addAll(
resourcePermissionLocalService.getResourcePermissions(
companyId, resourceName, ResourceConstants.SCOPE_COMPANY,
String.valueOf(companyId)));
resourcePermissions.addAll(
resourcePermissionLocalService.getResourcePermissions(
companyId, resourceName, ResourceConstants.SCOPE_GROUP,
String.valueOf(GroupThreadLocal.getGroupId())));
resourcePermissions.addAll(
resourcePermissionLocalService.getResourcePermissions(
companyId, resourceName, ResourceConstants.SCOPE_GROUP_TEMPLATE,
"0"));
resourcePermissions.addAll(
resourcePermissionLocalService.getResourcePermissions(
companyId, resourceName, ResourceConstants.SCOPE_INDIVIDUAL,
String.valueOf(resourceId)));
List resources = transform(
resourcePermissions,
resourcePermission -> ResourceLocalServiceUtil.getResource(
resourcePermission.getCompanyId(), resourcePermission.getName(),
resourcePermission.getScope(),
resourcePermission.getPrimKey()));
Set roles = new HashSet<>();
if (roleNames != null) {
for (String roleName : roleNames) {
roles.add(roleLocalService.getRole(companyId, roleName));
}
}
else {
for (ResourcePermission resourcePermission : resourcePermissions) {
com.liferay.portal.kernel.model.Role role =
roleLocalService.getRole(resourcePermission.getRoleId());
roles.add(role);
}
}
for (com.liferay.portal.kernel.model.Role role : roles) {
Set actionsIdsSet = new HashSet<>();
for (Resource resource : resources) {
actionsIdsSet.addAll(
resourcePermissionLocalService.
getAvailableResourcePermissionActionIds(
resource.getCompanyId(), resource.getName(),
ResourceConstants.SCOPE_COMPANY,
String.valueOf(resource.getCompanyId()),
role.getRoleId(), actionIds));
actionsIdsSet.addAll(
resourcePermissionLocalService.
getAvailableResourcePermissionActionIds(
resource.getCompanyId(), resource.getName(),
ResourceConstants.SCOPE_GROUP,
String.valueOf(GroupThreadLocal.getGroupId()),
role.getRoleId(), actionIds));
actionsIdsSet.addAll(
resourcePermissionLocalService.
getAvailableResourcePermissionActionIds(
resource.getCompanyId(), resource.getName(),
ResourceConstants.SCOPE_GROUP_TEMPLATE, "0",
role.getRoleId(), actionIds));
actionsIdsSet.addAll(
resourcePermissionLocalService.
getAvailableResourcePermissionActionIds(
resource.getCompanyId(), resource.getName(),
resource.getScope(), resource.getPrimKey(),
role.getRoleId(), actionIds));
}
if (actionsIdsSet.isEmpty()) {
continue;
}
Permission permission = new Permission() {
{
actionIds = actionsIdsSet.toArray(new String[0]);
roleName = role.getName();
}
};
permissions.put(role.getName(), permission);
}
return permissions.values();
}
public void setContextAcceptLanguage(AcceptLanguage contextAcceptLanguage) {
this.contextAcceptLanguage = contextAcceptLanguage;
}
public void setContextBatchUnsafeBiConsumer(
UnsafeBiConsumer
,
UnsafeFunction,
Exception> contextBatchUnsafeBiConsumer) {
this.contextBatchUnsafeBiConsumer = contextBatchUnsafeBiConsumer;
}
public void setContextBatchUnsafeConsumer(
UnsafeBiConsumer
,
UnsafeConsumer, Exception>
contextBatchUnsafeConsumer) {
this.contextBatchUnsafeConsumer = contextBatchUnsafeConsumer;
}
public void setContextCompany(
com.liferay.portal.kernel.model.Company contextCompany) {
this.contextCompany = contextCompany;
}
public void setContextHttpServletRequest(
HttpServletRequest contextHttpServletRequest) {
this.contextHttpServletRequest = contextHttpServletRequest;
}
public void setContextHttpServletResponse(
HttpServletResponse contextHttpServletResponse) {
this.contextHttpServletResponse = contextHttpServletResponse;
}
public void setContextUriInfo(UriInfo contextUriInfo) {
this.contextUriInfo = UriInfoUtil.getVulcanUriInfo(
getApplicationPath(), contextUriInfo);
}
public void setContextUser(
com.liferay.portal.kernel.model.User contextUser) {
this.contextUser = contextUser;
}
public void setExpressionConvert(
ExpressionConvert
expressionConvert) {
this.expressionConvert = expressionConvert;
}
public void setFilterParserProvider(
FilterParserProvider filterParserProvider) {
this.filterParserProvider = filterParserProvider;
}
public void setGroupLocalService(GroupLocalService groupLocalService) {
this.groupLocalService = groupLocalService;
}
public void setResourceActionLocalService(
ResourceActionLocalService resourceActionLocalService) {
this.resourceActionLocalService = resourceActionLocalService;
}
public void setResourcePermissionLocalService(
ResourcePermissionLocalService resourcePermissionLocalService) {
this.resourcePermissionLocalService = resourcePermissionLocalService;
}
public void setRoleLocalService(RoleLocalService roleLocalService) {
this.roleLocalService = roleLocalService;
}
public void setSortParserProvider(SortParserProvider sortParserProvider) {
this.sortParserProvider = sortParserProvider;
}
protected String getApplicationPath() {
return "headless-delivery";
}
public void setVulcanBatchEngineExportTaskResource(
VulcanBatchEngineExportTaskResource
vulcanBatchEngineExportTaskResource) {
this.vulcanBatchEngineExportTaskResource =
vulcanBatchEngineExportTaskResource;
}
public void setVulcanBatchEngineImportTaskResource(
VulcanBatchEngineImportTaskResource
vulcanBatchEngineImportTaskResource) {
this.vulcanBatchEngineImportTaskResource =
vulcanBatchEngineImportTaskResource;
}
@Override
public com.liferay.portal.kernel.search.filter.Filter toFilter(
String filterString, Map> multivaluedMap) {
try {
EntityModel entityModel = getEntityModel(multivaluedMap);
FilterParser filterParser = filterParserProvider.provide(
entityModel);
com.liferay.portal.odata.filter.Filter oDataFilter =
new com.liferay.portal.odata.filter.Filter(
filterParser.parse(filterString));
return expressionConvert.convert(
oDataFilter.getExpression(),
contextAcceptLanguage.getPreferredLocale(), entityModel);
}
catch (Exception exception) {
_log.error("Invalid filter " + filterString, exception);
return null;
}
}
@Override
public com.liferay.portal.kernel.search.Sort[] toSorts(String sortString) {
if (Validator.isNull(sortString)) {
return null;
}
try {
SortParser sortParser = sortParserProvider.provide(
getEntityModel(Collections.emptyMap()));
if (sortParser == null) {
return null;
}
com.liferay.portal.odata.sort.Sort oDataSort =
new com.liferay.portal.odata.sort.Sort(
sortParser.parse(sortString));
List sortFields = oDataSort.getSortFields();
com.liferay.portal.kernel.search.Sort[] sorts =
new com.liferay.portal.kernel.search.Sort[sortFields.size()];
for (int i = 0; i < sortFields.size(); i++) {
SortField sortField = sortFields.get(i);
sorts[i] = new com.liferay.portal.kernel.search.Sort(
sortField.getSortableFieldName(
contextAcceptLanguage.getPreferredLocale()),
!sortField.isAscending());
}
return sorts;
}
catch (Exception exception) {
_log.error("Invalid sort " + sortString, exception);
return new com.liferay.portal.kernel.search.Sort[0];
}
}
protected Map addAction(
String actionName,
com.liferay.portal.kernel.model.GroupedModel groupedModel,
String methodName) {
return ActionUtil.addAction(
actionName, getClass(), groupedModel, methodName,
contextScopeChecker, contextUriInfo);
}
protected Map addAction(
String actionName, Long id, String methodName, Long ownerId,
String permissionName, Long siteId) {
return ActionUtil.addAction(
actionName, getClass(), id, methodName, contextScopeChecker,
ownerId, permissionName, siteId, contextUriInfo);
}
protected Map addAction(
String actionName, Long id, String methodName,
ModelResourcePermission modelResourcePermission) {
return ActionUtil.addAction(
actionName, getClass(), id, methodName, contextScopeChecker,
modelResourcePermission, contextUriInfo);
}
protected Map addAction(
String actionName, String methodName, String permissionName,
Long siteId) {
return addAction(
actionName, siteId, methodName, null, permissionName, siteId);
}
protected void preparePatch(
DocumentFolder documentFolder, DocumentFolder existingDocumentFolder) {
}
protected List transform(
Collection collection, UnsafeFunction unsafeFunction) {
return TransformUtil.transform(collection, unsafeFunction);
}
protected R[] transform(
T[] array, UnsafeFunction unsafeFunction,
Class extends R> clazz) {
return TransformUtil.transform(array, unsafeFunction, clazz);
}
protected R[] transformToArray(
Collection collection, UnsafeFunction unsafeFunction,
Class extends R> clazz) {
return TransformUtil.transformToArray(
collection, unsafeFunction, clazz);
}
protected List transformToList(
T[] array, UnsafeFunction unsafeFunction) {
return TransformUtil.transformToList(array, unsafeFunction);
}
protected long[] transformToLongArray(
Collection collection, UnsafeFunction unsafeFunction) {
return TransformUtil.transformToLongArray(collection, unsafeFunction);
}
protected List unsafeTransform(
Collection collection, UnsafeFunction unsafeFunction)
throws E {
return TransformUtil.unsafeTransform(collection, unsafeFunction);
}
protected R[] unsafeTransform(
T[] array, UnsafeFunction unsafeFunction,
Class extends R> clazz)
throws E {
return TransformUtil.unsafeTransform(array, unsafeFunction, clazz);
}
protected R[] unsafeTransformToArray(
Collection collection, UnsafeFunction unsafeFunction,
Class extends R> clazz)
throws E {
return TransformUtil.unsafeTransformToArray(
collection, unsafeFunction, clazz);
}
protected List unsafeTransformToList(
T[] array, UnsafeFunction unsafeFunction)
throws E {
return TransformUtil.unsafeTransformToList(array, unsafeFunction);
}
protected long[] unsafeTransformToLongArray(
Collection collection, UnsafeFunction unsafeFunction)
throws E {
return TransformUtil.unsafeTransformToLongArray(
collection, unsafeFunction);
}
protected AcceptLanguage contextAcceptLanguage;
protected UnsafeBiConsumer
,
UnsafeFunction, Exception>
contextBatchUnsafeBiConsumer;
protected UnsafeBiConsumer
, UnsafeConsumer,
Exception> contextBatchUnsafeConsumer;
protected com.liferay.portal.kernel.model.Company contextCompany;
protected HttpServletRequest contextHttpServletRequest;
protected HttpServletResponse contextHttpServletResponse;
protected Object contextScopeChecker;
protected UriInfo contextUriInfo;
protected com.liferay.portal.kernel.model.User contextUser;
protected ExpressionConvert
expressionConvert;
protected FilterParserProvider filterParserProvider;
protected GroupLocalService groupLocalService;
protected ResourceActionLocalService resourceActionLocalService;
protected ResourcePermissionLocalService resourcePermissionLocalService;
protected RoleLocalService roleLocalService;
protected SortParserProvider sortParserProvider;
protected VulcanBatchEngineExportTaskResource
vulcanBatchEngineExportTaskResource;
protected VulcanBatchEngineImportTaskResource
vulcanBatchEngineImportTaskResource;
private static final com.liferay.portal.kernel.log.Log _log =
LogFactoryUtil.getLog(BaseDocumentFolderResourceImpl.class);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy