From a1917279ebccf9d19e731095cc04290ddea72f0c Mon Sep 17 00:00:00 2001 From: seitenbau-govdata Date: Fri, 20 Oct 2023 08:31:11 +0200 Subject: [PATCH] Version 6.4.0 --- CHANGELOG.md | 4 + Layout20-80-layouttpl/pom.xml | 2 +- boxes-portlet/pom.xml | 2 +- categories-grid-portlet/pom.xml | 2 +- entities/entities-api/pom.xml | 2 +- .../odp/entities/model/MetadataComment.java | 13 +- .../entities/model/MetadataCommentModel.java | 17 +- .../entities/model/MetadataCommentTable.java | 13 +- .../model/MetadataCommentWrapper.java | 18 +- .../service/MetadataCommentLocalService.java | 13 +- .../MetadataCommentLocalServiceUtil.java | 17 +- .../MetadataCommentLocalServiceWrapper.java | 19 +- .../MetadataCommentPersistence.java | 13 +- .../persistence/MetadataCommentUtil.java | 17 +- entities/entities-service/bnd.bnd | 3 +- entities/entities-service/pom.xml | 4 +- .../EntitiesServiceBundleActivator.java | 80 ------ .../model/impl/MetadataCommentBaseImpl.java | 13 +- .../model/impl/MetadataCommentCacheModel.java | 13 +- .../model/impl/MetadataCommentModelImpl.java | 155 +++++------ .../registry/EntitiesServiceUpgrade.java | 29 ++ .../MetadataCommentLocalServiceBaseImpl.java | 46 +--- ...MetadataCommentModelArgumentsResolver.java | 22 +- .../impl/MetadataCommentPersistenceImpl.java | 57 +--- .../entitiesPersistenceConstants.java | 34 +-- .../main/resources/META-INF/module-hbm.xml | 12 +- .../src/main/resources/service.properties | 6 +- .../test/MetadataCommentPersistenceTest.java | 13 +- entities/pom.xml | 5 +- gd-blogs-service-override/bnd.bnd | 9 +- gd-blogs-service-override/pom.xml | 24 +- .../impl/BlogsEntryLocalServiceImpl.java | 149 +++++------ gd-captcha-api/bnd.bnd | 5 +- gd-captcha-api/pom.xml | 2 +- gd-captcha-fragment/bnd.bnd | 2 +- gd-captcha-fragment/pom.xml | 2 +- gd-comment-taglib-fragment/bnd.bnd | 2 +- gd-comment-taglib-fragment/pom.xml | 2 +- .../discussion/view_message_thread.jsp | 17 +- gd-developers-corner-portlet/pom.xml | 2 +- gd-edit-portlet/pom.xml | 2 +- gd-login-web-fragment/bnd.bnd | 2 +- gd-login-web-fragment/pom.xml | 2 +- .../META-INF/resources/create_account.jsp | 79 +++--- .../resources/create_anonymous_account.jsp | 23 +- gd-metadata-quality-portlet/pom.xml | 2 +- gd-search-common/pom.xml | 2 +- .../index/ApplicationContextProvider.java | 27 ++ .../index/GovDataSearchIndexWriter.java | 252 +++++------------- .../index/GovDataSearchIndexWriterTest.java | 134 ++++++---- gd-search/pom.xml | 2 +- .../search/index/listener/IndexListener.java | 39 --- .../spring/gd-search-indexer-context.xml | 1 - .../resources/spring/messaging-spring.xml | 25 -- .../src/main/webapp/WEB-INF/liferay-hook.xml | 13 + gd-subscription-web-override/bnd.bnd | 4 +- gd-subscription-web-override/pom.xml | 2 +- .../web/internal/util/UnsubscribeHooks.java | 21 +- gd-user-menu/pom.xml | 2 +- gd-usermanage-portlet/pom.xml | 2 +- gd-users-admin-fragment/bnd.bnd | 2 +- gd-users-admin-fragment/pom.xml | 2 +- .../resources/edit_user_navigation.jsp | 17 +- govdatastyle-theme/pom.xml | 2 +- .../src/main/webapp/css/_portlet.scss | 33 ++- govdatastyle-theme/src/main/webapp/js/main.js | 40 ++- .../src/main/webapp/templates/navigation.ftl | 4 +- .../main/webapp/templates/portal_normal.ftl | 12 +- .../src/main/webapp/templates/portlet.ftl | 17 +- language-hook/pom.xml | 2 +- odp-common/pom.xml | 2 +- opendataregistry-client/pom.xml | 2 +- packaging/pom.xml | 2 +- .../src/main/resources/portal-ext.properties | 2 + pom.xml | 4 +- portlet-common/pom.xml | 2 +- screenname-hook/pom.xml | 2 +- 77 files changed, 640 insertions(+), 1003 deletions(-) delete mode 100644 entities/entities-service/src/main/java/de/fhg/fokus/odp/entities/activator/EntitiesServiceBundleActivator.java create mode 100644 entities/entities-service/src/main/java/de/fhg/fokus/odp/entities/registry/EntitiesServiceUpgrade.java create mode 100644 gd-search-common/src/main/java/de/seitenbau/govdata/search/index/ApplicationContextProvider.java delete mode 100644 gd-search/src/main/java/de/seitenbau/govdata/search/index/listener/IndexListener.java delete mode 100644 gd-search/src/main/resources/spring/messaging-spring.xml create mode 100644 gd-search/src/main/webapp/WEB-INF/liferay-hook.xml diff --git a/CHANGELOG.md b/CHANGELOG.md index e4eb59e6..6610e4ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## v6.4.0 2023-10-19 + +* Supports Liferay version 7.4.3.95 GA95 now + ## v6.3.0 2023-10-10 * Improves the error message in the metadata edit form if an user does not have enough rights to save a metadata diff --git a/Layout20-80-layouttpl/pom.xml b/Layout20-80-layouttpl/pom.xml index 7f3a4f8f..3e51e24b 100644 --- a/Layout20-80-layouttpl/pom.xml +++ b/Layout20-80-layouttpl/pom.xml @@ -4,7 +4,7 @@ od-platform de.seitenbau.govdata.odp - 6.3.0 + 6.4.0 Layout20-80-layouttpl war diff --git a/boxes-portlet/pom.xml b/boxes-portlet/pom.xml index 0813b225..5f7f6bed 100644 --- a/boxes-portlet/pom.xml +++ b/boxes-portlet/pom.xml @@ -5,7 +5,7 @@ od-platform de.seitenbau.govdata.odp - 6.3.0 + 6.4.0 boxes-portlet war diff --git a/categories-grid-portlet/pom.xml b/categories-grid-portlet/pom.xml index 5cc49072..829c6758 100644 --- a/categories-grid-portlet/pom.xml +++ b/categories-grid-portlet/pom.xml @@ -5,7 +5,7 @@ od-platform de.seitenbau.govdata.odp - 6.3.0 + 6.4.0 categories-grid-portlet war diff --git a/entities/entities-api/pom.xml b/entities/entities-api/pom.xml index 8a395d0c..d35e6314 100644 --- a/entities/entities-api/pom.xml +++ b/entities/entities-api/pom.xml @@ -5,7 +5,7 @@ de.fhg.fokus.odp entities - 6.3.0 + 6.4.0 ../pom.xml 4.0.0 diff --git a/entities/entities-api/src/main/java/de/fhg/fokus/odp/entities/model/MetadataComment.java b/entities/entities-api/src/main/java/de/fhg/fokus/odp/entities/model/MetadataComment.java index 0cd308f5..c13a984f 100644 --- a/entities/entities-api/src/main/java/de/fhg/fokus/odp/entities/model/MetadataComment.java +++ b/entities/entities-api/src/main/java/de/fhg/fokus/odp/entities/model/MetadataComment.java @@ -1,15 +1,6 @@ /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com + * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 */ package de.fhg.fokus.odp.entities.model; diff --git a/entities/entities-api/src/main/java/de/fhg/fokus/odp/entities/model/MetadataCommentModel.java b/entities/entities-api/src/main/java/de/fhg/fokus/odp/entities/model/MetadataCommentModel.java index 15aea0b3..9e13c894 100644 --- a/entities/entities-api/src/main/java/de/fhg/fokus/odp/entities/model/MetadataCommentModel.java +++ b/entities/entities-api/src/main/java/de/fhg/fokus/odp/entities/model/MetadataCommentModel.java @@ -1,15 +1,6 @@ /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com + * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 */ package de.fhg.fokus.odp.entities.model; @@ -145,4 +136,8 @@ public interface MetadataCommentModel extends BaseModel { @Override public MetadataComment cloneWithOriginalValues(); + public default String toXmlString() { + return null; + } + } \ No newline at end of file diff --git a/entities/entities-api/src/main/java/de/fhg/fokus/odp/entities/model/MetadataCommentTable.java b/entities/entities-api/src/main/java/de/fhg/fokus/odp/entities/model/MetadataCommentTable.java index 770042ad..5d9934f8 100644 --- a/entities/entities-api/src/main/java/de/fhg/fokus/odp/entities/model/MetadataCommentTable.java +++ b/entities/entities-api/src/main/java/de/fhg/fokus/odp/entities/model/MetadataCommentTable.java @@ -1,15 +1,6 @@ /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com + * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 */ package de.fhg.fokus.odp.entities.model; diff --git a/entities/entities-api/src/main/java/de/fhg/fokus/odp/entities/model/MetadataCommentWrapper.java b/entities/entities-api/src/main/java/de/fhg/fokus/odp/entities/model/MetadataCommentWrapper.java index c7ea3ba8..1d45afa3 100644 --- a/entities/entities-api/src/main/java/de/fhg/fokus/odp/entities/model/MetadataCommentWrapper.java +++ b/entities/entities-api/src/main/java/de/fhg/fokus/odp/entities/model/MetadataCommentWrapper.java @@ -1,15 +1,6 @@ /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com + * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 */ package de.fhg.fokus.odp.entities.model; @@ -241,6 +232,11 @@ public void setUuid(String uuid) { model.setUuid(uuid); } + @Override + public String toXmlString() { + return model.toXmlString(); + } + @Override protected MetadataCommentWrapper wrap(MetadataComment metadataComment) { return new MetadataCommentWrapper(metadataComment); diff --git a/entities/entities-api/src/main/java/de/fhg/fokus/odp/entities/service/MetadataCommentLocalService.java b/entities/entities-api/src/main/java/de/fhg/fokus/odp/entities/service/MetadataCommentLocalService.java index 74e4c318..f552515e 100644 --- a/entities/entities-api/src/main/java/de/fhg/fokus/odp/entities/service/MetadataCommentLocalService.java +++ b/entities/entities-api/src/main/java/de/fhg/fokus/odp/entities/service/MetadataCommentLocalService.java @@ -1,15 +1,6 @@ /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com + * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 */ package de.fhg.fokus.odp.entities.service; diff --git a/entities/entities-api/src/main/java/de/fhg/fokus/odp/entities/service/MetadataCommentLocalServiceUtil.java b/entities/entities-api/src/main/java/de/fhg/fokus/odp/entities/service/MetadataCommentLocalServiceUtil.java index 0500ecf8..1c9b8139 100644 --- a/entities/entities-api/src/main/java/de/fhg/fokus/odp/entities/service/MetadataCommentLocalServiceUtil.java +++ b/entities/entities-api/src/main/java/de/fhg/fokus/odp/entities/service/MetadataCommentLocalServiceUtil.java @@ -1,15 +1,6 @@ /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com + * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 */ package de.fhg.fokus.odp.entities.service; @@ -328,6 +319,10 @@ public static MetadataCommentLocalService getService() { return _service; } + public static void setService(MetadataCommentLocalService service) { + _service = service; + } + private static volatile MetadataCommentLocalService _service; } \ No newline at end of file diff --git a/entities/entities-api/src/main/java/de/fhg/fokus/odp/entities/service/MetadataCommentLocalServiceWrapper.java b/entities/entities-api/src/main/java/de/fhg/fokus/odp/entities/service/MetadataCommentLocalServiceWrapper.java index 5aaff9c0..374e2085 100644 --- a/entities/entities-api/src/main/java/de/fhg/fokus/odp/entities/service/MetadataCommentLocalServiceWrapper.java +++ b/entities/entities-api/src/main/java/de/fhg/fokus/odp/entities/service/MetadataCommentLocalServiceWrapper.java @@ -1,20 +1,12 @@ /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com + * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 */ package de.fhg.fokus.odp.entities.service; import com.liferay.portal.kernel.service.ServiceWrapper; +import com.liferay.portal.kernel.service.persistence.BasePersistence; /** * Provides a wrapper for {@link MetadataCommentLocalService}. @@ -362,6 +354,11 @@ public com.liferay.portal.kernel.model.PersistedModel getPersistedModel( metadataComment); } + @Override + public BasePersistence getBasePersistence() { + return _metadataCommentLocalService.getBasePersistence(); + } + @Override public MetadataCommentLocalService getWrappedService() { return _metadataCommentLocalService; diff --git a/entities/entities-api/src/main/java/de/fhg/fokus/odp/entities/service/persistence/MetadataCommentPersistence.java b/entities/entities-api/src/main/java/de/fhg/fokus/odp/entities/service/persistence/MetadataCommentPersistence.java index 0abc23b6..a24018cd 100644 --- a/entities/entities-api/src/main/java/de/fhg/fokus/odp/entities/service/persistence/MetadataCommentPersistence.java +++ b/entities/entities-api/src/main/java/de/fhg/fokus/odp/entities/service/persistence/MetadataCommentPersistence.java @@ -1,15 +1,6 @@ /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com + * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 */ package de.fhg.fokus.odp.entities.service.persistence; diff --git a/entities/entities-api/src/main/java/de/fhg/fokus/odp/entities/service/persistence/MetadataCommentUtil.java b/entities/entities-api/src/main/java/de/fhg/fokus/odp/entities/service/persistence/MetadataCommentUtil.java index f7dc2c55..de90ec85 100644 --- a/entities/entities-api/src/main/java/de/fhg/fokus/odp/entities/service/persistence/MetadataCommentUtil.java +++ b/entities/entities-api/src/main/java/de/fhg/fokus/odp/entities/service/persistence/MetadataCommentUtil.java @@ -1,15 +1,6 @@ /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com + * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 */ package de.fhg.fokus.odp.entities.service.persistence; @@ -798,6 +789,10 @@ public static MetadataCommentPersistence getPersistence() { return _persistence; } + public static void setPersistence(MetadataCommentPersistence persistence) { + _persistence = persistence; + } + private static volatile MetadataCommentPersistence _persistence; } \ No newline at end of file diff --git a/entities/entities-service/bnd.bnd b/entities/entities-service/bnd.bnd index 9ec0dadf..66fcf481 100644 --- a/entities/entities-service/bnd.bnd +++ b/entities/entities-service/bnd.bnd @@ -1,11 +1,10 @@ Bundle-Name: entities-service Bundle-SymbolicName: de.fhg.fokus.odp.entities.service Bundle-Version: 1.0.0 -Liferay-Require-SchemaVersion: 0.0.1 +Liferay-Require-SchemaVersion: 1.0.0 Liferay-Service: true -dsannotations-options: inherit -includeresource: META-INF/service.xml=service.xml -liferay-service-xml: META-INF/service.xml -plugin.metatype: com.liferay.ant.bnd.metatype.MetatypePlugin -plugin.service: com.liferay.ant.bnd.service.ServiceAnalyzerPlugin -Bundle-Activator: de.fhg.fokus.odp.entities.activator.EntitiesServiceBundleActivator diff --git a/entities/entities-service/pom.xml b/entities/entities-service/pom.xml index d36ec5b4..2894674c 100644 --- a/entities/entities-service/pom.xml +++ b/entities/entities-service/pom.xml @@ -5,7 +5,7 @@ de.fhg.fokus.odp entities - 6.3.0 + 6.4.0 ../pom.xml 4.0.0 @@ -17,7 +17,7 @@ com.liferay com.liferay.portal.tools.service.builder - 1.0.423 + 1.0.462 ../entities-api/src/main/java true diff --git a/entities/entities-service/src/main/java/de/fhg/fokus/odp/entities/activator/EntitiesServiceBundleActivator.java b/entities/entities-service/src/main/java/de/fhg/fokus/odp/entities/activator/EntitiesServiceBundleActivator.java deleted file mode 100644 index 2ced9e8b..00000000 --- a/entities/entities-service/src/main/java/de/fhg/fokus/odp/entities/activator/EntitiesServiceBundleActivator.java +++ /dev/null @@ -1,80 +0,0 @@ -package de.fhg.fokus.odp.entities.activator; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.osgi.framework.Filter; -import org.osgi.framework.ServiceReference; -import org.osgi.util.tracker.ServiceTracker; - -import com.liferay.portal.kernel.module.framework.ModuleServiceLifecycle; -import com.liferay.portal.kernel.upgrade.UpgradeException; -import com.liferay.portal.kernel.util.StringBundler; -import com.liferay.portal.upgrade.release.BaseUpgradeServiceModuleRelease; - -public class EntitiesServiceBundleActivator implements BundleActivator -{ - private ServiceTracker _serviceTracker; - - @Override - public void start(BundleContext context) throws Exception - { - Filter filter = context.createFilter( - StringBundler.concat( - "(&(objectClass=", ModuleServiceLifecycle.class.getName(), ")", - ModuleServiceLifecycle.DATABASE_INITIALIZED, ")")); - - _serviceTracker = new ServiceTracker( - context, filter, null) - { - @Override - public Object addingService( - ServiceReference serviceReference) - { - - try - { - BaseUpgradeServiceModuleRelease upgradeServiceModuleRelease = - new BaseUpgradeServiceModuleRelease() - { - - @Override - protected String getNamespace() - { - return "entities"; - } - - @Override - protected String getNewBundleSymbolicName() - { - return "de.fhg.fokus.odp.entities.service"; - } - - @Override - protected String getOldBundleSymbolicName() - { - return "entities_WAR_entitiesportlet"; - } - - }; - - upgradeServiceModuleRelease.upgrade(); - - return null; - } - catch (UpgradeException ue) - { - throw new RuntimeException(ue); - } - } - }; - - _serviceTracker.open(); - } - - @Override - public void stop(BundleContext context) throws Exception - { - _serviceTracker.close(); - } - -} diff --git a/entities/entities-service/src/main/java/de/fhg/fokus/odp/entities/model/impl/MetadataCommentBaseImpl.java b/entities/entities-service/src/main/java/de/fhg/fokus/odp/entities/model/impl/MetadataCommentBaseImpl.java index ed0225ef..f5666c59 100644 --- a/entities/entities-service/src/main/java/de/fhg/fokus/odp/entities/model/impl/MetadataCommentBaseImpl.java +++ b/entities/entities-service/src/main/java/de/fhg/fokus/odp/entities/model/impl/MetadataCommentBaseImpl.java @@ -1,15 +1,6 @@ /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com + * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 */ package de.fhg.fokus.odp.entities.model.impl; diff --git a/entities/entities-service/src/main/java/de/fhg/fokus/odp/entities/model/impl/MetadataCommentCacheModel.java b/entities/entities-service/src/main/java/de/fhg/fokus/odp/entities/model/impl/MetadataCommentCacheModel.java index 69894062..4ffe4603 100644 --- a/entities/entities-service/src/main/java/de/fhg/fokus/odp/entities/model/impl/MetadataCommentCacheModel.java +++ b/entities/entities-service/src/main/java/de/fhg/fokus/odp/entities/model/impl/MetadataCommentCacheModel.java @@ -1,15 +1,6 @@ /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com + * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 */ package de.fhg.fokus.odp.entities.model.impl; diff --git a/entities/entities-service/src/main/java/de/fhg/fokus/odp/entities/model/impl/MetadataCommentModelImpl.java b/entities/entities-service/src/main/java/de/fhg/fokus/odp/entities/model/impl/MetadataCommentModelImpl.java index 28e908a2..72c2eec8 100644 --- a/entities/entities-service/src/main/java/de/fhg/fokus/odp/entities/model/impl/MetadataCommentModelImpl.java +++ b/entities/entities-service/src/main/java/de/fhg/fokus/odp/entities/model/impl/MetadataCommentModelImpl.java @@ -1,15 +1,6 @@ /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com + * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 */ package de.fhg.fokus.odp.entities.model.impl; @@ -218,59 +209,77 @@ public void setModelAttributes(Map attributes) { public Map> getAttributeGetterFunctions() { - return _attributeGetterFunctions; + return AttributeGetterFunctionsHolder._attributeGetterFunctions; } public Map> getAttributeSetterBiConsumers() { - return _attributeSetterBiConsumers; + return AttributeSetterBiConsumersHolder._attributeSetterBiConsumers; } - private static final Map> - _attributeGetterFunctions; - private static final Map> - _attributeSetterBiConsumers; + private static class AttributeGetterFunctionsHolder { + + private static final Map> + _attributeGetterFunctions; + + static { + Map> + attributeGetterFunctions = + new LinkedHashMap + >(); + + attributeGetterFunctions.put("uuid", MetadataComment::getUuid); + attributeGetterFunctions.put("_id", MetadataComment::get_id); + attributeGetterFunctions.put( + "userLiferayId", MetadataComment::getUserLiferayId); + attributeGetterFunctions.put( + "metadataName", MetadataComment::getMetadataName); + attributeGetterFunctions.put("text", MetadataComment::getText); + attributeGetterFunctions.put( + "created", MetadataComment::getCreated); + + _attributeGetterFunctions = Collections.unmodifiableMap( + attributeGetterFunctions); + } + + } + + private static class AttributeSetterBiConsumersHolder { + + private static final Map> + _attributeSetterBiConsumers; + + static { + Map> + attributeSetterBiConsumers = + new LinkedHashMap>(); + + attributeSetterBiConsumers.put( + "uuid", + (BiConsumer)MetadataComment::setUuid); + attributeSetterBiConsumers.put( + "_id", + (BiConsumer)MetadataComment::set_id); + attributeSetterBiConsumers.put( + "userLiferayId", + (BiConsumer) + MetadataComment::setUserLiferayId); + attributeSetterBiConsumers.put( + "metadataName", + (BiConsumer) + MetadataComment::setMetadataName); + attributeSetterBiConsumers.put( + "text", + (BiConsumer)MetadataComment::setText); + attributeSetterBiConsumers.put( + "created", + (BiConsumer)MetadataComment::setCreated); + + _attributeSetterBiConsumers = Collections.unmodifiableMap( + (Map)attributeSetterBiConsumers); + } - static { - Map> - attributeGetterFunctions = - new LinkedHashMap>(); - Map> attributeSetterBiConsumers = - new LinkedHashMap>(); - - attributeGetterFunctions.put("uuid", MetadataComment::getUuid); - attributeSetterBiConsumers.put( - "uuid", - (BiConsumer)MetadataComment::setUuid); - attributeGetterFunctions.put("_id", MetadataComment::get_id); - attributeSetterBiConsumers.put( - "_id", (BiConsumer)MetadataComment::set_id); - attributeGetterFunctions.put( - "userLiferayId", MetadataComment::getUserLiferayId); - attributeSetterBiConsumers.put( - "userLiferayId", - (BiConsumer) - MetadataComment::setUserLiferayId); - attributeGetterFunctions.put( - "metadataName", MetadataComment::getMetadataName); - attributeSetterBiConsumers.put( - "metadataName", - (BiConsumer) - MetadataComment::setMetadataName); - attributeGetterFunctions.put("text", MetadataComment::getText); - attributeSetterBiConsumers.put( - "text", - (BiConsumer)MetadataComment::setText); - attributeGetterFunctions.put("created", MetadataComment::getCreated); - attributeSetterBiConsumers.put( - "created", - (BiConsumer)MetadataComment::setCreated); - - _attributeGetterFunctions = Collections.unmodifiableMap( - attributeGetterFunctions); - _attributeSetterBiConsumers = Collections.unmodifiableMap( - (Map)attributeSetterBiConsumers); } @Override @@ -646,37 +655,6 @@ else if (value instanceof Blob || value instanceof Date || return sb.toString(); } - @Override - public String toXmlString() { - Map> - attributeGetterFunctions = getAttributeGetterFunctions(); - - StringBundler sb = new StringBundler( - (5 * attributeGetterFunctions.size()) + 4); - - sb.append(""); - sb.append(getModelClassName()); - sb.append(""); - - for (Map.Entry> entry : - attributeGetterFunctions.entrySet()) { - - String attributeName = entry.getKey(); - Function attributeGetterFunction = - entry.getValue(); - - sb.append(""); - sb.append(attributeName); - sb.append(""); - } - - sb.append(""); - - return sb.toString(); - } - private static class EscapedModelProxyProviderFunctionHolder { private static final Function @@ -697,7 +675,8 @@ public T getColumnValue(String columnName) { columnName = _attributeNames.getOrDefault(columnName, columnName); Function function = - _attributeGetterFunctions.get(columnName); + AttributeGetterFunctionsHolder._attributeGetterFunctions.get( + columnName); if (function == null) { throw new IllegalArgumentException( diff --git a/entities/entities-service/src/main/java/de/fhg/fokus/odp/entities/registry/EntitiesServiceUpgrade.java b/entities/entities-service/src/main/java/de/fhg/fokus/odp/entities/registry/EntitiesServiceUpgrade.java new file mode 100644 index 00000000..62d42a91 --- /dev/null +++ b/entities/entities-service/src/main/java/de/fhg/fokus/odp/entities/registry/EntitiesServiceUpgrade.java @@ -0,0 +1,29 @@ +package de.fhg.fokus.odp.entities.registry; + +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; + +import com.liferay.portal.kernel.service.ReleaseLocalService; +import com.liferay.portal.kernel.upgrade.DummyUpgradeStep; +import com.liferay.portal.upgrade.registry.UpgradeStepRegistrator; +import com.liferay.portal.upgrade.release.ReleaseRenamingUpgradeStep; + +@Component(service = UpgradeStepRegistrator.class) +public class EntitiesServiceUpgrade implements UpgradeStepRegistrator +{ + + @Override + public void register(Registry registry) + { + registry.registerReleaseCreationUpgradeSteps( + new ReleaseRenamingUpgradeStep( + "de.fhg.fokus.odp.entities.service", "entities_WAR_entitiesportlet", + _releaseLocalService)); + + registry.register("0.0.1", "1.0.0", new DummyUpgradeStep()); + } + + @Reference + private ReleaseLocalService _releaseLocalService; + +} diff --git a/entities/entities-service/src/main/java/de/fhg/fokus/odp/entities/service/base/MetadataCommentLocalServiceBaseImpl.java b/entities/entities-service/src/main/java/de/fhg/fokus/odp/entities/service/base/MetadataCommentLocalServiceBaseImpl.java index 908e36f1..3748b348 100644 --- a/entities/entities-service/src/main/java/de/fhg/fokus/odp/entities/service/base/MetadataCommentLocalServiceBaseImpl.java +++ b/entities/entities-service/src/main/java/de/fhg/fokus/odp/entities/service/base/MetadataCommentLocalServiceBaseImpl.java @@ -1,15 +1,6 @@ /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com + * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 */ package de.fhg.fokus.odp.entities.service.base; @@ -28,6 +19,8 @@ import com.liferay.portal.kernel.dao.orm.Projection; import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.SystemException; +import com.liferay.portal.kernel.log.Log; +import com.liferay.portal.kernel.log.LogFactoryUtil; import com.liferay.portal.kernel.model.PersistedModel; import com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService; import com.liferay.portal.kernel.search.Indexable; @@ -46,8 +39,6 @@ import java.io.Serializable; -import java.lang.reflect.Field; - import java.util.List; import javax.sql.DataSource; @@ -319,6 +310,11 @@ public PersistedModel createPersistedModel(Serializable primaryKeyObj) public PersistedModel deletePersistedModel(PersistedModel persistedModel) throws PortalException { + if (_log.isWarnEnabled()) { + _log.warn( + "Implement MetadataCommentLocalServiceImpl#deleteMetadataComment(MetadataComment) to avoid orphaned data"); + } + return metadataCommentLocalService.deleteMetadataComment( (MetadataComment)persistedModel); } @@ -384,7 +380,7 @@ public MetadataComment updateMetadataComment( @Deactivate protected void deactivate() { - _setLocalServiceUtilService(null); + MetadataCommentLocalServiceUtil.setService(null); } @Override @@ -399,7 +395,7 @@ public Class[] getAopInterfaces() { public void setAopProxy(Object aopProxy) { metadataCommentLocalService = (MetadataCommentLocalService)aopProxy; - _setLocalServiceUtilService(metadataCommentLocalService); + MetadataCommentLocalServiceUtil.setService(metadataCommentLocalService); } /** @@ -444,23 +440,6 @@ protected void runSQL(String sql) { } } - private void _setLocalServiceUtilService( - MetadataCommentLocalService metadataCommentLocalService) { - - try { - Field field = - MetadataCommentLocalServiceUtil.class.getDeclaredField( - "_service"); - - field.setAccessible(true); - - field.set(null, metadataCommentLocalService); - } - catch (ReflectiveOperationException reflectiveOperationException) { - throw new RuntimeException(reflectiveOperationException); - } - } - protected MetadataCommentLocalService metadataCommentLocalService; @Reference @@ -482,4 +461,7 @@ private void _setLocalServiceUtilService( protected com.liferay.portal.kernel.service.UserLocalService userLocalService; + private static final Log _log = LogFactoryUtil.getLog( + MetadataCommentLocalServiceBaseImpl.class); + } \ No newline at end of file diff --git a/entities/entities-service/src/main/java/de/fhg/fokus/odp/entities/service/persistence/impl/MetadataCommentModelArgumentsResolver.java b/entities/entities-service/src/main/java/de/fhg/fokus/odp/entities/service/persistence/impl/MetadataCommentModelArgumentsResolver.java index 8fe9e419..4d72863d 100644 --- a/entities/entities-service/src/main/java/de/fhg/fokus/odp/entities/service/persistence/impl/MetadataCommentModelArgumentsResolver.java +++ b/entities/entities-service/src/main/java/de/fhg/fokus/odp/entities/service/persistence/impl/MetadataCommentModelArgumentsResolver.java @@ -1,15 +1,6 @@ /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com + * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 */ package de.fhg.fokus.odp.entities.service.persistence.impl; @@ -34,10 +25,11 @@ * @generated */ @Component( - immediate = true, - service = { - MetadataCommentModelArgumentsResolver.class, ArgumentsResolver.class - } + property = { + "class.name=de.fhg.fokus.odp.entities.model.impl.MetadataCommentImpl", + "table.name=entities_MetadataComment" + }, + service = ArgumentsResolver.class ) public class MetadataCommentModelArgumentsResolver implements ArgumentsResolver { diff --git a/entities/entities-service/src/main/java/de/fhg/fokus/odp/entities/service/persistence/impl/MetadataCommentPersistenceImpl.java b/entities/entities-service/src/main/java/de/fhg/fokus/odp/entities/service/persistence/impl/MetadataCommentPersistenceImpl.java index 1c427aaa..2fe33e52 100644 --- a/entities/entities-service/src/main/java/de/fhg/fokus/odp/entities/service/persistence/impl/MetadataCommentPersistenceImpl.java +++ b/entities/entities-service/src/main/java/de/fhg/fokus/odp/entities/service/persistence/impl/MetadataCommentPersistenceImpl.java @@ -1,15 +1,6 @@ /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com + * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 */ package de.fhg.fokus.odp.entities.service.persistence.impl; @@ -26,7 +17,6 @@ import com.liferay.portal.kernel.dao.orm.SessionFactory; import com.liferay.portal.kernel.log.Log; import com.liferay.portal.kernel.log.LogFactoryUtil; -import com.liferay.portal.kernel.service.persistence.BasePersistence; import com.liferay.portal.kernel.service.persistence.impl.BasePersistenceImpl; import com.liferay.portal.kernel.util.GetterUtil; import com.liferay.portal.kernel.util.OrderByComparator; @@ -48,7 +38,6 @@ import java.io.Serializable; -import java.lang.reflect.Field; import java.lang.reflect.InvocationHandler; import java.util.HashMap; @@ -74,7 +63,7 @@ * @author Brian Wing Shun Chan * @generated */ -@Component(service = {MetadataCommentPersistence.class, BasePersistence.class}) +@Component(service = MetadataCommentPersistence.class) public class MetadataCommentPersistenceImpl extends BasePersistenceImpl implements MetadataCommentPersistence { @@ -191,7 +180,7 @@ else if (useFinderCache) { if (useFinderCache) { list = (List)finderCache.getResult( - finderPath, finderArgs); + finderPath, finderArgs, this); if ((list != null) && !list.isEmpty()) { for (MetadataComment metadataComment : list) { @@ -575,7 +564,7 @@ public int countByUuid(String uuid) { Object[] finderArgs = new Object[] {uuid}; - Long count = (Long)finderCache.getResult(finderPath, finderArgs); + Long count = (Long)finderCache.getResult(finderPath, finderArgs, this); if (count == null) { StringBundler sb = new StringBundler(2); @@ -728,7 +717,7 @@ else if (useFinderCache) { if (useFinderCache) { list = (List)finderCache.getResult( - finderPath, finderArgs); + finderPath, finderArgs, this); if ((list != null) && !list.isEmpty()) { for (MetadataComment metadataComment : list) { @@ -1095,7 +1084,7 @@ public int countByuserLiferayId(long userLiferayId) { Object[] finderArgs = new Object[] {userLiferayId}; - Long count = (Long)finderCache.getResult(finderPath, finderArgs); + Long count = (Long)finderCache.getResult(finderPath, finderArgs, this); if (count == null) { StringBundler sb = new StringBundler(2); @@ -1236,7 +1225,7 @@ else if (useFinderCache) { if (useFinderCache) { list = (List)finderCache.getResult( - finderPath, finderArgs); + finderPath, finderArgs, this); if ((list != null) && !list.isEmpty()) { for (MetadataComment metadataComment : list) { @@ -1630,7 +1619,7 @@ public int countBymetadataName(String metadataName) { Object[] finderArgs = new Object[] {metadataName}; - Long count = (Long)finderCache.getResult(finderPath, finderArgs); + Long count = (Long)finderCache.getResult(finderPath, finderArgs, this); if (count == null) { StringBundler sb = new StringBundler(2); @@ -2085,7 +2074,7 @@ else if (useFinderCache) { if (useFinderCache) { list = (List)finderCache.getResult( - finderPath, finderArgs); + finderPath, finderArgs, this); } if (list == null) { @@ -2155,7 +2144,7 @@ public void removeAll() { @Override public int countAll() { Long count = (Long)finderCache.getResult( - _finderPathCountAll, FINDER_ARGS_EMPTY); + _finderPathCountAll, FINDER_ARGS_EMPTY, this); if (count == null) { Session session = null; @@ -2280,32 +2269,16 @@ public void activate() { new String[] {String.class.getName()}, new String[] {"metadataName"}, false); - _setMetadataCommentUtilPersistence(this); + MetadataCommentUtil.setPersistence(this); } @Deactivate public void deactivate() { - _setMetadataCommentUtilPersistence(null); + MetadataCommentUtil.setPersistence(null); entityCache.removeCache(MetadataCommentImpl.class.getName()); } - private void _setMetadataCommentUtilPersistence( - MetadataCommentPersistence metadataCommentPersistence) { - - try { - Field field = MetadataCommentUtil.class.getDeclaredField( - "_persistence"); - - field.setAccessible(true); - - field.set(null, metadataCommentPersistence); - } - catch (ReflectiveOperationException reflectiveOperationException) { - throw new RuntimeException(reflectiveOperationException); - } - } - @Override @Reference( target = entitiesPersistenceConstants.SERVICE_CONFIGURATION_FILTER, @@ -2372,8 +2345,4 @@ protected FinderCache getFinderCache() { @Reference private PortalUUID _portalUUID; - @Reference - private MetadataCommentModelArgumentsResolver - _metadataCommentModelArgumentsResolver; - } \ No newline at end of file diff --git a/entities/entities-service/src/main/java/de/fhg/fokus/odp/entities/service/persistence/impl/constants/entitiesPersistenceConstants.java b/entities/entities-service/src/main/java/de/fhg/fokus/odp/entities/service/persistence/impl/constants/entitiesPersistenceConstants.java index d30ac106..282da1db 100644 --- a/entities/entities-service/src/main/java/de/fhg/fokus/odp/entities/service/persistence/impl/constants/entitiesPersistenceConstants.java +++ b/entities/entities-service/src/main/java/de/fhg/fokus/odp/entities/service/persistence/impl/constants/entitiesPersistenceConstants.java @@ -1,32 +1,14 @@ /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com + * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 */ package de.fhg.fokus.odp.entities.service.persistence.impl.constants; -import com.liferay.petra.string.StringBundler; - -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; -import org.osgi.framework.Constants; -import org.osgi.service.component.annotations.Activate; -import org.osgi.service.component.annotations.Component; - /** * @author Brian Wing Shun Chan * @generated */ -@Component(immediate = true, service = {}) public class entitiesPersistenceConstants { public static final String BUNDLE_SYMBOLIC_NAME = @@ -38,16 +20,4 @@ public class entitiesPersistenceConstants { public static final String SERVICE_CONFIGURATION_FILTER = "(&" + ORIGIN_BUNDLE_SYMBOLIC_NAME_FILTER + "(name=service))"; - @Activate - protected void activate(BundleContext bundleContext) { - Bundle bundle = bundleContext.getBundle(); - - if (!BUNDLE_SYMBOLIC_NAME.equals(bundle.getSymbolicName())) { - throw new IllegalStateException( - StringBundler.concat( - "Incorrect ", Constants.BUNDLE_SYMBOLICNAME, " for bundle ", - bundle.getSymbolicName())); - } - } - } \ No newline at end of file diff --git a/entities/entities-service/src/main/resources/META-INF/module-hbm.xml b/entities/entities-service/src/main/resources/META-INF/module-hbm.xml index e6a8d606..9017ed00 100644 --- a/entities/entities-service/src/main/resources/META-INF/module-hbm.xml +++ b/entities/entities-service/src/main/resources/META-INF/module-hbm.xml @@ -4,13 +4,13 @@ - + - - - - - + + + + + \ No newline at end of file diff --git a/entities/entities-service/src/main/resources/service.properties b/entities/entities-service/src/main/resources/service.properties index c852cf2e..fa71a147 100644 --- a/entities/entities-service/src/main/resources/service.properties +++ b/entities/entities-service/src/main/resources/service.properties @@ -12,6 +12,6 @@ ## Build ## - build.namespace=entities - build.number=15 - build.date=1663333485285 \ No newline at end of file + build.namespace=de.fhg.fokus.odp.entities.service + build.number=19 + build.date=1695037516330 \ No newline at end of file diff --git a/entities/entities-service/src/main/test/de/fhg/fokus/odp/entities/service/persistence/test/MetadataCommentPersistenceTest.java b/entities/entities-service/src/main/test/de/fhg/fokus/odp/entities/service/persistence/test/MetadataCommentPersistenceTest.java index 24436e62..11dc29ab 100644 --- a/entities/entities-service/src/main/test/de/fhg/fokus/odp/entities/service/persistence/test/MetadataCommentPersistenceTest.java +++ b/entities/entities-service/src/main/test/de/fhg/fokus/odp/entities/service/persistence/test/MetadataCommentPersistenceTest.java @@ -1,15 +1,6 @@ /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com + * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 */ package de.fhg.fokus.odp.entities.service.persistence.test; diff --git a/entities/pom.xml b/entities/pom.xml index fb131f74..3325a49f 100644 --- a/entities/pom.xml +++ b/entities/pom.xml @@ -5,15 +5,12 @@ od-platform de.seitenbau.govdata.odp - 6.3.0 + 6.4.0 de.fhg.fokus.odp entities pom entities - - scm:git:git@git.dev.seitenbau.net:bmi-govdata-portal/entities - ${project.artifactId}-${project.version} diff --git a/gd-blogs-service-override/bnd.bnd b/gd-blogs-service-override/bnd.bnd index 68f02e6e..27da6253 100644 --- a/gd-blogs-service-override/bnd.bnd +++ b/gd-blogs-service-override/bnd.bnd @@ -1,13 +1,14 @@ Bundle-Name: Liferay Blogs Service Bundle-SymbolicName: com.liferay.blogs.service -Bundle-Version: 5.0.46 +Bundle-Version: 5.0.73 Liferay-Require-SchemaVersion: 3.1.0 Liferay-Service: true -dsannotations-options: inherit -plugin.metatype: com.liferay.ant.bnd.metatype.MetatypePlugin -includeresource: \ - @com.liferay.blogs.service-5.0.46.jar!/!com/liferay/blogs/service/impl/BlogsEntryLocalServiceImpl.class, \ - @jericho-html-3.1.jar + @com.liferay.blogs.service-5.0.73.jar!/!com/liferay/blogs/service/impl/BlogsEntryLocalServiceImpl.class, \ + @jericho-html-3.4.jar Import-Package: \ !net.htmlparser.jericho, \ - * \ No newline at end of file + * +Export-Package: com.liferay.portal.configuration.metatype.bnd.util \ No newline at end of file diff --git a/gd-blogs-service-override/pom.xml b/gd-blogs-service-override/pom.xml index 58291ecd..e9aee648 100644 --- a/gd-blogs-service-override/pom.xml +++ b/gd-blogs-service-override/pom.xml @@ -5,7 +5,7 @@ de.seitenbau.govdata.odp od-platform - 6.3.0 + 6.4.0 de.seitenbau.blogs.service.override gd-blogs-service-override @@ -106,11 +106,6 @@ com.liferay.friendly.url.api provided - - com.liferay - com.liferay.petra.portlet.url.builder - provided - com.liferay com.liferay.petra.reflect @@ -149,7 +144,22 @@ net.htmlparser.jericho jericho-html - 3.1 + 3.4 + provided + + + com.liferay + com.liferay.asset.link.api + provided + + + com.liferay + com.liferay.portal.configuration.module.configuration.api + provided + + + com.liferay + com.liferay.image.api provided diff --git a/gd-blogs-service-override/src/main/java/com/liferay/blogs/service/impl/BlogsEntryLocalServiceImpl.java b/gd-blogs-service-override/src/main/java/com/liferay/blogs/service/impl/BlogsEntryLocalServiceImpl.java index 5baef955..052b2837 100644 --- a/gd-blogs-service-override/src/main/java/com/liferay/blogs/service/impl/BlogsEntryLocalServiceImpl.java +++ b/gd-blogs-service-override/src/main/java/com/liferay/blogs/service/impl/BlogsEntryLocalServiceImpl.java @@ -1,47 +1,17 @@ /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * 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.blogs.service.impl; -import java.io.IOException; -import java.io.InputStream; -import java.io.Serializable; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Set; -import java.util.stream.Stream; - -import javax.portlet.PortletRequest; -import javax.servlet.http.HttpServletRequest; - -import org.osgi.service.component.annotations.Activate; -import org.osgi.service.component.annotations.Component; -import org.osgi.service.component.annotations.Modified; -import org.osgi.service.component.annotations.Reference; - import com.liferay.asset.kernel.model.AssetEntry; -import com.liferay.asset.kernel.model.AssetLinkConstants; import com.liferay.asset.kernel.service.AssetEntryLocalService; -import com.liferay.asset.kernel.service.AssetLinkLocalService; +import com.liferay.asset.link.constants.AssetLinkConstants; +import com.liferay.asset.link.service.AssetLinkLocalService; import com.liferay.blogs.configuration.BlogsFileUploadsConfiguration; import com.liferay.blogs.configuration.BlogsGroupServiceConfiguration; import com.liferay.blogs.constants.BlogsConstants; -import com.liferay.blogs.exception.DuplicateEntryExternalReferenceCodeException; import com.liferay.blogs.exception.EntryContentException; import com.liferay.blogs.exception.EntryCoverImageCropException; import com.liferay.blogs.exception.EntryDisplayDateException; @@ -49,6 +19,7 @@ import com.liferay.blogs.exception.EntrySmallImageScaleException; import com.liferay.blogs.exception.EntryTitleException; import com.liferay.blogs.exception.EntryUrlTitleException; +import com.liferay.blogs.internal.image.ImageSelectorProcessor; import com.liferay.blogs.model.BlogsEntry; import com.liferay.blogs.service.base.BlogsEntryLocalServiceBaseImpl; import com.liferay.blogs.settings.BlogsGroupServiceSettings; @@ -61,11 +32,12 @@ import com.liferay.friendly.url.exception.DuplicateFriendlyURLEntryException; import com.liferay.friendly.url.model.FriendlyURLEntry; import com.liferay.friendly.url.service.FriendlyURLEntryLocalService; -import com.liferay.petra.portlet.url.builder.PortletURLBuilder; +import com.liferay.image.ImageMagick; import com.liferay.petra.reflect.ReflectionUtil; import com.liferay.petra.string.StringBundler; import com.liferay.petra.string.StringPool; import com.liferay.portal.aop.AopService; +import com.liferay.portal.configuration.module.configuration.ConfigurationProvider; import com.liferay.portal.configuration.metatype.bnd.util.ConfigurableUtil; import com.liferay.portal.kernel.comment.CommentManager; import com.liferay.portal.kernel.dao.orm.QueryDefinition; @@ -83,10 +55,10 @@ import com.liferay.portal.kernel.model.ResourceConstants; import com.liferay.portal.kernel.model.SystemEventConstants; import com.liferay.portal.kernel.model.User; -import com.liferay.portal.kernel.module.configuration.ConfigurationProvider; import com.liferay.portal.kernel.notifications.UserNotificationDefinition; import com.liferay.portal.kernel.portlet.PortletProvider; import com.liferay.portal.kernel.portlet.PortletProviderUtil; +import com.liferay.portal.kernel.portlet.url.builder.PortletURLBuilder; import com.liferay.portal.kernel.portletfilerepository.PortletFileRepository; import com.liferay.portal.kernel.repository.model.FileEntry; import com.liferay.portal.kernel.repository.model.Folder; @@ -103,7 +75,6 @@ import com.liferay.portal.kernel.service.WorkflowInstanceLinkLocalService; import com.liferay.portal.kernel.service.permission.ModelPermissions; import com.liferay.portal.kernel.servlet.taglib.ui.ImageSelector; -import com.liferay.portal.kernel.servlet.taglib.ui.ImageSelectorProcessor; import com.liferay.portal.kernel.settings.GroupServiceSettingsLocator; import com.liferay.portal.kernel.settings.LocalizedValuesMap; import com.liferay.portal.kernel.social.SocialActivityManagerUtil; @@ -119,7 +90,7 @@ import com.liferay.portal.kernel.util.HtmlParser; import com.liferay.portal.kernel.util.HtmlUtil; import com.liferay.portal.kernel.util.Http; -import com.liferay.portal.kernel.util.LocalizationUtil; +import com.liferay.portal.kernel.util.Localization; import com.liferay.portal.kernel.util.MimeTypesUtil; import com.liferay.portal.kernel.util.ParamUtil; import com.liferay.portal.kernel.util.Portal; @@ -145,9 +116,30 @@ import com.liferay.trash.service.TrashEntryLocalService; import com.liferay.upload.UniqueFileNameProvider; +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; + +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Set; + +import javax.portlet.PortletRequest; + +import javax.servlet.http.HttpServletRequest; + import net.htmlparser.jericho.Source; import net.htmlparser.jericho.StartTag; +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Modified; +import org.osgi.service.component.annotations.Reference; + /** * Provides the local service for accessing, adding, checking, deleting, * subscription handling of, trash handling of, and updating blog entries. @@ -180,8 +172,9 @@ public FileEntry addAttachmentFileEntry( entry.getGroupId(), folder.getFolderId(), curFileName)); return _portletFileRepository.addPortletFileEntry( - entry.getGroupId(), userId, null, 0, BlogsConstants.SERVICE_NAME, - folder.getFolderId(), inputStream, uniqueFileName, mimeType, true); + null, entry.getGroupId(), userId, null, 0, + BlogsConstants.SERVICE_NAME, folder.getFolderId(), inputStream, + uniqueFileName, mimeType, true); } @Override @@ -303,8 +296,6 @@ public BlogsEntry addEntry( long entryId = counterLocalService.increment(); - _validateExternalReferenceCode(externalReferenceCode, groupId); - if (Validator.isNotNull(urlTitle)) { urlTitle = _validateURLTitle(groupId, urlTitle, serviceContext); } @@ -1456,6 +1447,26 @@ public BlogsEntry updateStatus( if (status == WorkflowConstants.STATUS_APPROVED) { + // Resources + + if ((oldStatus == WorkflowConstants.STATUS_DRAFT) && + GetterUtil.getBoolean( + serviceContext.getAttribute("addEntryResources"))) + { + + if (serviceContext.isAddGroupPermissions() || + serviceContext.isAddGuestPermissions()) { + + addEntryResources( + entry, serviceContext.isAddGroupPermissions(), + serviceContext.isAddGuestPermissions()); + } + else { + addEntryResources( + entry, serviceContext.getModelPermissions()); + } + } + // Asset _assetEntryLocalService.updateEntry( @@ -1582,7 +1593,7 @@ private long _addCoverImageFileEntry( try { ImageSelectorProcessor imageSelectorProcessor = - new ImageSelectorProcessor(imageSelector.getImageBytes()); + new ImageSelectorProcessor(imageSelector.getImageBytes(), _imageMagick); imageBytes = imageSelectorProcessor.cropImage( imageSelector.getImageCropRegion()); @@ -1660,7 +1671,7 @@ private long _addSmallImageFileEntry( BlogsGroupServiceSettings.getInstance(groupId); ImageSelectorProcessor imageSelectorProcessor = - new ImageSelectorProcessor(imageSelector.getImageBytes()); + new ImageSelectorProcessor(imageSelector.getImageBytes(), _imageMagick); imageBytes = imageSelectorProcessor.scaleImage( blogsGroupServiceSettings.getSmallImageWidth()); @@ -1676,8 +1687,8 @@ private long _addSmallImageFileEntry( imageSelector.getImageTitle(), imageSelector.getImageMimeType(), imageBytes); } - catch (IOException ioException) { - throw new EntrySmallImageScaleException(ioException); + catch (Exception exception) { + throw new EntrySmallImageScaleException(exception); } } @@ -1924,15 +1935,15 @@ private boolean _isValidImageMimeType(FileEntry fileEntry) { Set extensions = MimeTypesUtil.getExtensions( fileEntry.getMimeType()); - if (Stream.of( - _blogsFileUploadsConfiguration.imageExtensions() - ).anyMatch( - extension -> - extension.equals(StringPool.STAR) || - extensions.contains(extension) - )) { + for (String extension : _blogsFileUploadsConfiguration.imageExtensions()) + { - return true; + if (extension.equals(StringPool.STAR) || + extensions.contains(extension)) + { + + return true; + } } return false; @@ -2019,7 +2030,6 @@ else if ((invokedByCheckEntries || sendEmailEntryUpdated) && subscriptionSender.setClassPK(entry.getEntryId()); subscriptionSender.setClassName(entry.getModelClassName()); subscriptionSender.setCompanyId(entry.getCompanyId()); - subscriptionSender.setContextAttribute( "[$BLOGS_ENTRY_CONTENT$]", StringUtil.shorten(HtmlUtil.stripHtml(entry.getContent()), 500), @@ -2062,7 +2072,7 @@ else if ((invokedByCheckEntries || sendEmailEntryUpdated) && if (bodyLocalizedValuesMap != null) { subscriptionSender.setLocalizedBodyMap( - LocalizationUtil.getMap(bodyLocalizedValuesMap)); + _localization.getMap(bodyLocalizedValuesMap)); } subscriptionSender.setLocalizedContextAttributeWithFunction( @@ -2071,7 +2081,7 @@ else if ((invokedByCheckEntries || sendEmailEntryUpdated) && if (subjectLocalizedValuesMap != null) { subscriptionSender.setLocalizedSubjectMap( - LocalizationUtil.getMap(subjectLocalizedValuesMap)); + _localization.getMap(subjectLocalizedValuesMap)); } subscriptionSender.setMailId("blogs_entry", entry.getEntryId()); @@ -2416,25 +2426,6 @@ private void _validate( } } - private void _validateExternalReferenceCode( - String externalReferenceCode, long groupId) - throws PortalException { - - if (Validator.isNull(externalReferenceCode)) { - return; - } - - BlogsEntry entry = blogsEntryPersistence.fetchByG_ERC( - groupId, externalReferenceCode); - - if (entry != null) { - throw new DuplicateEntryExternalReferenceCodeException( - StringBundler.concat( - "Duplicate blogs entry external reference code ", - externalReferenceCode, " in group ", groupId)); - } - } - private String _validateURLTitle( long groupId, String urlTitle, ServiceContext serviceContext) throws PortalException { @@ -2510,9 +2501,15 @@ private String _validateURLTitle( @Reference private ImageLocalService _imageLocalService; + @Reference + private ImageMagick _imageMagick; + @Reference private LayoutLocalService _layoutLocalService; + @Reference + private Localization _localization; + @Reference private Portal _portal; diff --git a/gd-captcha-api/bnd.bnd b/gd-captcha-api/bnd.bnd index 0d0baea9..a86496df 100644 --- a/gd-captcha-api/bnd.bnd +++ b/gd-captcha-api/bnd.bnd @@ -4,7 +4,8 @@ Bundle-Version: 1.0.0 -metatype: * -plugin.metatype: com.liferay.ant.bnd.metatype.MetatypePlugin Export-Package: \ - com.liferay.captcha.configuration,\ - de.seitenbau.govdata.honeypot + com.liferay.portal.configuration.metatype.bnd.util,\ + com.liferay.captcha.configuration,\ + de.seitenbau.govdata.honeypot -includeresource: \ @commons-lang3-*.jar \ No newline at end of file diff --git a/gd-captcha-api/pom.xml b/gd-captcha-api/pom.xml index d4898288..80fd42e7 100644 --- a/gd-captcha-api/pom.xml +++ b/gd-captcha-api/pom.xml @@ -5,7 +5,7 @@ de.seitenbau.govdata.odp od-platform - 6.3.0 + 6.4.0 de.seitenbau.govdata.gd-captcha-api gd-captcha-api diff --git a/gd-captcha-fragment/bnd.bnd b/gd-captcha-fragment/bnd.bnd index cb076c5b..72b80258 100644 --- a/gd-captcha-fragment/bnd.bnd +++ b/gd-captcha-fragment/bnd.bnd @@ -1,7 +1,7 @@ Bundle-Name: gd-captcha-fragment Bundle-SymbolicName: de.seitenbau.govdata.captcha.fragment Bundle-Version: 1.0.0 -Fragment-Host: com.liferay.captcha.taglib;bundle-version="5.0.12" +Fragment-Host: com.liferay.captcha.taglib;bundle-version="5.1.1" -jsp: *.jsp,*.jspf -metatype: * -plugin.jsp: com.liferay.ant.bnd.jsp.JspAnalyzerPlugin diff --git a/gd-captcha-fragment/pom.xml b/gd-captcha-fragment/pom.xml index bb0fe1a3..23174f1f 100644 --- a/gd-captcha-fragment/pom.xml +++ b/gd-captcha-fragment/pom.xml @@ -4,7 +4,7 @@ od-platform de.seitenbau.govdata.odp - 6.3.0 + 6.4.0 gd-captcha-fragment diff --git a/gd-comment-taglib-fragment/bnd.bnd b/gd-comment-taglib-fragment/bnd.bnd index b77efead..224c42db 100644 --- a/gd-comment-taglib-fragment/bnd.bnd +++ b/gd-comment-taglib-fragment/bnd.bnd @@ -1,7 +1,7 @@ Bundle-Name: gd-comment-taglib-fragment Bundle-SymbolicName: de.seitenbau.govdata.comment.taglib.fragment Bundle-Version: 1.0.0 -Fragment-Host: com.liferay.comment.taglib;bundle-version="4.0.33" +Fragment-Host: com.liferay.comment.taglib;bundle-version="4.0.45" -jsp: *.jsp,*.jspf -metatype: * -plugin.jsp: com.liferay.ant.bnd.jsp.JspAnalyzerPlugin diff --git a/gd-comment-taglib-fragment/pom.xml b/gd-comment-taglib-fragment/pom.xml index ae8dd8d2..645e4e8f 100644 --- a/gd-comment-taglib-fragment/pom.xml +++ b/gd-comment-taglib-fragment/pom.xml @@ -4,7 +4,7 @@ od-platform de.seitenbau.govdata.odp - 6.3.0 + 6.4.0 gd-comment-taglib-fragment diff --git a/gd-comment-taglib-fragment/src/main/resources/META-INF/resources/discussion/view_message_thread.jsp b/gd-comment-taglib-fragment/src/main/resources/META-INF/resources/discussion/view_message_thread.jsp index 22e00d96..471b1ef9 100644 --- a/gd-comment-taglib-fragment/src/main/resources/META-INF/resources/discussion/view_message_thread.jsp +++ b/gd-comment-taglib-fragment/src/main/resources/META-INF/resources/discussion/view_message_thread.jsp @@ -1,16 +1,7 @@ <%-- /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * 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 */ --%> @@ -31,9 +22,7 @@ String randomNamespace = (String)request.getAttribute("liferay-comment:discussio DiscussionComment rootDiscussionComment = discussion.getRootDiscussionComment(); -DiscussionRequestHelper discussionRequestHelper = new DiscussionRequestHelper(request); - -CommentTreeDisplayContext commentTreeDisplayContext = CommentDisplayContextProviderUtil.getCommentTreeDisplayContext(request, response, CommentManagerUtil.getDiscussionPermission(discussionRequestHelper.getPermissionChecker()), discussionComment); +CommentTreeDisplayContext commentTreeDisplayContext = CommentDisplayContextProviderUtil.getCommentTreeDisplayContext(request, response, DiscussionPermissionUtil.getDiscussionPermission(), discussionComment); Format dateFormatDateTime = FastDateFormatFactoryUtil.getDateTime(locale, timeZone); %> diff --git a/gd-developers-corner-portlet/pom.xml b/gd-developers-corner-portlet/pom.xml index 24eb794a..b7395765 100644 --- a/gd-developers-corner-portlet/pom.xml +++ b/gd-developers-corner-portlet/pom.xml @@ -5,7 +5,7 @@ od-platform de.seitenbau.govdata.odp - 6.3.0 + 6.4.0 gd-developers-corner-portlet war diff --git a/gd-edit-portlet/pom.xml b/gd-edit-portlet/pom.xml index f366149b..d80b962d 100644 --- a/gd-edit-portlet/pom.xml +++ b/gd-edit-portlet/pom.xml @@ -7,7 +7,7 @@ de.seitenbau.govdata.odp od-platform - 6.3.0 + 6.4.0 diff --git a/gd-login-web-fragment/bnd.bnd b/gd-login-web-fragment/bnd.bnd index 36966793..aa318e30 100644 --- a/gd-login-web-fragment/bnd.bnd +++ b/gd-login-web-fragment/bnd.bnd @@ -1,7 +1,7 @@ Bundle-Name: gd-login-web-fragment Bundle-SymbolicName: de.seitenbau.govdata.login.web.fragment Bundle-Version: 1.0.0 -Fragment-Host: com.liferay.login.web;bundle-version="6.0.27" +Fragment-Host: com.liferay.login.web;bundle-version="6.0.44" -jsp: *.jsp,*.jspf -metatype: * -plugin.jsp: com.liferay.ant.bnd.jsp.JspAnalyzerPlugin diff --git a/gd-login-web-fragment/pom.xml b/gd-login-web-fragment/pom.xml index ba85808a..6628cbbe 100644 --- a/gd-login-web-fragment/pom.xml +++ b/gd-login-web-fragment/pom.xml @@ -4,7 +4,7 @@ od-platform de.seitenbau.govdata.odp - 6.3.0 + 6.4.0 gd-login-web-fragment diff --git a/gd-login-web-fragment/src/main/resources/META-INF/resources/create_account.jsp b/gd-login-web-fragment/src/main/resources/META-INF/resources/create_account.jsp index 6d543e12..51c733b4 100644 --- a/gd-login-web-fragment/src/main/resources/META-INF/resources/create_account.jsp +++ b/gd-login-web-fragment/src/main/resources/META-INF/resources/create_account.jsp @@ -1,16 +1,7 @@ <%-- /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * 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 */ --%> @@ -88,6 +79,17 @@ renderResponse.setTitle(LanguageUtil.get(request, "create-account")); + + + + + <% + UserPasswordException.MustComplyWithRegex upe = (UserPasswordException.MustComplyWithRegex)errorException; + %> + + + + <% @@ -96,24 +98,23 @@ renderResponse.setTitle(LanguageUtil.get(request, "create-account")); - + + <% - UserPasswordException.MustHaveMoreUppercase upe = (UserPasswordException.MustHaveMoreUppercase)errorException; + UserPasswordException.MustHaveMoreSymbols upe = (UserPasswordException.MustHaveMoreSymbols)errorException; %> - + - - - + <% - UserPasswordException.MustComplyWithRegex upe = (UserPasswordException.MustComplyWithRegex)errorException; + UserPasswordException.MustHaveMoreUppercase upe = (UserPasswordException.MustHaveMoreUppercase)errorException; %> - + @@ -144,6 +145,7 @@ renderResponse.setTitle(LanguageUtil.get(request, "create-account"));
+

