-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…/MIPs#150 (#4118) This change will add a new portlet for Space Template Management with its Backend using spring Beans.
- Loading branch information
Showing
68 changed files
with
6,086 additions
and
530 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ | |
|
||
import java.time.Instant; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
/** | ||
* @author <a href="mailto:[email protected]">Alain Defrance</a> | ||
|
@@ -852,4 +853,11 @@ default int countCommonSpaces(String userId, String otherUserId){ | |
default Instant getSpaceMembershipDate(long spaceId, String username) { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
/** | ||
* @return the count of spaces by Space Template identifier | ||
*/ | ||
default Map<Long, Long> countSpacesByTemplate() { | ||
throw new UnsupportedOperationException(); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
component/core/src/main/java/io/meeds/social/space/constant/Priority.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* This file is part of the Meeds project (https://meeds.io/). | ||
* | ||
* Copyright (C) 2020 - 2024 Meeds Association [email protected] | ||
* | ||
* This program 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 3 of the License, or (at your option) any later version. | ||
* | ||
* This program 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. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
* | ||
*/ | ||
package io.meeds.social.space.constant; | ||
|
||
public enum Priority { | ||
HIGH, INTERMEDIATE, LOW | ||
} |
25 changes: 25 additions & 0 deletions
25
component/core/src/main/java/io/meeds/social/space/constant/PublicSiteVisibility.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* This file is part of the Meeds project (https://meeds.io/). | ||
* | ||
* Copyright (C) 2020 - 2024 Meeds Association [email protected] | ||
* | ||
* This program 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 3 of the License, or (at your option) any later version. | ||
* | ||
* This program 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. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
* | ||
*/ | ||
package io.meeds.social.space.constant; | ||
|
||
public enum PublicSiteVisibility { | ||
MANAGER, MEMBER, INTERNAL, AUTHENTICATED, EVERYONE; | ||
} |
25 changes: 25 additions & 0 deletions
25
component/core/src/main/java/io/meeds/social/space/constant/Registration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* This file is part of the Meeds project (https://meeds.io/). | ||
* | ||
* Copyright (C) 2020 - 2024 Meeds Association [email protected] | ||
* | ||
* This program 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 3 of the License, or (at your option) any later version. | ||
* | ||
* This program 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. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
* | ||
*/ | ||
package io.meeds.social.space.constant; | ||
|
||
public enum Registration { | ||
OPEN, VALIDATION, CLOSED | ||
} |
25 changes: 25 additions & 0 deletions
25
component/core/src/main/java/io/meeds/social/space/constant/Visibility.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* This file is part of the Meeds project (https://meeds.io/). | ||
* | ||
* Copyright (C) 2020 - 2024 Meeds Association [email protected] | ||
* | ||
* This program 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 3 of the License, or (at your option) any later version. | ||
* | ||
* This program 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. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
* | ||
*/ | ||
package io.meeds.social.space.constant; | ||
|
||
public enum Visibility { | ||
PUBLIC, PRIVATE, HIDDEN | ||
} |
36 changes: 36 additions & 0 deletions
36
component/core/src/main/java/io/meeds/social/space/template/dao/SpaceTemplateDAO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* This file is part of the Meeds project (https://meeds.io/). | ||
* | ||
* Copyright (C) 2020 - 2024 Meeds Association [email protected] | ||
* | ||
* This program 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 3 of the License, or (at your option) any later version. | ||
* This program 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. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
package io.meeds.social.space.template.dao; | ||
|
||
import java.util.List; | ||
|
||
import org.springframework.data.domain.Pageable; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import io.meeds.social.space.template.entity.SpaceTemplateEntity; | ||
|
||
@Repository | ||
public interface SpaceTemplateDAO extends JpaRepository<SpaceTemplateEntity, Long> { | ||
|
||
List<SpaceTemplateEntity> findByDeletedFalse(Pageable pageable); | ||
|
||
List<SpaceTemplateEntity> findByDeletedFalseAndEnabledTrue(Pageable pageable); | ||
|
||
} |
93 changes: 93 additions & 0 deletions
93
component/core/src/main/java/io/meeds/social/space/template/entity/SpaceTemplateEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
/** | ||
* This file is part of the Meeds project (https://meeds.io/). | ||
* | ||
* Copyright (C) 2020 - 2024 Meeds Association [email protected] | ||
* | ||
* This program 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 3 of the License, or (at your option) any later version. | ||
* This program 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. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
package io.meeds.social.space.template.entity; | ||
|
||
import java.util.List; | ||
|
||
import org.exoplatform.commons.utils.StringListConverter; | ||
|
||
import io.meeds.social.space.constant.Registration; | ||
import io.meeds.social.space.constant.Visibility; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Convert; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.SequenceGenerator; | ||
import jakarta.persistence.Table; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Entity(name = "SpaceTemplate") | ||
@Table(name = "SOC_SPACE_TEMPLATES") | ||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class SpaceTemplateEntity { | ||
|
||
@Id | ||
@SequenceGenerator(name = "SEQ_SOC_SPACE_TEMPLATE_ID", sequenceName = "SEQ_SOC_SPACE_TEMPLATE_ID", allocationSize = 1) | ||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ_SOC_SPACE_TEMPLATE_ID") | ||
@Column(name = "ID") | ||
private Long id; | ||
|
||
@Column(name = "ICON") | ||
private String icon; | ||
|
||
@Column(name = "ENABLED") | ||
private boolean enabled; | ||
|
||
@Column(name = "DELETED") | ||
private boolean deleted; | ||
|
||
@Column(name = "IS_SYSTEM") | ||
private boolean system; | ||
|
||
@Column(name = "TEMPLATE_ORDER") | ||
private long order; | ||
|
||
@Convert(converter = StringListConverter.class) | ||
@Column(name = "PERMISSIONS") | ||
private List<String> permissions; | ||
|
||
@Convert(converter = StringListConverter.class) | ||
@Column(name = "SPACE_LAYOUT_PERMISSIONS") | ||
private List<String> spaceLayoutPermissions; | ||
|
||
@Convert(converter = StringListConverter.class) | ||
@Column(name = "SPACE_DELETE_PERMISSIONS") | ||
private List<String> spaceDeletePermissions; | ||
|
||
@Convert(converter = StringListConverter.class) | ||
@Column(name = "SPACE_FIELDS") | ||
private List<String> spaceFields; | ||
|
||
@Column(name = "SPACE_DEFAULT_VISIBILITY") | ||
private Visibility spaceDefaultVisibility; | ||
|
||
@Column(name = "SPACE_DEFAULT_ACCESS") | ||
private Registration spaceDefaultRegistration; | ||
|
||
@Column(name = "SPACE_ALLOW_CONTENT_CREATION") | ||
private boolean spaceAllowContentCreation; | ||
|
||
} |
Oops, something went wrong.