
com.liferay.headless.delivery.internal.resource.v1_0.BaseStructuredContentFolderResourceImpl 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.StructuredContentFolder;
import com.liferay.headless.delivery.resource.v1_0.StructuredContentFolderResource;
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.exception.NoSuchModelException;
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 BaseStructuredContentFolderResourceImpl
implements EntityModelResource, StructuredContentFolderResource,
VulcanBatchEngineTaskItemDelegate,
VulcanCRUDItemDelegate {
/**
* Invoke this method with the command line:
*
* curl -X 'DELETE' 'http://localhost:8080/o/headless-delivery/v1.0/asset-libraries/{assetLibraryId}/structured-content-folders/by-external-reference-code/{externalReferenceCode}' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Operation(
description = "Deletes the asset library's structured content 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 = "assetLibraryId"
),
@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 = "StructuredContentFolder"
)
}
)
@jakarta.ws.rs.DELETE
@jakarta.ws.rs.Path(
"/asset-libraries/{assetLibraryId}/structured-content-folders/by-external-reference-code/{externalReferenceCode}"
)
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@Override
public void
deleteAssetLibraryStructuredContentFolderByExternalReferenceCode(
@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.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("externalReferenceCode")
String externalReferenceCode)
throws Exception {
}
/**
* Invoke this method with the command line:
*
* curl -X 'DELETE' 'http://localhost:8080/o/headless-delivery/v1.0/sites/{siteId}/structured-content-folders/by-external-reference-code/{externalReferenceCode}' -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.PATH,
name = "externalReferenceCode"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(
name = "StructuredContentFolder"
)
}
)
@jakarta.ws.rs.DELETE
@jakarta.ws.rs.Path(
"/sites/{siteId}/structured-content-folders/by-external-reference-code/{externalReferenceCode}"
)
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@Override
public void deleteSiteStructuredContentFolderByExternalReferenceCode(
@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 'DELETE' 'http://localhost:8080/o/headless-delivery/v1.0/structured-content-folders/{structuredContentFolderId}' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Operation(
description = "Deletes the structured content 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 = "structuredContentFolderId"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(
name = "StructuredContentFolder"
)
}
)
@jakarta.ws.rs.DELETE
@jakarta.ws.rs.Path(
"/structured-content-folders/{structuredContentFolderId}"
)
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@Override
public void deleteStructuredContentFolder(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("structuredContentFolderId")
Long structuredContentFolderId)
throws Exception {
}
/**
* Invoke this method with the command line:
*
* curl -X 'DELETE' 'http://localhost:8080/o/headless-delivery/v1.0/structured-content-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 = "StructuredContentFolder"
)
}
)
@jakarta.ws.rs.Consumes("application/json")
@jakarta.ws.rs.DELETE
@jakarta.ws.rs.Path("/structured-content-folders/batch")
@jakarta.ws.rs.Produces("application/json")
@Override
public Response deleteStructuredContentFolderBatch(
@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(
StructuredContentFolder.class.getName(), callbackURL, object)
).build();
}
/**
* Invoke this method with the command line:
*
* curl -X 'GET' 'http://localhost:8080/o/headless-delivery/v1.0/asset-libraries/{assetLibraryId}/structured-content-folders/by-external-reference-code/{externalReferenceCode}' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Operation(
description = "Retrieves the asset library's structured content 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 = "assetLibraryId"
),
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "externalReferenceCode"
),
@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 = "StructuredContentFolder"
)
}
)
@jakarta.ws.rs.GET
@jakarta.ws.rs.Path(
"/asset-libraries/{assetLibraryId}/structured-content-folders/by-external-reference-code/{externalReferenceCode}"
)
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@Override
public StructuredContentFolder
getAssetLibraryStructuredContentFolderByExternalReferenceCode(
@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.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("externalReferenceCode")
String externalReferenceCode)
throws Exception {
return new StructuredContentFolder();
}
/**
* Invoke this method with the command line:
*
* curl -X 'GET' 'http://localhost:8080/o/headless-delivery/v1.0/asset-libraries/{assetLibraryId}/structured-content-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 = "StructuredContentFolder"
)
}
)
@jakarta.ws.rs.GET
@jakarta.ws.rs.Path(
"/asset-libraries/{assetLibraryId}/structured-content-folders/permissions"
)
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@Override
public Page
getAssetLibraryStructuredContentFolderPermissionsPage(
@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,
"getAssetLibraryStructuredContentFolderPermissionsPage",
portletName, assetLibraryId)
).put(
"replace",
addAction(
ActionKeys.PERMISSIONS,
"putAssetLibraryStructuredContentFolderPermissionsPage",
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}/structured-content-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 = "StructuredContentFolder"
)
}
)
@jakarta.ws.rs.GET
@jakarta.ws.rs.Path(
"/asset-libraries/{assetLibraryId}/structured-content-folders"
)
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@Override
public Page
getAssetLibraryStructuredContentFoldersPage(
@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/sites/{siteId}/structured-content-folders/by-external-reference-code/{externalReferenceCode}' -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.PATH,
name = "externalReferenceCode"
),
@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 = "StructuredContentFolder"
)
}
)
@jakarta.ws.rs.GET
@jakarta.ws.rs.Path(
"/sites/{siteId}/structured-content-folders/by-external-reference-code/{externalReferenceCode}"
)
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@Override
public StructuredContentFolder
getSiteStructuredContentFolderByExternalReferenceCode(
@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 StructuredContentFolder();
}
/**
* Invoke this method with the command line:
*
* curl -X 'GET' 'http://localhost:8080/o/headless-delivery/v1.0/sites/{siteId}/structured-content-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 = "StructuredContentFolder"
)
}
)
@jakarta.ws.rs.GET
@jakarta.ws.rs.Path(
"/sites/{siteId}/structured-content-folders/permissions"
)
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@Override
public Page getSiteStructuredContentFolderPermissionsPage(
@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,
"getSiteStructuredContentFolderPermissionsPage",
portletName, siteId)
).put(
"replace",
addAction(
ActionKeys.PERMISSIONS,
"putSiteStructuredContentFolderPermissionsPage",
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}/structured-content-folders' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Operation(
description = "Retrieves the site's structured content 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 = "StructuredContentFolder"
)
}
)
@jakarta.ws.rs.GET
@jakarta.ws.rs.Path("/sites/{siteId}/structured-content-folders")
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@Override
public Page getSiteStructuredContentFoldersPage(
@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/structured-content-folders/{structuredContentFolderId}' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Operation(
description = "Retrieves the structured content folder."
)
@io.swagger.v3.oas.annotations.Parameters(
value = {
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "structuredContentFolderId"
),
@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 = "StructuredContentFolder"
)
}
)
@jakarta.ws.rs.GET
@jakarta.ws.rs.Path(
"/structured-content-folders/{structuredContentFolderId}"
)
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@Override
public StructuredContentFolder getStructuredContentFolder(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("structuredContentFolderId")
Long structuredContentFolderId)
throws Exception {
return new StructuredContentFolder();
}
/**
* Invoke this method with the command line:
*
* curl -X 'GET' 'http://localhost:8080/o/headless-delivery/v1.0/structured-content-folder/{structuredContentFolderId}/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 = "structuredContentFolderId"
),
@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 = "StructuredContentFolder"
)
}
)
@jakarta.ws.rs.GET
@jakarta.ws.rs.Path(
"/structured-content-folder/{structuredContentFolderId}/permissions"
)
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@Override
public Page getStructuredContentFolderPermissionsPage(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("structuredContentFolderId")
Long structuredContentFolderId,
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.ws.rs.QueryParam("roleNames")
String roleNames)
throws Exception {
String resourceName = getPermissionCheckerResourceName(
structuredContentFolderId);
Long resourceId = getPermissionCheckerResourceId(
structuredContentFolderId);
PermissionServiceUtil.checkPermission(
getPermissionCheckerGroupId(structuredContentFolderId),
resourceName, resourceId);
return toPermissionPage(
HashMapBuilder.put(
"get",
addAction(
ActionKeys.PERMISSIONS,
"getStructuredContentFolderPermissionsPage", resourceName,
resourceId)
).put(
"replace",
addAction(
ActionKeys.PERMISSIONS,
"putStructuredContentFolderPermissionsPage", resourceName,
resourceId)
).build(),
resourceId, resourceName, roleNames);
}
/**
* Invoke this method with the command line:
*
* curl -X 'GET' 'http://localhost:8080/o/headless-delivery/v1.0/structured-content-folders/{parentStructuredContentFolderId}/structured-content-folders' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Operation(
description = "Retrieves the parent structured content 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 = "parentStructuredContentFolderId"
),
@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 = "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 = "StructuredContentFolder"
)
}
)
@jakarta.ws.rs.GET
@jakarta.ws.rs.Path(
"/structured-content-folders/{parentStructuredContentFolderId}/structured-content-folders"
)
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@Override
public Page
getStructuredContentFolderStructuredContentFoldersPage(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("parentStructuredContentFolderId")
Long parentStructuredContentFolderId,
@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 'PATCH' 'http://localhost:8080/o/headless-delivery/v1.0/structured-content-folders/{structuredContentFolderId}' -d $'{"customFields": ___, "description": ___, "externalReferenceCode": ___, "name": ___, "parentStructuredContentFolderId": ___, "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, leaving any other fields untouched."
)
@io.swagger.v3.oas.annotations.Parameters(
value = {
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "structuredContentFolderId"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(
name = "StructuredContentFolder"
)
}
)
@jakarta.ws.rs.Consumes({"application/json", "application/xml"})
@jakarta.ws.rs.PATCH
@jakarta.ws.rs.Path(
"/structured-content-folders/{structuredContentFolderId}"
)
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@Override
public StructuredContentFolder patchStructuredContentFolder(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("structuredContentFolderId")
Long structuredContentFolderId,
StructuredContentFolder structuredContentFolder)
throws Exception {
StructuredContentFolder existingStructuredContentFolder =
getStructuredContentFolder(structuredContentFolderId);
if (structuredContentFolder.getCustomFields() != null) {
existingStructuredContentFolder.setCustomFields(
structuredContentFolder.getCustomFields());
}
if (structuredContentFolder.getDescription() != null) {
existingStructuredContentFolder.setDescription(
structuredContentFolder.getDescription());
}
if (structuredContentFolder.getExternalReferenceCode() != null) {
existingStructuredContentFolder.setExternalReferenceCode(
structuredContentFolder.getExternalReferenceCode());
}
if (structuredContentFolder.getName() != null) {
existingStructuredContentFolder.setName(
structuredContentFolder.getName());
}
if (structuredContentFolder.getParentStructuredContentFolderId() !=
null) {
existingStructuredContentFolder.setParentStructuredContentFolderId(
structuredContentFolder.getParentStructuredContentFolderId());
}
if (structuredContentFolder.getViewableBy() != null) {
existingStructuredContentFolder.setViewableBy(
structuredContentFolder.getViewableBy());
}
preparePatch(structuredContentFolder, existingStructuredContentFolder);
return putStructuredContentFolder(
structuredContentFolderId, existingStructuredContentFolder);
}
/**
* Invoke this method with the command line:
*
* curl -X 'POST' 'http://localhost:8080/o/headless-delivery/v1.0/asset-libraries/{assetLibraryId}/structured-content-folders' -d $'{"customFields": ___, "description": ___, "externalReferenceCode": ___, "name": ___, "parentStructuredContentFolderId": ___, "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 = "StructuredContentFolder"
)
}
)
@jakarta.ws.rs.Consumes({"application/json", "application/xml"})
@jakarta.ws.rs.Path(
"/asset-libraries/{assetLibraryId}/structured-content-folders"
)
@jakarta.ws.rs.POST
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@Override
public StructuredContentFolder postAssetLibraryStructuredContentFolder(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("assetLibraryId")
Long assetLibraryId,
StructuredContentFolder structuredContentFolder)
throws Exception {
return new StructuredContentFolder();
}
/**
* Invoke this method with the command line:
*
* curl -X 'POST' 'http://localhost:8080/o/headless-delivery/v1.0/asset-libraries/{assetLibraryId}/structured-content-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 = "StructuredContentFolder"
)
}
)
@jakarta.ws.rs.Consumes("application/json")
@jakarta.ws.rs.Path(
"/asset-libraries/{assetLibraryId}/structured-content-folders/batch"
)
@jakarta.ws.rs.POST
@jakarta.ws.rs.Produces("application/json")
@Override
public Response postAssetLibraryStructuredContentFolderBatch(
@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(
StructuredContentFolder.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}/structured-content-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 = "StructuredContentFolder"
)
}
)
@jakarta.ws.rs.Consumes("application/json")
@jakarta.ws.rs.Path(
"/asset-libraries/{assetLibraryId}/structured-content-folders/export-batch"
)
@jakarta.ws.rs.POST
@jakarta.ws.rs.Produces("application/json")
@Override
public Response postAssetLibraryStructuredContentFoldersPageExportBatch(
@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(
StructuredContentFolder.class.getName(), callbackURL,
contentType, fieldNames)
).build();
}
/**
* Invoke this method with the command line:
*
* curl -X 'POST' 'http://localhost:8080/o/headless-delivery/v1.0/sites/{siteId}/structured-content-folders' -d $'{"customFields": ___, "description": ___, "externalReferenceCode": ___, "name": ___, "parentStructuredContentFolderId": ___, "viewableBy": ___}' --header 'Content-Type: application/json' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Operation(
description = "Creates a new structured content 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 = "StructuredContentFolder"
)
}
)
@jakarta.ws.rs.Consumes({"application/json", "application/xml"})
@jakarta.ws.rs.Path("/sites/{siteId}/structured-content-folders")
@jakarta.ws.rs.POST
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@Override
public StructuredContentFolder postSiteStructuredContentFolder(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("siteId")
Long siteId,
StructuredContentFolder structuredContentFolder)
throws Exception {
return new StructuredContentFolder();
}
/**
* Invoke this method with the command line:
*
* curl -X 'POST' 'http://localhost:8080/o/headless-delivery/v1.0/sites/{siteId}/structured-content-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 = "StructuredContentFolder"
)
}
)
@jakarta.ws.rs.Consumes("application/json")
@jakarta.ws.rs.Path("/sites/{siteId}/structured-content-folders/batch")
@jakarta.ws.rs.POST
@jakarta.ws.rs.Produces("application/json")
@Override
public Response postSiteStructuredContentFolderBatch(
@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(
StructuredContentFolder.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}/structured-content-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 = "StructuredContentFolder"
)
}
)
@jakarta.ws.rs.Consumes("application/json")
@jakarta.ws.rs.Path(
"/sites/{siteId}/structured-content-folders/export-batch"
)
@jakarta.ws.rs.POST
@jakarta.ws.rs.Produces("application/json")
@Override
public Response postSiteStructuredContentFoldersPageExportBatch(
@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(
StructuredContentFolder.class.getName(), callbackURL,
contentType, fieldNames)
).build();
}
/**
* Invoke this method with the command line:
*
* curl -X 'POST' 'http://localhost:8080/o/headless-delivery/v1.0/structured-content-folders/{parentStructuredContentFolderId}/structured-content-folders' -d $'{"customFields": ___, "description": ___, "externalReferenceCode": ___, "name": ___, "parentStructuredContentFolderId": ___, "viewableBy": ___}' --header 'Content-Type: application/json' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Operation(
description = "Creates a new structured content folder in an existing folder."
)
@io.swagger.v3.oas.annotations.Parameters(
value = {
@io.swagger.v3.oas.annotations.Parameter(
in = io.swagger.v3.oas.annotations.enums.ParameterIn.PATH,
name = "parentStructuredContentFolderId"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(
name = "StructuredContentFolder"
)
}
)
@jakarta.ws.rs.Consumes({"application/json", "application/xml"})
@jakarta.ws.rs.Path(
"/structured-content-folders/{parentStructuredContentFolderId}/structured-content-folders"
)
@jakarta.ws.rs.POST
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@Override
public StructuredContentFolder
postStructuredContentFolderStructuredContentFolder(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("parentStructuredContentFolderId")
Long parentStructuredContentFolderId,
StructuredContentFolder structuredContentFolder)
throws Exception {
return new StructuredContentFolder();
}
/**
* Invoke this method with the command line:
*
* curl -X 'PUT' 'http://localhost:8080/o/headless-delivery/v1.0/asset-libraries/{assetLibraryId}/structured-content-folders/by-external-reference-code/{externalReferenceCode}' -d $'{"customFields": ___, "description": ___, "externalReferenceCode": ___, "name": ___, "parentStructuredContentFolderId": ___, "viewableBy": ___}' --header 'Content-Type: application/json' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Operation(
description = "Updates the asset library's structured content folder with the given external reference code, or creates 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 = "assetLibraryId"
),
@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 = "StructuredContentFolder"
)
}
)
@jakarta.ws.rs.Consumes({"application/json", "application/xml"})
@jakarta.ws.rs.Path(
"/asset-libraries/{assetLibraryId}/structured-content-folders/by-external-reference-code/{externalReferenceCode}"
)
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@jakarta.ws.rs.PUT
@Override
public StructuredContentFolder
putAssetLibraryStructuredContentFolderByExternalReferenceCode(
@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.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("externalReferenceCode")
String externalReferenceCode,
StructuredContentFolder structuredContentFolder)
throws Exception {
return new StructuredContentFolder();
}
/**
* Invoke this method with the command line:
*
* curl -X 'PUT' 'http://localhost:8080/o/headless-delivery/v1.0/asset-libraries/{assetLibraryId}/structured-content-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 = "StructuredContentFolder"
)
}
)
@jakarta.ws.rs.Consumes({"application/json", "application/xml"})
@jakarta.ws.rs.Path(
"/asset-libraries/{assetLibraryId}/structured-content-folders/permissions"
)
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@jakarta.ws.rs.PUT
@Override
public Page
putAssetLibraryStructuredContentFolderPermissionsPage(
@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,
"getAssetLibraryStructuredContentFolderPermissionsPage",
portletName, assetLibraryId)
).put(
"replace",
addAction(
ActionKeys.PERMISSIONS,
"putAssetLibraryStructuredContentFolderPermissionsPage",
portletName, assetLibraryId)
).build(),
assetLibraryId, portletName, null);
}
/**
* Invoke this method with the command line:
*
* curl -X 'PUT' 'http://localhost:8080/o/headless-delivery/v1.0/sites/{siteId}/structured-content-folders/by-external-reference-code/{externalReferenceCode}' -d $'{"customFields": ___, "description": ___, "externalReferenceCode": ___, "name": ___, "parentStructuredContentFolderId": ___, "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 = "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 = "StructuredContentFolder"
)
}
)
@jakarta.ws.rs.Consumes({"application/json", "application/xml"})
@jakarta.ws.rs.Path(
"/sites/{siteId}/structured-content-folders/by-external-reference-code/{externalReferenceCode}"
)
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@jakarta.ws.rs.PUT
@Override
public StructuredContentFolder
putSiteStructuredContentFolderByExternalReferenceCode(
@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,
StructuredContentFolder structuredContentFolder)
throws Exception {
return new StructuredContentFolder();
}
/**
* Invoke this method with the command line:
*
* curl -X 'PUT' 'http://localhost:8080/o/headless-delivery/v1.0/sites/{siteId}/structured-content-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 = "StructuredContentFolder"
)
}
)
@jakarta.ws.rs.Consumes({"application/json", "application/xml"})
@jakarta.ws.rs.Path(
"/sites/{siteId}/structured-content-folders/permissions"
)
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@jakarta.ws.rs.PUT
@Override
public Page putSiteStructuredContentFolderPermissionsPage(
@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,
"getSiteStructuredContentFolderPermissionsPage",
portletName, siteId)
).put(
"replace",
addAction(
ActionKeys.PERMISSIONS,
"putSiteStructuredContentFolderPermissionsPage",
portletName, siteId)
).build(),
siteId, portletName, null);
}
/**
* Invoke this method with the command line:
*
* curl -X 'PUT' 'http://localhost:8080/o/headless-delivery/v1.0/structured-content-folders/{structuredContentFolderId}' -d $'{"customFields": ___, "description": ___, "externalReferenceCode": ___, "name": ___, "parentStructuredContentFolderId": ___, "viewableBy": ___}' --header 'Content-Type: application/json' -u '[email protected]:test'
*/
@io.swagger.v3.oas.annotations.Operation(
description = "Replaces the structured content 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 = "structuredContentFolderId"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(
name = "StructuredContentFolder"
)
}
)
@jakarta.ws.rs.Consumes({"application/json", "application/xml"})
@jakarta.ws.rs.Path(
"/structured-content-folders/{structuredContentFolderId}"
)
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@jakarta.ws.rs.PUT
@Override
public StructuredContentFolder putStructuredContentFolder(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("structuredContentFolderId")
Long structuredContentFolderId,
StructuredContentFolder structuredContentFolder)
throws Exception {
return new StructuredContentFolder();
}
/**
* Invoke this method with the command line:
*
* curl -X 'PUT' 'http://localhost:8080/o/headless-delivery/v1.0/structured-content-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 = "StructuredContentFolder"
)
}
)
@jakarta.ws.rs.Consumes("application/json")
@jakarta.ws.rs.Path("/structured-content-folders/batch")
@jakarta.ws.rs.Produces("application/json")
@jakarta.ws.rs.PUT
@Override
public Response putStructuredContentFolderBatch(
@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(
StructuredContentFolder.class.getName(), callbackURL, object)
).build();
}
/**
* Invoke this method with the command line:
*
* curl -X 'PUT' 'http://localhost:8080/o/headless-delivery/v1.0/structured-content-folder/{structuredContentFolderId}/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 = "structuredContentFolderId"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(
name = "StructuredContentFolder"
)
}
)
@jakarta.ws.rs.Consumes({"application/json", "application/xml"})
@jakarta.ws.rs.Path(
"/structured-content-folder/{structuredContentFolderId}/permissions"
)
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@jakarta.ws.rs.PUT
@Override
public Page putStructuredContentFolderPermissionsPage(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("structuredContentFolderId")
Long structuredContentFolderId,
Permission[] permissions)
throws Exception {
String resourceName = getPermissionCheckerResourceName(
structuredContentFolderId);
Long resourceId = getPermissionCheckerResourceId(
structuredContentFolderId);
PermissionServiceUtil.checkPermission(
getPermissionCheckerGroupId(structuredContentFolderId),
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(structuredContentFolderId),
resourceName, String.valueOf(resourceId), modelPermissions);
return toPermissionPage(
HashMapBuilder.put(
"get",
addAction(
ActionKeys.PERMISSIONS,
"getStructuredContentFolderPermissionsPage", resourceName,
resourceId)
).put(
"replace",
addAction(
ActionKeys.PERMISSIONS,
"putStructuredContentFolderPermissionsPage", resourceName,
resourceId)
).build(),
resourceId, resourceName, null);
}
/**
* Invoke this method with the command line:
*
* curl -X 'PUT' 'http://localhost:8080/o/headless-delivery/v1.0/structured-content-folders/{structuredContentFolderId}/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 = "structuredContentFolderId"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(
name = "StructuredContentFolder"
)
}
)
@jakarta.ws.rs.Path(
"/structured-content-folders/{structuredContentFolderId}/subscribe"
)
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@jakarta.ws.rs.PUT
@Override
public void putStructuredContentFolderSubscribe(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("structuredContentFolderId")
Long structuredContentFolderId)
throws Exception {
}
/**
* Invoke this method with the command line:
*
* curl -X 'PUT' 'http://localhost:8080/o/headless-delivery/v1.0/structured-content-folders/{structuredContentFolderId}/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 = "structuredContentFolderId"
)
}
)
@io.swagger.v3.oas.annotations.tags.Tags(
value = {
@io.swagger.v3.oas.annotations.tags.Tag(
name = "StructuredContentFolder"
)
}
)
@jakarta.ws.rs.Path(
"/structured-content-folders/{structuredContentFolderId}/unsubscribe"
)
@jakarta.ws.rs.Produces({"application/json", "application/xml"})
@jakarta.ws.rs.PUT
@Override
public void putStructuredContentFolderUnsubscribe(
@io.swagger.v3.oas.annotations.Parameter(hidden = true)
@jakarta.validation.constraints.NotNull
@jakarta.ws.rs.PathParam("structuredContentFolderId")
Long structuredContentFolderId)
throws Exception {
}
@Override
@SuppressWarnings("PMD.UnusedLocalVariable")
public void create(
Collection structuredContentFolders,
Map parameters)
throws Exception {
UnsafeFunction
structuredContentFolderUnsafeFunction = null;
String createStrategy = (String)parameters.getOrDefault(
"createStrategy", "INSERT");
if (StringUtil.equalsIgnoreCase(createStrategy, "INSERT")) {
if (parameters.containsKey("assetLibraryId")) {
structuredContentFolderUnsafeFunction =
structuredContentFolder ->
postAssetLibraryStructuredContentFolder(
(Long)parameters.get("assetLibraryId"),
structuredContentFolder);
}
else if (parameters.containsKey("siteId")) {
structuredContentFolderUnsafeFunction =
structuredContentFolder -> postSiteStructuredContentFolder(
(Long)parameters.get("siteId"),
structuredContentFolder);
}
else {
throw new NotSupportedException(
"One of the following parameters must be specified: [assetLibraryId, siteId]");
}
}
if (StringUtil.equalsIgnoreCase(createStrategy, "UPSERT")) {
String updateStrategy = (String)parameters.getOrDefault(
"updateStrategy", "UPDATE");
if (StringUtil.equalsIgnoreCase(updateStrategy, "PARTIAL_UPDATE")) {
structuredContentFolderUnsafeFunction =
structuredContentFolder -> {
StructuredContentFolder getStructuredContentFolder =
null;
StructuredContentFolder
persistedStructuredContentFolder = null;
try {
if (parameters.containsKey("assetLibraryId")) {
getStructuredContentFolder =
getAssetLibraryStructuredContentFolderByExternalReferenceCode(
(Long)parameters.get("assetLibraryId"),
structuredContentFolder.
getExternalReferenceCode());
}
else if (parameters.containsKey("siteId")) {
getStructuredContentFolder =
getSiteStructuredContentFolderByExternalReferenceCode(
(Long)parameters.get("siteId"),
structuredContentFolder.
getExternalReferenceCode());
}
else {
throw new NotSupportedException(
"One of the following parameters must be specified: [assetLibraryId, siteId]");
}
persistedStructuredContentFolder =
patchStructuredContentFolder(
getStructuredContentFolder.getId(),
structuredContentFolder);
}
catch (NoSuchModelException noSuchModelException) {
if (parameters.containsKey("assetLibraryId")) {
persistedStructuredContentFolder =
postAssetLibraryStructuredContentFolder(
(Long)parameters.get("assetLibraryId"),
structuredContentFolder);
}
else if (parameters.containsKey("siteId")) {
persistedStructuredContentFolder =
postSiteStructuredContentFolder(
(Long)parameters.get("siteId"),
structuredContentFolder);
}
else {
throw new NotSupportedException(
"One of the following parameters must be specified: [assetLibraryId, siteId]");
}
}
return persistedStructuredContentFolder;
};
}
if (StringUtil.equalsIgnoreCase(updateStrategy, "UPDATE")) {
structuredContentFolderUnsafeFunction =
structuredContentFolder -> {
StructuredContentFolder
persistedStructuredContentFolder = null;
if (parameters.containsKey("assetLibraryId")) {
persistedStructuredContentFolder =
putAssetLibraryStructuredContentFolderByExternalReferenceCode(
(Long)parameters.get("assetLibraryId"),
structuredContentFolder.
getExternalReferenceCode(),
structuredContentFolder);
}
else if (parameters.containsKey("siteId")) {
persistedStructuredContentFolder =
putSiteStructuredContentFolderByExternalReferenceCode(
(Long)parameters.get("siteId"),
structuredContentFolder.
getExternalReferenceCode(),
structuredContentFolder);
}
else {
throw new NotSupportedException(
"One of the following parameters must be specified: [assetLibraryId, siteId]");
}
return persistedStructuredContentFolder;
};
}
}
if (structuredContentFolderUnsafeFunction == null) {
throw new NotSupportedException(
"Create strategy \"" + createStrategy +
"\" is not supported for StructuredContentFolder");
}
if (contextBatchUnsafeBiConsumer != null) {
contextBatchUnsafeBiConsumer.accept(
structuredContentFolders,
structuredContentFolderUnsafeFunction);
}
else if (contextBatchUnsafeConsumer != null) {
contextBatchUnsafeConsumer.accept(
structuredContentFolders,
structuredContentFolderUnsafeFunction::apply);
}
else {
for (StructuredContentFolder structuredContentFolder :
structuredContentFolders) {
structuredContentFolderUnsafeFunction.apply(
structuredContentFolder);
}
}
}
@Override
public void delete(
Collection structuredContentFolders,
Map parameters)
throws Exception {
UnsafeFunction
structuredContentFolderUnsafeFunction =
structuredContentFolder -> {
deleteStructuredContentFolder(
structuredContentFolder.getId());
return structuredContentFolder;
};
if (contextBatchUnsafeBiConsumer != null) {
contextBatchUnsafeBiConsumer.accept(
structuredContentFolders,
structuredContentFolderUnsafeFunction);
}
else if (contextBatchUnsafeConsumer != null) {
contextBatchUnsafeConsumer.accept(
structuredContentFolders,
structuredContentFolderUnsafeFunction::apply);
}
else {
for (StructuredContentFolder structuredContentFolder :
structuredContentFolders) {
structuredContentFolderUnsafeFunction.apply(
structuredContentFolder);
}
}
}
public Set getAvailableCreateStrategies() {
return SetUtil.fromArray("INSERT", "UPSERT");
}
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 "StructuredContentFolder";
}
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 getAssetLibraryStructuredContentFoldersPage(
(Long)parameters.get("assetLibraryId"),
_parseBoolean((String)parameters.get("flatten")), search, null,
filter, pagination, sorts);
}
else if (parameters.containsKey("siteId")) {
return getSiteStructuredContentFoldersPage(
(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 structuredContentFolders,
Map parameters)
throws Exception {
UnsafeFunction
structuredContentFolderUnsafeFunction = null;
String updateStrategy = (String)parameters.getOrDefault(
"updateStrategy", "UPDATE");
if (StringUtil.equalsIgnoreCase(updateStrategy, "PARTIAL_UPDATE")) {
structuredContentFolderUnsafeFunction =
structuredContentFolder -> patchStructuredContentFolder(
structuredContentFolder.getId(), structuredContentFolder);
}
if (StringUtil.equalsIgnoreCase(updateStrategy, "UPDATE")) {
structuredContentFolderUnsafeFunction =
structuredContentFolder -> putStructuredContentFolder(
structuredContentFolder.getId(), structuredContentFolder);
}
if (structuredContentFolderUnsafeFunction == null) {
throw new NotSupportedException(
"Update strategy \"" + updateStrategy +
"\" is not supported for StructuredContentFolder");
}
if (contextBatchUnsafeBiConsumer != null) {
contextBatchUnsafeBiConsumer.accept(
structuredContentFolders,
structuredContentFolderUnsafeFunction);
}
else if (contextBatchUnsafeConsumer != null) {
contextBatchUnsafeConsumer.accept(
structuredContentFolders,
structuredContentFolderUnsafeFunction::apply);
}
else {
for (StructuredContentFolder structuredContentFolder :
structuredContentFolders) {
structuredContentFolderUnsafeFunction.apply(
structuredContentFolder);
}
}
}
private Boolean _parseBoolean(String value) {
if (value != null) {
return Boolean.parseBoolean(value);
}
return null;
}
@Override
public StructuredContentFolder getItem(Long id) throws Exception {
return getStructuredContentFolder(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(
StructuredContentFolder structuredContentFolder,
StructuredContentFolder existingStructuredContentFolder) {
}
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(BaseStructuredContentFolderResourceImpl.class);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy