From 26e6346c2623126264a7240c001a5ac33939cb34 Mon Sep 17 00:00:00 2001 From: erickgonzalez Date: Fri, 17 Jan 2025 17:42:00 -0600 Subject: [PATCH] fix compilation issues --- .../business/ESContentletAPIImpl.java | 561 +++++++++--------- .../dotmarketing/init/DotInitScheduler.java | 1 - .../quartz/job/EsReadOnlyMonitorJob.java | 21 - 3 files changed, 278 insertions(+), 305 deletions(-) delete mode 100644 dotCMS/src/main/java/com/dotmarketing/quartz/job/EsReadOnlyMonitorJob.java diff --git a/dotCMS/src/main/java/com/dotcms/content/elasticsearch/business/ESContentletAPIImpl.java b/dotCMS/src/main/java/com/dotcms/content/elasticsearch/business/ESContentletAPIImpl.java index 32970e85fee9..97a85b440c82 100644 --- a/dotCMS/src/main/java/com/dotcms/content/elasticsearch/business/ESContentletAPIImpl.java +++ b/dotCMS/src/main/java/com/dotcms/content/elasticsearch/business/ESContentletAPIImpl.java @@ -287,10 +287,7 @@ public enum QueryType { private static final Supplier ND_SUPPLIER = () -> "N/D"; - /** - * Default class constructor. - */ - @VisibleForTesting + public ESContentletAPIImpl() { indexAPI = new ContentletIndexAPIImpl(); fieldAPI = APILocator.getFieldAPI(); @@ -308,18 +305,16 @@ public ESContentletAPIImpl() { fileMetadataAPI = APILocator.getFileMetadataAPI(); } - public ESContentletAPIImpl() {} - @Override public SearchResponse esSearchRaw(String esQuery, boolean live, User user, - boolean respectFrontendRoles) throws DotSecurityException, DotDataException { + boolean respectFrontendRoles) throws DotSecurityException, DotDataException { return APILocator.getEsSearchAPI().esSearchRaw(esQuery, live, user, respectFrontendRoles); } @Override public ESSearchResults esSearch(String esQuery, boolean live, User user, - boolean respectFrontendRoles) throws DotSecurityException, DotDataException { + boolean respectFrontendRoles) throws DotSecurityException, DotDataException { return APILocator.getEsSearchAPI().esSearch(esQuery, live, user, respectFrontendRoles); } @@ -331,7 +326,7 @@ public Object loadField(String inode, Field f) throws DotDataException { @CloseDBIfOpened public Object loadField(final String inode, - final com.dotcms.contenttype.model.field.Field field) throws DotDataException { + final com.dotcms.contenttype.model.field.Field field) throws DotDataException { if (APILocator.getContentletJsonAPI().isPersistContentAsJson()) { final Object value = contentFactory.loadJsonField(inode, field); if (null != value) { @@ -390,8 +385,8 @@ public Contentlet find(final String inode, final User user, final boolean respec @Override public Contentlet move(final Contentlet contentlet, final User user, - final String hostAndFolderPath, - final boolean respectFrontendRoles) throws DotSecurityException, DotDataException { + final String hostAndFolderPath, + final boolean respectFrontendRoles) throws DotSecurityException, DotDataException { Logger.debug(this, () -> "Moving contentlet: " + contentlet.getIdentifier() + " to: " + hostAndFolderPath); @@ -412,8 +407,8 @@ public Contentlet move(final Contentlet contentlet, final User user, @Override public Contentlet move(final Contentlet contentlet, final User user, final Host host, - final String folderPathParam, - final boolean respectFrontendRoles) throws DotSecurityException, DotDataException { + final String folderPathParam, + final boolean respectFrontendRoles) throws DotSecurityException, DotDataException { Logger.debug(this, () -> "Moving contentlet: " + contentlet.getIdentifier() + " to: " + folderPathParam); @@ -479,8 +474,8 @@ public Contentlet move(final Contentlet contentlet, final User user, final Host @WrapInTransaction private Folder createFolder(final String folderPath, final Contentlet contentlet, - final Host host, - final User user, final boolean respectFrontendRoles) + final Host host, + final User user, final boolean respectFrontendRoles) throws DotDataException, DotSecurityException { Logger.debug(this, () -> "Creating folders: " + folderPath + ", contentlet: " @@ -492,8 +487,8 @@ private Folder createFolder(final String folderPath, final Contentlet contentlet @WrapInTransaction @Override public Contentlet move(final Contentlet contentlet, final User incomingUser, final Host host, - final Folder folder, - final boolean respectFrontendRoles) throws DotSecurityException, DotDataException { + final Folder folder, + final boolean respectFrontendRoles) throws DotSecurityException, DotDataException { Logger.debug(this, () -> "Moving contentlet: " + contentlet.getIdentifier() + " to host: " + host.getHostname() + " and path: " + folder.getPath() + ", id: " @@ -579,7 +574,7 @@ public Optional findInDb(final String inode) { @CloseDBIfOpened @Override public List findByStructure(String structureInode, User user, - boolean respectFrontendRoles, int limit, int offset) + boolean respectFrontendRoles, int limit, int offset) throws DotDataException, DotSecurityException { List contentlets = contentFactory.findByStructure(structureInode, limit, offset); @@ -589,7 +584,7 @@ public List findByStructure(String structureInode, User user, @Override public List findByStructure(Structure structure, User user, - boolean respectFrontendRoles, int limit, int offset) + boolean respectFrontendRoles, int limit, int offset) throws DotDataException, DotSecurityException { return findByStructure(structure.getInode(), user, respectFrontendRoles, limit, offset); } @@ -611,7 +606,7 @@ public Contentlet findContentletForLanguage(long languageId, Identifier contentl public Contentlet findContentletByIdentifier(String identifier, boolean live, long languageId, - String variantId, User user, boolean respectFrontendRoles) + String variantId, User user, boolean respectFrontendRoles) throws DotDataException, DotSecurityException, DotContentletStateException { if (languageId <= 0) { languageId = APILocator.getLanguageAPI().getDefaultLanguage().getId(); @@ -645,7 +640,7 @@ public Contentlet findContentletByIdentifier(String identifier, boolean live, lo @CloseDBIfOpened @Override public Contentlet findContentletByIdentifier(String identifier, boolean live, long languageId, - User user, boolean respectFrontendRoles) + User user, boolean respectFrontendRoles) throws DotDataException, DotSecurityException, DotContentletStateException { return findContentletByIdentifier(identifier, live, languageId, VariantAPI.DEFAULT_VARIANT.name(), user, respectFrontendRoles); @@ -656,8 +651,8 @@ public Contentlet findContentletByIdentifier(String identifier, boolean live, lo @CloseDBIfOpened @Override public Optional findContentletByIdentifierOrFallback(final String identifier, - final boolean live, - final long incomingLangId, final User user, final boolean respectFrontendRoles) { + final boolean live, + final long incomingLangId, final User user, final boolean respectFrontendRoles) { final long defaultLanguageId = this.languageAPI.getDefaultLanguage().getId(); final long tryLanguage = incomingLangId <= 0 ? defaultLanguageId : incomingLangId; @@ -709,7 +704,7 @@ public Optional findContentletByIdentifierOrFallback(final String id @CloseDBIfOpened @Override public Contentlet findContentletByIdentifierAnyLanguage(final String identifier, - final boolean includeDeleted) throws DotDataException { + final boolean includeDeleted) throws DotDataException { try { return contentFactory.findContentletByIdentifierAnyLanguage(identifier, includeDeleted); @@ -754,7 +749,7 @@ public Contentlet findContentletByIdentifierAnyLanguage(final String identifier, @CloseDBIfOpened @Override public Contentlet findContentletByIdentifierAnyLanguage(final String identifier, final String variant, - final boolean includeDeleted) throws DotDataException{ + final boolean includeDeleted) throws DotDataException{ try { return contentFactory.findContentletByIdentifierAnyLanguage(identifier, variant, includeDeleted); } catch (Exception e) { @@ -766,8 +761,8 @@ public Contentlet findContentletByIdentifierAnyLanguage(final String identifier, @CloseDBIfOpened @Override public List findContentletsByIdentifiers(final String[] identifiers, - final boolean live, final long languageId, final User user, - final boolean respectFrontendRoles) + final boolean live, final long languageId, final User user, + final boolean respectFrontendRoles) throws DotDataException, DotSecurityException, DotContentletStateException { final List contentlets = new ArrayList<>(); @@ -791,7 +786,7 @@ public List findContentlets(List inodes) @CloseDBIfOpened @Override public List findContentletsByFolder(Folder parentFolder, User user, - boolean respectFrontendRoles) throws DotDataException, DotSecurityException { + boolean respectFrontendRoles) throws DotDataException, DotSecurityException { try { return permissionAPI.filterCollection( @@ -808,7 +803,7 @@ public List findContentletsByFolder(Folder parentFolder, User user, @CloseDBIfOpened @Override public List findContentletsByHost(Host parentHost, User user, - boolean respectFrontendRoles) throws DotDataException, DotSecurityException { + boolean respectFrontendRoles) throws DotDataException, DotSecurityException { try { return permissionAPI.filterCollection( search("+conHost:" + parentHost.getIdentifier() + " +working:true", -1, 0, null, @@ -823,16 +818,16 @@ public List findContentletsByHost(Host parentHost, User user, @CloseDBIfOpened @Override public PaginatedContentlets findContentletsPaginatedByHost(Host parentHost, User user, - boolean respectFrontendRoles) throws DotDataException, DotSecurityException { + boolean respectFrontendRoles) throws DotDataException, DotSecurityException { return findContentletsPaginatedByHost(parentHost, null, null, user, respectFrontendRoles); } public PaginatedContentlets findContentletsPaginatedByHost(final Host parentHost, - final List includingContentTypes, - final List excludingContentTypes, - final User user, - final boolean respectFrontendRoles) throws DotDataException, DotSecurityException { + final List includingContentTypes, + final List excludingContentTypes, + final User user, + final boolean respectFrontendRoles) throws DotDataException, DotSecurityException { final String query = getContentletByHostQuery(parentHost, includingContentTypes, excludingContentTypes); @@ -847,8 +842,8 @@ public PaginatedContentlets findContentletsPaginatedByHost(final Host parentHost @CloseDBIfOpened @Override public List findContentletsByHost(Host parentHost, - List includingContentTypes, List excludingContentTypes, User user, - boolean respectFrontendRoles) throws DotDataException, DotSecurityException { + List includingContentTypes, List excludingContentTypes, User user, + boolean respectFrontendRoles) throws DotDataException, DotSecurityException { try { final String query = getContentletByHostQuery(parentHost, includingContentTypes, excludingContentTypes); @@ -863,7 +858,7 @@ public List findContentletsByHost(Host parentHost, } private String getContentletByHostQuery(Host parentHost, List includingContentTypes, - List excludingContentTypes) { + List excludingContentTypes) { final StringBuilder query = new StringBuilder(); query.append("+conHost:").append(parentHost.getIdentifier()).append(" +working:true"); @@ -884,7 +879,7 @@ private String getContentletByHostQuery(Host parentHost, List including @CloseDBIfOpened @Override public List findContentletsByHostBaseType(Host parentHost, - List includingBaseTypes, User user, boolean respectFrontendRoles) + List includingBaseTypes, User user, boolean respectFrontendRoles) throws DotDataException, DotSecurityException { try { StringBuilder query = new StringBuilder(); @@ -909,7 +904,7 @@ public List findContentletsByHostBaseType(Host parentHost, @WrapInTransaction @Override public void publish(final Contentlet contentlet, final User userIn, - final boolean respectFrontendRoles) + final boolean respectFrontendRoles) throws DotSecurityException, DotDataException, DotStateException { final User user = (userIn != null) ? userIn : APILocator.getUserAPI().getAnonymousUser(); String contentPushPublishDate = contentlet.getStringProperty( @@ -967,7 +962,7 @@ public void publish(final Contentlet contentlet, final User userIn, } private void internalPublish(final Contentlet contentlet, final User user, - final boolean respectFrontendRoles) throws DotDataException, DotSecurityException { + final boolean respectFrontendRoles) throws DotDataException, DotSecurityException { if (StringPool.BLANK.equals(contentlet.getInode())) { @@ -1089,7 +1084,7 @@ public void publishAssociated(Contentlet contentlet, boolean isNew) @WrapInTransaction @Override public void publishAssociated(final Contentlet contentlet, final boolean isNew, - final boolean isNewVersion) throws + final boolean isNewVersion) throws DotSecurityException, DotDataException, DotStateException { if (!contentlet.isWorking()) { @@ -1184,8 +1179,8 @@ public void publishAssociated(final Contentlet contentlet, final boolean isNew, @CloseDBIfOpened private void publishRelatedLinks(final Contentlet contentlet, - final boolean isNewVersion, - final User systemUser) throws DotDataException, DotSecurityException { + final boolean isNewVersion, + final User systemUser) throws DotDataException, DotSecurityException { // gets all not live link children Logger.debug(this, "IM HERE BEFORE PUBLISHING LINKS FOR A CONTENTLET!!!!!!!"); final List links = getRelatedLinks(contentlet, systemUser, false); @@ -1212,14 +1207,14 @@ private void publishRelatedLinks(final Contentlet contentlet, @Override public List search(String luceneQuery, int limit, int offset, String sortBy, - User user, boolean respectFrontendRoles) throws DotDataException, DotSecurityException { + User user, boolean respectFrontendRoles) throws DotDataException, DotSecurityException { return search(luceneQuery, limit, offset, sortBy, user, respectFrontendRoles, PermissionAPI.PERMISSION_READ); } @Override public List search(String luceneQuery, int limit, int offset, String sortBy, - User user, boolean respectFrontendRoles, int requiredPermission) + User user, boolean respectFrontendRoles, int requiredPermission) throws DotDataException, DotSecurityException { PaginatedArrayList contents = new PaginatedArrayList<>(); ArrayList inodes = new ArrayList<>(); @@ -1248,7 +1243,7 @@ public List search(String luceneQuery, int limit, int offset, String @Override public List searchByIdentifier(String luceneQuery, int limit, int offset, - String sortBy, User user, boolean respectFrontendRoles) + String sortBy, User user, boolean respectFrontendRoles) throws DotDataException, DotSecurityException { return searchByIdentifier(luceneQuery, limit, offset, sortBy, user, respectFrontendRoles, PermissionAPI.PERMISSION_READ); @@ -1256,7 +1251,7 @@ public List searchByIdentifier(String luceneQuery, int limit, int of @Override public List searchByIdentifier(String luceneQuery, int limit, int offset, - String sortBy, User user, boolean respectFrontendRoles, int requiredPermission) + String sortBy, User user, boolean respectFrontendRoles, int requiredPermission) throws DotDataException, DotSecurityException { return searchByIdentifier(luceneQuery, limit, offset, sortBy, user, respectFrontendRoles, requiredPermission, false); @@ -1265,8 +1260,8 @@ public List searchByIdentifier(String luceneQuery, int limit, int of @CloseDBIfOpened @Override public List searchByIdentifier(String luceneQuery, int limit, int offset, - String sortBy, User user, boolean respectFrontendRoles, int requiredPermission, - boolean anyLanguage) throws DotDataException, DotSecurityException { + String sortBy, User user, boolean respectFrontendRoles, int requiredPermission, + boolean anyLanguage) throws DotDataException, DotSecurityException { PaginatedArrayList contents = new PaginatedArrayList<>(); PaginatedArrayList list = (PaginatedArrayList) searchIndex(luceneQuery, limit, offset, sortBy, user, respectFrontendRoles); @@ -1326,7 +1321,7 @@ public List searchByIdentifier(String luceneQuery, int limit, int of @Override public List getAllContentByVariants(final User user, - final boolean respectFrontendRoles, final String... variantNames) + final boolean respectFrontendRoles, final String... variantNames) throws DotDataException, DotStateException, DotSecurityException { @@ -1342,7 +1337,7 @@ public List getAllContentByVariants(final User user, @Override public void addPermissionsToQuery(StringBuffer buffy, User user, List roles, - boolean respectFrontendRoles) throws DotSecurityException, DotDataException { + boolean respectFrontendRoles) throws DotSecurityException, DotDataException { if (user != null) { buffy.append(" +((+owner:" + user.getUserId() + " +ownerCanRead:true) "); } else { @@ -1375,7 +1370,7 @@ public void addPermissionsToQuery(StringBuffer buffy, User user, List role @Override public List searchIndex(String luceneQuery, int limit, int offset, - String sortBy, User user, boolean respectFrontendRoles) + String sortBy, User user, boolean respectFrontendRoles) throws DotSecurityException, DotDataException { boolean isAdmin = false; List roles = new ArrayList<>(); @@ -1495,8 +1490,8 @@ public void publishRelatedHtmlPages(final Contentlet contentlet) @WrapInTransaction @Override public void cleanField(final Structure structure, final Date deletionDate, final Field oldField, - final User user, - final boolean respectFrontendRoles) + final User user, + final boolean respectFrontendRoles) throws DotSecurityException, DotDataException { if (!permissionAPI.doesUserHavePermission(structure, PermissionAPI.PERMISSION_PUBLISH, user, respectFrontendRoles)) { @@ -1555,7 +1550,7 @@ public void cleanField(final Structure structure, final Date deletionDate, final @Override @WrapInTransaction public void cleanField(Structure structure, Field oldField, User user, - boolean respectFrontendRoles) + boolean respectFrontendRoles) throws DotSecurityException, DotDataException { cleanField(structure, null, oldField, user, respectFrontendRoles); } @@ -1575,7 +1570,7 @@ public void cleanField(Structure structure, Field oldField, User user, * @throws DotSecurityException */ private IHTMLPage loadPageByIdentifier(String ident, boolean live, Long languageId, User user, - boolean frontRoles) + boolean frontRoles) throws DotDataException, DotContentletStateException, DotSecurityException { return APILocator.getHTMLPageAssetAPI().fromContentlet( @@ -1588,7 +1583,7 @@ private IHTMLPage loadPageByIdentifier(String ident, boolean live, Long language * {@link #loadPageByIdentifier(String, boolean, Long, User, boolean)} */ private IHTMLPage loadPageByIdentifier(String ident, boolean live, User user, - boolean frontRoles) + boolean frontRoles) throws DotDataException, DotContentletStateException, DotSecurityException { return loadPageByIdentifier(ident, live, 0L, user, frontRoles); } @@ -1596,7 +1591,7 @@ private IHTMLPage loadPageByIdentifier(String ident, boolean live, User user, @CloseDBIfOpened @Override public List> getContentletReferences(final Contentlet contentlet, - final User user, final boolean respectFrontendRoles) + final User user, final boolean respectFrontendRoles) throws DotSecurityException, DotDataException, DotContentletStateException { final List> results = new ArrayList<>(); @@ -1669,15 +1664,15 @@ private String getPersonaNameByMultitree(final MultiTree tree) @CloseDBIfOpened @Override public Object getFieldValue(final Contentlet contentlet, - final com.dotcms.contenttype.model.field.Field theField) { + final com.dotcms.contenttype.model.field.Field theField) { return getFieldValue(contentlet, theField, null, false); } @CloseDBIfOpened @Override public Object getFieldValue(final Contentlet contentlet, - final com.dotcms.contenttype.model.field.Field theField, final User user, - final boolean respectFrontEndRoles) { + final com.dotcms.contenttype.model.field.Field theField, final User user, + final boolean respectFrontEndRoles) { try { User currentUser = user; if (currentUser == null) { @@ -1756,7 +1751,7 @@ public Object getFieldValue(final Contentlet contentlet, final Field theField) { @WrapInTransaction @Override public void addLinkToContentlet(Contentlet contentlet, String linkInode, String relationName, - User user, boolean respectFrontendRoles) throws DotSecurityException, DotDataException { + User user, boolean respectFrontendRoles) throws DotSecurityException, DotDataException { if (contentlet.getInode().equals("")) { throw new DotContentletStateException(CAN_T_CHANGE_STATE_OF_CHECKED_OUT_CONTENT); } @@ -1772,8 +1767,8 @@ public void addLinkToContentlet(Contentlet contentlet, String linkInode, String @CloseDBIfOpened @Override public List findPageContentlets(String HTMLPageIdentifier, - String containerIdentifier, String orderby, boolean working, long languageId, User user, - boolean respectFrontendRoles) throws DotSecurityException, DotDataException { + String containerIdentifier, String orderby, boolean working, long languageId, User user, + boolean respectFrontendRoles) throws DotSecurityException, DotDataException { List contentlets = contentFactory.findPageContentlets(HTMLPageIdentifier, containerIdentifier, orderby, working, languageId); return permissionAPI.filterCollection(contentlets, PermissionAPI.PERMISSION_READ, @@ -1792,7 +1787,7 @@ public List findPageContentlets(String HTMLPageIdentifier, */ @Override public ContentletRelationships getAllRelationships(String contentletInode, User user, - boolean respectFrontendRoles) throws DotDataException, DotSecurityException { + boolean respectFrontendRoles) throws DotDataException, DotSecurityException { return getAllRelationships(find(contentletInode, user, respectFrontendRoles)); } @@ -1821,7 +1816,7 @@ public ContentletRelationships getAllRelationships(final Contentlet contentlet) */ @CloseDBIfOpened private ContentletRelationships getAllRelationships(final Contentlet contentlet, - ContentletRelationships cRelationships) throws DotDataException { + ContentletRelationships cRelationships) throws DotDataException { if (cRelationships == null) { cRelationships = new ContentletRelationships(contentlet); @@ -1862,7 +1857,7 @@ private ContentletRelationships getAllRelationships(final Contentlet contentlet, } private void pullRelated(Contentlet contentlet, ContentletRelationships cRelationships, - Relationship relationship, boolean hasParent) + Relationship relationship, boolean hasParent) throws DotDataException { final boolean selfRelated = APILocator.getRelationshipAPI() @@ -1890,7 +1885,7 @@ private void pullRelated(Contentlet contentlet, ContentletRelationships cRelatio @CloseDBIfOpened @Override public List getAllLanguages(Contentlet contentlet, Boolean isLiveContent, User user, - boolean respectFrontendRoles) + boolean respectFrontendRoles) throws DotDataException, DotSecurityException { if (!permissionAPI.doesUserHavePermission(contentlet, PermissionAPI.PERMISSION_READ, user, @@ -1914,7 +1909,7 @@ public List getAllLanguages(Contentlet contentlet, Boolean isLiveCon @WrapInTransaction @Override public void unlock(final Contentlet contentlet, final User user, - final boolean respectFrontendRoles) throws DotDataException, DotSecurityException { + final boolean respectFrontendRoles) throws DotDataException, DotSecurityException { if (contentlet == null) { @@ -1964,7 +1959,7 @@ public void unlock(final Contentlet contentlet, final User user, @CloseDBIfOpened @Override public Identifier getRelatedIdentifier(Contentlet contentlet, String relationshipType, - User user, boolean respectFrontendRoles) throws DotDataException, DotSecurityException { + User user, boolean respectFrontendRoles) throws DotDataException, DotSecurityException { if (!permissionAPI.doesUserHavePermission(contentlet, PermissionAPI.PERMISSION_READ, user, respectFrontendRoles)) { throw new DotSecurityException("User: " + (user != null ? user.getUserId() : "Unknown") @@ -1976,7 +1971,7 @@ public Identifier getRelatedIdentifier(Contentlet contentlet, String relationshi @CloseDBIfOpened @Override public List getRelatedLinks(Contentlet contentlet, User user, - boolean respectFrontendRoles) throws DotDataException, DotSecurityException { + boolean respectFrontendRoles) throws DotDataException, DotSecurityException { return permissionAPI.filterCollection(contentFactory.getRelatedLinks(contentlet), PermissionAPI.PERMISSION_READ, respectFrontendRoles, user); } @@ -1985,8 +1980,8 @@ public List getRelatedLinks(Contentlet contentlet, User user, @Deprecated @Override public List filterRelatedContent(Contentlet contentlet, Relationship rel, - User user, boolean respectFrontendRoles, Boolean pullByParent, int limit, int offset, - String sortBy) + User user, boolean respectFrontendRoles, Boolean pullByParent, int limit, int offset, + String sortBy) throws DotDataException, DotSecurityException { Logger.warn(this, "This implementation of ContentletAPI.filterRelatedContent is deprecated and no longer respects the sort. " @@ -1998,7 +1993,7 @@ public List filterRelatedContent(Contentlet contentlet, Relationship @VisibleForTesting @CloseDBIfOpened List filterRelatedContent(Contentlet contentlet, Relationship rel, - User user, boolean respectFrontendRoles, Boolean pullByParent, int limit, int offset) + User user, boolean respectFrontendRoles, Boolean pullByParent, int limit, int offset) throws DotDataException, DotSecurityException { if (!UtilMethods.isSet(contentlet.getIdentifier())) { @@ -2041,8 +2036,8 @@ List filterRelatedContent(Contentlet contentlet, Relationship rel, @Override public List getRelatedContent(final Contentlet contentlet, final Relationship rel, - final User user, - final boolean respectFrontendRoles) throws DotDataException, DotSecurityException { + final User user, + final boolean respectFrontendRoles) throws DotDataException, DotSecurityException { try { return getRelatedContent(contentlet, rel, null, user, respectFrontendRoles); } catch (final Exception e) { @@ -2081,8 +2076,8 @@ public List getRelatedContent(final Contentlet contentlet, final Rel * @throws DotDataException An error occurred when interacting with the data source. */ private List getRelatedChildren(final Contentlet contentlet, final Relationship rel, - final User user, final boolean respectFrontendRoles, final int limitParam, - final int offset) + final User user, final boolean respectFrontendRoles, final int limitParam, + final int offset) throws DotSecurityException, DotDataException { final boolean HAS_PARENT = Boolean.TRUE; final boolean WORKING_VERSION = Boolean.FALSE; @@ -2176,7 +2171,7 @@ private List getRelatedChildren(final Contentlet contentlet, final R * @throws DotDataException An error occurred when interacting with the data source. */ private List getRelatedParents(final Contentlet contentlet, final Relationship rel, - final User user, final boolean respectFrontendRoles, int limitParam, final int offset) + final User user, final boolean respectFrontendRoles, int limitParam, final int offset) throws DotSecurityException, DotDataException { final boolean HAS_NO_PARENT = Boolean.FALSE; final boolean WORKING_VERSION = Boolean.FALSE; @@ -2232,8 +2227,8 @@ private List getRelatedParents(final Contentlet contentlet, final Re @Override public List getRelatedContent(Contentlet contentlet, Relationship rel, - Boolean pullByParent, User user, boolean respectFrontendRoles, int limit, int offset, - String sortBy) throws DotDataException { + Boolean pullByParent, User user, boolean respectFrontendRoles, int limit, int offset, + String sortBy) throws DotDataException { return getRelatedContent(contentlet, rel, pullByParent, user, respectFrontendRoles, limit, offset, sortBy, -1, null); } @@ -2241,9 +2236,9 @@ public List getRelatedContent(Contentlet contentlet, Relationship re @CloseDBIfOpened @Override public List getRelatedContent(final Contentlet contentlet, final Relationship rel, - final Boolean pullByParent, final User user, final boolean respectFrontendRoles, - final int limit, final int offset, - final String sortBy, final long language, final Boolean live) + final Boolean pullByParent, final User user, final boolean respectFrontendRoles, + final int limit, final int offset, + final String sortBy, final long language, final Boolean live) throws DotDataException { String fieldVariable = rel.getRelationTypeValue(); try { @@ -2284,8 +2279,8 @@ public List getRelatedContent(final Contentlet contentlet, final Rel @Override public List getRelatedContent(Contentlet contentlet, Relationship rel, - Boolean pullByParent, User user, boolean respectFrontendRoles, final long language, - final Boolean live) + Boolean pullByParent, User user, boolean respectFrontendRoles, final long language, + final Boolean live) throws DotDataException, DotSecurityException { return getRelatedContent(contentlet, rel, pullByParent, user, respectFrontendRoles, -1, -1, null, language, live); @@ -2293,7 +2288,7 @@ public List getRelatedContent(Contentlet contentlet, Relationship re @Override public List getRelatedContent(Contentlet contentlet, Relationship rel, - Boolean pullByParent, User user, boolean respectFrontendRoles) + Boolean pullByParent, User user, boolean respectFrontendRoles) throws DotDataException, DotSecurityException { return getRelatedContent(contentlet, rel, pullByParent, user, respectFrontendRoles, -1, -1, null); @@ -2314,8 +2309,8 @@ public List getRelatedContent(Contentlet contentlet, Relationship re */ @Deprecated public List getRelatedContentFromIndex(final Contentlet contentlet, - final Relationship rel, final boolean pullByParent, - final User user, final boolean respectFrontendRoles) + final Relationship rel, final boolean pullByParent, + final User user, final boolean respectFrontendRoles) throws DotDataException, DotSecurityException { try { @@ -2348,8 +2343,8 @@ public List getRelatedContentFromIndex(final Contentlet contentlet, * @throws DotDataException */ private Optional checkAndRunDeleteAsWorkflow(final Contentlet contentletIn, - final User user, - final boolean respectFrontendRoles) throws DotSecurityException, DotDataException { + final User user, + final boolean respectFrontendRoles) throws DotSecurityException, DotDataException { // if already on workflow or has an actionid skip this method. if (this.isDisableWorkflow(contentletIn) @@ -2413,7 +2408,7 @@ private Optional checkAndRunDeleteAsWorkflow(final Contentlet contentle @Override public boolean delete(final Contentlet contentlet, final User user, - final boolean respectFrontendRoles) throws DotDataException, DotSecurityException { + final boolean respectFrontendRoles) throws DotDataException, DotSecurityException { final Optional deleteOpt = this.checkAndRunDeleteAsWorkflow(contentlet, user, respectFrontendRoles); @@ -2445,7 +2440,7 @@ public boolean delete(final Contentlet contentlet, final User user, @Override public boolean delete(final Contentlet contentlet, final User user, - final boolean respectFrontendRoles, final boolean allVersions) + final boolean respectFrontendRoles, final boolean allVersions) throws DotDataException, DotSecurityException { final List contentlets = new ArrayList<>(); @@ -2469,7 +2464,7 @@ public boolean delete(final Contentlet contentlet, final User user, @WrapInTransaction @Override public boolean deleteByHost(final Host host, final User user, - final boolean respectFrontendRoles) + final boolean respectFrontendRoles) throws DotDataException, DotSecurityException { final DotConnect db = new DotConnect(); @@ -2514,7 +2509,7 @@ public boolean deleteByHost(final Host host, final User user, @WrapInTransaction @Override public boolean delete(final List contentlets, final User user, - final boolean respectFrontendRoles) + final boolean respectFrontendRoles) throws DotDataException, DotSecurityException { return deleteContentlets(contentlets, user, respectFrontendRoles, false); @@ -2531,8 +2526,8 @@ public boolean delete(final List contentlets, final User user, * @throws DotDataException */ private Optional checkAndRunDestroyAsWorkflow(final Contentlet contentletIn, - final User user, - final boolean respectFrontendRoles) throws DotSecurityException, DotDataException { + final User user, + final boolean respectFrontendRoles) throws DotSecurityException, DotDataException { // if already on workflow or has an actionid skip this method. if (this.isDisableWorkflow(contentletIn) @@ -2596,7 +2591,7 @@ private Optional checkAndRunDestroyAsWorkflow(final Contentlet contentl @Override public boolean destroy(final Contentlet contentlet, final User user, - final boolean respectFrontendRoles) throws DotDataException, DotSecurityException { + final boolean respectFrontendRoles) throws DotDataException, DotSecurityException { final Optional deleteOpt = this.checkAndRunDestroyAsWorkflow(contentlet, user, respectFrontendRoles); @@ -2623,7 +2618,7 @@ public boolean destroy(final Contentlet contentlet, final User user, @WrapInTransaction @Override public boolean destroy(final List contentlets, final User user, - final boolean respectFrontendRoles) throws DotDataException, + final boolean respectFrontendRoles) throws DotDataException, DotSecurityException { boolean destroyed = false; @@ -2655,7 +2650,7 @@ public boolean destroy(final List contentlets, final User user, } private boolean internalDestroy(final List contentlets, final User user, - final boolean respectFrontendRoles) throws DotSecurityException, DotDataException { + final boolean respectFrontendRoles) throws DotSecurityException, DotDataException { this.logContentletActivity(contentlets, "Destroying Content", user); @@ -2712,7 +2707,7 @@ private void forceUnpublishArchive(final Contentlet contentlet, final User user) } private void deleteRelationships(final Contentlet contentlet, final User user, - final boolean respectFrontendRoles) + final boolean respectFrontendRoles) throws DotSecurityException, DotDataException { final List relationships = @@ -2769,7 +2764,7 @@ private void deleteMultitrees(final Contentlet contentlet, final User user) * perform this action. */ private boolean destroyContentlets(final List contentlets, final User user, - final boolean respectFrontendRoles) + final boolean respectFrontendRoles) throws DotDataException, DotSecurityException { boolean noErrors = true; @@ -2970,7 +2965,7 @@ private void backupDestroyedContentlets(final List contentlets, fina * @throws DotStateException One of the specified contentlets is not archived. */ private boolean deleteContentlets(final List contentlets, final User user, - final boolean respectFrontendRoles, final boolean isDeletingAHost) + final boolean respectFrontendRoles, final boolean isDeletingAHost) throws DotDataException, DotSecurityException { @@ -3018,8 +3013,8 @@ private boolean deleteContentlets(final List contentlets, final User } private void deleteContentlet(final List contentlets, final User user, - final boolean isDeletingAHost, - final HashSet deletedIdentifiers, final Contentlet contentletToDelete) + final boolean isDeletingAHost, + final HashSet deletedIdentifiers, final Contentlet contentletToDelete) throws DotDataException, DotSecurityException { //If we are deleting a Site/Host, we can call directly the destroy method. @@ -3181,7 +3176,7 @@ private void unlinkRelatedContentType(User user, Contentlet c) @WrapInTransaction @Override public void deleteAllVersionsandBackup(List contentlets, User user, - boolean respectFrontendRoles) throws DotDataException, DotSecurityException { + boolean respectFrontendRoles) throws DotDataException, DotSecurityException { if (contentlets == null || contentlets.size() == 0) { Logger.info(this, "No contents passed to delete so returning"); return; @@ -3263,7 +3258,7 @@ public void deleteAllVersionsandBackup(List contentlets, User user, @WrapInTransaction @Override public void delete(List contentlets, User user, boolean respectFrontendRoles, - boolean allVersions) throws DotDataException, DotSecurityException { + boolean allVersions) throws DotDataException, DotSecurityException { for (Contentlet con : contentlets) { if (con.getInode().equals("")) { throw new DotContentletStateException(CAN_T_CHANGE_STATE_OF_CHECKED_OUT_CONTENT); @@ -3353,7 +3348,7 @@ public void deleteVersion(Contentlet contentlet, User user, boolean respectFront @WrapInTransaction @Override public void archive(final Contentlet contentlet, final User user, - final boolean respectFrontendRoles) + final boolean respectFrontendRoles) throws DotDataException, DotSecurityException, DotContentletStateException { archive(contentlet, user, respectFrontendRoles, false); @@ -3370,8 +3365,8 @@ public void archive(final Contentlet contentlet, final User user, * @throws DotDataException */ private Optional checkAndRunArchiveAsWorkflow(final Contentlet contentletIn, - final User user, - final boolean respectFrontendRoles) throws DotSecurityException, DotDataException { + final User user, + final boolean respectFrontendRoles) throws DotSecurityException, DotDataException { // if already on workflow or has an actionid skip this method. if (this.isDisableWorkflow(contentletIn) @@ -3428,7 +3423,7 @@ private Optional checkAndRunArchiveAsWorkflow(final Contentlet conte } private void archive(final Contentlet contentlet, final User user, - final boolean respectFrontendRoles, final boolean isDestroy) + final boolean respectFrontendRoles, final boolean isDestroy) throws DotDataException, DotSecurityException, DotContentletStateException { this.logContentletActivity(contentlet, "Archiving Content", user); @@ -3467,8 +3462,8 @@ private void archive(final Contentlet contentlet, final User user, } private void internalArchive(final Contentlet contentlet, final User user, - final boolean respectFrontendRoles, - final boolean isDestroy) throws DotDataException, DotSecurityException { + final boolean respectFrontendRoles, + final boolean isDestroy) throws DotDataException, DotSecurityException { if (!permissionAPI.doesUserHavePermission(contentlet, PermissionAPI.PERMISSION_EDIT, user, respectFrontendRoles)) { @@ -3525,10 +3520,10 @@ private void internalArchive(final Contentlet contentlet, final User user, } // internalArchive. private void internalArchive(final Contentlet contentlet, final User user, - final boolean respectFrontendRoles, - final boolean isDestroy, final IndexPolicy indexPolicy, - final IndexPolicy indexPolicyDependencies, - final Contentlet workingContentlet, final Contentlet liveContentlet) + final boolean respectFrontendRoles, + final boolean isDestroy, final IndexPolicy indexPolicy, + final IndexPolicy indexPolicyDependencies, + final Contentlet workingContentlet, final Contentlet liveContentlet) throws DotDataException, DotSecurityException { if (liveContentlet != null && InodeUtils.isSet(liveContentlet.getInode())) { @@ -3571,7 +3566,7 @@ private void internalArchive(final Contentlet contentlet, final User user, } // internalArchive. private void archiveFileAsset(final Contentlet contentlet, final User user, - final boolean respectFrontendRoles) + final boolean respectFrontendRoles) throws DotDataException, DotSecurityException { if (contentlet.getStructure().getStructureType() == Structure.STRUCTURE_TYPE_FILEASSET) { @@ -3613,7 +3608,7 @@ private User getModUser(final Contentlet workingContentlet) { // todo: everything should be in a transaction>???? @Override public void archive(final List contentlets, final User user, - final boolean respectFrontendRoles) throws DotDataException, DotSecurityException { + final boolean respectFrontendRoles) throws DotDataException, DotSecurityException { boolean stateError = false; for (final Contentlet contentlet : contentlets) { @@ -3743,7 +3738,7 @@ public void refresh(ContentType type) throws DotReindexStateException { @WrapInTransaction @Override public Contentlet copyContentToVariant(final Contentlet contentlet, final String variantName, - final User user) throws DotDataException, DotSecurityException { + final User user) throws DotDataException, DotSecurityException { final Contentlet contentletFromDataBase = find(contentlet.getInode(), user, false); @@ -3751,7 +3746,7 @@ public Contentlet copyContentToVariant(final Contentlet contentlet, final String checkout.setVariantId(variantName); return Try.of(() -> checkin(checkout, user, false)) - .getOrElseThrow( + .getOrElseThrow( e -> new DotStateException("Unable to create a new version from Contentlet:" + contentlet.getInode(), e)); } @@ -3840,7 +3835,7 @@ public void refreshContentUnderFolderPath(String hostId, String folderPath) @WrapInTransaction @Override public void unpublish(final Contentlet contentlet, final User user, - final boolean respectFrontendRoles) + final boolean respectFrontendRoles) throws DotDataException, DotSecurityException, DotContentletStateException { if (StringPool.BLANK.equals(contentlet.getInode())) { @@ -3869,8 +3864,8 @@ public void unpublish(final Contentlet contentlet, final User user, * @throws DotDataException */ private Optional checkAndRunUnpublishAsWorkflow(final Contentlet contentletIn, - final User user, - final boolean respectFrontendRoles) throws DotSecurityException, DotDataException { + final User user, + final boolean respectFrontendRoles) throws DotSecurityException, DotDataException { // if already on workflow or has an actionid skip this method. if (this.isDisableWorkflow(contentletIn) @@ -3927,7 +3922,7 @@ private Optional checkAndRunUnpublishAsWorkflow(final Contentlet con } private void unpublish(final Contentlet contentlet, final User user, - final boolean respectFrontendRoles, final int reindex) + final boolean respectFrontendRoles, final int reindex) throws DotDataException, DotSecurityException, DotContentletStateException { if (contentlet == null || !UtilMethods.isSet(contentlet.getInode())) { @@ -4049,7 +4044,7 @@ private void internalUnpublish(final Contentlet contentlet, final User user, fin } private void cleanFileAssetCache(final Contentlet contentlet, final User user, - final boolean respectFrontEndPermissions) + final boolean respectFrontEndPermissions) throws DotDataException, DotSecurityException { final Identifier identifier = APILocator.getIdentifierAPI().find(contentlet); @@ -4068,7 +4063,7 @@ private void cleanFileAssetCache(final Contentlet contentlet, final User user, // todo:should be in a transaction? @Override public void unpublish(final List contentlets, final User user, - final boolean respectFrontendRoles) + final boolean respectFrontendRoles) throws DotDataException, DotSecurityException, DotContentletStateException { boolean stateError = false; @@ -4105,8 +4100,8 @@ public void unpublish(final List contentlets, final User user, * @throws DotDataException */ private Optional checkAndRunUnarchiveAsWorkflow(final Contentlet contentletIn, - final User user, - final boolean respectFrontendRoles) throws DotSecurityException, DotDataException { + final User user, + final boolean respectFrontendRoles) throws DotSecurityException, DotDataException { // if already on workflow or has an actionid skip this method. if (this.isDisableWorkflow(contentletIn) @@ -4165,7 +4160,7 @@ private Optional checkAndRunUnarchiveAsWorkflow(final Contentlet con @WrapInTransaction @Override public void unarchive(final Contentlet contentlet, final User user, - final boolean respectFrontendRoles) + final boolean respectFrontendRoles) throws DotDataException, DotSecurityException, DotContentletStateException { final String contentPushPublishDate = UtilMethods.get( @@ -4228,7 +4223,7 @@ public void unarchive(final Contentlet contentlet, final User user, } private void internalUnarchive(final Contentlet contentlet, final User user, - final boolean respectFrontendRoles) + final boolean respectFrontendRoles) throws DotDataException, DotSecurityException { final Contentlet workingContentlet = this.findContentletByIdentifier( @@ -4284,7 +4279,7 @@ private void sendUnArchiveContentSystemEvent(final Contentlet contentlet) { // todo: should be in a transaction. @Override public void unarchive(final List contentlets, final User user, - final boolean respectFrontendRoles) + final boolean respectFrontendRoles) throws DotDataException, DotSecurityException, DotContentletStateException { boolean stateError = false; @@ -4310,7 +4305,7 @@ public void unarchive(final List contentlets, final User user, @Override public void deleteRelatedContent(Contentlet contentlet, Relationship relationship, User user, - boolean respectFrontendRoles) + boolean respectFrontendRoles) throws DotDataException, DotSecurityException, DotContentletStateException { this.deleteRelatedContent(contentlet, relationship, APILocator.getRelationshipAPI() @@ -4319,7 +4314,7 @@ public void deleteRelatedContent(Contentlet contentlet, Relationship relationshi @Override public void deleteRelatedContent(final Contentlet contentlet, final Relationship relationship, - final boolean hasParent, final User user, final boolean respectFrontendRoles) + final boolean hasParent, final User user, final boolean respectFrontendRoles) throws DotDataException, DotSecurityException, DotContentletStateException { deleteRelatedContent(contentlet, relationship, hasParent, user, respectFrontendRoles, Collections.emptyList()); @@ -4328,8 +4323,8 @@ public void deleteRelatedContent(final Contentlet contentlet, final Relationship @WrapInTransaction @Override public void deleteRelatedContent(final Contentlet contentlet, final Relationship relationship, - final boolean hasParent, final User user, final boolean respectFrontendRoles, - final List contentletsToBeRelated) + final boolean hasParent, final User user, final boolean respectFrontendRoles, + final List contentletsToBeRelated) throws DotDataException, DotSecurityException, DotContentletStateException { if (!permissionAPI.doesUserHavePermission(contentlet, PermissionAPI.PERMISSION_EDIT, user, @@ -4391,7 +4386,7 @@ public void deleteRelatedContent(final Contentlet contentlet, final Relationship @Override public void invalidateRelatedContentCache(Contentlet contentlet, Relationship relationship, - boolean hasParent) { + boolean hasParent) { //If relationship field, related content cache must be invalidated if (relationship.isRelationshipField()) { @@ -4424,10 +4419,10 @@ public void invalidateRelatedContentCache(Contentlet contentlet, Relationship re @Override public List getRelatedContent(final Contentlet contentlet, - final String variableName, - final User user, - final boolean respectFrontendRoles, Boolean pullByParents, final int limit, - final int offset, final String sortBy) { + final String variableName, + final User user, + final boolean respectFrontendRoles, Boolean pullByParents, final int limit, + final int offset, final String sortBy) { return getRelatedContent(contentlet, variableName, user, respectFrontendRoles, pullByParents, limit, offset, sortBy, -1, null); } @@ -4435,10 +4430,10 @@ public List getRelatedContent(final Contentlet contentlet, @CloseDBIfOpened @Override public List getRelatedContent(final Contentlet contentlet, - final String variableName, - final User user, - final boolean respectFrontendRoles, Boolean pullByParents, final int limit, - final int offset, final String sortBy, final long language, final Boolean live) { + final String variableName, + final User user, + final boolean respectFrontendRoles, Boolean pullByParents, final int limit, + final int offset, final String sortBy, final long language, final Boolean live) { if (variableName == null) { return Collections.EMPTY_LIST; @@ -4524,9 +4519,9 @@ public List getRelatedContent(final Contentlet contentlet, */ @Nullable private List getNonCachedRelatedContentlets(final Contentlet contentlet, - final Map> relatedIds, final String variableName, - final Boolean pullByParent, final int limit, final int offset, final long language, - final Boolean live) + final Map> relatedIds, final String variableName, + final Boolean pullByParent, final int limit, final int offset, final long language, + final Boolean live) throws DotDataException, DotSecurityException { final User systemUser = APILocator.getUserAPI().getSystemUser(); @@ -4594,7 +4589,7 @@ private List getNonCachedRelatedContentlets(final Contentlet content */ @NotNull private List getCachedRelatedContentlets(final Map> relatedIds, - final String variableName, final long language, final Boolean live) { + final String variableName, final long language, final Boolean live) { return relatedIds .get(variableName).stream() @@ -4610,15 +4605,15 @@ private List getCachedRelatedContentlets(final Map filterRelatedContentByLiveAndLanguage(final long language, - final Boolean live, - final String identifier) { + final Boolean live, + final String identifier) { final List relatedContentList = new ArrayList<>(); //If language is set, we must return the content version in that language. //Otherwise, we need to return a version for each language if exists List languages = language > 0 ? CollectionsUtils.list(language) : languageAPI.getLanguages().stream().map(lang -> lang.getId()).collect( - Collectors.toList()); + Collectors.toList()); for (Long currentLanguage : languages) { try { @@ -4643,9 +4638,9 @@ private Stream filterRelatedContentByLiveAndLanguage(final @CloseDBIfOpened @Override public void relateContent(final Contentlet contentlet, - final Relationship rel, - final List records, - final User user, boolean respectFrontendRoles) + final Relationship rel, + final List records, + final User user, boolean respectFrontendRoles) throws DotDataException, DotSecurityException, DotContentletStateException { final Structure structure = CacheLocator.getContentTypeCache() @@ -4673,9 +4668,9 @@ private List getContentParents(final String inode) throws DotDataException @CloseDBIfOpened @Override public void relateContent(final Contentlet contentlet, - final ContentletRelationshipRecords related, - final User user, - final boolean respectFrontendRoles) + final ContentletRelationshipRecords related, + final User user, + final boolean respectFrontendRoles) throws DotDataException, DotSecurityException, DotContentletStateException { if (!permissionAPI.doesUserHavePermission(contentlet, PermissionAPI.PERMISSION_EDIT, user, @@ -4802,7 +4797,7 @@ public void publish(List contentlets, User user, boolean respectFron @CloseDBIfOpened @Override public boolean isContentEqual(Contentlet contentlet1, Contentlet contentlet2, User user, - boolean respectFrontendRoles) throws DotSecurityException, DotDataException { + boolean respectFrontendRoles) throws DotSecurityException, DotDataException { if (!permissionAPI.doesUserHavePermission(contentlet1, PermissionAPI.PERMISSION_READ, user, respectFrontendRoles)) { throw new DotSecurityException("User: " + (user != null ? user.getUserId() : "Unknown") @@ -4833,8 +4828,8 @@ public List getSiblings(String identifier) @CloseDBIfOpened @Override public Contentlet checkin(Contentlet contentlet, List cats, - List permissions, User user, - boolean respectFrontendRoles) + List permissions, User user, + boolean respectFrontendRoles) throws IllegalArgumentException, DotDataException, DotSecurityException, DotContentletStateException { return checkin(contentlet, (Map>) null, cats, permissions, @@ -4845,7 +4840,7 @@ public Contentlet checkin(Contentlet contentlet, List cats, @CloseDBIfOpened @Override public Contentlet checkin(Contentlet contentlet, List permissions, User user, - boolean respectFrontendRoles) + boolean respectFrontendRoles) throws IllegalArgumentException, DotDataException, DotSecurityException, DotContentletStateException { return checkin(contentlet, (ContentletRelationships) null, null, permissions, user, @@ -4855,8 +4850,8 @@ public Contentlet checkin(Contentlet contentlet, List permissions, U @CloseDBIfOpened @Override public Contentlet checkin(Contentlet contentlet, - Map> contentRelationships, - List cats, User user, boolean respectFrontendRoles) + Map> contentRelationships, + List cats, User user, boolean respectFrontendRoles) throws IllegalArgumentException, DotDataException, DotSecurityException, DotContentletStateException { return checkin(contentlet, contentRelationships, cats, user, respectFrontendRoles, false); } @@ -4864,8 +4859,8 @@ public Contentlet checkin(Contentlet contentlet, @CloseDBIfOpened @Override public Contentlet checkin(Contentlet contentlet, - Map> contentRelationships, User user, - boolean respectFrontendRoles) + Map> contentRelationships, User user, + boolean respectFrontendRoles) throws IllegalArgumentException, DotDataException, DotSecurityException, DotContentletStateException { return checkin(contentlet, contentRelationships, null, user, respectFrontendRoles); } @@ -4884,16 +4879,16 @@ public Contentlet checkin(Contentlet contentlet, User user, boolean respectFront @CloseDBIfOpened @Override public Contentlet checkin(Contentlet contentlet, User user, boolean respectFrontendRoles, - List cats) + List cats) throws IllegalArgumentException, DotDataException, DotSecurityException { return checkin(contentlet, null, cats, user, respectFrontendRoles); } @Override public Contentlet checkin(Contentlet contentlet, - Map> contentRelationships, - List cats, List permissions, User user, - boolean respectFrontendRoles) + Map> contentRelationships, + List cats, List permissions, User user, + boolean respectFrontendRoles) throws DotDataException, DotSecurityException, DotContentletStateException, DotContentletValidationException { final Contentlet contentletReturned = checkin(contentlet, contentRelationships, cats, user, respectFrontendRoles, false); @@ -4918,9 +4913,9 @@ public Contentlet checkin(Contentlet contentlet, */ @CloseDBIfOpened private Contentlet checkin(Contentlet contentlet, - Map> contentRelationships, - List cats, User user, boolean respectFrontendRoles, - boolean generateSystemEvent) + Map> contentRelationships, + List cats, User user, boolean respectFrontendRoles, + boolean generateSystemEvent) throws DotDataException, DotSecurityException, DotContentletStateException { ContentletRelationships relationshipsData = getContentletRelationshipsFromMap(contentlet, @@ -4932,13 +4927,13 @@ private Contentlet checkin(Contentlet contentlet, @Override public Contentlet checkin(Contentlet contentlet, ContentletRelationships contentRelationships, - List cats, - List permissions, User user, boolean respectFrontendRoles) + List cats, + List permissions, User user, boolean respectFrontendRoles) throws DotDataException, DotSecurityException, DotContentletStateException { final Contentlet contentletReturned = - checkin(contentlet, contentRelationships, cats, user, respectFrontendRoles, true, - false); + checkin(contentlet, contentRelationships, cats, user, respectFrontendRoles, true, + false); this.handlePermissions(permissions, user, respectFrontendRoles, contentletReturned); @@ -4946,7 +4941,7 @@ public Contentlet checkin(Contentlet contentlet, ContentletRelationships content } private ContentletRelationships getContentletRelationshipsFromMap(final Contentlet contentlet, - final Map> contentRelationships) { + final Map> contentRelationships) { return new ContentletRelationshipsTransformer(contentlet, contentRelationships).findFirst(); } @@ -4954,8 +4949,8 @@ private ContentletRelationships getContentletRelationshipsFromMap(final Contentl @CloseDBIfOpened @Override public Contentlet checkinWithoutVersioning(Contentlet contentlet, - Map> contentRelationships, List cats, - List permissions, User user, boolean respectFrontendRoles) + Map> contentRelationships, List cats, + List permissions, User user, boolean respectFrontendRoles) throws DotDataException, DotSecurityException, DotContentletStateException, DotContentletValidationException { final ContentletRelationships relationshipsData = getContentletRelationshipsFromMap(contentlet, @@ -4971,8 +4966,8 @@ public Contentlet checkinWithoutVersioning(Contentlet contentlet, @CloseDBIfOpened @Override public Contentlet checkinWithoutVersioning(final Contentlet contentlet, - final ContentletRelationships contentRelationships, final List cats, - final List permissions, final User user, final boolean respectFrontendRoles) + final ContentletRelationships contentRelationships, final List cats, + final List permissions, final User user, final boolean respectFrontendRoles) throws DotContentletStateException, DotSecurityException, DotDataException { return checkin(contentlet, contentRelationships, cats, user, respectFrontendRoles, false, false); @@ -4993,9 +4988,9 @@ public Contentlet checkinWithoutVersioning(final Contentlet contentlet, */ @WrapInTransaction private Contentlet checkin(final Contentlet contentletIn, - final ContentletRelationships contentRelationships, - final List categories, final User user, boolean respectFrontendRoles, - final boolean createNewVersion, final boolean generateSystemEvent) + final ContentletRelationships contentRelationships, + final List categories, final User user, boolean respectFrontendRoles, + final boolean createNewVersion, final boolean generateSystemEvent) throws DotDataException, DotSecurityException { Contentlet contentletOut = null; @@ -5153,8 +5148,8 @@ private void checkOrSetContentType(final Contentlet contentletIn, final User use * @throws DotDataException */ private Optional checkAndRunPublishAsWorkflow(final Contentlet contentletIn, - final User user, - final boolean respectFrontendRoles) throws DotSecurityException, DotDataException { + final User user, + final boolean respectFrontendRoles) throws DotSecurityException, DotDataException { // if already on workflow or has an actionid skip this method. if (this.isDisableWorkflow(contentletIn) @@ -5211,9 +5206,9 @@ private Optional checkAndRunPublishAsWorkflow(final Contentlet conte } private boolean isDefaultActionOnAvailableActions(final Contentlet contentletIn, - final User user, - final WorkflowAPI workflowAPI, - final String actionId) throws DotDataException, DotSecurityException { + final User user, + final WorkflowAPI workflowAPI, + final String actionId) throws DotDataException, DotSecurityException { if (workflowAPI.isActionAvailable(contentletIn, user, actionId)) { @@ -5227,10 +5222,10 @@ private boolean isDefaultActionOnAvailableActions(final Contentlet contentletIn, } private Optional validateWorkflowStateOrRunAsWorkflow(final Contentlet contentletIn, - final ContentletRelationships contentRelationships, - final List categories, final User userIn, - final boolean respectFrontendRoles, final boolean createNewVersion, - boolean generateSystemEvent) throws DotSecurityException, DotDataException { + final ContentletRelationships contentRelationships, + final List categories, final User userIn, + final boolean respectFrontendRoles, final boolean createNewVersion, + boolean generateSystemEvent) throws DotSecurityException, DotDataException { final User user = (userIn == null) ? APILocator.getUserAPI().getAnonymousUser() : userIn; @@ -5306,10 +5301,10 @@ private boolean isWorkflowInProgress(final Contentlet contentlet) { } private Contentlet internalCheckin(Contentlet contentlet, - ContentletRelationships contentRelationships, List categories, - final User incomingUser, - final boolean respectFrontendRoles, - boolean createNewVersion + ContentletRelationships contentRelationships, List categories, + final User incomingUser, + final boolean respectFrontendRoles, + boolean createNewVersion ) throws DotDataException, DotSecurityException { final User user = @@ -5705,8 +5700,8 @@ private boolean shouldRemoveOldHostCache(Contentlet contentlet, String oldHostId * @throws DotDataException */ private boolean addOrUpdateContentletIdentifier(final Contentlet contentlet, - final Contentlet contentletRaw, - final String existingIdentifier, final String existingInode, final String htmlPageURL) + final Contentlet contentletRaw, + final String existingIdentifier, final String existingInode, final String htmlPageURL) throws DotSecurityException, DotDataException { final FolderAPI folderAPI = APILocator.getFolderAPI(); @@ -5831,8 +5826,8 @@ private boolean addOrUpdateContentletIdentifier(final Contentlet contentlet, * @return */ private Contentlet includeSystemFields(final Contentlet contentlet, - final Contentlet contentletRaw, final Map tagsValues, - final List categories, final User user) { + final Contentlet contentletRaw, final Map tagsValues, + final List categories, final User user) { final ContentType contentType = contentlet.getContentType(); final Contentlet systemFieldsInclusiveContentlet = new Contentlet(contentlet); final Map map = systemFieldsInclusiveContentlet.getMap(); @@ -5884,10 +5879,10 @@ private Contentlet includeSystemFields(final Contentlet contentlet, * @throws DotSecurityException */ private void invalidateThenReindex(final Contentlet contentlet, final boolean createNewVersion, - final User user, - final boolean changedURI, final boolean isNewContent, - final boolean structureHasAHostField, - final boolean movedContentDependencies) throws DotDataException, DotSecurityException { + final User user, + final boolean changedURI, final boolean isNewContent, + final boolean structureHasAHostField, + final boolean movedContentDependencies) throws DotDataException, DotSecurityException { boolean isLive = false; if (contentlet.isHTMLPage()) { try { @@ -5967,8 +5962,8 @@ private void invalidateThenReindex(final Contentlet contentlet, final boolean cr * @return tagsHost */ private String prepareTags(final Contentlet contentlet, final User user, - final ContentType contentType, - final boolean structureHasAHostField, final HashMap tagsValues) { + final ContentType contentType, + final boolean structureHasAHostField, final HashMap tagsValues) { String tagsHost = Host.SYSTEM_HOST; for (com.dotcms.contenttype.model.field.Field field : contentType.fields(TagField.class)) { @@ -6018,8 +6013,8 @@ private String prepareTags(final Contentlet contentlet, final User user, * @throws DotSecurityException */ private void flushMenuCacheIfNeeded(final Contentlet contentlet, - final Contentlet workingContentlet, - final boolean isNewContent, final User systemUser) + final Contentlet workingContentlet, + final boolean isNewContent, final User systemUser) throws DotDataException, DotSecurityException { // both file & page as content might trigger a menu cache flush if (contentlet.isFileAsset() || contentlet.isHTMLPage()) { @@ -6062,7 +6057,7 @@ private void flushMenuCacheIfNeeded(final Contentlet contentlet, * @throws DotSecurityException */ private void updatePublishAndExpireDates(final Contentlet contentlet, final User systemUser, - final Contentlet contentletRaw) + final Contentlet contentletRaw) throws DotDataException, DotSecurityException { // lets update identifier's sysPubDate & sysExpireDate if ((contentlet != null) && InodeUtils.isSet(contentlet.getIdentifier())) { @@ -6150,7 +6145,7 @@ private void updatePublishAndExpireDates(final Contentlet contentlet, final User * @throws DotDataException */ private Contentlet relateTags(final Contentlet contentlet, final Map tagsValues, - final String tagsHost) throws DotSecurityException, DotDataException { + final String tagsHost) throws DotSecurityException, DotDataException { //Relate the tags with the saved contentlet for (final Entry tagEntry : tagsValues.entrySet()) { //From the given CSV tags names list search for the tag objects and if does not exist create them @@ -6187,8 +6182,8 @@ private Contentlet relateTags(final Contentlet contentlet, final Map this.localSystemEventsAPI.notify( @@ -6559,7 +6554,7 @@ private void updateTemplateInAllLanguageVersions(final Contentlet contentlet, fi } private void pushSaveEvent(final Contentlet eventContentlet, - final boolean eventCreateNewVersion) throws DotHibernateException { + final boolean eventCreateNewVersion) throws DotHibernateException { HibernateUtil.addCommitListener( () -> this.contentletSystemEventUtil.pushSaveEvent(eventContentlet, @@ -6579,7 +6574,7 @@ private List getExistingContentCategories(Contentlet contentlet) } private void throwSecurityException(final Contentlet contentlet, - final User user) throws DotSecurityException { + final User user) throws DotSecurityException { final String userName = (user != null ? user.getUserId() : "Unknown"); final String message = UtilMethods.isSet(contentlet.getIdentifier()) ? @@ -6593,7 +6588,7 @@ private void throwSecurityException(final Contentlet contentlet, // todo: should be this in a transaction??? @Override public List checkout(List contentlets, User user, - boolean respectFrontendRoles) + boolean respectFrontendRoles) throws DotDataException, DotSecurityException, DotContentletStateException { List result = new ArrayList<>(); for (Contentlet contentlet : contentlets) { @@ -6605,7 +6600,7 @@ public List checkout(List contentlets, User user, // todo: should be this in a transaction??? @Override public List checkoutWithQuery(String luceneQuery, User user, - boolean respectFrontendRoles) + boolean respectFrontendRoles) throws DotDataException, DotSecurityException, DotContentletStateException { List result = new ArrayList<>(); List cons = search(luceneQuery, 0, -1, "", user, respectFrontendRoles); @@ -6618,7 +6613,7 @@ public List checkoutWithQuery(String luceneQuery, User user, // todo: should be this in a transaction??? @Override public List checkout(String luceneQuery, User user, boolean respectFrontendRoles, - int offset, int limit) + int offset, int limit) throws DotDataException, DotSecurityException, DotContentletStateException { List result = new ArrayList<>(); List cons = search(luceneQuery, limit, offset, "", user, respectFrontendRoles); @@ -6631,7 +6626,7 @@ public List checkout(String luceneQuery, User user, boolean respectF @WrapInTransaction @Override public Contentlet checkout(final String contentletInode, final User user, - final boolean respectFrontendRoles) + final boolean respectFrontendRoles) throws DotDataException, DotSecurityException, DotContentletStateException { //return new version final Contentlet contentlet = find(contentletInode, user, respectFrontendRoles); @@ -6678,8 +6673,8 @@ is always sent from the UI, but if we checkout the content and then save (checki * @throws DotSecurityException */ private void moveContentDependencies(final Contentlet fromContentlet, - final Contentlet toContentlet, ContentletRelationships contentRelationships, - List categories, final User user, final boolean respect) + final Contentlet toContentlet, ContentletRelationships contentRelationships, + List categories, final User user, final boolean respect) throws DotDataException, DotSecurityException { //Handles Categories @@ -6698,8 +6693,8 @@ private void moveContentDependencies(final Contentlet fromContentlet, * @throws DotSecurityException */ private void moveContentRelationships(final Contentlet fromContentlet, - final Contentlet toContentlet, - ContentletRelationships contentRelationships, final User user) + final Contentlet toContentlet, + ContentletRelationships contentRelationships, final User user) throws DotDataException, DotSecurityException { if (contentRelationships == null) { @@ -6735,9 +6730,9 @@ private void moveContentRelationships(final Contentlet fromContentlet, * @throws DotSecurityException */ private void addRestrictedContentForLimitedUser(final Contentlet fromContentlet, - final ContentletRelationships contentRelationships, final User user, - final ContentType contentType, - final RelationshipAPI relationshipAPI) throws DotDataException, DotSecurityException { + final ContentletRelationships contentRelationships, final User user, + final ContentType contentType, + final RelationshipAPI relationshipAPI) throws DotDataException, DotSecurityException { for (ContentletRelationshipRecords contentletRelationshipRecords : contentRelationships .getRelationshipsRecords()) { if (contentletRelationshipRecords.getRecords() != null) { @@ -6779,7 +6774,7 @@ private void addRestrictedContentForLimitedUser(final Contentlet fromContentlet, * @throws DotDataException */ private void getWipeOutRelationships(final ContentletRelationships contentRelationships, - final ContentType contentType, final RelationshipAPI relationshipAPI) + final ContentType contentType, final RelationshipAPI relationshipAPI) throws DotDataException { //wipe out all relationships final List relationships = APILocator.getRelationshipAPI() @@ -6812,8 +6807,8 @@ private void getWipeOutRelationships(final ContentletRelationships contentRelati * @param relatedContentlets */ private void addContentLimitedByPermissions(User user, - ContentletRelationshipRecords contentletRelationshipRecords, - List relatedContentlets) { + ContentletRelationshipRecords contentletRelationshipRecords, + List relatedContentlets) { //consider immutable collections contentletRelationshipRecords.setRecords( @@ -6842,8 +6837,8 @@ private void addContentLimitedByPermissions(User user, * @throws DotSecurityException */ private void moveContentCategories(final Contentlet fromContentlet, - final Contentlet toContentlet, - List categories, final User user, final boolean respect) + final Contentlet toContentlet, + List categories, final User user, final boolean respect) throws DotDataException, DotSecurityException { final List categoriesUserCannotRemove = new ArrayList<>(); if (categories == null) { @@ -6899,7 +6894,7 @@ public void restoreVersion(Contentlet contentlet, User user, boolean respectFron @CloseDBIfOpened @Override public List findAllUserVersions(Identifier identifier, User user, - boolean respectFrontendRoles) + boolean respectFrontendRoles) throws DotSecurityException, DotDataException, DotStateException { List contentlets = contentFactory.findAllUserVersions(identifier); if (contentlets.isEmpty()) { @@ -6918,7 +6913,7 @@ public List findAllUserVersions(Identifier identifier, User user, @CloseDBIfOpened @Override public List findAllVersions(Identifier identifier, User user, - boolean respectFrontendRoles) + boolean respectFrontendRoles) throws DotSecurityException, DotDataException, DotStateException { return findAllVersions(identifier, true, user, respectFrontendRoles); } @@ -6934,7 +6929,7 @@ public List findAllVersions(Identifier identifier, User user, */ @Override public List findLiveOrWorkingVersions(Set identifiers, User user, - boolean respectFrontendRoles) throws DotDataException, DotSecurityException { + boolean respectFrontendRoles) throws DotDataException, DotSecurityException { final List allVersions = contentFactory.findLiveOrWorkingVersions(identifiers); if (allVersions.isEmpty()) { @@ -6953,7 +6948,7 @@ public List findLiveOrWorkingVersions(Set identifiers, User @CloseDBIfOpened @Override public List findAllVersions(final Identifier identifier, final Variant variant, - final User user, boolean respectFrontendRoles) + final User user, boolean respectFrontendRoles) throws DotSecurityException, DotDataException { final List allVersions = contentFactory.findAllVersions(identifier, variant); @@ -6973,7 +6968,7 @@ public List findAllVersions(final Identifier identifier, final Varia @CloseDBIfOpened @Override public List findAllVersions(Identifier identifier, boolean bringOldVersions, - User user, boolean respectFrontendRoles) + User user, boolean respectFrontendRoles) throws DotSecurityException, DotDataException, DotStateException { List contentlets = contentFactory.findAllVersions(identifier, bringOldVersions); if (contentlets.isEmpty()) { @@ -6991,7 +6986,7 @@ public List findAllVersions(Identifier identifier, boolean bringOldV @CloseDBIfOpened @Override public String getName(final Contentlet contentlet, final User user, - final boolean respectFrontendRoles) + final boolean respectFrontendRoles) throws DotSecurityException, DotContentletStateException, DotDataException { Preconditions.checkNotNull(contentlet, "The contentlet is null"); @@ -7033,7 +7028,7 @@ public void copyProperties(Contentlet contentlet, Map properties */ @CloseDBIfOpened public void copyProperties(final Contentlet contentlet, final Map properties, - boolean checkIsUnique) throws DotContentletStateException, DotSecurityException { + boolean checkIsUnique) throws DotContentletStateException, DotSecurityException { if (!InodeUtils.isSet(contentlet.getStructureInode())) { Logger.warn(this, "Cannot copy properties to contentlet where structure inode < 1 : You must set the structure's inode"); @@ -7213,7 +7208,7 @@ private void copyWorkflowProperties(Contentlet contentlet, Map p @Override public List find(Category category, long languageId, boolean live, String orderBy, - User user, boolean respectFrontendRoles) + User user, boolean respectFrontendRoles) throws DotDataException, DotContentletStateException, DotSecurityException { List cats = new ArrayList<>(); return find(cats, languageId, live, orderBy, user, respectFrontendRoles); @@ -7221,7 +7216,7 @@ public List find(Category category, long languageId, boolean live, S @Override public List find(List categories, long languageId, boolean live, - String orderBy, User user, boolean respectFrontendRoles) + String orderBy, User user, boolean respectFrontendRoles) throws DotDataException, DotContentletStateException, DotSecurityException { if (categories == null || categories.size() < 1) { return new ArrayList<>(); @@ -7891,7 +7886,7 @@ public void validateContentlet(final Contentlet contentlet, final List } private String getUniqueFieldErrorMessage(final Field field, final Object fieldValue, - final ContentletSearch contentletSearch) { + final ContentletSearch contentletSearch) { return String.format( "Value of Field [%s] must be unique. Contents having the same value (%s): %s", @@ -7908,7 +7903,7 @@ private boolean getUniquePerSiteConfig(final com.dotcms.contenttype.model.field. } private void validateBinary(final File binary, final String fieldName, final Field legacyField, - final ContentType contentType) { + final ContentType contentType) { final Map fieldMap = contentType.fieldMap(); @@ -7987,7 +7982,7 @@ private void validateBinary(final File binary, final String fieldName, final Fie } // validateBinary. private void validateHtmlPage(Contentlet contentlet, String contentIdentifier, - ContentType contentType) { + ContentType contentType) { if (contentlet.getHost() != null && contentlet.getHost().equals(Host.SYSTEM_HOST) && ( !UtilMethods.isSet(contentlet.getFolder()) || contentlet.getFolder() .equals(FolderAPI.SYSTEM_FOLDER))) { @@ -8066,7 +8061,7 @@ private void validateHtmlPage(Contentlet contentlet, String contentIdentifier, } private void validateFileAsset(final Contentlet contentlet, final String contentIdentifier, - final ContentType contentType) { + final ContentType contentType) { if (contentlet.getHost() != null && contentlet.getHost().equals(Host.SYSTEM_HOST) && ( !UtilMethods.isSet(contentlet.getFolder()) || contentlet.getFolder() @@ -8159,7 +8154,7 @@ private void validateSite(Contentlet contentlet) { @CloseDBIfOpened @Override public void validateContentlet(Contentlet contentlet, - Map> contentRelationships, List cats) + Map> contentRelationships, List cats) throws DotContentletValidationException { Structure st = CacheLocator.getContentTypeCache() .getStructureByInode(contentlet.getStructureInode()); @@ -8179,7 +8174,7 @@ public void validateContentlet(Contentlet contentlet, @CloseDBIfOpened @Override public void validateContentletNoRels(final Contentlet contentlet, - final List cats) throws DotContentletValidationException { + final List cats) throws DotContentletValidationException { if (null != contentlet.getMap().get(Contentlet.DONT_VALIDATE_ME)) { return; } @@ -8207,8 +8202,8 @@ public void validateContentletNoRels(final Contentlet contentlet, @CloseDBIfOpened @Override public void validateContentlet(final Contentlet contentlet, - final ContentletRelationships contentRelationships, - final List cats) throws DotContentletValidationException { + final ContentletRelationships contentRelationships, + final List cats) throws DotContentletValidationException { if (null != contentlet.getMap().get(Contentlet.DONT_VALIDATE_ME)) { return; } @@ -8251,7 +8246,7 @@ public void validateContentlet(final Contentlet contentlet, * the user. */ private void validateRelationships(final Contentlet contentlet, - final ContentletRelationships contentRelationships) + final ContentletRelationships contentRelationships) throws DotContentletValidationException { boolean hasError = false; @@ -8425,8 +8420,8 @@ private void validateRelationships(final Contentlet contentlet, * @return */ private boolean isValidOneToOneRelationship(final Contentlet contentlet, - final DotContentletValidationException cve, final Relationship relationship, - final List contentsInRelationship) { + final DotContentletValidationException cve, final Relationship relationship, + final List contentsInRelationship) { //Trying to relate more than one piece of content if (contentsInRelationship.size() > 1) { @@ -8604,7 +8599,7 @@ public int deleteOldContent(Date deleteFrom) throws DotDataException { @CloseDBIfOpened @Override public List findFieldValues(String structureInode, Field field, User user, - boolean respectFrontEndRoles) throws DotDataException { + boolean respectFrontEndRoles) throws DotDataException { List result = new ArrayList<>(); List contentlets; @@ -8769,7 +8764,7 @@ private String getContentletCacheAssetPath(Contentlet con, Field field) { @CloseDBIfOpened @Override public File getBinaryFile(final String contentletInode, final String velocityVariableName, - final User user) throws DotDataException, DotSecurityException { + final User user) throws DotDataException, DotSecurityException { Logger.debug(this, "Retrieving binary file name : getBinaryFileName()."); @@ -8835,7 +8830,7 @@ public long contentletIdentifierCount() throws DotDataException { @CloseDBIfOpened @Override public List> DBSearch(Query query, User user, - boolean respectFrontendRoles) throws ValidationException, DotDataException { + boolean respectFrontendRoles) throws ValidationException, DotDataException { List fields; try { @@ -8898,8 +8893,8 @@ public List> DBSearch(Query query, User user, @WrapInTransaction @Override public Contentlet copyContentlet(final Contentlet sourceContentlet, final Host host, - final Folder folder, final User user, final String copySuffix, - final boolean respectFrontendRoles) + final Folder folder, final User user, final String copySuffix, + final boolean respectFrontendRoles) throws DotDataException, DotSecurityException, DotContentletStateException { return copyContentlet(sourceContentlet, null, host, folder, user, copySuffix, respectFrontendRoles); @@ -9177,7 +9172,7 @@ public Contentlet copyContentlet(final Contentlet sourceContentlet, * @throws DotDataException An error occurred when interacting with the data source. */ private void copyWorkflowState(final Contentlet sourceContentlet, - final Contentlet copyContentlet, final User user) throws DotDataException { + final Contentlet copyContentlet, final User user) throws DotDataException { final long sourceLangId = sourceContentlet.getLanguageId(); final List availableLanguages = APILocator.getLanguageAPI().getLanguages(); try { @@ -9254,7 +9249,7 @@ public Contentlet copyContentlet(Contentlet contentlet, User user, boolean respe @WrapInTransaction @Override public Contentlet copyContentlet(Contentlet contentlet, Host host, User user, - boolean respectFrontendRoles) + boolean respectFrontendRoles) throws DotDataException, DotSecurityException, DotContentletStateException { return copyContentlet(contentlet, host, null, user, generateCopySuffix(contentlet, host, null), respectFrontendRoles); @@ -9290,7 +9285,7 @@ public Contentlet copyContentlet(final Contentlet contentlet, final ContentType @WrapInTransaction @Override public Contentlet copyContentlet(Contentlet contentlet, Folder folder, User user, - boolean appendCopyToFileName, boolean respectFrontendRoles) + boolean appendCopyToFileName, boolean respectFrontendRoles) throws DotDataException, DotSecurityException, DotContentletStateException { // Suffix that we need to apply to append in content name final String copySuffix = appendCopyToFileName ? "_copy" : StringPool.BLANK; @@ -9371,7 +9366,7 @@ private String generateCopySuffix(Contentlet contentlet, Host host, Folder folde * @throws DotSecurityException */ private boolean isContentletUrlAlreadyUsed(Contentlet contentlet, Host destinationHost, - Folder destinationFolder, final String assetNameSuffix) + Folder destinationFolder, final String assetNameSuffix) throws DotStateException, DotDataException, DotSecurityException { Identifier contentletId = APILocator.getIdentifierAPI().find(contentlet); @@ -9400,8 +9395,8 @@ private boolean isContentletUrlAlreadyUsed(Contentlet contentlet, Host destinati final Host host = destinationFolder.getInode().equals(FolderAPI.SYSTEM_FOLDER) ? destinationHost : APILocator.getHostAPI() - .find(destinationFolder.getHostId(), - APILocator.getUserAPI().getSystemUser(), false); + .find(destinationFolder.getHostId(), + APILocator.getUserAPI().getSystemUser(), false); identifierWithSameUrl = APILocator.getIdentifierAPI().find(host, path); } else if (UtilMethods.isSet(destinationHost) && InodeUtils.isSet( destinationHost.getInode())) { // Hosts @@ -9501,7 +9496,7 @@ private boolean isInodeIndexedWithQuery(String luceneQuery) { 55); // it is around 14 + 9 (by the timeout delay) seconds, enough to wait private boolean isInodeIndexedWithQuery(final String luceneQuery, - final int milliSecondsToWait) { + final int milliSecondsToWait) { final long millistoWait = Config.getLongProperty("IS_NODE_INDEXED_INDEX_MILLIS_WAIT", 100); final int limit = -1 != milliSecondsToWait ? milliSecondsToWait : 300; @@ -9567,7 +9562,7 @@ public void updateUserReferences(User userToReplace, String replacementUserId, U @CloseDBIfOpened @Override public String getUrlMapForContentlet(Contentlet contentlet, User user, - boolean respectFrontendRoles) throws DotSecurityException, DotDataException { + boolean respectFrontendRoles) throws DotSecurityException, DotDataException { // no structure, no inode, no workee if (UtilMethods.isEmpty(()->contentlet.getInode())) {//NOSONAR return null; @@ -9666,10 +9661,10 @@ private String sanitizeForURLMap(String value) { @WrapInTransaction @Override public Contentlet saveDraft(final Contentlet contentlet, - final ContentletRelationships contentletRelationships, - final List cats, - final List permissions, - final User user, boolean respectFrontendRoles) + final ContentletRelationships contentletRelationships, + final List cats, + final List permissions, + final User user, boolean respectFrontendRoles) throws IllegalArgumentException, DotDataException, DotSecurityException, DotContentletStateException, DotContentletValidationException { if (!InodeUtils.isSet(contentlet.getInode())) { @@ -9720,8 +9715,8 @@ public Contentlet saveDraft(final Contentlet contentlet, @WrapInTransaction @Override public Contentlet saveDraft(Contentlet contentlet, - Map> contentRelationships, List cats, - List permissions, User user, boolean respectFrontendRoles) + Map> contentRelationships, List cats, + List permissions, User user, boolean respectFrontendRoles) throws IllegalArgumentException, DotDataException, DotSecurityException, DotContentletStateException, DotContentletValidationException { if (!InodeUtils.isSet(contentlet.getInode())) { return checkin(contentlet, contentRelationships, cats, permissions, user, false); @@ -9780,7 +9775,7 @@ public boolean canLock(final Contentlet contentlet, final User user) @CloseDBIfOpened @Override public boolean canLock(final Contentlet contentlet, final User user, - final boolean respectFrontendRoles) throws DotLockException { + final boolean respectFrontendRoles) throws DotLockException { if (contentlet == null || !UtilMethods.isSet(contentlet.getIdentifier())) { @@ -9799,9 +9794,9 @@ public boolean canLock(final Contentlet contentlet, final User user, return true; } else if (!APILocator.getPermissionAPI().doesUserHavePermission( - contentlet, PermissionAPI.PERMISSION_EDIT, user, respectFrontendRoles) + contentlet, PermissionAPI.PERMISSION_EDIT, user, respectFrontendRoles) && !APILocator.getPermissionAPI().doesUserHavePermission( - contentlet.getContentType(), PermissionAPI.PERMISSION_EDIT, user, respectFrontendRoles)) { + contentlet.getContentType(), PermissionAPI.PERMISSION_EDIT, user, respectFrontendRoles)) { throw new DotLockException("User: " + (user != null ? user.getUserId() : "Unknown") + " does not have Edit Permissions to lock content: " + (contentlet != null @@ -9874,7 +9869,7 @@ public long indexCount(String luceneQuery, User user, boolean respectFrontendRol @CloseDBIfOpened @Override public List> getMostViewedContent(String structureVariableName, - String startDateStr, String endDateStr, User user) { + String startDateStr, String endDateStr, User user) { String[] dateFormats = new String[]{"yyyy-MM-dd HH:mm", "d-MMM-yy", "MMM-yy", "MMMM-yy", "d-MMM", "dd-MMM-yyyy", "MM/dd/yyyy hh:mm aa", "MM/dd/yy HH:mm", @@ -9951,7 +9946,7 @@ public List> getMostViewedContent(String structureVariableNa * @param user - The currently logged in user. */ private void logContentletActivity(List contentlets, - String description, User user) { + String description, User user) { for (Contentlet content : contentlets) { logContentletActivity(content, description, user); } @@ -9967,7 +9962,7 @@ private void logContentletActivity(List contentlets, * @param user - The currently logged in user. */ private void logContentletActivity(final Contentlet contentlet, - final String description, final User user) { + final String description, final User user) { String contentPushPublishDate = contentlet .getStringProperty(Contentlet.WORKFLOW_PUBLISH_DATE); @@ -10028,8 +10023,8 @@ private void addURLToContentlet(Contentlet contentlet, String url) { @Override public Contentlet checkin(Contentlet contentlet, ContentletRelationships contentRelationships, - List cats, List selectedPermissions, User user, - boolean respectFrontendRoles, boolean generateSystemEvent) + List cats, List selectedPermissions, User user, + boolean respectFrontendRoles, boolean generateSystemEvent) throws IllegalArgumentException, DotDataException, DotSecurityException, DotContentletStateException, DotContentletValidationException { @@ -10082,7 +10077,7 @@ private void handlePermissions(final List selectedPermissions, @Override public Contentlet checkin(final Contentlet contentlet, - final ContentletDependencies contentletDependencies) + final ContentletDependencies contentletDependencies) throws DotSecurityException, DotDataException { if (null != contentletDependencies.getIndexPolicy()) { @@ -10113,7 +10108,7 @@ public Contentlet checkin(final Contentlet contentlet, * @param publish true if it is publish, false unpublish */ private void triggerCommitListenerEvent(final Contentlet contentlet, final User user, - final boolean publish) { + final boolean publish) { try { if (!contentlet.getBoolProperty(Contentlet.IS_TEST_MODE)) { diff --git a/dotCMS/src/main/java/com/dotmarketing/init/DotInitScheduler.java b/dotCMS/src/main/java/com/dotmarketing/init/DotInitScheduler.java index 1272c8c022f5..a263ebf77d81 100644 --- a/dotCMS/src/main/java/com/dotmarketing/init/DotInitScheduler.java +++ b/dotCMS/src/main/java/com/dotmarketing/init/DotInitScheduler.java @@ -13,7 +13,6 @@ import com.dotmarketing.quartz.job.CleanUnDeletedUsersJob; import com.dotmarketing.quartz.job.DeleteInactiveLiveWorkingIndicesJob; import com.dotmarketing.quartz.job.DropOldContentVersionsJob; -import com.dotmarketing.quartz.job.EsReadOnlyMonitorJob; import com.dotmarketing.quartz.job.FreeServerFromClusterJob; import com.dotmarketing.quartz.job.ServerHeartbeatJob; import com.dotmarketing.quartz.job.StartEndScheduledExperimentsJob; diff --git a/dotCMS/src/main/java/com/dotmarketing/quartz/job/EsReadOnlyMonitorJob.java b/dotCMS/src/main/java/com/dotmarketing/quartz/job/EsReadOnlyMonitorJob.java deleted file mode 100644 index 9eaf261aa51b..000000000000 --- a/dotCMS/src/main/java/com/dotmarketing/quartz/job/EsReadOnlyMonitorJob.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.dotmarketing.quartz.job; - -import com.dotmarketing.util.Logger; -import org.quartz.JobExecutionContext; -import org.quartz.JobExecutionException; -import org.quartz.StatefulJob; - -/** - * This job check if the Elastic server is running on ready only mode and will try to switch to write mode - * @author jsanca - */ -public class EsReadOnlyMonitorJob implements StatefulJob { - - @Override - public void execute(final JobExecutionContext jobExecutionContext) throws JobExecutionException { - - final ElasticReadOnlyCommand command = ElasticReadOnlyCommand.getInstance(); - Logger.debug(this, ()->"Running the EsReadOnlyMonitorJob..."); - command.executeCheck(); - } -}