- + <% ScreenNameValidator screenNameValidator = ScreenNameValidatorFactory.getInstance(); @@ -169,16 +171,13 @@ renderResponse.setTitle(LanguageUtil.get(request, "create-account")); - - - - - +
+

-
+ +
+

- - - - - - + + + - + '#password1' - - - - - -
+ + +
+
+

diff --git a/gd-login-web-fragment/src/main/resources/META-INF/resources/create_anonymous_account.jsp b/gd-login-web-fragment/src/main/resources/META-INF/resources/create_anonymous_account.jsp index 18566990..42852720 100644 --- a/gd-login-web-fragment/src/main/resources/META-INF/resources/create_anonymous_account.jsp +++ b/gd-login-web-fragment/src/main/resources/META-INF/resources/create_anonymous_account.jsp @@ -1,16 +1,7 @@ <%-- /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * 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 */ --%> @@ -68,16 +59,10 @@ renderResponse.setTitle(LanguageUtil.get(request, "anonymous-account")); %> - - - + - - - - - + od-platform de.seitenbau.govdata.odp - 6.3.0 + 6.4.0 gd-metadata-quality-portlet war diff --git a/gd-search-common/pom.xml b/gd-search-common/pom.xml index be82d1e4..430d0a1f 100644 --- a/gd-search-common/pom.xml +++ b/gd-search-common/pom.xml @@ -3,7 +3,7 @@ de.seitenbau.govdata.odp od-platform - 6.3.0 + 6.4.0 gd-search-common GovData search common diff --git a/gd-search-common/src/main/java/de/seitenbau/govdata/search/index/ApplicationContextProvider.java b/gd-search-common/src/main/java/de/seitenbau/govdata/search/index/ApplicationContextProvider.java new file mode 100644 index 00000000..e26d7890 --- /dev/null +++ b/gd-search-common/src/main/java/de/seitenbau/govdata/search/index/ApplicationContextProvider.java @@ -0,0 +1,27 @@ +package de.seitenbau.govdata.search.index; + +import org.springframework.beans.BeansException; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.stereotype.Component; + +@Component("applicationContextProvider") +public class ApplicationContextProvider implements ApplicationContextAware +{ + private static ApplicationContext ctx = null; + + public static ApplicationContext getApplicationContext() + { + return ctx; + } + @Override + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException + { + if (ctx == null) + { + ctx = applicationContext; + } + + } + +} diff --git a/gd-search-common/src/main/java/de/seitenbau/govdata/search/index/GovDataSearchIndexWriter.java b/gd-search-common/src/main/java/de/seitenbau/govdata/search/index/GovDataSearchIndexWriter.java index 653867cc..a99bd704 100644 --- a/gd-search-common/src/main/java/de/seitenbau/govdata/search/index/GovDataSearchIndexWriter.java +++ b/gd-search-common/src/main/java/de/seitenbau/govdata/search/index/GovDataSearchIndexWriter.java @@ -1,26 +1,26 @@ package de.seitenbau.govdata.search.index; import java.text.ParseException; -import java.util.Collection; import java.util.HashMap; -import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Set; -import javax.inject.Inject; import javax.ws.rs.NotFoundException; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; - import com.google.gson.Gson; import com.liferay.asset.kernel.service.AssetTagLocalServiceUtil; +import com.liferay.portal.kernel.log.Log; +import com.liferay.portal.kernel.log.LogFactoryUtil; +import com.liferay.portal.kernel.search.BooleanQuery; import com.liferay.portal.kernel.search.Document; import com.liferay.portal.kernel.search.Field; -import com.liferay.portal.kernel.search.IndexWriter; +import com.liferay.portal.kernel.search.IndexerPostProcessor; import com.liferay.portal.kernel.search.SearchContext; import com.liferay.portal.kernel.search.SearchException; +import com.liferay.portal.kernel.search.Summary; +import com.liferay.portal.kernel.search.filter.BooleanFilter; +import com.liferay.portal.kernel.util.PropsUtil; import de.seitenbau.govdata.common.api.RestUserMetadata; import de.seitenbau.govdata.common.client.impl.RestCallFailedException; @@ -28,7 +28,6 @@ import de.seitenbau.govdata.date.DateUtil; import de.seitenbau.govdata.index.queue.adapter.IndexQueueAdapterServiceRESTResource; import de.seitenbau.govdata.odp.common.filter.SearchConsts; -import de.seitenbau.govdata.search.adapter.SearchService; import de.seitenbau.govdata.search.index.filter.FilterProxy; import de.seitenbau.govdata.search.index.mapper.ClassToTypeMapper; import de.seitenbau.govdata.search.index.util.SearchIndexUtil; @@ -43,222 +42,85 @@ * */ @Slf4j -@Service -public class GovDataSearchIndexWriter implements IndexWriter +public class GovDataSearchIndexWriter implements IndexerPostProcessor { private static final Locale LOCALE_USED = Locale.GERMANY; - @Inject - private IndexQueueAdapterServiceRESTResource indexClient; - - @Inject - private SearchService searchService; - - @Inject - private FilterProxy filterProxy; + private IndexQueueAdapterServiceRESTResource indexClient = ApplicationContextProvider.getApplicationContext().getBean(IndexQueueAdapterServiceRESTResource.class); - private String indexName; + private String indexName = PropsUtil.get(SearchConsts.PARAM_ELASTICSEARCH_LIFERAY_INDEX_NAME); - @Inject - private SearchIndexUtil searchIndexUtil; - - @Override - public void addDocument(SearchContext searchContext, Document document) - throws SearchException - { - if (!filterProxy.isRelevantForIndex(document)) - { - log.debug("addDocument: ignoring document uid={} (not relevant for index)", document.getUID()); - return; - } - log.debug("addDocument: uid={}", document.getUID()); - // same as update - updateDocument(searchContext, document); - } + private SearchIndexUtil searchIndexUtil = ApplicationContextProvider.getApplicationContext().getBean(SearchIndexUtil.class); - @Override - public void addDocuments(SearchContext searchContext, - Collection documents) throws SearchException - { - log.debug("addDocuments " + Integer.toString(documents.size()) + " documents."); - for (Document document : documents) - { - try - { - addDocument(searchContext, document); - } - catch (Exception e) - { - // Would it be better to stop processing here? - log.error("Could not add document uid=" + document.getUID(), e); - } - } - } + private FilterProxy filterProxy = + ApplicationContextProvider.getApplicationContext().getBean(FilterProxy.class); + + private static Log _log = LogFactoryUtil.getLog(GovDataSearchIndexWriter.class); @Override - public void deleteEntityDocuments(SearchContext searchContext, String className) throws SearchException + public void postProcessContextBooleanFilter(BooleanFilter booleanFilter, SearchContext searchContext) + throws Exception { - log.debug("deleteEntityDocuments className=" + className); - List uids = searchService.findPortalContentIdsByPortletId(className); - if (uids.size() > 0) - { - deleteDocuments(searchContext, uids); - } + log.info("postProcessContextBooleanFilter()"); + if (_log.isDebugEnabled()) + _log.debug("postProcessContextBooleanFilter()"); } @Override - public void deleteDocument(SearchContext searchContext, String uid) - throws SearchException + public void postProcessDocument(Document document, Object object) throws Exception { - log.debug("deleteDocument uid=" + uid); - - SearchIndexEntry entry = createSearchIndexEntryWithBasicInformation(uid); - + SearchIndexEntry entry = buildSearchIndexEntryFromLiferayDocument(document); RestUserMetadata ruMetadata = new RestUserMetadata(IndexConstants.INDEX_MANDANT); - - try - { - indexClient.deleteAndSendDeleteMessage(ruMetadata, uid, entry); - } - catch (RestCallFailedException restCallFailedException) - { - Throwable cause = restCallFailedException.getCause(); - if (!(cause instanceof NotFoundException)) - { - throwOnDeletingExcpetion(uid, cause); - } - } - catch(Exception e) - { - throwOnDeletingExcpetion(uid, e); - } - } + String uid = document.getUID(); - @Override - public void deleteDocuments(SearchContext searchContext, - Collection uids) throws SearchException - { - log.debug("deleteDocuments " + Integer.toString(uids.size()) + " documents."); - for (String uid : uids) + if (!document.get(Field.REMOVED_DATE).isEmpty() + || !filterProxy.isRelevantForIndex(document)) { try { - deleteDocument(searchContext, uid); + deleteDocument(entry, ruMetadata, uid); } catch (Exception e) { - // Would it be better to stop processing here? log.error("Could not delete document uid=" + uid, e); } } - } - - @Override - public void updateDocument(SearchContext searchContext, Document document) - throws SearchException - { - if (!filterProxy.isRelevantForIndex(document)) - { - log.debug("updateDocument: ignoring document uid={} (not relevant for index)", document.getUID()); - // as the document may already be in the index, we try to delete it - deleteDocument(searchContext, document.getUID()); - return; - } - log.debug("updateDocument: uid=" + document.getUID()); - - SearchIndexEntry entry = buildSearchIndexEntryFromLiferayDocument(document); - - RestUserMetadata ruMetadata = new RestUserMetadata(IndexConstants.INDEX_MANDANT); - indexClient.save(ruMetadata, entry); - } - - @Override - public void updateDocuments(SearchContext searchContext, - Collection documents) throws SearchException - { - log.debug("updateDocuments " + Integer.toString(documents.size()) + " documents."); - for (Document document : documents) + else { try { - updateDocument(searchContext, document); + addDocument(entry, ruMetadata, uid); } catch (Exception e) { - // Would it be better to stop processing here? - log.error("Could not update document uid=" + document.getUID(), e); + log.error("Could not add document uid=" + uid, e); } } } @Override - public void clearQuerySuggestionDictionaryIndexes( - SearchContext searchContext) throws SearchException - { - log.debug("clearQuerySuggestionDictionaryIndexes"); - } - - @Override - public void clearSpellCheckerDictionaryIndexes(SearchContext searchContext) - throws SearchException - { - log.debug("clearSpellCheckerDictionaryIndexes"); - } - - @Override - public void indexKeyword(SearchContext searchContext, float weight, - String keywordType) throws SearchException - { - log.debug("indexKeyword"); - } - - @Override - public void indexQuerySuggestionDictionaries(SearchContext searchContext) - throws SearchException - { - log.debug("indexQuerySuggestionDictionaries"); - } - - @Override - public void indexQuerySuggestionDictionary(SearchContext searchContext) - throws SearchException - { - log.debug("indexQuerySuggestionDictionary"); - } - - @Override - public void indexSpellCheckerDictionaries(SearchContext searchContext) - throws SearchException - { - log.debug("indexSpellCheckerDictionaries"); - } - - @Override - public void indexSpellCheckerDictionary(SearchContext searchContext) - throws SearchException - { - log.debug("indexSpellCheckerDictionary"); - } - - @Override - public void commit(SearchContext searchContext) throws SearchException + public void postProcessFullQuery(BooleanQuery fullQuery, SearchContext searchContext) throws Exception { - log.debug("commit"); + log.info("postProcessFullQuery()"); + if (_log.isDebugEnabled()) + _log.debug(" postProcessFullQuery()"); } @Override - public void partiallyUpdateDocument(SearchContext searchContext, Document document) throws SearchException + public void postProcessSearchQuery(BooleanQuery searchQuery, BooleanFilter booleanFilter, + SearchContext searchContext) throws Exception { - log.debug("partiallyUpdateDocument"); - updateDocument(searchContext, document); + log.info("postProcessSearchQuery()"); + if (_log.isDebugEnabled()) + _log.debug(" postProcessSearchQuery()"); } @Override - public void partiallyUpdateDocuments(SearchContext searchContext, Collection documents) - throws SearchException + public void postProcessSummary(Summary summary, Document document, Locale locale, String snippet) { - log.debug("partiallyUpdateDocuments"); - updateDocuments(searchContext, documents); + log.info("postProcessSummary()"); + if (_log.isDebugEnabled()) + _log.debug("postProcessSummary()"); } private SearchIndexEntry createSearchIndexEntryWithBasicInformation(String uid) @@ -341,9 +203,33 @@ private void throwOnDeletingExcpetion(String uid, Throwable cause) throws Search throw new SearchException("Deleting document uid=" + uid + " failed.", cause); } - @Value(SearchConsts.CONFIG_ELASTICSEARCH_LIFERAY_INDEX_NAME) - public void setIndexName(String indexName) + private void addDocument(SearchIndexEntry entry, RestUserMetadata ruMetadata, String uid) { - this.indexName = indexName; + log.debug("addDocument: uid={}", uid); + indexClient.save(ruMetadata, entry); + } + + private void deleteDocument(SearchIndexEntry entry, RestUserMetadata ruMetadata, String uid) + throws SearchException + { + log.debug("deleteDocument uid=" + uid); + try + { + indexClient.deleteAndSendDeleteMessage(ruMetadata, uid, entry); + } + catch (RestCallFailedException restCallFailedException) + { + Throwable cause = restCallFailedException.getCause(); + if (!(cause instanceof NotFoundException)) + { + + throwOnDeletingExcpetion(uid, cause); + } + } + catch (Exception e) + { + throwOnDeletingExcpetion(uid, e); + } } + } diff --git a/gd-search-common/src/test/java/de/seitenbau/govdata/search/index/GovDataSearchIndexWriterTest.java b/gd-search-common/src/test/java/de/seitenbau/govdata/search/index/GovDataSearchIndexWriterTest.java index 04482a54..ee11f366 100644 --- a/gd-search-common/src/test/java/de/seitenbau/govdata/search/index/GovDataSearchIndexWriterTest.java +++ b/gd-search-common/src/test/java/de/seitenbau/govdata/search/index/GovDataSearchIndexWriterTest.java @@ -2,20 +2,16 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.never; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import java.text.DateFormat; import java.text.SimpleDateFormat; -import java.util.ArrayList; import java.util.HashMap; -import java.util.List; import java.util.Map; import org.assertj.core.api.Assertions; -import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; @@ -32,7 +28,6 @@ import com.liferay.portal.kernel.search.DocumentImpl; import com.liferay.portal.kernel.search.Field; import com.liferay.portal.kernel.search.SearchContext; -import com.liferay.portal.kernel.search.SearchException; import com.liferay.portal.kernel.util.DateFormatFactory; import com.liferay.portal.kernel.util.DateFormatFactoryUtil; import com.liferay.portal.kernel.util.FastDateFormatFactory; @@ -92,68 +87,65 @@ private static class MetadataType extends HashMap{}; @InjectMocks private GovDataSearchIndexWriter sutWriter; - - @Before - public void setUp() - { - sutWriter.setIndexName(DEFAULT_INDEXNAME); - } - + @Test - public void testDeletePortletDocuments() throws SearchException + public void testpostProcessAddDocument() throws Exception { - String portletId = "42"; - String uid1 = "12345"; - String uid2 = "54321"; - - List uids = new ArrayList(); - uids.add(uid1); - uids.add(uid2); - - when(searchServiceMock.findPortalContentIdsByPortletId(portletId)).thenReturn(uids); - - sutWriter.deleteEntityDocuments(searchContextMock, portletId); - + /* prepare */ + DocumentImpl document = createAndGetDocument(); + + + sutWriter.postProcessDocument(document, new Object()); + ArgumentCaptor idCaptor = ArgumentCaptor.forClass(String.class); ArgumentCaptor searchIndexEntryCaptor = ArgumentCaptor.forClass(SearchIndexEntry.class); - - verify(indexQueueServiceMock, times(2)).deleteAndSendDeleteMessage( - any(RestUserMetadata.class), - idCaptor.capture(), + + verify(indexQueueServiceMock, times(0)).deleteAndSendDeleteMessage( + any(RestUserMetadata.class), + idCaptor.capture(), + searchIndexEntryCaptor.capture()); + verify(indexQueueServiceMock, times(1)).save( + any(RestUserMetadata.class), searchIndexEntryCaptor.capture()); - - assertThat(idCaptor.getAllValues().get(0)).isEqualTo(uid1); - assertThat(idCaptor.getAllValues().get(1)).isEqualTo(uid2); - + + assertThat(searchIndexEntryCaptor.getAllValues().size()).isEqualTo(1); SearchIndexEntry firstSearchIndexEntry = searchIndexEntryCaptor.getAllValues().get(0); - assertThat(firstSearchIndexEntry.getDocument().getId()).isEqualTo(uid1); + assertThat(firstSearchIndexEntry.getDocument().getId()).isEqualTo(document.getUID()); assertThat(firstSearchIndexEntry.getDocument().getMandant()).isEqualTo(DEFAULT_MANDANT); assertThat(firstSearchIndexEntry.getIndexName()).isEqualTo(DEFAULT_INDEXNAME); - assertThat(firstSearchIndexEntry.getType()).isEqualTo(IndexConstants.INDEX_TYPE_PORTAL); - - SearchIndexEntry secondSearchIndexEntry = searchIndexEntryCaptor.getAllValues().get(1); - assertThat(secondSearchIndexEntry.getDocument().getId()).isEqualTo(uid2); - assertThat(secondSearchIndexEntry.getDocument().getMandant()).isEqualTo(DEFAULT_MANDANT); - assertThat(secondSearchIndexEntry.getIndexName()).isEqualTo(DEFAULT_INDEXNAME); - assertThat(secondSearchIndexEntry.getType()).isEqualTo(IndexConstants.INDEX_TYPE_PORTAL); + } - + @Test - public void testDeletePortletDocuments_NoDocuments() throws SearchException + public void testpostProcessDeleteDocument() throws Exception { - String portletId = "42"; - - List uids = new ArrayList(); - - when(searchServiceMock.findPortalContentIdsByPortletId(portletId)).thenReturn(uids); - - sutWriter.deleteEntityDocuments(searchContextMock, portletId); - - verify(indexQueueServiceMock, never()).deleteAndSendDeleteMessage( - any(RestUserMetadata.class), - any(String.class), - any(SearchIndexEntry.class)); - + /* prepare */ + DocumentImpl document = createAndGetDocument(); + // Field.REMOVED_DATE + document.add(new Field(Field.REMOVED_DATE, "20150819035215")); // UTC +2:00 + + sutWriter.postProcessDocument(document, new Object()); + + ArgumentCaptor idCaptor = ArgumentCaptor.forClass(String.class); + ArgumentCaptor searchIndexEntryCaptor = ArgumentCaptor.forClass(SearchIndexEntry.class); + + verify(indexQueueServiceMock, times(0)).save( + any(RestUserMetadata.class), + searchIndexEntryCaptor.capture()); + verify(indexQueueServiceMock, times(1)).deleteAndSendDeleteMessage( + any(RestUserMetadata.class), + idCaptor.capture(), + searchIndexEntryCaptor.capture()); + + assertThat(idCaptor.getAllValues().size()).isEqualTo(1); + assertThat(idCaptor.getAllValues().get(0)).isEqualTo(document.getUID()); + + assertThat(searchIndexEntryCaptor.getAllValues().size()).isEqualTo(1); + SearchIndexEntry firstSearchIndexEntry = searchIndexEntryCaptor.getAllValues().get(0); + assertThat(firstSearchIndexEntry.getDocument().getId()).isEqualTo(document.getUID()); + assertThat(firstSearchIndexEntry.getDocument().getMandant()).isEqualTo(DEFAULT_MANDANT); + assertThat(firstSearchIndexEntry.getIndexName()).isEqualTo(DEFAULT_INDEXNAME); + } @Test @@ -262,4 +254,34 @@ public void buildSearchIndexEntryFromLiferayDocument() throws Exception Map metadata = new Gson().fromJson(metadataJsonString, MetadataType.class); Assertions.assertThat(metadata).isEqualTo(metadataExpected); } + + private DocumentImpl createAndGetDocument() + { + String portletId = "42"; + String entryId = "100"; + String uuid = portletId + "_PORTLET_" + entryId; + String entryClassPk = "20013"; + String version = "1.0"; + String title = "My title"; + String content = "My content"; + String entryClassName = BlogsEntry.class.getName(); + + // Document + DocumentImpl document = new DocumentImpl(); + document.addUID(portletId, entryId); + // Field.VERSION + document.add(new Field(Field.VERSION, version)); + // Field.TITLE + document.add(new Field(Field.TITLE, title)); + // Field.CONTENT + document.add(new Field(Field.CONTENT, content)); + // Field.MODIFIED_DATE + document.add(new Field(Field.MODIFIED_DATE, "20150819035214")); // UTC +2:00 + // Field.ENTRY_CLASS_NAME + document.add(new Field(Field.ENTRY_CLASS_NAME, entryClassName)); + // Field.ENTRY_CLASS_NAME + document.add(new Field(Field.ENTRY_CLASS_PK, entryClassPk)); + + return document; + } } diff --git a/gd-search/pom.xml b/gd-search/pom.xml index 30c7e752..ebd14f5d 100644 --- a/gd-search/pom.xml +++ b/gd-search/pom.xml @@ -7,7 +7,7 @@ de.seitenbau.govdata.odp od-platform - 6.3.0 + 6.4.0 diff --git a/gd-search/src/main/java/de/seitenbau/govdata/search/index/listener/IndexListener.java b/gd-search/src/main/java/de/seitenbau/govdata/search/index/listener/IndexListener.java deleted file mode 100644 index 1fb30d41..00000000 --- a/gd-search/src/main/java/de/seitenbau/govdata/search/index/listener/IndexListener.java +++ /dev/null @@ -1,39 +0,0 @@ -package de.seitenbau.govdata.search.index.listener; - - -import javax.inject.Inject; - -import com.liferay.portal.kernel.messaging.Message; -import com.liferay.portal.kernel.messaging.MessageListener; -import com.liferay.portal.kernel.messaging.MessageListenerException; -import com.liferay.portal.kernel.messaging.proxy.ProxyRequest; -import com.liferay.portal.kernel.search.IndexWriter; - -import lombok.extern.slf4j.Slf4j; - -@Slf4j -public class IndexListener implements MessageListener -{ - @Inject - private IndexWriter indexWriter; - - @Override - public void receive(Message message) throws MessageListenerException - { - log.debug("IndexListener.recieve: " + message.getDestinationName()); - ProxyRequest proxyRequest = (ProxyRequest) message.getPayload(); - - try - { - proxyRequest.execute(indexWriter); - } - catch (Exception e) - { - log.error("Exceution of proxy request failed: " + e.getMessage()); - throw new MessageListenerException(e); - } - - return; - } - -} diff --git a/gd-search/src/main/resources/spring/gd-search-indexer-context.xml b/gd-search/src/main/resources/spring/gd-search-indexer-context.xml index 03188861..8b1bbee3 100644 --- a/gd-search/src/main/resources/spring/gd-search-indexer-context.xml +++ b/gd-search/src/main/resources/spring/gd-search-indexer-context.xml @@ -9,7 +9,6 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/gd-search/src/main/webapp/WEB-INF/liferay-hook.xml b/gd-search/src/main/webapp/WEB-INF/liferay-hook.xml new file mode 100644 index 00000000..8b9fb9b9 --- /dev/null +++ b/gd-search/src/main/webapp/WEB-INF/liferay-hook.xml @@ -0,0 +1,13 @@ + + + + + + com.liferay.blogs.model.BlogsEntry + de.seitenbau.govdata.search.index.GovDataSearchIndexWriter + + + com.liferay.journal.model.JournalArticle + de.seitenbau.govdata.search.index.GovDataSearchIndexWriter + + \ No newline at end of file diff --git a/gd-subscription-web-override/bnd.bnd b/gd-subscription-web-override/bnd.bnd index 68cc48a7..853f32cc 100644 --- a/gd-subscription-web-override/bnd.bnd +++ b/gd-subscription-web-override/bnd.bnd @@ -1,11 +1,11 @@ Bundle-Name: Liferay Subscription Web Bundle-SymbolicName: com.liferay.subscription.web -Bundle-Version: 4.0.16 +Bundle-Version: 4.0.27 Liferay-Service: true -dsannotations-options: inherit -plugin.metatype: com.liferay.ant.bnd.metatype.MetatypePlugin -includeresource: \ - @com.liferay.subscription.web-4.0.16.jar!/!com/liferay/subscription/web/internal/util/UnsubscribeHooks.class + @com.liferay.subscription.web-4.0.27.jar!/!com/liferay/subscription/web/internal/util/UnsubscribeHooks.class Import-Package: \ !org.apache.jasper.runtime, \ !org.glassfish.jsp.api, \ diff --git a/gd-subscription-web-override/pom.xml b/gd-subscription-web-override/pom.xml index 5bccc6c4..6531aa3b 100644 --- a/gd-subscription-web-override/pom.xml +++ b/gd-subscription-web-override/pom.xml @@ -5,7 +5,7 @@ de.seitenbau.govdata.odp od-platform - 6.3.0 + 6.4.0 de.seitenbau.subscription.web.override gd-subscription-web-override diff --git a/gd-subscription-web-override/src/main/java/com/liferay/subscription/web/internal/util/UnsubscribeHooks.java b/gd-subscription-web-override/src/main/java/com/liferay/subscription/web/internal/util/UnsubscribeHooks.java index d93876db..e9d10e7d 100644 --- a/gd-subscription-web-override/src/main/java/com/liferay/subscription/web/internal/util/UnsubscribeHooks.java +++ b/gd-subscription-web-override/src/main/java/com/liferay/subscription/web/internal/util/UnsubscribeHooks.java @@ -1,15 +1,6 @@ /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * 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.subscription.web.internal.util; @@ -33,6 +24,7 @@ import com.liferay.petra.string.StringPool; import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.model.Ticket; +import com.liferay.portal.kernel.model.TicketConstants; import com.liferay.portal.kernel.model.User; import com.liferay.portal.kernel.service.TicketLocalService; import com.liferay.portal.kernel.service.UserLocalService; @@ -44,7 +36,6 @@ import com.liferay.portal.kernel.util.Validator; import com.liferay.subscription.model.Subscription; import com.liferay.subscription.web.internal.configuration.SubscriptionConfiguration; -import com.liferay.subscription.web.internal.constants.SubscriptionConstants; /** * @author Alejandro Tardín @@ -155,13 +146,13 @@ private Ticket _getTicket( List tickets = _ticketLocalService.getTickets( subscription.getCompanyId(), Subscription.class.getName(), subscription.getSubscriptionId(), - SubscriptionConstants.TICKET_TYPE); + TicketConstants.TYPE_SUBSCRIPTION); if (ListUtil.isEmpty(tickets)) { return _ticketLocalService.addTicket( subscription.getCompanyId(), Subscription.class.getName(), subscription.getSubscriptionId(), - SubscriptionConstants.TICKET_TYPE, StringPool.BLANK, + TicketConstants.TYPE_SUBSCRIPTION, StringPool.BLANK, calendar.getTime(), _subscriptionSender.getServiceContext()); } @@ -171,7 +162,7 @@ private Ticket _getTicket( return _ticketLocalService.updateTicket( ticket.getTicketId(), Subscription.class.getName(), subscription.getSubscriptionId(), - SubscriptionConstants.TICKET_TYPE, StringPool.BLANK, + TicketConstants.TYPE_SUBSCRIPTION, StringPool.BLANK, calendar.getTime()); } catch (PortalException portalException) { diff --git a/gd-user-menu/pom.xml b/gd-user-menu/pom.xml index 7dd79bc6..32c1aba5 100644 --- a/gd-user-menu/pom.xml +++ b/gd-user-menu/pom.xml @@ -5,7 +5,7 @@ od-platform de.seitenbau.govdata.odp - 6.3.0 + 6.4.0 gd-user-menu diff --git a/gd-usermanage-portlet/pom.xml b/gd-usermanage-portlet/pom.xml index 4c0f0c72..d2091402 100644 --- a/gd-usermanage-portlet/pom.xml +++ b/gd-usermanage-portlet/pom.xml @@ -7,7 +7,7 @@ de.seitenbau.govdata.odp od-platform - 6.3.0 + 6.4.0 diff --git a/gd-users-admin-fragment/bnd.bnd b/gd-users-admin-fragment/bnd.bnd index 7f1a7bd7..ab7e07e5 100644 --- a/gd-users-admin-fragment/bnd.bnd +++ b/gd-users-admin-fragment/bnd.bnd @@ -1,7 +1,7 @@ Bundle-Name: users-admin-fragment Bundle-SymbolicName: de.seitenbau.govdata.users.admin.fragment Bundle-Version: 1.0.0 -Fragment-Host: com.liferay.users.admin.web;bundle-version="6.0.61" +Fragment-Host: com.liferay.users.admin.web;bundle-version="6.0.108" -jsp: *.jsp,*.jspf -metatype: * -plugin.jsp: com.liferay.ant.bnd.jsp.JspAnalyzerPlugin diff --git a/gd-users-admin-fragment/pom.xml b/gd-users-admin-fragment/pom.xml index b993841e..0f0b3f62 100644 --- a/gd-users-admin-fragment/pom.xml +++ b/gd-users-admin-fragment/pom.xml @@ -4,7 +4,7 @@ od-platform de.seitenbau.govdata.odp - 6.3.0 + 6.4.0 gd-users-admin-fragment diff --git a/gd-users-admin-fragment/src/main/resources/META-INF/resources/edit_user_navigation.jsp b/gd-users-admin-fragment/src/main/resources/META-INF/resources/edit_user_navigation.jsp index 764181e3..b86a19de 100644 --- a/gd-users-admin-fragment/src/main/resources/META-INF/resources/edit_user_navigation.jsp +++ b/gd-users-admin-fragment/src/main/resources/META-INF/resources/edit_user_navigation.jsp @@ -1,16 +1,7 @@ <%-- /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * 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 */ --%> @@ -42,6 +33,7 @@ String backURL = ParamUtil.getString(request, "backURL", viewURL.toString()); if (!portletName.equals(UsersAdminPortletKeys.MY_ACCOUNT)) { portletDisplay.setShowBackIcon(true); portletDisplay.setURLBack(backURL); + portletDisplay.setURLBackTitle(LanguageUtil.get(request, "users-and-organizations")); renderResponse.setTitle((selUser == null) ? LanguageUtil.get(request, "add-user") : LanguageUtil.format(request, "edit-user-x", selUser.getFullName(), false)); } @@ -92,7 +84,8 @@ redirect = HttpComponentsUtil.addParameter(redirect, liferayPortletResponse.getN - + + diff --git a/govdatastyle-theme/pom.xml b/govdatastyle-theme/pom.xml index d29ce883..672d717e 100644 --- a/govdatastyle-theme/pom.xml +++ b/govdatastyle-theme/pom.xml @@ -5,7 +5,7 @@ od-platform de.seitenbau.govdata.odp - 6.3.0 + 6.4.0 com.seitenbau.govdata.theme govdatastyle-theme diff --git a/govdatastyle-theme/src/main/webapp/css/_portlet.scss b/govdatastyle-theme/src/main/webapp/css/_portlet.scss index ac176d47..31619699 100644 --- a/govdatastyle-theme/src/main/webapp/css/_portlet.scss +++ b/govdatastyle-theme/src/main/webapp/css/_portlet.scss @@ -302,30 +302,27 @@ body.portlet { } } -.portlet-title-default { - display: block; - - @include ellipsis; - +html:not(#__):not(#___) .cadmin .portlet-title-default { + overflow: hidden; + text-overflow: ellipsis; float: right; - font-weight: bold; - height: 0; - line-height: 19px; - max-width: 50%; padding: 0 10px; text-transform: uppercase; + color: white; } -.portlet-draggable { - .portlet-header { - cursor: move; - } +html:not(#__):not(#___) .portlet-draggable .portlet-title-default { + background: #333 url(../images/portlet/draggable_borderless.png) no-repeat 0 50%; + padding-left: 20px; +} - .portlet-title-default { - background: #333 url(../images/portlet/draggable_borderless.png) no-repeat 0 50%; - cursor: move; - padding-left: 20px; - } +.portlet-topper { + cursor: move; +} + +.aui .controls-hidden .portlet-topper .portlet-title-default { + // hide if control elements are hidden + display: none !important; } /* ---------- Panel page ---------- */ diff --git a/govdatastyle-theme/src/main/webapp/js/main.js b/govdatastyle-theme/src/main/webapp/js/main.js index ac81e7b5..a8c1569c 100644 --- a/govdatastyle-theme/src/main/webapp/js/main.js +++ b/govdatastyle-theme/src/main/webapp/js/main.js @@ -9,12 +9,38 @@ AUI.add('lang/autocomplete-list', function (e) { AUI().ready( - 'liferay-navigation-interaction', 'liferay-sign-in-modal', - function(A) { - var signIn = A.one('li.sign-in a'); + 'liferay-navigation-interaction', 'liferay-sign-in-modal', + function(A) { + var signInLink = document.querySelector('li.sign-in > a'); - if (signIn && signIn.getData('redirect') !== 'true') { - signIn.plug(Liferay.SignInModal); - } - } + if (signInLink && signInLink.dataset.redirect === 'false') { + signInLink.addEventListener('click', function(event) { + event.preventDefault(); + + var modalSignInURL = Liferay.Util.addParams( + 'windowState=exclusive', + signInLink.href + ); + + Liferay.Util.fetch(modalSignInURL) + .then(response => response.text()) + .then(response => { + if (response) { + Liferay.Util.openModal({ + bodyHTML: response, + title: Liferay.Language.get('sign-in'), + }); + } + else { + redirectPage(); + } + }) + .catch(() => redirectPage()); + }); + } + + function redirectPage() { + window.location.href = signInLink.href; + } + } ); diff --git a/govdatastyle-theme/src/main/webapp/templates/navigation.ftl b/govdatastyle-theme/src/main/webapp/templates/navigation.ftl index 9f65ab0c..3640791b 100644 --- a/govdatastyle-theme/src/main/webapp/templates/navigation.ftl +++ b/govdatastyle-theme/src/main/webapp/templates/navigation.ftl @@ -1,11 +1,11 @@ <#ftl output_format="HTML" auto_esc=false> -