diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/PageFileForm.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/PageFileForm.java index 7a9928c98..39d96464e 100644 --- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/PageFileForm.java +++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/PageFileForm.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package com.arsdigita.cms.ui.authoring; diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/PageTextForm.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/PageTextForm.java index efa1cf79d..0ffd6d471 100644 --- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/PageTextForm.java +++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/PageTextForm.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package com.arsdigita.cms.ui.authoring; diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/event/EventTextBody.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/event/EventTextBody.java index 250a9e4e4..1980fa1a0 100644 --- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/event/EventTextBody.java +++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/event/EventTextBody.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package com.arsdigita.cms.ui.authoring.event; diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/news/NewsController.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/news/NewsController.java index 1012553b2..48a52b158 100644 --- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/news/NewsController.java +++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/news/NewsController.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package com.arsdigita.cms.ui.authoring.news; diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/folder/FolderEditorFormController.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/folder/FolderEditorFormController.java index 9ad21a482..86a7040b9 100644 --- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/folder/FolderEditorFormController.java +++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/folder/FolderEditorFormController.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package com.arsdigita.cms.ui.folder; diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/pages/PageModelAdminPageController.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/pages/PageModelAdminPageController.java index 8a660ebc1..cfa46aad8 100644 --- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/pages/PageModelAdminPageController.java +++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/pages/PageModelAdminPageController.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package com.arsdigita.cms.ui.pages; diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/pages/PageModelData.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/pages/PageModelData.java index 36ad8c932..218eae658 100644 --- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/pages/PageModelData.java +++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/pages/PageModelData.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package com.arsdigita.cms.ui.pages; diff --git a/ccm-cms/src/main/java/db/migrations/org/librecms/ccm_cms/h2/V7_0_0_24__add_lifecycle_uuid.java b/ccm-cms/src/main/java/db/migrations/org/librecms/ccm_cms/h2/V7_0_0_24__add_lifecycle_uuid.java index 0a5aed475..3b355d14e 100644 --- a/ccm-cms/src/main/java/db/migrations/org/librecms/ccm_cms/h2/V7_0_0_24__add_lifecycle_uuid.java +++ b/ccm-cms/src/main/java/db/migrations/org/librecms/ccm_cms/h2/V7_0_0_24__add_lifecycle_uuid.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package db.migrations.org.librecms.ccm_cms.h2; diff --git a/ccm-cms/src/main/java/db/migrations/org/librecms/ccm_cms/pgsql/V7_0_0_24__add_lifecycle_uuid.java b/ccm-cms/src/main/java/db/migrations/org/librecms/ccm_cms/pgsql/V7_0_0_24__add_lifecycle_uuid.java index 62b12dc3e..195f73740 100644 --- a/ccm-cms/src/main/java/db/migrations/org/librecms/ccm_cms/pgsql/V7_0_0_24__add_lifecycle_uuid.java +++ b/ccm-cms/src/main/java/db/migrations/org/librecms/ccm_cms/pgsql/V7_0_0_24__add_lifecycle_uuid.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package db.migrations.org.librecms.ccm_cms.pgsql; diff --git a/ccm-cms/src/main/java/org/libreccm/ui/admin/contentsections/ContentSectionAdminMessages.java b/ccm-cms/src/main/java/org/libreccm/ui/admin/contentsections/ContentSectionAdminMessages.java index 6411f3690..09c7cc374 100644 --- a/ccm-cms/src/main/java/org/libreccm/ui/admin/contentsections/ContentSectionAdminMessages.java +++ b/ccm-cms/src/main/java/org/libreccm/ui/admin/contentsections/ContentSectionAdminMessages.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.libreccm.ui.admin.contentsections; diff --git a/ccm-cms/src/main/java/org/libreccm/ui/admin/contentsections/ContentSectionApplicationController.java b/ccm-cms/src/main/java/org/libreccm/ui/admin/contentsections/ContentSectionApplicationController.java index c2dd62829..058e53f0b 100644 --- a/ccm-cms/src/main/java/org/libreccm/ui/admin/contentsections/ContentSectionApplicationController.java +++ b/ccm-cms/src/main/java/org/libreccm/ui/admin/contentsections/ContentSectionApplicationController.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.libreccm.ui.admin.contentsections; diff --git a/ccm-cms/src/main/java/org/libreccm/ui/admin/contentsections/ContentSectionTableRow.java b/ccm-cms/src/main/java/org/libreccm/ui/admin/contentsections/ContentSectionTableRow.java index 35acea6e7..bd5cfc565 100644 --- a/ccm-cms/src/main/java/org/libreccm/ui/admin/contentsections/ContentSectionTableRow.java +++ b/ccm-cms/src/main/java/org/libreccm/ui/admin/contentsections/ContentSectionTableRow.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.libreccm.ui.admin.contentsections; diff --git a/ccm-cms/src/main/java/org/librecms/contentsection/AbstractContentItemImExporter.java b/ccm-cms/src/main/java/org/librecms/contentsection/AbstractContentItemImExporter.java index 6098f25c8..5a014d6a0 100644 --- a/ccm-cms/src/main/java/org/librecms/contentsection/AbstractContentItemImExporter.java +++ b/ccm-cms/src/main/java/org/librecms/contentsection/AbstractContentItemImExporter.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.contentsection; diff --git a/ccm-cms/src/main/java/org/librecms/contentsection/AssetFolderEntry.java b/ccm-cms/src/main/java/org/librecms/contentsection/AssetFolderEntry.java index d0342e09f..f97cd9394 100644 --- a/ccm-cms/src/main/java/org/librecms/contentsection/AssetFolderEntry.java +++ b/ccm-cms/src/main/java/org/librecms/contentsection/AssetFolderEntry.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.contentsection; diff --git a/ccm-cms/src/main/java/org/librecms/contentsection/AttachmentListRepository.java b/ccm-cms/src/main/java/org/librecms/contentsection/AttachmentListRepository.java index ea436bfc8..ade33d4bc 100644 --- a/ccm-cms/src/main/java/org/librecms/contentsection/AttachmentListRepository.java +++ b/ccm-cms/src/main/java/org/librecms/contentsection/AttachmentListRepository.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.contentsection; diff --git a/ccm-cms/src/main/java/org/librecms/contentsection/ContentSectionImExporter.java b/ccm-cms/src/main/java/org/librecms/contentsection/ContentSectionImExporter.java index d4405055c..3b9b2f8bf 100644 --- a/ccm-cms/src/main/java/org/librecms/contentsection/ContentSectionImExporter.java +++ b/ccm-cms/src/main/java/org/librecms/contentsection/ContentSectionImExporter.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.contentsection; diff --git a/ccm-cms/src/main/java/org/librecms/contentsection/DocumentFolderEntry.java b/ccm-cms/src/main/java/org/librecms/contentsection/DocumentFolderEntry.java index b70b7929c..14ac8e893 100644 --- a/ccm-cms/src/main/java/org/librecms/contentsection/DocumentFolderEntry.java +++ b/ccm-cms/src/main/java/org/librecms/contentsection/DocumentFolderEntry.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.contentsection; diff --git a/ccm-cms/src/main/java/org/librecms/contenttypes/ArticleImExporter.java b/ccm-cms/src/main/java/org/librecms/contenttypes/ArticleImExporter.java index e2bbcce54..a3721f79c 100644 --- a/ccm-cms/src/main/java/org/librecms/contenttypes/ArticleImExporter.java +++ b/ccm-cms/src/main/java/org/librecms/contenttypes/ArticleImExporter.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.contenttypes; diff --git a/ccm-cms/src/main/java/org/librecms/contenttypes/EventImExporter.java b/ccm-cms/src/main/java/org/librecms/contenttypes/EventImExporter.java index 782d2d049..cf79b0069 100644 --- a/ccm-cms/src/main/java/org/librecms/contenttypes/EventImExporter.java +++ b/ccm-cms/src/main/java/org/librecms/contenttypes/EventImExporter.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.contenttypes; diff --git a/ccm-cms/src/main/java/org/librecms/contenttypes/MultiPartArticleImExporter.java b/ccm-cms/src/main/java/org/librecms/contenttypes/MultiPartArticleImExporter.java index ca3349900..5575d19a0 100644 --- a/ccm-cms/src/main/java/org/librecms/contenttypes/MultiPartArticleImExporter.java +++ b/ccm-cms/src/main/java/org/librecms/contenttypes/MultiPartArticleImExporter.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.contenttypes; diff --git a/ccm-cms/src/main/java/org/librecms/contenttypes/NewsImExporter.java b/ccm-cms/src/main/java/org/librecms/contenttypes/NewsImExporter.java index 42ee1d1b7..6cd83da5f 100644 --- a/ccm-cms/src/main/java/org/librecms/contenttypes/NewsImExporter.java +++ b/ccm-cms/src/main/java/org/librecms/contenttypes/NewsImExporter.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.contenttypes; diff --git a/ccm-cms/src/main/java/org/librecms/ui/CmsApplication.java b/ccm-cms/src/main/java/org/librecms/ui/CmsApplication.java index fb370a372..8bc4c238b 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/CmsApplication.java +++ b/ccm-cms/src/main/java/org/librecms/ui/CmsApplication.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui; diff --git a/ccm-cms/src/main/java/org/librecms/ui/CmsController.java b/ccm-cms/src/main/java/org/librecms/ui/CmsController.java index 7601d4bac..708157619 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/CmsController.java +++ b/ccm-cms/src/main/java/org/librecms/ui/CmsController.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui; diff --git a/ccm-cms/src/main/java/org/librecms/ui/CmsMessages.java b/ccm-cms/src/main/java/org/librecms/ui/CmsMessages.java index 3b42e857b..442d8732e 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/CmsMessages.java +++ b/ccm-cms/src/main/java/org/librecms/ui/CmsMessages.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui; diff --git a/ccm-cms/src/main/java/org/librecms/ui/CmsMessagesContext.java b/ccm-cms/src/main/java/org/librecms/ui/CmsMessagesContext.java index c7e4046f9..765a7dec7 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/CmsMessagesContext.java +++ b/ccm-cms/src/main/java/org/librecms/ui/CmsMessagesContext.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui; diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/AbstractCurrentUserPermissions.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/AbstractCurrentUserPermissions.java index be5517131..8e290e496 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/AbstractCurrentUserPermissions.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/AbstractCurrentUserPermissions.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/AbstractFolderTree.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/AbstractFolderTree.java index 296c32901..422e904e9 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/AbstractFolderTree.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/AbstractFolderTree.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/AbstractGrantedPrivileges.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/AbstractGrantedPrivileges.java index 633b698c2..5c21e7935 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/AbstractGrantedPrivileges.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/AbstractGrantedPrivileges.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/AdminPermissionsChecker.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/AdminPermissionsChecker.java index a1fc3d54e..a8ccd3332 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/AdminPermissionsChecker.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/AdminPermissionsChecker.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/AssetFolderController.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/AssetFolderController.java index b1b037f7c..e80af045b 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/AssetFolderController.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/AssetFolderController.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/AssetFolderModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/AssetFolderModel.java index d2afb115a..9fdc445cb 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/AssetFolderModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/AssetFolderModel.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/AssetFolderRowModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/AssetFolderRowModel.java index 2fe5e70cd..36ab250ca 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/AssetFolderRowModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/AssetFolderRowModel.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/AssetFolderTree.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/AssetFolderTree.java index 5f2b8625b..6c461a3a8 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/AssetFolderTree.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/AssetFolderTree.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/AssetFolderTreeNode.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/AssetFolderTreeNode.java index 10dc1a06e..e0bfafb67 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/AssetFolderTreeNode.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/AssetFolderTreeNode.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/AssetPermissionsChecker.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/AssetPermissionsChecker.java index 9c02fcf95..906e7f3e9 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/AssetPermissionsChecker.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/AssetPermissionsChecker.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/AssetPermissionsModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/AssetPermissionsModel.java index da33426fe..cc937daf3 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/AssetPermissionsModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/AssetPermissionsModel.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/AssetPermissionsModelProvider.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/AssetPermissionsModelProvider.java index 263e5d2e8..f623cd212 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/AssetPermissionsModelProvider.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/AssetPermissionsModelProvider.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; @@ -62,7 +75,7 @@ public class AssetPermissionsModelProvider { * Builds an {@link AssetPermissionsModel} for the provided assets * {@link Asset} * - * @param folder The {@link Asset} for which the + * @param asset The {@link Asset} for which the * {@link AssetPermissionsModel} is build. * * @return The {@link AssetFolderModel} for the {@link Asset}. diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/CategoriesController.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/CategoriesController.java index cac5952cc..2015ffc89 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/CategoriesController.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/CategoriesController.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/CategorizedObjectModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/CategorizedObjectModel.java index 22de7d6f6..fb42f143b 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/CategorizedObjectModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/CategorizedObjectModel.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/CategoryModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/CategoryModel.java index cb46c4867..4e4f258e3 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/CategoryModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/CategoryModel.java @@ -1,10 +1,26 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; +import org.libreccm.categorization.Category; +import org.libreccm.l10n.GlobalizationHelper; + import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -12,43 +28,99 @@ import java.util.List; import java.util.Map; /** + * Model for the details view of a category. * * @author Jens Pelzetter */ public class CategoryModel { + /** + * The ID of the category. + */ private long categoryId; + /** + * The UUID of the category. + */ private String uuid; + /** + * The unique ID of the category. + */ private String uniqueId; + /** + * The name of the category. + */ private String name; + /** + * The path of the category. + */ private String path; + /** + * The title of the category to display. This value is determined from + * {@link Category#title} using {@link GlobalizationHelper#getValueFromLocalizedString(org.libreccm.l10n.LocalizedString) + * }. + */ private String title; + /** + * The localized titles of the category. + */ private Map localizedTitles; + /** + * The description of the category to display. This value is determined from + * {@link Category#description} using {@link GlobalizationHelper#getValueFromLocalizedString(org.libreccm.l10n.LocalizedString) + * }. + */ private String description; + /** + * The localized descriptions of the category. + */ private Map localizedDescriptions; + /** + * Is the category enabled? + */ private boolean enabled; + /** + * Is the category visible? + */ private boolean visible; + /** + * Is the category an abstract category? + */ private boolean abstractCategory; + /** + * The sub categories of the category. + */ private List subCategories; + /** + * The objects assigned to which the category is assigned. + */ private List objects; + /** + * The order of the category. + */ private long categoryOrder; + /** + * Locales for which no localized title has been defined yet. + */ private List unusedTitleLocales; + /** + * Locales for which no localized description has been defined yet. + */ private List unusedDescriptionLocales; public CategoryModel() { diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/CategorySystemModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/CategorySystemModel.java index 0de42cc93..a8be267c4 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/CategorySystemModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/CategorySystemModel.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; @@ -13,6 +26,8 @@ import javax.enterprise.context.RequestScoped; import javax.inject.Named; /** + * Model for showing the {@link Domain}s (category systems) and categories + * assigned to a content section. * * @author Jens Pelzetter */ @@ -20,14 +35,27 @@ import javax.inject.Named; @Named("CategorySystemModel") public class CategorySystemModel { + /** + * List of the category systems/{@link Domain} assigned to the current + * content section. + */ private List categorySystems; + /** + * The currently selected category system. + */ private DomainListEntryModel selectedCategorySystem; + /** + * The category tree of the currently selected category system. + */ private CategoryTreeNodeModel categoryTree; + /** + * The currently selected category. + */ private CategoryModel selectedCategory; - + public CategorySystemModel() { categorySystems = new ArrayList<>(); } diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/CategoryTreeNodeModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/CategoryTreeNodeModel.java index 696dc0c75..668746b0b 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/CategoryTreeNodeModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/CategoryTreeNodeModel.java @@ -1,35 +1,69 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; +import org.libreccm.categorization.Category; +import org.libreccm.l10n.GlobalizationHelper; + import java.util.ArrayList; import java.util.Collections; import java.util.List; /** + * Node of a category tree representing a category. * * @author Jens Pelzetter */ public class CategoryTreeNodeModel { + /** + * The UUID of the category. + */ private String uuid; - + + /** + * Is the category the active category. + */ private boolean active; - + + /** + * The path of the category. + */ private String path; + /** + * The title of the category. This value is determined from + * {@link Category#title} using {@link GlobalizationHelper#getValueFromLocalizedString(org.libreccm.l10n.LocalizedString) + * }. + */ private String title; + /** + * The subcategories of the category. + */ private List subCategories; public CategoryTreeNodeModel() { subCategories = new ArrayList<>(); } - + public String getPath() { return path; } @@ -71,6 +105,5 @@ public class CategoryTreeNodeModel { public void setActive(final boolean active) { this.active = active; } - } diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/ConfigurationController.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/ConfigurationController.java index 388e8b60c..93ac282c0 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/ConfigurationController.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/ConfigurationController.java @@ -1,16 +1,26 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; -import org.libreccm.api.Identifier; -import org.libreccm.api.IdentifierParser; import org.libreccm.security.AuthorizationRequired; import org.libreccm.security.PermissionChecker; import org.librecms.contentsection.ContentSection; -import org.librecms.contentsection.ContentSectionRepository; import org.librecms.contentsection.privileges.AdminPrivileges; import java.util.Optional; @@ -18,13 +28,14 @@ import java.util.Optional; import javax.enterprise.context.RequestScoped; import javax.inject.Inject; import javax.mvc.Controller; -import javax.mvc.Models; import javax.transaction.Transactional; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.PathParam; /** + * Controller for the index page of the configuration of a + * {@link ContentSection}. * * @author Jens Pelzetter */ @@ -33,24 +44,32 @@ import javax.ws.rs.PathParam; @Path("/{sectionIdentifier}/configuration") public class ConfigurationController { + /** + * Model for the current content section. + */ @Inject private ContentSectionModel sectionModel; - @Inject - private ContentSectionRepository sectionRepo; - + /** + * Common functions for controllers working with content sections. + */ @Inject private ContentSectionsUi sectionsUi; - @Inject - private IdentifierParser identifierParser; - - @Inject - private Models models; - + /** + * Checks permissions. + */ @Inject private PermissionChecker permissionChecker; + /** + * Shows the configuration index page for the current content section. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * + * @return The template for the index page. + */ @GET @Path("/") @AuthorizationRequired @@ -74,6 +93,15 @@ public class ConfigurationController { return "org/librecms/ui/contentsection/configuration/index.xhtml"; } + /** + * Checks if the current user is permitted to access the configurations page + * of the content section. + * + * @param section The content section. + * + * @return {@code true} if the current user is permitted, {@code false} + * otherwise. + */ private boolean hasRequiredPermission(final ContentSection section) { return permissionChecker.isPermitted( AdminPrivileges.ADMINISTER_CONTENT_TYPES, section diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/ConfigurationDocumentTypesController.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/ConfigurationDocumentTypesController.java index 5051cc37e..7080590ae 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/ConfigurationDocumentTypesController.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/ConfigurationDocumentTypesController.java @@ -1,13 +1,26 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; -import org.libreccm.api.Identifier; import org.libreccm.api.IdentifierParser; import org.libreccm.l10n.GlobalizationHelper; +import org.libreccm.l10n.LocalizedString; import org.libreccm.l10n.LocalizedTextsUtil; import org.libreccm.security.AuthorizationRequired; import org.libreccm.security.PermissionChecker; @@ -16,11 +29,9 @@ import org.libreccm.security.Role; import org.libreccm.workflow.Workflow; import org.librecms.contentsection.ContentSection; import org.librecms.contentsection.ContentSectionManager; -import org.librecms.contentsection.ContentSectionRepository; import org.librecms.contentsection.ContentType; import org.librecms.contentsection.ContentTypeManager; import org.librecms.contentsection.ContentTypeMode; -import org.librecms.contentsection.privileges.AdminPrivileges; import org.librecms.contentsection.privileges.TypePrivileges; import org.librecms.contenttypes.ContentTypeInfo; import org.librecms.contenttypes.ContentTypesManager; @@ -45,6 +56,8 @@ import javax.ws.rs.Path; import javax.ws.rs.PathParam; /** + * Controller for managing the document types assigned to a + * {@link ContentSection}. * * @author Jens Pelzetter */ @@ -53,48 +66,81 @@ import javax.ws.rs.PathParam; @Path("/{sectionIdentifier}/configuration/documenttypes") public class ConfigurationDocumentTypesController { + /** + * Checks admin permissions for {@link ContentSection}s. + */ @Inject private AdminPermissionsChecker adminPermissionsChecker; + /** + * Provides some localized messages. + */ @Inject private CmsAdminMessages cmsAdminMessages; + /** + * Model for the current content section. + */ @Inject private ContentSectionModel sectionModel; + /** + * Provides functions for working with content sections. + */ @Inject private ContentSectionManager sectionManager; + /** + * Common functions for controllers working with content sections. + */ @Inject private ContentSectionsUi sectionsUi; + /** + * Provides functions for working with content types. + */ @Inject private ContentTypeManager typeManager; + /** + * Provides function for managing the content types assigned to a content + * section. + */ @Inject private ContentTypesManager typesManager; - @Inject - private DocumentTypeModel documentTypeModel; - + /** + * Model for displaying a list of document types. + */ @Inject private DocumentTypesModel documentTypesModel; + /** + * Provides functions for working with {@link LocalizedString}s. + */ @Inject private GlobalizationHelper globalizationHelper; - @Inject - private IdentifierParser identifierParser; - + /** + * Used to provide data for the views without a named bean. + */ @Inject private Models models; + /** + * Checks permissions. + */ @Inject private PermissionChecker permissionChecker; - @Inject - private PermissionManager permissionManager; - + /** + * Shows a list of {@link ContentType}s assigned to a content section. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * + * @return The template of the list of document types. + */ @GET @Path("/") @AuthorizationRequired @@ -168,6 +214,19 @@ public class ConfigurationDocumentTypesController { return "org/librecms/ui/contentsection/configuration/documenttypes.xhtml"; } + /** + * Adds a document type to a {@link ContentSection}. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param contentItemClass The class of the content type to add. + * @param defaultLifecycleUuid The UUID of the default lifecycle for the + * type. + * @param defaultWorkflowUuid The UUID of the default workflow for the + * type. + * + * @return A redirect to the list of document types. + */ @POST @Path("/") @AuthorizationRequired @@ -260,6 +319,19 @@ public class ConfigurationDocumentTypesController { ); } + /** + * Updates a document type. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param documentTypeParam the identifier of the type to update. + * @param defaultLifecycleUuid The UUID of the new default lifecycle. + * @param defaultWorkflowUuid The UUID of the new default workflow. + * @param roleUuids The roles that are permitted to use the + * type. + * + * @return A redirect to the list of document types. + */ @POST @Path("/{documentType}") @AuthorizationRequired @@ -351,90 +423,15 @@ public class ConfigurationDocumentTypesController { ); } -// @POST -// @Path("/{documentType}/default-workflow") -// public String setDefaultWorkflow( -// @PathParam("sectionIdentifier") final String sectionIdentifierParam, -// @PathParam("documentType") final String documentTypeParam, -// @FormParam("defaultWorkflowUuid") final String defaultWorkflowUuid -// ) { -// final Identifier sectionIdentifier = identifierParser.parseIdentifier( -// sectionIdentifierParam -// ); -// -// final Optional sectionResult; -// switch (sectionIdentifier.getType()) { -// case ID: -// sectionResult = sectionRepo.findById( -// Long.parseLong( -// sectionIdentifier.getIdentifier() -// ) -// ); -// break; -// case UUID: -// sectionResult = sectionRepo.findByUuid( -// sectionIdentifier.getIdentifier() -// ); -// break; -// default: -// sectionResult = sectionRepo.findByLabel( -// sectionIdentifier.getIdentifier() -// ); -// break; -// } -// -// if (!sectionResult.isPresent()) { -// models.put("sectionIdentifier", sectionIdentifier); -// return "org/librecms/ui/contentsection/contentsection-not-found.xhtml"; -// } -// final ContentSection section = sectionResult.get(); -// sectionModel.setSection(section); -// -// if (!permissionChecker.isPermitted( -// AdminPrivileges.ADMINISTER_CONTENT_TYPES, section -// )) { -// models.put("sectionIdentifier", sectionIdentifier); -// return "org/librecms/ui/contentsection/access-denied.xhtml"; -// } -// -// final Optional typeResult = section -// .getContentTypes() -// .stream() -// .filter(type -> type.getContentItemClass().equals(documentTypeParam)) -// .findAny(); -// -// if (!typeResult.isPresent()) { -// return "org/librecms/ui/contentsection/configuration/documenttype-not-found.xhtml"; -// } -// -// final Optional defaultWorkflow = section -// .getWorkflowTemplates() -// .stream() -// .filter(def -> def.getUuid().equals(defaultWorkflowUuid)) -// .findAny(); -// -// if (!defaultWorkflow.isPresent()) { -// models.put( -// "errors", -// cmsAdminMessages.getMessage( -// "contentsection.configuration.documenttypes.selected_workflow_not_available", -// new String[]{defaultWorkflowUuid} -// ) -// ); -// -// return listDocumentTypes(sectionIdentifierParam); -// } -// -// typeManager.setDefaultWorkflow( -// typeResult.get(), defaultWorkflow.get() -// ); -// -// return String.format( -// "redirect:%s/configuration/documenttypes/%s", -// sectionIdentifierParam, -// documentTypeParam -// ); -// } + /** + * Removes a {@link ContentType} from a {@link ContentSection}. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param documentTypeParam The identifier of the type to remove. + * + * @return A redirect to the list of document types. + */ @POST @Path("/{documentType}/@remove") @AuthorizationRequired @@ -480,6 +477,13 @@ public class ConfigurationDocumentTypesController { ); } + /** + * Builds a {@link DocumentTypesTableRowModel} for a {@link ContentType}. + * + * @param type The content type. + * + * @return The {@link DocumentTypesTableRowModel} for the the {@code type}. + */ private DocumentTypesTableRowModel buildDocumentTypesTableRowModel( final ContentType type ) { @@ -552,6 +556,13 @@ public class ConfigurationDocumentTypesController { return model; } + /** + * Builds a {@link DocumentTypeInfoModel} from a {@link ContentTypeInfo}. + * + * @param typeInfo The type info. + * + * @return A {@link DocumentTypeInfoModel} for the {@code typeInfo}. + */ private DocumentTypeInfoModel buildDocumentTypeInfoModel( final ContentTypeInfo typeInfo ) { @@ -569,6 +580,17 @@ public class ConfigurationDocumentTypesController { return model; } + /** + * Builds a {@link DocumentTypeLifecycleModel} for a + * {@link LifecycleDefinition}. + * + * @param definition The lifecycle definition. + * @param defaultLifecycle Is the definition the default lifecycle for the + * content types. + * + * @return The {@link DocumentTypeLifecycleModel} for the + * {@code definition}. + */ private DocumentTypeLifecycleModel buildLifecycleModel( final LifecycleDefinition definition, final boolean defaultLifecycle @@ -592,6 +614,14 @@ public class ConfigurationDocumentTypesController { return model; } + /** + * Builds a {@link DocumentTypeWorkflowModel} for a {@link Workflow}. + * + * @param workflow The workflow (template). + * @param defaultWorkflow Is the workflow the default workflow for the type? + * + * @return A {@link DocumentTypeWorkflowModel} for the {@code workflow}. + */ private DocumentTypeWorkflowModel buildWorkflowModel( final Workflow workflow, final boolean defaultWorkflow ) { @@ -612,6 +642,16 @@ public class ConfigurationDocumentTypesController { return model; } + /** + * Builds a {@link DocumentTypePermissionModel} for a {@link ContentType} + * and a {@code Role}. + * + * @param type The content type. + * @param role The role. + * + * @return A {@link DocumentTypePermissionModel} for the {@link ContentType} + * and {@link Role}. + */ private DocumentTypePermissionModel buildDocumentTypePermissionModel( final ContentType type, final Role role ) { diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/ConfigurationLifecyclesController.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/ConfigurationLifecyclesController.java index b56f4bcc6..f6379e6ee 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/ConfigurationLifecyclesController.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/ConfigurationLifecyclesController.java @@ -1,13 +1,27 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; import org.libreccm.api.Identifier; import org.libreccm.api.IdentifierParser; import org.libreccm.l10n.GlobalizationHelper; +import org.libreccm.l10n.LocalizedString; import org.libreccm.security.AuthorizationRequired; import org.librecms.contentsection.ContentSection; import org.librecms.contentsection.ContentSectionManager; @@ -35,6 +49,8 @@ import javax.ws.rs.Path; import javax.ws.rs.PathParam; /** + * Controller for managing the {@link LifecycleDefinition}s of a + * {@link ContentSection}. * * @author Jens Pelzetter */ @@ -43,42 +59,86 @@ import javax.ws.rs.PathParam; @Path("/{sectionIdentifier}/configuration/lifecycles") public class ConfigurationLifecyclesController { + /** + * Checks admin permissions for the current content section. + */ @Inject private AdminPermissionsChecker adminPermissionsChecker; + /** + * Used for some operations on {@link ContentSection}s. + */ @Inject private ContentSectionManager sectionManager; - + + /** + * Model for the current content section. + */ @Inject private ContentSectionModel sectionModel; + /** + * Provides common functions for controllers working with content sections. + */ @Inject private ContentSectionsUi sectionsUi; + /** + * Provides functions for working with {@link LocalizedString}s. + */ @Inject private GlobalizationHelper globalizationHelper; + /** + * Used to parse identifiers. + */ @Inject private IdentifierParser identifierParser; + /** + * Used to manage lifecycles. + */ @Inject private LifecycleManager lifecycleManager; - + + /** + * Used to retrieve and save {@link LifecycleDefinition}s. + */ @Inject private LifecycleDefinitionRepository definitionRepo; + /** + * Used to provide data for the views without a named bean. + */ @Inject private Models models; + /** + * Used to retrive and save {@link PhaseDefinition}s. + */ @Inject private PhaseDefinititionRepository phaseDefinititionRepo; + /** + * Model for the current {@link LifecycleDefinition}. + */ @Inject private SelectedLifecycleDefinitionModel selectedLifecycleDefModel; + /** + * Model for the selected {@link PhaseDefinition}. + */ @Inject private SelectedPhaseDefinitionModel selectedPhaseDefModel; + /** + * List all {@link LifecycleDefinition}s of the current content section. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * + * @return The template for the list of {@link LifecycleDefinition}s. + */ @GET @Path("/") @AuthorizationRequired @@ -110,6 +170,17 @@ public class ConfigurationLifecyclesController { return "org/librecms/ui/contentsection/configuration/lifecycles.xhtml"; } + /** + * Show the details view for a {@link LifecycleDefinition}. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param lifecycleIdentiferParam The identifier of the lifecycle + * definition. + * + * @return The template for the details view of + * {@link LifecycleDefinition}s. + */ @GET @Path("/{lifecycleIdentifier}") @AuthorizationRequired @@ -206,6 +277,17 @@ public class ConfigurationLifecyclesController { return "org/librecms/ui/contentsection/configuration/lifecycle.xhtml"; } + /** + * Add a {@link LifecycleDefinition} to the current {@link ContentSection} + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param label The label of the new + * {@link LifecycleDefinition}. + * + * @return A redirect to the list of lifecycle definitions of the content + * section. + */ @POST @Path("/@add") @AuthorizationRequired @@ -241,6 +323,17 @@ public class ConfigurationLifecyclesController { ); } + /** + * Deletes a {@link LifecycleDefinition} of the current + * {@link ContentSection} + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param lifecycleIdentiferParam The identifier of the lifecycle to delete. + * + * @return A redirect to the list of lifecycle definitions of the content + * section. + */ @POST @Path("/{lifecycleIdentifier}/@delete") @AuthorizationRequired @@ -280,6 +373,18 @@ public class ConfigurationLifecyclesController { ); } + /** + * Adds a localized label to a {@link LifecycleDefinition}. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param lifecycleIdentiferParam The identifier of the lifecycle + * definition. + * @param localeParam The locale of the value to add. + * @param value The value to add. + * + * @return A redirect to the details view of the lifecycle. + */ @POST @Path("/{lifecycleIdentifier}/label/@add") @AuthorizationRequired @@ -321,6 +426,18 @@ public class ConfigurationLifecyclesController { ); } + /** + * Updates a localized label of a {@link LifecycleDefinition}. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param lifecycleIdentiferParam The identifier of the lifecycle + * definition. + * @param localeParam The locale of the value to update. + * @param value The updated value. + * + * @return A redirect to the details view of the lifecycle. + */ @POST @Path("/{lifecycleIdentifier}/label/@edit/{locale}") @AuthorizationRequired @@ -362,6 +479,17 @@ public class ConfigurationLifecyclesController { ); } + /** + * Removes a localized label from a {@link LifecycleDefinition}. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param lifecycleIdentiferParam The identifier of the lifecycle + * definition. + * @param localeParam The locale of the value to remove. + * + * @return A redirect to the details view of the lifecycle. + */ @POST @Path("/{lifecycleIdentifier}/label/@remove/{locale}") @AuthorizationRequired @@ -402,6 +530,18 @@ public class ConfigurationLifecyclesController { ); } + /** + * Adds a localized description to a {@link LifecycleDefinition}. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param lifecycleIdentiferParam The identifier of the lifecycle + * definition. + * @param localeParam The locale of the value to add. + * @param value The value to add. + * + * @return A redirect to the details view of the lifecycle. + */ @POST @Path("/{lifecycleIdentifier}/description/@add") @AuthorizationRequired @@ -443,6 +583,18 @@ public class ConfigurationLifecyclesController { ); } + /** + * Updates a localized description of a {@link LifecycleDefinition}. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param lifecycleIdentiferParam The identifier of the lifecycle + * definition. + * @param localeParam The locale of the value to update. + * @param value The updated value. + * + * @return A redirect to the details view of the lifecycle. + */ @POST @Path("/{lifecycleIdentifier}/description/@edit/{locale}") @AuthorizationRequired @@ -484,6 +636,17 @@ public class ConfigurationLifecyclesController { ); } + /** + * Removes a localized description from a {@link LifecycleDefinition}. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param lifecycleIdentiferParam The identifier of the lifecycle + * definition. + * @param localeParam The locale of the value to remove + * + * @return A redirect to the details view of the lifecycle. + */ @POST @Path("/{lifecycleIdentifier}/description/@remove/{locale}") @AuthorizationRequired @@ -524,6 +687,23 @@ public class ConfigurationLifecyclesController { ); } + /** + * Adds a {@link PhaseDefinition} to a {@link LifecycleDefinition}. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param lifecycleIdentiferParam The identifier of the current lifecycle. + * @param label The label of the new phase definition. + * @param defaultDelayDays The day part of the default deplay. + * @param defaultDelayHours The hours part of the default delay. + * @param defaultDelayMinutes The minutes part of the default delay. + * @param defaultDurationDays The day part of the default duration. + * @param defaultDurationHours The hours part of the default duration. + * @param defaultDurationMinutes The minutes part of the default duration. + * + * @return A redirect to the details view of the + * {@link LifecycleDefinition}. + */ @POST @Path("/{lifecycleIdentifier}/phases/@add") @AuthorizationRequired @@ -562,23 +742,23 @@ public class ConfigurationLifecyclesController { final LifecycleDefinition definition = definitionResult.get(); final PhaseDefinition phaseDefinition = new PhaseDefinition(); - + final Duration defaultDelay = new Duration(); defaultDelay.setDays(defaultDelayDays); defaultDelay.setHours(defaultDelayHours); defaultDelay.setMinutes(defaultDelayMinutes); phaseDefinition.setDefaultDelay(defaultDelay.toMinutes()); - + final Duration defaultDuration = new Duration(); defaultDuration.setDays(defaultDurationDays); defaultDuration.setHours(defaultDurationHours); defaultDuration.setMinutes(defaultDurationMinutes); phaseDefinition.setDefaultDuration(defaultDuration.toMinutes()); - + phaseDefinition .getLabel() .addValue(globalizationHelper.getNegotiatedLocale(), label); - + phaseDefinititionRepo.save(phaseDefinition); lifecycleManager.addPhaseDefinition(definition, phaseDefinition); @@ -589,6 +769,18 @@ public class ConfigurationLifecyclesController { ); } + /** + * Show the details view of a phase definition. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param lifecycleIdentiferParam The identifier of the current lifecycle + * definition. + * @param phaseIdentifierParam the identifier of the lifecycle + * definition. + * + * @return The template for the details view of the phase definition. + */ @GET @Path("/{lifecycleIdentifier}/phases/{phaseIdentifier}") @AuthorizationRequired @@ -705,6 +897,23 @@ public class ConfigurationLifecyclesController { return "org/librecms/ui/contentsection/configuration/lifecycle-phase.xhtml"; } + /** + * Updates the parameters of a phase definition. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param lifecycleIdentiferParam The identifier of the current lifecycle. + * @param phaseIdentifier The identifier of the phase to update. + * @param defaultDelayDays The day part of the default deplay. + * @param defaultDelayHours The hours part of the default delay. + * @param defaultDelayMinutes The minutes part of the default delay. + * @param defaultDurationDays The day part of the default duration. + * @param defaultDurationHours The hours part of the default duration. + * @param defaultDurationMinutes The minutes part of the default duration. + * + * @return A redirect to the details view of the + * {@link LifecycleDefinition}. + */ @POST @Path("/{lifecycleIdentifier}/phases/{phaseIdentifier}/@edit") @AuthorizationRequired @@ -751,13 +960,13 @@ public class ConfigurationLifecyclesController { ); } final PhaseDefinition phaseDefinition = phaseDefinitionResult.get(); - - final Duration defaultDelay = new Duration(); + + final Duration defaultDelay = new Duration(); defaultDelay.setDays(defaultDelayDays); defaultDelay.setHours(defaultDelayHours); defaultDelay.setMinutes(defaultDelayMinutes); phaseDefinition.setDefaultDelay(defaultDelay.toMinutes()); - + final Duration defaultDuration = new Duration(); defaultDuration.setDays(defaultDurationDays); defaultDuration.setHours(defaultDurationHours); @@ -774,6 +983,18 @@ public class ConfigurationLifecyclesController { ); } + /** + * Removes a phase definition from the a lifecycle definition. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param lifecycleIdentiferParam The identifier of the current lifecycle + * definition. + * @param phaseIdentifierParam The identifier of the phase definition to + * remove. + * + * @return A redirect to the details view of the lifecycle definition. + */ @POST @Path("/{lifecycleIdentifier}/phases/{phaseIdentifier}/@remove") @AuthorizationRequired @@ -824,6 +1045,19 @@ public class ConfigurationLifecyclesController { ); } + /** + * Adds a localized label to a {@link PhaseDefinition}. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param lifecycleIdentiferParam The identifier of the current lifecycle + * definition. + * @param phaseIdentifierParam Identifier of the {@link PhaseDefinition}. + * @param localeParam The locale of the value to add. + * @param value The value to add. + * + * @return A redirect to the details view of the {@link PhaseDefinition}. + */ @POST @Path("/{lifecycleIdentifier}/phases/{phaseIdentifier}/label/@add") @AuthorizationRequired @@ -877,6 +1111,19 @@ public class ConfigurationLifecyclesController { ); } + /** + * Updates the localized label of a {@link PhaseDefinition}. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param lifecycleIdentiferParam The identifier of the current lifecycle + * definition. + * @param phaseIdentifierParam Identifier of the {@link PhaseDefinition}. + * @param localeParam The locale of the value to update. + * @param value The updated value. + * + * @return A redirect to the details view of the {@link PhaseDefinition}. + */ @POST @Path("/{lifecycleIdentifier}/phases/{phaseIdentifier}/label/@edit/{locale}") @AuthorizationRequired @@ -930,6 +1177,18 @@ public class ConfigurationLifecyclesController { ); } + /** + * Removes a localized label of a {@link PhaseDefinition}. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param lifecycleIdentiferParam The identifier of the current lifecycle + * definition. + * @param phaseIdentifierParam Identifier of the {@link PhaseDefinition}. + * @param localeParam The locale of the value to remove. + * + * @return A redirect to the details view of the {@link PhaseDefinition}. + */ @POST @Path( "/{lifecycleIdentifier}/phases/{phaseIdentifier}/label/@remove/{locale}" @@ -984,6 +1243,19 @@ public class ConfigurationLifecyclesController { ); } + /** + * Adds a localized description to a {@link PhaseDefinition}. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param lifecycleIdentiferParam The identifier of the current lifecycle + * definition. + * @param phaseIdentifierParam Identifier of the {@link PhaseDefinition}. + * @param localeParam The locale of the value to add. + * @param value The value to add. + * + * @return A redirect to the details view of the {@link PhaseDefinition}. + */ @POST @Path("/{lifecycleIdentifier}/phases/{phaseIdentifier}/description/@add") @AuthorizationRequired @@ -1039,6 +1311,19 @@ public class ConfigurationLifecyclesController { ); } + /** + * Updates the localized description of a {@link PhaseDefinition}. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param lifecycleIdentiferParam The identifier of the current lifecycle + * definition. + * @param phaseIdentifierParam Identifier of the {@link PhaseDefinition}. + * @param localeParam The locale of the value to update. + * @param value The updated value. + * + * @return A redirect to the details view of the {@link PhaseDefinition}. + */ @POST @Path( "/{lifecycleIdentifier}/phases/{phaseIdentifier}/description/@edit/{locale}" @@ -1096,6 +1381,18 @@ public class ConfigurationLifecyclesController { ); } + /** + * Removes a localized description of a {@link PhaseDefinition}. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param lifecycleIdentiferParam The identifier of the current lifecycle + * definition. + * @param phaseIdentifierParam Identifier of the {@link PhaseDefinition}. + * @param localeParam The locale of the value to remove. + * + * @return A redirect to the details view of the {@link PhaseDefinition}. + */ @POST @Path( "/{lifecycleIdentifier}/phases/{phaseIdentifier}/description/@remove/{locale}" @@ -1150,6 +1447,15 @@ public class ConfigurationLifecyclesController { ); } + /** + * Builds a {@link LifecycleDefinitionListModel} for a + * {@link LifecycleDefinition}. + * + * @param definition The lifecycle definition. + * + * @return A {@link LifecycleDefinitionListModel} for the + * {@code definition}. + */ private LifecycleDefinitionListModel buildListModel( final LifecycleDefinition definition ) { @@ -1170,6 +1476,16 @@ public class ConfigurationLifecyclesController { return model; } + /** + * Finds a lifecycle definition. + * + * @param section The current content section. + * @param definitionIdentifierParam The identifier of the definition. + * + * @return An {@link Optional} with the {@link LifecycleDefinition} or an + * empty {@link Optional} if the current content section has no + * matching {@link LifecycleDefinition}. + */ private Optional findLifecycleDefinition( final ContentSection section, final String definitionIdentifierParam ) { @@ -1196,6 +1512,14 @@ public class ConfigurationLifecyclesController { } } + /** + * Shows the "lifecycle definition not found" error page. + * + * @param section The current content section. + * @param definitionIdentifier The identifier of the lifecycle definition. + * + * @return The template for the "lifecycle definition not found" error page. + */ private String showLifecycleDefinitionNotFound( final ContentSection section, final String definitionIdentifier @@ -1205,6 +1529,13 @@ public class ConfigurationLifecyclesController { return "org/librecms/ui/contentsection/configuration/lifecycle-not-found.xhtml"; } + /** + * Build the {@link PhaseDefinitionModel} for a {@link PhaseDefinition}. + * + * @param definition The phase definition. + * + * @return A {@link PhaseDefinitionModel} for the {@code definition}. + */ private PhaseDefinitionModel buildPhaseDefinitionModel( final PhaseDefinition definition ) { @@ -1227,6 +1558,17 @@ public class ConfigurationLifecyclesController { return model; } + /** + * Finds a {@link PhaseDefinition}. + * + * @param lifecycleDefinition The lifecycle definition. + * @param phaseDefinitionIdentifierParam The identifier of the phase + * definition. + * + * @return An {@link Optional} with the {@link PhaseDefinition} or an empty + * {@link Optional} if the {@link LifecycleDefinition} has the + * {@link PhaseDefinition} with the provided identifier. + */ private Optional findPhaseDefinition( final LifecycleDefinition lifecycleDefinition, final String phaseDefinitionIdentifierParam @@ -1240,6 +1582,16 @@ public class ConfigurationLifecyclesController { ).findAny(); } + /** + * Shows the "phase definition not found" error page. + * + * @param section The current content section. + * @param definitionIdentifier The identifier of the lifecycle + * definition. + * @param phaseDefinitionIdentifier The idenfifier of the phase definition. + * + * @return The template for the "phase definition not found" error page. + */ private String showPhaseDefinitionNotFound( final ContentSection section, final String definitionIdentifier, diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/ConfigurationRolesController.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/ConfigurationRolesController.java index 0dd0c8460..8b1d89daa 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/ConfigurationRolesController.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/ConfigurationRolesController.java @@ -1,13 +1,27 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; import org.libreccm.api.Identifier; import org.libreccm.api.IdentifierParser; import org.libreccm.l10n.GlobalizationHelper; +import org.libreccm.l10n.LocalizedString; import org.libreccm.security.AuthorizationRequired; import org.libreccm.security.Party; import org.libreccm.security.PartyRepository; @@ -47,6 +61,7 @@ import javax.ws.rs.FormParam; import javax.ws.rs.POST; /** + * Controller for managing the roles of a content section. * * @author Jens Pelzetter */ @@ -55,50 +70,98 @@ import javax.ws.rs.POST; @Path("/{sectionIdentifier}/configuration/roles") public class ConfigurationRolesController { + /** + * Used to check admin permissions for content sections. + */ @Inject private AdminPermissionsChecker adminPermissionsChecker; + /** + * Wrapper around the messages bundle for CMS admin messages. + */ @Inject private CmsAdminMessages messages; + /** + * Used to perform actions involing {@link ContentSection}s. + */ @Inject private ContentSectionManager sectionManager; + /** + * Model for the current content section. + */ @Inject private ContentSectionModel sectionModel; -// @Inject -// private ContentSectionRepository sectionRepo; + /** + * Provides common functions for all controllers working with + * {@link ContentSection}s. + */ @Inject private ContentSectionsUi sectionsUi; + /** + * Provides several functions for working with {@link LocalizedString} + */ @Inject private GlobalizationHelper globalizationHelper; + /** + * Used to parse identifiers. + */ @Inject private IdentifierParser identifierParser; + /** + * Used to provide data for views with a named bean. + */ @Inject private Models models; + /** + * Used to retrieve and save parties. + */ @Inject private PartyRepository partyRepository; + /** + * Used to check permissions. + */ @Inject private PermissionChecker permissionChecker; + /** + * Used for complex operations on permissions. + */ @Inject private PermissionManager permissionManager; + /** + * Used for operations on roles. + */ @Inject private RoleManager roleManager; + /** + * Used to retrieve and save {@link Role}s. + */ @Inject private RoleRepository roleRepo; + /** + * Model for the selected role. + */ @Inject private SelectedRoleModel selectedRoleModel; + /** + * List all roles of the current content section. + * + * @param sectionIdentifierParam Identifier of the current content section. + * + * @return The template for the roles list. + */ @GET @Path("/") @AuthorizationRequired @@ -148,6 +211,14 @@ public class ConfigurationRolesController { return "org/librecms/ui/contentsection/configuration/roles.xhtml"; } + /** + * Show the details view for a role. + * + * @param sectionIdentifierParam Identifier of the current content section. + * @param roleName The name of the role. + * + * @return The template for the details view of the role. + */ @GET @Path("/{roleName}") @AuthorizationRequired @@ -219,6 +290,15 @@ public class ConfigurationRolesController { return "org/librecms/ui/contentsection/configuration/role.xhtml"; } + /** + * Renames a role + * + * @param sectionIdentifierParam Identifier of the current content section. + * @param roleName The name of the role to rename. + * @param newRoleName The new name of the role. + * + * @return A redirect to the details view of the role. + */ @POST @Path("/{roleName}/@rename") @AuthorizationRequired @@ -263,6 +343,18 @@ public class ConfigurationRolesController { ); } + /** + * Update the permissions granted to the role for the current content + * section. + * + * @param sectionIdentifierParam Identifier of the current content section. + * @param roleName The name of the role. + * @param grantedPermissions The permissions granted to the role for the + * current content section. Permissions not + * included here, but are granted are removed. + * + * @return A redirect to the details view of the role. + */ @POST @Path("/{roleName}/@permissions") @AuthorizationRequired @@ -345,6 +437,18 @@ public class ConfigurationRolesController { ); } + /** + * Updates the members of a role. + * + * @param sectionIdentifierParam Identifier of the current content section. + * @param roleName The name of the role. + * @param roleMembersParam The members of the role. Parties that are a + * member of the role but not included this + * list are removed from the members of the + * role. + * + * @return A redirect to the details view of the role. + */ @POST @Path("/{roleName}/@members") @AuthorizationRequired @@ -409,6 +513,17 @@ public class ConfigurationRolesController { ); } + /** + * Adds a localized description to a role. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param roleName The name of the role. + * @param localeParam The locale of the value to add. + * @param value The value to add. + * + * @return A redirect to the details view of the role. + */ @POST @Path("/{roleName}/description/@add") @AuthorizationRequired @@ -455,6 +570,17 @@ public class ConfigurationRolesController { ); } + /** + * Updates a localized description of a role. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param roleName The name of the role. + * @param localeParam The locale of the value to update. + * @param value The updated value. + * + * @return A redirect to the details view of the role. + */ @POST @Path("/{roleName}/description/@edit/{locale}") @AuthorizationRequired @@ -501,6 +627,16 @@ public class ConfigurationRolesController { ); } + /** + * Removes a localized description from a role. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param roleName The name of the role. + * @param localeParam The locale of the value to remove. + * + * @return A redirect to the details view of the role. + */ @POST @Path("/{roleName}/description/@remove/{locale}") @AuthorizationRequired @@ -545,6 +681,15 @@ public class ConfigurationRolesController { ); } + /** + * Creates a new role for the current content section. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param roleName The name of the new role. + * + * @return A redirect to the list of roles. + */ @POST @Path("/@new") @AuthorizationRequired @@ -595,6 +740,16 @@ public class ConfigurationRolesController { ); } + /** + * Adds some existing roles the content section. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param rolesToAdd The existing roles to add to the current + * content section. + * + * @return A redirect to the list of roles. + */ @POST @Path("/@add") @AuthorizationRequired @@ -632,6 +787,16 @@ public class ConfigurationRolesController { ); } + /** + * Removes a role from the current content section. The role is + * not deleted. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param roleIdentifierParam The identifier of the role to remove. + * + * @return A redirect to the list of roles. + */ @POST @Path("/{roleIdentifier}/@remove") @AuthorizationRequired @@ -654,7 +819,7 @@ public class ConfigurationRolesController { "sectionIdentifier", sectionIdentifierParam ); } - + final Optional roleResult = findRole(roleIdentifierParam); if (!roleResult.isPresent()) { return showRoleNotFound(section, roleIdentifierParam); @@ -667,6 +832,15 @@ public class ConfigurationRolesController { ); } + /** + * Removes a role from the current content section and deletes the role. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param roleIdentifierParam The identifier of the role to delete. + * + * @return A redirect to the list of roles. + */ @POST @Path("/{roleIdentifier}/@delete") @AuthorizationRequired @@ -702,6 +876,14 @@ public class ConfigurationRolesController { ); } + /** + * Helper method for finding a role. + * + * @param roleIdentifierParam The identifier of the role. + * + * @return An {@link Optional} with the role, or an empty {@link Optional} + * if there is not role with the provided identifier. + */ private Optional findRole(final String roleIdentifierParam) { final Identifier roleIdentifier = identifierParser.parseIdentifier( roleIdentifierParam @@ -722,6 +904,14 @@ public class ConfigurationRolesController { } } + /** + * Shows the "role not found" error page. + * + * @param section The current content section. + * @param roleName The name of the role. + * + * @return The template of the "role not found" error page. + */ private String showRoleNotFound( final ContentSection section, final String roleName ) { @@ -730,6 +920,13 @@ public class ConfigurationRolesController { return "org/librecms/ui/contentsection/configuration/role-not-found.xhtml"; } + /** + * Helper method for building a {@link RoleListItemModel} for a role. + * + * @param role The role. + * + * @return A {@link RoleListItemModel} for the {@code role}. + */ private RoleListItemModel buildRoleListModel(final Role role) { final RoleListItemModel model = new RoleListItemModel(); model.setRoleId(role.getRoleId()); @@ -743,6 +940,13 @@ public class ConfigurationRolesController { return model; } + /** + * Build a {@link RoleMembershipModel} for showing the members of a role. + * + * @param membership The membership from which the model is build. + * + * @return {@link RoleMembershipModel} for the {@code membership}. + */ private RoleMembershipModel buildRoleMembershipModel( final RoleMembership membership ) { @@ -753,6 +957,16 @@ public class ConfigurationRolesController { return model; } + /** + * Builds the {@link RoleSectionPermissionModel}s for a role and content + * section. + * + * @param role The role. + * @param section The content section + * + * @return A list of {@link RoleSectionPermissionModel}s for the role and + * the content section. + */ private List buildRolePermissions( final Role role, final ContentSection section ) { @@ -791,6 +1005,16 @@ public class ConfigurationRolesController { return permissions; } + /** + * Builds a {@link RoleSectionPermissionModel} for a role, a privilege and a + * content section. + * + * @param role The role. + * @param privilege The privilege. + * @param section The content section. + * + * @return A {@link RoleSectionPermissionModel} for the provided parameters. + */ private RoleSectionPermissionModel buildRoleSectionPermissionModel( final Role role, final String privilege, final ContentSection section ) { @@ -803,6 +1027,16 @@ public class ConfigurationRolesController { return model; } + /** + * Builds a {@link RoleSectionPermissionModel} for a role, a privilege and a + * folder. + * + * @param role The role. + * @param privilege The privilege. + * @param folder The folder + * + * @return A {@link RoleSectionPermissionModel} for the provided parameters. + */ private RoleSectionPermissionModel buildRoleSectionPermissionModel( final Role role, final String privilege, final Folder folder ) { @@ -815,6 +1049,15 @@ public class ConfigurationRolesController { return model; } + /** + * Checks if a role has a member. + * + * @param role The role. + * @param memberName The name of the member. + * + * @return {@code true} if the role has member with the provided name, + * {@code false} otherwise. + */ private boolean hasMember(final Role role, final String memberName) { return role .getMemberships() @@ -823,6 +1066,12 @@ public class ConfigurationRolesController { .anyMatch(name -> name.equals(memberName)); } + /** + * Adds a new member to a role. + * + * @param role The role. + * @param newMemberName The name of the new member. + */ private void addNewMember(final Role role, final String newMemberName) { final Optional result = partyRepository.findByName( newMemberName @@ -833,6 +1082,12 @@ public class ConfigurationRolesController { } } + /** + * Removes a new member from a role. + * + * @param role The role. + * @param removedMemberName The name of the member to remove from the role. + */ private void removeMember(final Role role, final String removedMemberName) { final Optional result = partyRepository.findByName( removedMemberName diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/ConfigurationWorkflowController.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/ConfigurationWorkflowController.java index c9e79ef31..431526376 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/ConfigurationWorkflowController.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/ConfigurationWorkflowController.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; @@ -37,6 +50,8 @@ import javax.ws.rs.Path; import javax.ws.rs.PathParam; /** + * Controller for managing the {@link Workflow} templates of the + * {@link ContentSection} * * @author Jens Pelzetter */ @@ -45,45 +60,92 @@ import javax.ws.rs.PathParam; @Path("/{sectionIdentifier}/configuration/workflows") public class ConfigurationWorkflowController { + /** + * Used to check the admin permissions of a content section. + */ @Inject private AdminPermissionsChecker adminPermissionsChecker; + /** + * Used for actions involving content sections. + */ @Inject private ContentSectionManager sectionManager; + /** + * Model for the current content section. + */ @Inject private ContentSectionModel sectionModel; + /** + * Common functions for views working with {@link ContentSection}s. + */ @Inject private ContentSectionsUi sectionsUi; + /** + * Used for globaliazation stuff. + */ @Inject private GlobalizationHelper globalizationHelper; + /** + * Used to parse identifiers. + */ @Inject private IdentifierParser identifierParser; + /** + * Used to provide data for the views without a named bean. + */ @Inject private Models models; + /** + * Used to manage workflows and workflow templates. + */ @Inject private WorkflowManager workflowManager; + /** + * Used to retrieve and save workflows and workflow templates. + */ @Inject private WorkflowRepository workflowRepo; + /** + * Model for the selected {@link Workflow} template. + */ @Inject private SelectedWorkflowTemplateModel selectedWorkflowTemplateModel; + /** + * Model for the selected task template of a workflow template. + */ @Inject private SelectedWorkflowTaskTemplateModel selectedWorkflowTaskTemplateModel; + /** + * Used to manage the task of a workflow template. + */ @Inject private TaskManager taskManager; + /** + * Used to retrieve and save tasks. + */ @Inject private TaskRepository taskRepo; + /** + * List all {@link Workflow} templates in the current content section. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * + * @return The template for the list of workflow templates. + */ @GET @Path("/") @AuthorizationRequired @@ -115,6 +177,15 @@ public class ConfigurationWorkflowController { return "org/librecms/ui/contentsection/configuration/workflows.xhtml"; } + /** + * Show the details view for a workflow template. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param workflowIdentiferParam The identifier of the workflow to show. + * + * @return The template of the details view for workflow templates. + */ @GET @Path("/{workflowIdentifier}") @AuthorizationRequired @@ -214,6 +285,15 @@ public class ConfigurationWorkflowController { return "org/librecms/ui/contentsection/configuration/workflow.xhtml"; } + /** + * Add a new workflow template to the current content section. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param label The label of the new workflow template. + * + * @return A redirect to the list of workflow templates. + */ @POST @Path("/@add") @AuthorizationRequired @@ -248,6 +328,16 @@ public class ConfigurationWorkflowController { ); } + /** + * Deletes a workflow template. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param workflowIdentiferParam The identifier of the workflow template to + * remove. + * + * @return A redirect to the list of workflow templates. + */ @POST @Path("/{workflowIdentifier}/@delete") @AuthorizationRequired @@ -286,6 +376,17 @@ public class ConfigurationWorkflowController { ); } + /** + * Add a localized name to a workflow template. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param workflowIdentiferParam The identifier of the workflow template. + * @param localeParam The locale of the value to add. + * @param value The value to add. + * + * @return A redirect to the details view of the workflow template. + */ @POST @Path("/{workflowIdentifier}/label/@add") @AuthorizationRequired @@ -326,6 +427,17 @@ public class ConfigurationWorkflowController { ); } + /** + * Updates tzhe localized name of a workflow template. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param workflowIdentiferParam The identifier of the workflow template. + * @param localeParam The locale of the value to update. + * @param value The updated. + * + * @return A redirect to the details view of the workflow template. + */ @POST @Path("/{workflowIdentifier}/label/@edit/{locale}") @AuthorizationRequired @@ -366,6 +478,16 @@ public class ConfigurationWorkflowController { ); } + /** + * Removes a localized name from a workflow template. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param workflowIdentiferParam The identifier of the workflow template. + * @param localeParam The locale of the value to remove. + * + * @return A redirect to the details view of the workflow template. + */ @POST @Path("/{workflowIdentifier}/label/@remove/{locale}") @AuthorizationRequired @@ -373,8 +495,7 @@ public class ConfigurationWorkflowController { public String removeWorkflowTemplateName( @PathParam("sectionIdentifier") final String sectionIdentifierParam, @PathParam("workflowIdentifier") final String workflowIdentiferParam, - @PathParam("locale") final String localeParam, - @FormParam("value") final String value + @PathParam("locale") final String localeParam ) { final Optional sectionResult = sectionsUi @@ -407,6 +528,17 @@ public class ConfigurationWorkflowController { ); } + /** + * Adds a localized description to a workflow template. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param workflowIdentiferParam The identifier of the workflow template. + * @param localeParam The locale of the value to add. + * @param value The value to add. + * + * @return A redirect to the details view of the workflow template. + */ @POST @Path("/{workflowIdentifier}/description/@add") @AuthorizationRequired @@ -447,6 +579,17 @@ public class ConfigurationWorkflowController { ); } + /** + * Updates a localized description of a workflow template. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param workflowIdentiferParam The identifier of the workflow template. + * @param localeParam The locale of the value to update. + * @param value The updated value. + * + * @return A redirect to the details view of the workflow template. + */ @POST @Path("/{workflowIdentifier}/description/@edit/{locale}") @AuthorizationRequired @@ -487,6 +630,16 @@ public class ConfigurationWorkflowController { ); } + /** + * Removes a localized description from a workflow template. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param workflowIdentiferParam The identifier of the workflow template. + * @param localeParam The locale of the value to remove. + * + * @return A redirect to the details view of the workflow template. + */ @POST @Path("/{workflowIdentifier}/description/@remove/{locale}") @AuthorizationRequired @@ -494,8 +647,7 @@ public class ConfigurationWorkflowController { public String removeWorkflowTemplateDescription( @PathParam("sectionIdentifier") final String sectionIdentifierParam, @PathParam("workflowIdentifier") final String workflowIdentiferParam, - @PathParam("locale") final String localeParam, - @FormParam("value") final String value + @PathParam("locale") final String localeParam ) { final Optional sectionResult = sectionsUi .findContentSection(sectionIdentifierParam); @@ -527,6 +679,17 @@ public class ConfigurationWorkflowController { ); } + /** + * Shows the details view for a task of a workflow template. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param workflowIdentiferParam The identifier of the current workflow + * template. + * @param taskIdentifierParam The identifier of the task to show. + * + * @return The template for the details view of the task. + */ @GET @Path("/{workflowIdentifier}/tasks/{taskIdentifier}") @AuthorizationRequired @@ -674,6 +837,17 @@ public class ConfigurationWorkflowController { return "org/librecms/ui/contentsection/configuration/workflow-task.xhtml"; } + /** + * Adds a task to a workflow template. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param workflowIdentiferParam The identifier of the current workflow + * template. + * @param label The label of the new task. + * + * @return A redirect to the details view of the workflow. + */ @POST @Path("/{workflowIdentifier}/tasks/@add") @AuthorizationRequired @@ -718,6 +892,16 @@ public class ConfigurationWorkflowController { ); } + /** + * Removes a task from a workflow template. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param workflowIdentiferParam The identifier of the current workflow + * @param taskIdentifierParam The identifier of the task to remove. + * + * @return A redirect to the details view of the workflow template. + */ @POST @Path("/{workflowIdentifier}/tasks/{taskIdentifier}/@remove") @AuthorizationRequired @@ -765,6 +949,18 @@ public class ConfigurationWorkflowController { ); } + /** + * Adds a localized label the a task. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param workflowIdentiferParam The identifer of the current workflow. + * @param taskIdentifierParam The identifier of the current task. + * @param localeParam The locale of the value to add. + * @param value The value to add. + * + * @return A redirect to the details view of the task. + */ @POST @Path("/{workflowIdentifier}/tasks/{taskIdentifier}/label/@add") @AuthorizationRequired @@ -816,6 +1012,18 @@ public class ConfigurationWorkflowController { ); } + /** + * Updates a localized label of a task. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param workflowIdentiferParam The identifer of the current workflow. + * @param taskIdentifierParam The identifier of the current task. + * @param localeParam The locale of the value to update. + * @param value The updated value. + * + * @return A redirect to the details view of the task. + */ @POST @Path("/{workflowIdentifier}/tasks/{taskIdentifier}/label/@edit/{locale}") @AuthorizationRequired @@ -867,6 +1075,17 @@ public class ConfigurationWorkflowController { ); } + /** + * Removes a localized label from a task. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param workflowIdentiferParam The identifer of the current workflow. + * @param taskIdentifierParam The identifier of the current task. + * @param localeParam The locale of the value to remove. + * + * @return A redirect to the details view of the task. + */ @POST @Path( "/{workflowIdentifier}/tasks/{taskIdentifier}/label/@remove/{locale}") @@ -918,6 +1137,18 @@ public class ConfigurationWorkflowController { ); } + /** + * Adds a localized description to a task. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param workflowIdentiferParam The identifer of the current workflow. + * @param taskIdentifierParam The identifier of the current task. + * @param localeParam The locale of the value to add. + * @param value The value to add. + * + * @return A redirect to the details view of the task. + */ @POST @Path("/{workflowIdentifier}/tasks/{taskIdentifier}/description/@add") @AuthorizationRequired @@ -969,6 +1200,18 @@ public class ConfigurationWorkflowController { ); } + /** + * Updates a localized description of a task. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param workflowIdentiferParam The identifer of the current workflow. + * @param taskIdentifierParam The identifier of the current task. + * @param localeParam The locale of the value to update. + * @param value The updated value. + * + * @return A redirect to the details view of the task. + */ @POST @Path( "/{workflowIdentifier}/tasks/{taskIdentifier}/description/@edit/{locale}") @@ -1021,6 +1264,17 @@ public class ConfigurationWorkflowController { ); } + /** + * Removes a localized description from a task. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param workflowIdentiferParam The identifer of the current workflow. + * @param taskIdentifierParam The identifier of the current task. + * @param localeParam The locale of the value to remove. + * + * @return A redirect to the details view of the task. + */ @POST @Path( "/{workflowIdentifier}/tasks/{taskIdentifier}/description/@remove/{locale}") @@ -1072,6 +1326,18 @@ public class ConfigurationWorkflowController { ); } + /** + * Adds a blocking task to a task. Both task must exist and be part of the + * the current workflow. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param workflowIdentiferParam The identifer of the current workflow. + * @param taskIdentifierParam The identifier of the current task. + * @param blockingTaskParam The identifier of the blocking task. + * + * @return A redirect to the details view of the task. + */ @POST @Path( "/{workflowIdentifier}/tasks/{taskIdentifier}/blocking-tasks/@add") @@ -1141,6 +1407,18 @@ public class ConfigurationWorkflowController { ); } + /** + * Removes a blocking task from a task. Both task must exist and be part of + * the the current workflow. + * + * @param sectionIdentifierParam The identifier of the current content + * section. + * @param workflowIdentiferParam The identifer of the current workflow. + * @param taskIdentifierParam The identifier of the current task. + * @param blockingTaskParam The identifier of the blocking task. + * + * @return A redirect to the details view of the task. + */ @POST @Path( "/{workflowIdentifier}/tasks/{taskIdentifier}/blockingTasks/{blockingTaskIdentifier}/@remove") @@ -1201,6 +1479,16 @@ public class ConfigurationWorkflowController { ); } + /** + * Helper method for retrieving a workflow template. + * + * @param section The current content section. + * @param templateIdentifierParam The identifier of the workflow template. + * + * @return An {@link Optional} with the workflow template or an empty + * {@link Optional} if the content section has not matching workflow + * template. + */ private Optional findWorkflowTemplate( final ContentSection section, final String templateIdentifierParam ) { @@ -1233,6 +1521,14 @@ public class ConfigurationWorkflowController { } } + /** + * Shows the "workflow template not found" error page. + * + * @param section The current content section. + * @param templateIdentifier The identifier of the workflow template. + * + * @return The template for the "workflow template not found" error page. + */ private String showWorkflowTemplateNotFound( final ContentSection section, final String templateIdentifier @@ -1270,6 +1566,17 @@ public class ConfigurationWorkflowController { } } + /** + * Shows the "workflow task template not found" error page. + * + * @param section The current content section. + * @param workflowTemplateIdentifier The identifier of the workflow + * template. + * @param taskTemplateIdentifier The idenfifier of the task template. + * + * @return The template for the "workflow task template not found" error + * page. + */ private String showWorkflowTaskTemplateNotFound( final ContentSection section, final String workflowTemplateIdentifier, @@ -1281,6 +1588,14 @@ public class ConfigurationWorkflowController { return "org/librecms/ui/contentsection/configuration/workflow-task-not-found.xhtml"; } + /** + * Helper method for building a {@link WorkflowTemplateListModel} for a + * {@link Workflow}. + * + * @param workflow The workflow. + * + * @return A {@link WorkflowTemplateListModel} for the {@code workflow}. + */ private WorkflowTemplateListModel buildWorkflowTemplateListModel( final Workflow workflow ) { @@ -1299,6 +1614,14 @@ public class ConfigurationWorkflowController { return model; } + /** + * Helper method for building a {@link WorkflowTaskTemplateListModel} for a + * {@link Task}. + * + * @param task The task. + * + * @return A {@link WorkflowTaskTemplateListModel} for the {@code task}. + */ private WorkflowTaskTemplateListModel buildWorkflowTaskTemplateListModel( final Task task ) { diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/ContentSectionApplication.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/ContentSectionApplication.java index 632fc10b4..0830628ad 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/ContentSectionApplication.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/ContentSectionApplication.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; @@ -17,7 +30,8 @@ import javax.ws.rs.ApplicationPath; import javax.ws.rs.core.Application; /** - * + * JAX-RS application for managing a content section. + * * @author Jens Pelzetter */ @ApplicationPath("/@contentsections") diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/ContentSectionController.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/ContentSectionController.java index 8c5c4d766..d0dc19ff7 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/ContentSectionController.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/ContentSectionController.java @@ -16,6 +16,7 @@ import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.Response; /** + * Controller for managing content sections. * * @author Jens Pelzetter */ @@ -23,9 +24,17 @@ import javax.ws.rs.core.Response; @Path("/") public class ContentSectionController { + /** + * The current HTTP Servlet request. + */ @Inject private HttpServletRequest request; + /** + * Redirect to the list of content sections. + * + * @return A redirect. + */ @GET @Path("/") @AuthorizationRequired @@ -51,7 +60,14 @@ public class ContentSectionController { throw new WebApplicationException(ex); } } - + + /** + * Redirect to the document folder page of the content section. + * + * @param sectionIdentifier The identifier of the content section. + * + * @return A redirect to the document folders page. + */ @GET @Path("/{sectionIdentifier}") @AuthorizationRequired diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/ContentSectionModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/ContentSectionModel.java index 88f4dc7d1..b84be5a18 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/ContentSectionModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/ContentSectionModel.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; @@ -20,6 +33,7 @@ import javax.inject.Inject; import javax.inject.Named; /** + * Model for providing data about a {@link ContentSection}. * * @author Jens Pelzetter */ @@ -27,21 +41,43 @@ import javax.inject.Named; @Named("ContentSectionModel") public class ContentSectionModel { + /** + * Used to check permissions on the {@link ContentSection}. + */ @Inject private PermissionChecker permissionChecker; + /** + * The content section. + */ private ContentSection section; + /** + * The asset folder tree of the section. + */ private List assetFolders; + /** + * The document folder tree of the section. + */ private List documentFolders; + /** + * Sets the section for the model + * + * @param section The content section. + */ protected void setSection(final ContentSection section) { this.section = Objects.requireNonNull( section, "Parameter section can't be null" ); } + /** + * Get the label of the content section. + * + * @return The label of the content section. + */ public String getSectionName() { return Optional .ofNullable(section) @@ -69,32 +105,60 @@ public class ContentSectionModel { this.documentFolders = new ArrayList<>(documentFolders); } + /** + * Can the current user administer the categories of the domains/category + * sytems assigned to the section? + * + * @return + */ public boolean getCanAdministerCategories() { return permissionChecker.isPermitted( AdminPrivileges.ADMINISTER_CATEGORIES, section ); } + /** + * Can the current user administer the content types assigned to the + * section? + * + * @return + */ public boolean getCanAdministerContentTypes() { return permissionChecker.isPermitted( AdminPrivileges.ADMINISTER_CATEGORIES, section ); } + /** + * Can the current user administer the lifecycle definitions of the section? + * + * @return + */ public boolean getCanAdministerLifecycles() { return permissionChecker.isPermitted( AdminPrivileges.ADMINISTER_LIFECYLES, section ); } + /** + * Can the current user administer the roles of the section? + * + * @return + */ public boolean getCanAdministerRoles() { return permissionChecker.isPermitted( AdminPrivileges.ADMINISTER_ROLES, section ); } + /** + * Can the current user administer the workflows templates of the section? + * + * @return + */ public boolean getCanAdministerWorkflows() { - return permissionChecker.isPermitted(AdminPrivileges.ADMINISTER_WORKFLOWS, section + return permissionChecker.isPermitted( + AdminPrivileges.ADMINISTER_WORKFLOWS, section ); } diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/ContentSectionsUi.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/ContentSectionsUi.java index 70ee657f0..7b0efcf37 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/ContentSectionsUi.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/ContentSectionsUi.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; @@ -20,22 +33,40 @@ import javax.inject.Inject; import javax.mvc.Models; /** + * Provides common functions for controllers working with + * {@link ContentSection}s. * * @author Jens Pelzetter */ @RequestScoped public class ContentSectionsUi { + /** + * Used to retrieve {@link ContentSection}s. + */ @Inject private ContentSectionRepository sectionRepo; + /** + * Used to parse the identifier of {@link ContentSection}s. + */ @Inject private IdentifierParser identifierParser; + /** + * Used to provided data for views (here: error pages) without a named bean. + */ private Models models; - private PermissionChecker permissionChecker; - + /** + * Retrieve a content section. + * + * @param identifierParam The identifier of the content section. + * + * @return An {@link Optional} with the content section, or an empty + * {@link Optional} if there is not {@link ContentSection} with the + * provided identifier. + */ public Optional findContentSection( final String identifierParam ) { @@ -64,6 +95,13 @@ public class ContentSectionsUi { } } + /** + * Show the access denied error page. + * + * @param identifiers The identifiers of the resource. + * + * @return The template of the access denied error page. + */ public String showAccessDenied(final String... identifiers) { if (identifiers.length % 2 != 0) { throw new IllegalArgumentException( @@ -76,6 +114,13 @@ public class ContentSectionsUi { return "org/librecms/ui/contentsection/contentsection-not-found.xhtml"; } + /** + * Show the access denied error page. + * + * @param identifiers The identifiers of the resource. + * + * @return The template of the access denied error page. + */ public String showAccessDenied(final Map identifiers) { for (final Map.Entry entry : identifiers.entrySet()) { models.put(entry.getKey(), entry.getValue()); @@ -83,46 +128,16 @@ public class ContentSectionsUi { return "org/librecms/ui/contentsection/access-denied.xhtml"; } + /** + * Show the "content section not found" error page. + * + * @param sectionIdentifier The identifier of the content section. + * + * @return The template of the "content section not found" error page. + */ public String showContentSectionNotFound(final String sectionIdentifier) { models.put("sectionIdentifier", sectionIdentifier); return "org/librecms/ui/contentsection/contentsection-not-found.xhtml"; } -// public RetrieveResult retrieveContentSection( -// final String identifierParam -// ) { -// final Identifier sectionIdentifier = identifierParser.parseIdentifier( -// identifierParam -// ); -// -// final Optional sectionResult; -// switch (sectionIdentifier.getType()) { -// case ID: -// sectionResult = sectionRepo.findById( -// Long.parseLong( -// sectionIdentifier.getIdentifier() -// ) -// ); -// break; -// case UUID: -// sectionResult = sectionRepo.findByUuid( -// sectionIdentifier.getIdentifier() -// ); -// break; -// default: -// sectionResult = sectionRepo.findByLabel( -// sectionIdentifier.getIdentifier() -// ); -// break; -// } -// -// if (sectionResult.isPresent()) { -// return RetrieveResult.successful(sectionResult.get()); -// } else { -// models.put("sectionIdentifier", sectionIdentifier); -// return RetrieveResult.failed( -// "org/librecms/ui/contentsection/contentsection-not-found.xhtml" -// ); -// } -// } } diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/CurrentUserAssetPermissions.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/CurrentUserAssetPermissions.java index 336dcc8ef..cfb313a1e 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/CurrentUserAssetPermissions.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/CurrentUserAssetPermissions.java @@ -1,15 +1,31 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; +import org.librecms.contentsection.Asset; import org.librecms.contentsection.privileges.AssetPrivileges; import javax.enterprise.context.Dependent; /** + * Implementation of {@link AbstractCurrentUserPermissions} for the permissions + * of {@link Asset}. * * @author Jens Pelzetter */ diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/CurrentUserDocumentPermissions.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/CurrentUserDocumentPermissions.java index 6e544bc85..e53eb7403 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/CurrentUserDocumentPermissions.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/CurrentUserDocumentPermissions.java @@ -1,16 +1,31 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; +import org.librecms.contentsection.ContentItem; import org.librecms.contentsection.privileges.ItemPrivileges; import javax.enterprise.context.Dependent; /** - * + * Implementation of {@link AbstractCurrentUserPermissions} for the permissions of {@link ContentItem}. + * * @author Jens Pelzetter */ @Dependent diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentFolderController.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentFolderController.java index d75f4a646..c917758cd 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentFolderController.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentFolderController.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; @@ -56,6 +69,7 @@ import javax.ws.rs.FormParam; import javax.ws.rs.POST; /** + * Controller for managing doucment folders. * * @author Jens Pelzetter */ @@ -68,60 +82,127 @@ public class DocumentFolderController { DocumentFolderController.class ); + /** + * Used for actions on {@link ContentItem}s in the folder. + */ @Inject private ContentItemManager itemManager; + /** + * Used to retrieve {@link ContentItem}s in the folder. + */ @Inject private ContentItemRepository itemRepo; + /** + * Used for localization actions for the items in the folder. + */ @Inject private ContentItemL10NManager itemL10NManager; + /** + * Model for the current {@link ContentSection}. + */ @Inject private ContentSectionModel contentSectionModel; + /** + * Provides common functions for all controllers working with + * {@link ContentSection}s. + */ @Inject private ContentSectionsUi sectionsUi; + /** + * Used to retrieve {@link ContentType}s. + */ @Inject private ContentTypeRepository contentTypeRepo; + /** + * Model for the current document folder. + */ @Inject private DocumentFolderModel documentFolderModel; + /** + * Used for actions on folders. + */ @Inject private FolderManager folderManager; + /** + * Used to retrieve and save folders. + */ @Inject private FolderRepository folderRepo; + /** + * Used for globalization actions. + */ @Inject private GlobalizationHelper globalizationHelper; + /** + * Used to provide data for the views without a named bean. + */ @Inject private Models models; + /** + * Used to update the permissions of the folder. + */ @Inject private PermissionManager permissionManager; + /** + * Used to retrieve roles. + */ @Inject private RoleRepository roleRepo; + /** + * Used to check permissions on {@link ContentItem}s. + */ @Inject private DocumentPermissions documentPermissions; + /** + * Model for the document folder tree. + */ @Inject private DocumentFolderTree documentFolderTree; + /** + * Privileges granted to the current for the items in the folder. + */ @Inject private GrantedItemPrivileges grantedPrivileges; + /** + * Privileges granted to the current for the items in the folder. + */ @Inject private CurrentUserDocumentPermissions currentUserPermissions; + /** + * Permission checker for {@link ContentItem}s. + */ @Inject private ItemPermissionChecker itemPermissionChecker; + /** + * List the content items and subfolders of the root folder of a content + * section. + * + * @param sectionIdentifier The identifier of the content section. + * @param filterTerm An optional filter term for filtering the items + * and subfolders. + * @param firstResult The index of the first result to show. + * @param maxResults The maximum number of results to show. + * + * @return The template for showing the content of a document folder. + */ @GET @Path("/") @AuthorizationRequired @@ -137,6 +218,18 @@ public class DocumentFolderController { ); } + /** + * List the content items and subfolders of a folder of a content section. + * + * @param sectionIdentifier The identifier of the content section. + * @param folderPath Path of the folder. + * @param filterTerm An optional filter term for filtering the items + * and subfolders. + * @param firstResult The index of the first result to show. + * @param maxResults The maximum number of results to show. + * + * @return The template for showing the content of a document folder. + */ @GET @Path("/{folderPath:(.+)?}") @AuthorizationRequired @@ -242,10 +335,20 @@ public class DocumentFolderController { return "org/librecms/ui/contentsection/documentfolder/documentfolder.xhtml"; } + /** + * Only for testing, will be removed. + * + * @param sectionIdentifier + * + * @return + * + * @deprecated + */ @GET @Path("/create-testdata") @AuthorizationRequired @Transactional(Transactional.TxType.REQUIRED) + @Deprecated public String createTestData( @PathParam("sectionIdentifier") final String sectionIdentifier ) { @@ -315,6 +418,14 @@ public class DocumentFolderController { } } + /** + * Creates a new subfolder in the root folder of a content section. + * + * @param sectionIdentifier The identifier of the content section. + * @param folderName The name of the new folder. + * + * @return A redirect to the listing of the root folder. + */ @POST @Path("/") @AuthorizationRequired @@ -328,6 +439,15 @@ public class DocumentFolderController { ); } + /** + * Create a new subfolder in a folder. + * + * @param sectionIdentifier The identifier of the content section. + * @param parentFolderPath The path of the parent folder. + * @param folderName The name of the new folder. + * + * @return A redirect to the listing of the parent folder. + */ @POST @Path("/{parentFolderPath:(.+)?}") @AuthorizationRequired @@ -383,6 +503,16 @@ public class DocumentFolderController { ); } + /** + * Updates the permissions of the root folder of a content section. + * + * @param sectionIdentifier The identifier of the content section. + * @param roleParam The identifier of the role for which the + * permissions are updated. + * @param permissions The updated permissions. + * + * @return A redirect to the listing of the folder. + */ @POST @Path("/@permissions/{role}/") @AuthorizationRequired @@ -397,6 +527,17 @@ public class DocumentFolderController { ); } + /** + * Updates the permissions of afolder of a content section. + * + * @param sectionIdentifier The identifier of the content section. + * @param folderPath The path of the folder. + * @param roleParam The identifier of the role for which the + * permissions are updated. + * @param permissions The updated permissions. + * + * @return A redirect to the listing of the folder. + */ @POST @Path("/@permissions/{role}/{folderPath:(.+)?}") @AuthorizationRequired @@ -478,6 +619,15 @@ public class DocumentFolderController { ); } + /** + * Renames a folder. + * + * @param sectionIdentifier The identifier of the content section + * @param folderPath The path of the folder. + * @param folderName The new name of the folder. + * + * @return A redirect to the folder. + */ @POST @Path("/@rename/{folderPath:(.+)?}") @AuthorizationRequired @@ -538,6 +688,13 @@ public class DocumentFolderController { ); } + /** + * A helper method for building the breadcrumb trail of a folder. + * + * @param folderPath The path of the folder. + * + * @return The breadcrumb trail for the folder. + */ private List buildBreadcrumbs( final String folderPath ) { @@ -564,6 +721,15 @@ public class DocumentFolderController { return breadcrumbs; } + /** + * Helper method for building a {@link DocumentFolderRowModel} for an entry + * in the document folder. + * + * @param section The content section of the folder. + * @param entry The entry from which the row is created. + * + * @return A {@link DocumentFolderRowModel} for the provided {@code entry}. + */ private DocumentFolderRowModel buildRowModel( final ContentSection section, final DocumentFolderEntry entry ) { @@ -688,6 +854,15 @@ public class DocumentFolderController { return row; } + /** + * Helper method for showing the "document folder not found" page if there + * is not folder for the provided path. + * + * @param section The content section. + * @param folderPath The folder path. + * + * @return The template of the "document folder not found" page. + */ private String showDocumentFolderNotFound( final ContentSection section, final String folderPath ) { diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentFolderModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentFolderModel.java index a27a366d5..26c209917 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentFolderModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentFolderModel.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; @@ -14,6 +27,7 @@ import javax.enterprise.context.RequestScoped; import javax.inject.Named; /** + * Model for displaying a document folder. * * @author Jens Pelzetter */ @@ -21,28 +35,64 @@ import javax.inject.Named; @Named("DocumentFolderModel") public class DocumentFolderModel { + /** + * Count of items (content items and subfolders) in the folder. + */ private long count; + /** + * The index of the first item in the folder shown. + */ private int firstResult; + /** + * The maximum number of items shown. + */ private int maxResults; + /** + * The rows for the table showing the contents of the folder. + */ private List rows; + /** + * The breadcrumb trail of the folder. + */ private List breadcrumbs; + /** + * The path of the folder. + */ private String path; + /** + * Can the current user create subfolders in the folder. + */ private boolean canCreateSubFolders; + /** + * Can the current user create items in the folder. + */ private boolean canCreateItems; + /** + * Can the current user administer items in the folder. + */ private boolean canAdminister; + /** + * Permissions of the current user for the folder. + */ private List currentUserPermissions; + /** + * Privileges granted to the roles of the content section for the folder. + */ private List grantedPermissions; + /** + * A list of the privileges that can be granted for a document folder. + */ private List privileges; public long getCount() { diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentFolderRowModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentFolderRowModel.java index 0de442599..e38d3eda6 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentFolderRowModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentFolderRowModel.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; @@ -9,33 +22,75 @@ import java.util.Collections; import java.util.SortedSet; /** + * Model for a row in the document folder browser. * * @author Jens Pelzetter */ public class DocumentFolderRowModel { + /** + * ISO formatted creation date of the item represented by the row. May be + * {@code null}. + */ private String created; + /** + * Can the object represented by the row by deleted? + */ private boolean deletable; + /** + * Does the row represent a folder? + */ private boolean folder; + /** + * The the row represents a folder: The path of the folder. + */ private String folderPath; + /** + * If the row representents a {@link ContentItem}: The languages in which + * the item is available. + */ private SortedSet languages; + /** + * ISO formatted date of the last edit of the item represented by the row. + * May be {@code null}. + */ private String lastEdited; + /** + * ISO formatted date of the last publication of the item represented by the + * row. May be {@code null}. + */ private boolean lastEditPublished; + /** + * The name of the entry. + */ private String name; + /** + * The row represents a none CMS object does has been assigned to the + * category backing the folder. + */ private boolean noneCmsObject; + /** + * The title of the item represented by the row. + */ private String title; + /** + * The type of the item represented by the row. + */ private String type; + /** + * The {@link DocumentPermissionsModel} for the entry. + */ private DocumentPermissionsModel permissions; public String getCreated() { diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentFolderTree.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentFolderTree.java index 23bb6b3fc..494d10fc3 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentFolderTree.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentFolderTree.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; @@ -13,16 +26,21 @@ import javax.inject.Inject; import javax.transaction.Transactional; /** + * The document folder tree of a {@link ContentSection}. * * @author Jens Pelzetter */ @Dependent -public class DocumentFolderTree - extends AbstractFolderTree{ +public class DocumentFolderTree + extends AbstractFolderTree { + /** + * {@link DocumentPermissions} instance used to check permissions on the + * documents. + */ @Inject private DocumentPermissions documentPermissions; - + @Override public DocumentFolderTreeNode newFolderTreeNode() { return new DocumentFolderTreeNode(); @@ -39,6 +57,4 @@ public class DocumentFolderTree return documentPermissions.buildDocumentPermissionsModel(folder); } - - } diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentFolderTreeNode.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentFolderTreeNode.java index 09d6e6686..b76b8490e 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentFolderTreeNode.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentFolderTreeNode.java @@ -1,15 +1,31 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; +import org.librecms.contentsection.ContentSection; + /** + * A node in the document folder tree of {@link ContentSection}. * * @author Jens Pelzetter */ -public class DocumentFolderTreeNode +public class DocumentFolderTreeNode extends FolderTreeNode { } diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentPermissions.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentPermissions.java index 97c4ca3e0..76c8b6966 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentPermissions.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentPermissions.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; @@ -14,15 +27,28 @@ import javax.enterprise.context.Dependent; import javax.inject.Inject; /** + * Used to determine the priviliges granted on a document/{@link ContentItem}. * * @author Jens Pelzetter */ @Dependent public class DocumentPermissions { + /** + * The {@link PermissionChecker} instance used for checking permissions. + */ @Inject private PermissionChecker permissionChecker; + /** + * Builds a {@link DocumentPermissionsModel} for the current user and the + * provided {@code folder}. + * + * @param folder The folder. + * + * @return A {@link DocumentPermissionsModel} for the folder and items in + * the folder. + */ public DocumentPermissionsModel buildDocumentPermissionsModel( final Folder folder ) { @@ -80,6 +106,15 @@ public class DocumentPermissions { return model; } + /** + * Builds a {@link DocumentPermissionsModel} for the current user and + * specific content item. + * + * + * @param item The {@link ContentItem}. + * + * @return A {@link DocumentPermissionsModel} for the item. + */ public DocumentPermissionsModel buildDocumentPermissionsModel( final ContentItem item ) { diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentPermissionsModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentPermissionsModel.java index ac5b67cbb..29ee21691 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentPermissionsModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentPermissionsModel.java @@ -1,34 +1,90 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; +import org.librecms.contentsection.privileges.ItemPrivileges; + /** + * Model for the permissions of a document/{@link ContentItem}. * * @author Jens Pelzetter */ public class DocumentPermissionsModel implements PermissionsModel { + /** + * Has the {@link ItemPrivileges#ADMINISTER} privilege been granted for the + * content item? + */ private boolean grantedAdminister; + /** + * Has the {@link ItemPrivileges#APPLY_ALTERNATE_WORKFLOW} privilege been + * granted for the content item? + */ private boolean grantedApplyAlternateWorkflow; + /** + * Has the {@link ItemPrivileges#APPROVE} privilege been granted for the + * content item? + */ private boolean grantedApprove; + /** + * Has the {@link ItemPrivileges#CATEGORIZE} privilege been granted for the + * content item? + */ private boolean grantedCategorize; + /** + * Has the {@link ItemPrivileges#CREATE_NEW} privilege been granted for the + * content item? + */ private boolean grantedCreateNew; + /** + * Has the {@link ItemPrivileges#DELETE} privilege been granted for the + * content item? + */ private boolean grantedDelete; + /** + * Has the {@link ItemPrivileges#EDIT} privilege been granted for the + * content item? + */ private boolean grantedEdit; + /** + * Has the {@link ItemPrivileges#PREVIEW} privilege been granted for the + * content item? + */ private boolean grantedPreview; + /** + * Has the {@link ItemPrivileges#PUBLISH} privilege been granted for the + * content item? + */ private boolean grantedPublish; + /** + * Has the {@link ItemPrivileges#VIEW_PUBLISHED} privilege been granted for + * the content item? + */ private boolean grantedViewPublished; public boolean isGrantedAdminister() { diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentTypeInfoModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentTypeInfoModel.java index 26bb46d8a..e4dc3103f 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentTypeInfoModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentTypeInfoModel.java @@ -1,20 +1,51 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; +import org.libreccm.l10n.GlobalizationHelper; +import org.librecms.contentsection.ContentType; + /** + * Model for displaying the basic information about a document type + * ({@link ContentType}): * * @author Jens Pelzetter */ public class DocumentTypeInfoModel { + /** + * The label of the type. This value is determined from + * {@link ContentType#label} using {@link GlobalizationHelper#getValueFromLocalizedString(org.libreccm.l10n.LocalizedString) + * }. + */ private String label; + /** + * The description of the type. This value is determined from + * {@link ContentType#description} using {@link GlobalizationHelper#getValueFromLocalizedString(org.libreccm.l10n.LocalizedString) + * }. + */ private String description; + /** + * The fully qualified name of the class implementing the type. + */ private String contentItemClass; public String getLabel() { diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentTypeLifecycleModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentTypeLifecycleModel.java index a74997141..3301a039e 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentTypeLifecycleModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentTypeLifecycleModel.java @@ -1,24 +1,60 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; +import org.libreccm.l10n.GlobalizationHelper; +import org.librecms.lifecycle.LifecycleDefinition; + /** + * Model for the lifecyles of a {@link ContentType} (document type). * * @author Jens Pelzetter */ public class DocumentTypeLifecycleModel { + /** + * The ID of the lifecycle definition. + */ private long definitionId; + /** + * The UUID of the lifecycle definition. + */ private String uuid; + /** + * The label of the lifecycle definition.This value is determined from + * {@link LifecycleDefinition#label} using {@link GlobalizationHelper#getValueFromLocalizedString(org.libreccm.l10n.LocalizedString) + * }. + */ private String label; + /** + * The description of the lifecycle definition.This value is determined from + * {@link LifecycleDefinition#description} using {@link GlobalizationHelper#getValueFromLocalizedString(org.libreccm.l10n.LocalizedString) + * }. + */ private String description; + /** + * Is the lifecycle the default lifecycle for the type? + */ private boolean defaultLifecycle; public long getDefinitionId() { diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentTypeModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentTypeModel.java index e9f68db52..4272ee969 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentTypeModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentTypeModel.java @@ -1,10 +1,24 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; + import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -15,23 +29,42 @@ import javax.enterprise.context.RequestScoped; import javax.inject.Named; /** + * Model for the details view of a document type. * * @author Jens Pelzetter */ @RequestScoped @Named("CmsDocumentTypeModel") public class DocumentTypeModel { - + + /** + * The display name of the type. + */ private String displayName; + /** + * The class implementing the type. + */ private String contentItemClass; + /** + * The localized labels of the type. + */ private Map labels; + /** + * The localized descriptions of the type. + */ private Map descriptions; + /** + * The lifecycles of the type. + */ private List lifecycles; + /** + * The workflows of the type. + */ private List workflows; public String getContentItemClass() { @@ -41,37 +74,37 @@ public class DocumentTypeModel { public void setContentItemClass(final String contentItemClass) { this.contentItemClass = contentItemClass; } - + public Map getLabels() { return Collections.unmodifiableMap(labels); } - + public void setLabels(final Map labels) { this.labels = new HashMap<>(labels); } - + public Map getDescriptions() { return Collections.unmodifiableMap(descriptions); } - + public void setDescriptions(final Map descriptions) { this.descriptions = new HashMap<>(descriptions); } - + public List getLifecycles() { return Collections.unmodifiableList(lifecycles); } - + public void setLifecycles( final List lifecyles ) { this.lifecycles = new ArrayList<>(lifecyles); } - + public List getWorkflows() { return Collections.unmodifiableList(workflows); } - + public void setWorkflows(final List workflows) { this.workflows = new ArrayList<>(workflows); } @@ -83,7 +116,5 @@ public class DocumentTypeModel { public void setDisplayName(String displayName) { this.displayName = displayName; } - - } diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentTypePermissionModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentTypePermissionModel.java index e2083c916..0983f96e8 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentTypePermissionModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentTypePermissionModel.java @@ -1,20 +1,43 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; /** - * + * Model for the permissions of role for a document type/content type. + * * @author Jens Pelzetter */ public class DocumentTypePermissionModel { + /** + * The UUID of the role. + */ private String roleUuid; + /** + * The name of the role. + */ private String roleName; - + + /** + * Can a member of the role use the type + */ private boolean canUse; public String getRoleUuid() { diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentTypeWorkflowModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentTypeWorkflowModel.java index 99a89d93d..a04416753 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentTypeWorkflowModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentTypeWorkflowModel.java @@ -1,24 +1,60 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; +import org.libreccm.l10n.GlobalizationHelper; +import org.libreccm.workflow.Workflow; + /** + * Model for the list of workflows of a content item. * * @author Jens Pelzetter */ public class DocumentTypeWorkflowModel { + /** + * The ID of the workflow. + */ private long workflowId; + /** + * The UUID of the workflow. + */ private String uuid; + /** + * The name of the workflow. This value is determined from + * {@link Workflow#name} using {@link GlobalizationHelper#getValueFromLocalizedString(org.libreccm.l10n.LocalizedString) + * }. + */ private String name; + /** + * The description of the workflow. This value is determined from + * {@link Workflow#description} using {@link GlobalizationHelper#getValueFromLocalizedString(org.libreccm.l10n.LocalizedString) + * }. + */ private String description; + /** + * Is the workflow the default workflow for the type? + */ private boolean defaultWorkflow; public long getWorkflowId() { diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentTypesModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentTypesModel.java index c0f7a22bc..265dbef81 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentTypesModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentTypesModel.java @@ -1,10 +1,25 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; +import org.librecms.contentsection.ContentSection; + import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -15,6 +30,8 @@ import javax.enterprise.context.RequestScoped; import javax.inject.Named; /** + * Model for the list view of document types/{@link ContentTypes} of a + * {@link ContentSection}. * * @author Jens Pelzetter */ @@ -22,12 +39,24 @@ import javax.inject.Named; @Named("CmsDocumentTypesModel") public class DocumentTypesModel { + /** + * The content types assigned to the content section. + */ private List assignedTypes; + /** + * The available types thare are not assigned to the content section. + */ private Map availableTypes; + /** + * The available lifecycles definitions. + */ private Map availableLifecycles; + /** + * The available workflow templates. + */ private Map availableWorkflows; public List getAssignedTypes() { diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentTypesTableRowModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentTypesTableRowModel.java index 4c0cd926e..c83f5ff3b 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentTypesTableRowModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentTypesTableRowModel.java @@ -1,40 +1,103 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; +import org.libreccm.l10n.GlobalizationHelper; +import org.librecms.contentsection.ContentSection; +import org.librecms.contentsection.ContentType; + import java.util.ArrayList; import java.util.Collections; import java.util.List; /** + * Model for a row in the table of document types/cintent types assigned to a + * {@link ContentSection}. * * @author Jens Pelzetter + * + * @see ConfigurationDocumentTypesController + * @see ContentType */ public class DocumentTypesTableRowModel { + /** + * The display name of the content type. + */ private String displayName; + /** + * The class implementing the type. + */ private String contentItemClass; + /** + * The label of the content type. This value is determined from + * {@link ContentType#label} using {@link GlobalizationHelper#getValueFromLocalizedString(org.libreccm.l10n.LocalizedString) + * }. + */ private String label; + /** + * The description of the content type. This value is determined from + * {@link ContentType#description} using {@link GlobalizationHelper#getValueFromLocalizedString(org.libreccm.l10n.LocalizedString) + * }. + */ private String description; + /** + * The mode of the type. + */ private String mode; + /** + * The label of the default lifecycle of the type. This value of determined + * from the label of the default lifecycle using {@link GlobalizationHelper#getValueFromLocalizedString(org.libreccm.l10n.LocalizedString) + * }. + */ private String defaultLifecycleLabel; + /** + * The UUID of the default lifecycle. + */ private List defaultLifecycleUuid; + /** + * The label of the default workflow of the type. This value of determined + * from the label of the default workflow using {@link GlobalizationHelper#getValueFromLocalizedString(org.libreccm.l10n.LocalizedString) + * }. + */ private String defaultWorkflowLabel; + /** + * The UUID of the default workflow. + */ private List defaultWorkflowUuid; + /** + * The UUID of the type. + */ private String uuid; + /** + * The permissions of the current user for the type. + */ private List permissions; public String getContentItemClass() { diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/DomainListEntryModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/DomainListEntryModel.java index dbeb9e368..a5c6abc60 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/DomainListEntryModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/DomainListEntryModel.java @@ -1,26 +1,67 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; +import org.libreccm.categorization.Domain; +import org.libreccm.categorization.DomainOwnership; +import org.libreccm.l10n.GlobalizationHelper; + /** + * Model for an entry in the list of {@link Domain}s (category system) assigned + * to a {@link ContentSection}. * * @author Jens Pelzetter */ public class DomainListEntryModel { + /** + * The context of the assigned domain. + * + * @see DomainOwnership#context + */ private String context; + /** + * The key of the domain. + */ private String domainKey; + /** + * The URI of the domain. + */ private String uri; + /** + * The title of the domain. This value is determined from + * {@link Domain#title} using {@link GlobalizationHelper#getValueFromLocalizedString(org.libreccm.l10n.LocalizedString) + * }. + */ private String title; + /** + * The version of the domain. + */ private String version; + /** + * The release date of the domain as ISO formatted date. + */ private String released; public String getContext() { diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/Duration.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/Duration.java index 42c1a9fd2..e754f2d65 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/Duration.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/Duration.java @@ -1,35 +1,67 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; /** + * Shows a duration stored in minutes in a human readable way as days, hours and + * minutes. * * @author Jens Pelzetter */ public class Duration { - + + /** + * Days part of the duration. + */ private long days; - + + /** + * Hours part of the duration. + */ private long hours; - + + /** + * Minutes part of the duration. + */ private long minutes; + /** + * Create a {@code Duration} instance from a duration in minutes. + * + * @param value The duration in minutes. + * + * @return A {@code Duration} instance for displaying the duration as days, + * hours and minutes. + */ public static Duration fromMinutes(final long value) { final long days = value / (24 * 60); final long daysReminder = value % (24 * 60); final long hours = daysReminder / 60; final long minutes = daysReminder % 60; - + final Duration result = new Duration(); result.setDays(days); result.setHours(hours); result.setMinutes(minutes); return result; } - + public long getDays() { return days; } @@ -53,10 +85,9 @@ public class Duration { public void setMinutes(final long minutes) { this.minutes = minutes; } - + public long toMinutes() { return days * 24 * 60 + hours * 60 + minutes; } - - + } diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/FolderBreadcrumbsModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/FolderBreadcrumbsModel.java index a383ccd9a..27bda32e8 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/FolderBreadcrumbsModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/FolderBreadcrumbsModel.java @@ -1,20 +1,43 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; /** - * + * Model for an individual breadcrumb in the breadcrumb trail of a folder. + * * @author Jens Pelzetter */ public class FolderBreadcrumbsModel { + /** + * A path token of the folder. + */ private String pathToken; + /** + * The full path of the folder. + */ private String path; + /** + * Is the folder the currently selected folder. + */ private boolean currentFolder; public String getPathToken() { diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/FolderTreeNode.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/FolderTreeNode.java index 07b857805..10f275b7f 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/FolderTreeNode.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/FolderTreeNode.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; @@ -9,27 +22,55 @@ import java.util.Collections; import java.util.List; /** + * Node of a folder tree. + * + * This class is not idented for direct. In most cases the subclasses + * {@link AssetFolderTreeNode} or {@link DocumentFolderTreeNode} should be used. * * @author Jens Pelzetter - * @param - * @param

+ * @param The subtype of folder tree node. + * @param

The type of the permissions model to use. */ -public class FolderTreeNode { +public class FolderTreeNode, P extends PermissionsModel> { + /** + * The ID of the folder. + */ private long folderId; + /** + * The UUID of the folder. + */ private String uuid; + /** + * The name of the folder. + */ private String name; + /** + * The path of the folder. + */ private String path; + /** + * The subfolders of the folder. + */ private List subFolders; + /** + * Should the folder open (sub folder are visible) in the view. + */ private boolean open; + /** + * Is the folder the currently selected folder? + */ private boolean selected; + /** + * Permissions of the current user for the folder. + */ private P permissions; public long getFolderId() { diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/GrantedAssetPrivileges.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/GrantedAssetPrivileges.java index 44365903a..9d6d7218d 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/GrantedAssetPrivileges.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/GrantedAssetPrivileges.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; @@ -10,7 +23,8 @@ import org.librecms.contentsection.privileges.AssetPrivileges; import javax.enterprise.context.Dependent; /** - * + * Implementation of {@link AbstractGrantedPrivileges} for {@link Asset}s. + * * @author Jens Pelzetter */ @Dependent diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/GrantedItemPrivileges.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/GrantedItemPrivileges.java index 7ce48b604..8937871fa 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/GrantedItemPrivileges.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/GrantedItemPrivileges.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; @@ -10,6 +23,7 @@ import org.librecms.contentsection.privileges.ItemPrivileges; import javax.enterprise.context.Dependent; /** + * Implemention of {@link AbstractGrantedPrivileges} for content items. * * @author Jens Pelzetter */ diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/GrantedPrivilegeModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/GrantedPrivilegeModel.java index d56e1686e..5919a5666 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/GrantedPrivilegeModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/GrantedPrivilegeModel.java @@ -1,20 +1,43 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; /** - * + * Model for displaying the privileges granted to a user or a role. + * * @author Jens Pelzetter */ public class GrantedPrivilegeModel { + /** + * The privilege. + */ private String privilege; + /** + * Is the privilege granted? + */ private boolean granted; + /** + * The the permission granting the privilege inherited from another object? + */ private boolean inherited; public String getPrivilege() { diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/ItemPermissionChecker.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/ItemPermissionChecker.java index d68d480c2..0995804b7 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/ItemPermissionChecker.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/ItemPermissionChecker.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; @@ -15,33 +28,72 @@ import javax.enterprise.context.RequestScoped; import javax.inject.Inject; /** + * Used to check permissions on {@link ContentItem}s for the current user. * * @author Jens Pelzetter */ @RequestScoped public class ItemPermissionChecker { + /** + * The {@link PermissionChecker} instance used to perform the permission + * checks. + */ @Inject private PermissionChecker permissionChecker; + /** + * Can the current user administer the provided content item? + * + * @param item The content item. + * + * @return {@code true} if the current user can administer the item, + * {@code false} otherwise. + */ public boolean canAdministerItems(final ContentItem item) { return permissionChecker.isPermitted( ItemPrivileges.ADMINISTER, item ); } + /** + * Can the current user administer the content items in the provided content + * section? + * + * @param section The content section + * + * @return {@code true} if the current user can administer items of the + * content section, {@code false} otherwise. + */ public boolean canAdministerItems(final ContentSection section) { return permissionChecker.isPermitted( ItemPrivileges.ADMINISTER, section.getRootDocumentsFolder() ); } + /** + * Can the current user administer the content items in the provided folder? + * + * @param folder The folder. + * + * @return {@code true} if the current user can administer items of the + * folder, {@code false} otherwise. + */ public boolean canAdministerItems(final Folder folder) { return permissionChecker.isPermitted( ItemPrivileges.ADMINISTER, folder ); } + /** + * Can the current user apply alternate workflows to the content items in + * the provided content section? + * + * @param section The content section + * + * @return {@code true} if the current user can apply alternate workflows to + * the items of the content section, {@code false} otherwise. + */ public boolean canApplyAlternateWorkflowItems( final ContentSection section ) { @@ -51,6 +103,15 @@ public class ItemPermissionChecker { ); } + /** + * Can the current user apply alternate workflows to the provided content + * item? + * + * @param item The content item. + * + * @return {@code true} if the current user can apply alternate workflows to + * the item, {@code false} otherwise. + */ public boolean canApplyAlternateWorkflowItems( final ContentItem item ) { @@ -59,6 +120,15 @@ public class ItemPermissionChecker { ); } + /** + * Can the current user apply alternate workflow to the content items in the + * provided folder? + * + * @param folder The folder. + * + * @return {@code true} if the current user can apply alternate workflows to + * the items of the folder, {@code false} otherwise. + */ public boolean canApplyAlternateWorkflowItems( final Folder folder ) { @@ -67,144 +137,332 @@ public class ItemPermissionChecker { ); } + /** + * Can the current user approve the provided content item? + * + * @param item The content item. + * + * @return {@code true} if the current user can approve the item, + * {@code false} otherwise. + */ public boolean canApproveItems(final ContentItem item) { return permissionChecker.isPermitted( ItemPrivileges.APPROVE, item ); } + /** + * Can the current user approve the content items in the provided content + * section? + * + * @param section The content section + * + * @return {@code true} if the current user can approve items of the content + * section, {@code false} otherwise. + */ public boolean canApproveItems(final ContentSection section) { return permissionChecker.isPermitted( ItemPrivileges.APPROVE, section.getRootDocumentsFolder() ); } + /** + * Can the current user approve the content items in the provided folder? + * + * @param folder The folder. + * + * @return {@code true} if the current user can approve items of the folder, + * {@code false} otherwise. + */ public boolean canApproveItems(final Folder folder) { return permissionChecker.isPermitted( ItemPrivileges.APPROVE, folder ); } + /** + * Can the current user categorize the provided content item? + * + * @param item The content item. + * + * @return {@code true} if the current user can categorize the item, + * {@code false} otherwise. + */ public boolean canCategorizeItems(final ContentItem item) { return permissionChecker.isPermitted( ItemPrivileges.CATEGORIZE, item ); } + /** + * Can the current user categorize the content items in the provided content + * section? + * + * @param section The content section + * + * @return {@code true} if the current user can categorize items of the + * content section, {@code false} otherwise. + */ public boolean canCategorizeItems(final ContentSection section) { return permissionChecker.isPermitted( ItemPrivileges.CATEGORIZE, section.getRootDocumentsFolder() ); } + /** + * Can the current user categorize the content items in the provided folder? + * + * @param folder The folder. + * + * @return {@code true} if the current user can categorize items of the + * folder, {@code false} otherwise. + */ public boolean canCategorizeItems(final Folder folder) { return permissionChecker.isPermitted( ItemPrivileges.CATEGORIZE, folder ); } - public boolean canCreateNewItems(final ContentItem item) { - return permissionChecker.isPermitted( - ItemPrivileges.CREATE_NEW, item - ); - } - + /** + * Can the current user create new content items in the provided content + * section? + * + * @param section The content section + * + * @return {@code true} if the current user can create new items in the + * content section, {@code false} otherwise. + */ public boolean canCreateNewItems(final ContentSection section) { return permissionChecker.isPermitted( ItemPrivileges.CREATE_NEW, section.getRootDocumentsFolder() ); } + /** + * Can the current user create new content items in the provided folder? + * + * @param folder The folder. + * + * @return {@code true} if the current user can create new items in the + * folder, {@code false} otherwise. + */ public boolean canCreateNewItems(final Folder folder) { return permissionChecker.isPermitted( ItemPrivileges.CREATE_NEW, folder ); } + /** + * Can the current user delete the provided content item? + * + * @param item The content item. + * + * @return {@code true} if the current user can delete the item, + * {@code false} otherwise. + */ public boolean canDeleteItems(final ContentItem item) { return permissionChecker.isPermitted( ItemPrivileges.DELETE, item ); } + /** + * Can the current user delete content items in the provided content + * section? + * + * @param section The content section + * + * @return {@code true} if the current user can delete items in the content + * section, {@code false} otherwise. + */ public boolean canDeleteItems(final ContentSection section) { return permissionChecker.isPermitted( ItemPrivileges.DELETE, section.getRootDocumentsFolder() ); } + /** + * Can the current user delete the content items in the provided folder? + * + * @param folder The folder. + * + * @return {@code true} if the current user can delete items in the folder, + * {@code false} otherwise. + */ public boolean canDeleteItems(final Folder folder) { return permissionChecker.isPermitted( ItemPrivileges.DELETE, folder ); } + /** + * Can the current user edit the provided content item? + * + * @param item The content item. + * + * @return {@code true} if the current user can edit the item, {@code false} + * otherwise. + */ public boolean canEditItems(final ContentItem item) { return permissionChecker.isPermitted( ItemPrivileges.EDIT, item ); } + /** + * Can the current user edit the content items in the provided content + * section? + * + * @param section The content section + * + * @return {@code true} if the current user can edit items of the content + * section, {@code false} otherwise. + */ public boolean canEditItems(final ContentSection section) { return permissionChecker.isPermitted( ItemPrivileges.EDIT, section.getRootDocumentsFolder() ); } + /** + * Can the current user edit the content items in the provided folder? + * + * @param folder The folder. + * + * @return {@code true} if the current user can administer edit items in the + * folder, {@code false} otherwise. + */ public boolean canEditItems(final Folder folder) { return permissionChecker.isPermitted( ItemPrivileges.EDIT, folder ); } + /** + * Can the current user preview the provided content item? + * + * @param item The content item. + * + * @return {@code true} if the current user can preview the item, + * {@code false} otherwise. + */ public boolean canPreviewItems(final ContentItem item) { return permissionChecker.isPermitted( ItemPrivileges.PREVIEW, item ); } + /** + * Can the current user preview the content items in the provided content + * section? + * + * @param section The content section + * + * @return {@code true} if the current user can preview items of the content + * section, {@code false} otherwise. + */ public boolean canPreviewItems(final ContentSection section) { return permissionChecker.isPermitted( ItemPrivileges.PREVIEW, section.getRootDocumentsFolder() ); } + /** + * Can the current user preview the content items in the provided folder? + * + * @param folder The folder. + * + * @return {@code true} if the current user can preview items in the folder, + * {@code false} otherwise. + */ public boolean canPreviewItems(final Folder folder) { return permissionChecker.isPermitted( ItemPrivileges.PREVIEW, folder ); } + /** + * Can the current user publish the provided content item? + * + * @param item The content item. + * + * @return {@code true} if the current user can publish the item, + * {@code false} otherwise. + */ public boolean canPublishItems(final ContentItem item) { return permissionChecker.isPermitted( ItemPrivileges.PUBLISH, item ); } + /** + * Can the current user publish the content items in the provided content + * section? + * + * @param section The content section + * + * @return {@code true} if the current user can publish items of the content + * section, {@code false} otherwise. + */ public boolean canPublishItems(final ContentSection section) { return permissionChecker.isPermitted( ItemPrivileges.PUBLISH, section.getRootDocumentsFolder() ); } + /** + * Can the current user publish the content items in the provided folder? + * + * @param folder The folder. + * + * @return {@code true} if the current user can publish items in the folder, + * {@code false} otherwise. + */ public boolean canPublishItems(final Folder folder) { return permissionChecker.isPermitted( ItemPrivileges.PUBLISH, folder ); } + /** + * Can the current user view the published version the provided content + * item? + * + * @param item The content item. + * + * @return {@code true} if the current user can view the published of the + * item, {@code false} otherwise. + */ public boolean canViewPublishedItems(final ContentItem item) { return permissionChecker.isPermitted( ItemPrivileges.VIEW_PUBLISHED, item ); } + /** + * Can the current user view publish content items of the provided content + * section? + * + * @param section The content section + * + * @return {@code true} if the current user can view publish items of the + * content section, {@code false} otherwise. + */ public boolean canViewPublishedItems(final ContentSection section) { return permissionChecker.isPermitted( ItemPrivileges.VIEW_PUBLISHED, section.getRootDocumentsFolder() ); } + /** + * Can the current user view the published version of content items in the + * provided folder? + * + * @param folder The folder. + * + * @return {@code true} if the current user can view the published version + * of items in the folder, {@code false} otherwise. + */ public boolean canViewPublishedItems(final Folder folder) { return permissionChecker.isPermitted( ItemPrivileges.VIEW_PUBLISHED, folder diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/LifecycleDefinitionListModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/LifecycleDefinitionListModel.java index 70c281ab3..08850d175 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/LifecycleDefinitionListModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/LifecycleDefinitionListModel.java @@ -1,22 +1,55 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; +import org.libreccm.l10n.GlobalizationHelper; +import org.librecms.lifecycle.LifecycleDefinition; + /** + * Model for the entries in a list of {@link LifecycleDefinition}s. * * @author Jens Pelzetter */ public class LifecycleDefinitionListModel { + /** + * The ID of the lifecycle definition. + */ private long definitionId; + /** + * The UUID of the lifecycle definition. + */ private String uuid; + /** + * The label of the lifecycle definition. This value is determined from + * {@link LifecycleDefinition#label} using {@link GlobalizationHelper#getValueFromLocalizedString(org.libreccm.l10n.LocalizedString) + * }. + */ private String label; + /** + * The description of the lifecycle definition. This value is determined + * from {@link LifecycleDefinition#description} using {@link GlobalizationHelper#getValueFromLocalizedString(org.libreccm.l10n.LocalizedString) + * }. + */ private String description; public long getDefinitionId() { diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/PermissionsModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/PermissionsModel.java index a126491fa..23355dee0 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/PermissionsModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/PermissionsModel.java @@ -1,14 +1,29 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; /** + * Used as super interface for {@link AssetPermissionsModel} and + * {@link DocumentPermissionsModel} so that both can be used in the same place. * * @author Jens Pelzetter */ public interface PermissionsModel { - + } diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/PhaseDefinitionModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/PhaseDefinitionModel.java index 7e47f7bb1..d6c1bec80 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/PhaseDefinitionModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/PhaseDefinitionModel.java @@ -1,24 +1,60 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; +import org.libreccm.l10n.GlobalizationHelper; +import org.librecms.lifecycle.PhaseDefinition; + /** + * Model for displaying a {@link PhaseDefinition}. * * @author Jens Pelzetter */ public class PhaseDefinitionModel { + /** + * The ID of the definition. + */ private long definitionId; - + + /** + * The label of the definition. This value is determined from + * {@link PhaseDefinition#label} using {@link GlobalizationHelper#getValueFromLocalizedString(org.libreccm.l10n.LocalizedString) + * }. + */ private String label; + /** + * The description of the definition. This value is determined from + * {@link PhaseDefinition#description} using {@link GlobalizationHelper#getValueFromLocalizedString(org.libreccm.l10n.LocalizedString) + * }. + */ private String description; + /** + * The default delay of the phase. + */ private Duration defaultDelay; + /** + * The default duration of the phase. + */ private Duration defaultDuration; public long getDefinitionId() { diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/PrivilegesGrantedToRoleModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/PrivilegesGrantedToRoleModel.java index ea65946cd..4a4553927 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/PrivilegesGrantedToRoleModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/PrivilegesGrantedToRoleModel.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; @@ -10,13 +23,20 @@ import java.util.List; /** - * + * Model for displaying the privileges granted to a role. + * * @author Jens Pelzetter */ public class PrivilegesGrantedToRoleModel { + /** + * The name of the role. + */ private String grantee; + /** + * The privileges granted to the role. + */ private List grantedPrivileges; public String getGrantee() { diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/RetrieveResult.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/RetrieveResult.java index ad5b722bf..b526368ed 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/RetrieveResult.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/RetrieveResult.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/RoleListItemModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/RoleListItemModel.java index c7739d6a3..cea96b647 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/RoleListItemModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/RoleListItemModel.java @@ -1,22 +1,53 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; +import org.libreccm.l10n.GlobalizationHelper; +import org.libreccm.security.Role; + /** + * Model for a list of roles assigned to a content section. * * @author Jens Pelzetter */ public class RoleListItemModel { + /** + * The ID of the role. + */ private long roleId; + /** + * The UUID of the role. + */ private String uuid; + /** + * The name of the role. + */ private String name; + /** + * The description of the role. This value is determined from + * {@link Role#description} using {@link GlobalizationHelper#getValueFromLocalizedString(org.libreccm.l10n.LocalizedString) + * }, + */ private String description; public long getRoleId() { diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/RoleMembershipModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/RoleMembershipModel.java index a3b148e9d..4de7acbea 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/RoleMembershipModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/RoleMembershipModel.java @@ -1,18 +1,39 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; /** + * + * Model for the members of a role. * * @author Jens Pelzetter */ public class RoleMembershipModel { + /** + * The name of the member. + */ private String memberName; + /** + * The UUID of the member. + */ private String memberUuid; public String getMemberName() { diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/RoleSectionPermissionModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/RoleSectionPermissionModel.java index 89b7d89c4..c007ba521 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/RoleSectionPermissionModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/RoleSectionPermissionModel.java @@ -1,18 +1,40 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; +import org.librecms.contentsection.ContentSection; + /** - * + * Model for the permissions table of a {@link ContentSection}. + * * @author Jens Pelzetter */ public class RoleSectionPermissionModel { + /** + * The privilege. + */ private String privilege; + /** + * If the privilege granted? + */ private boolean granted; public String getPrivilege() { diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/SelectedLifecycleDefinitionModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/SelectedLifecycleDefinitionModel.java index a824df44a..19c2eb435 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/SelectedLifecycleDefinitionModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/SelectedLifecycleDefinitionModel.java @@ -1,10 +1,27 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; +import org.libreccm.l10n.GlobalizationHelper; +import org.librecms.lifecycle.LifecycleDefinition; +import org.librecms.lifecycle.PhaseDefinition; + import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -15,6 +32,7 @@ import javax.enterprise.context.RequestScoped; import javax.inject.Named; /** + * Model for the details view of {@link LifecycleDefinition}s. * * @author Jens Pelzetter */ @@ -22,20 +40,43 @@ import javax.inject.Named; @Named("SelectedLifecycleDefinitionModel") public class SelectedLifecycleDefinitionModel { + /** + * The UUID of the lifecycle definition. + */ private String uuid; + /** + * The display label of the lifecycle definition. This value determined from + * {@link LifecycleDefinition#label} using {@link GlobalizationHelper#getValueFromLocalizedString(org.libreccm.l10n.LocalizedString) + * }. + */ private String displayLabel; + /** + * The localized labels of the lifecycle definition. + */ private Map label; + /** + * The locales for which no localized label has been defined yet. + */ private List unusedLabelLocales; + /** + * The localized descriptions of the lifecycle definition. + */ private Map description; - - private List phaseDefinitions; + /** + * The locales for which no localized description has been defined yet. + */ private List unusedDescriptionLocales; + /** + * The {@link PhaseDefinition}s of the {@link LifecycleDefinition}. + */ + private List phaseDefinitions; + public Map getLabel() { return Collections.unmodifiableMap(label); } @@ -89,7 +130,7 @@ public class SelectedLifecycleDefinitionModel { public boolean getHasUnusedLabelLocales() { return !unusedLabelLocales.isEmpty(); } - + public List getUnusedDescriptionLocales() { return Collections.unmodifiableList(unusedDescriptionLocales); } @@ -100,7 +141,7 @@ public class SelectedLifecycleDefinitionModel { this.unusedDescriptionLocales = new ArrayList<>(unusedDescriptionLocales); } - + public boolean getHasUnusedDescriptionLocales() { return !unusedDescriptionLocales.isEmpty(); } diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/SelectedPhaseDefinitionModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/SelectedPhaseDefinitionModel.java index a25fece65..cd2c1fab0 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/SelectedPhaseDefinitionModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/SelectedPhaseDefinitionModel.java @@ -1,10 +1,27 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; +import org.libreccm.l10n.GlobalizationHelper; +import org.librecms.lifecycle.LifecycleDefinition; +import org.librecms.lifecycle.PhaseDefinition; + import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -15,6 +32,8 @@ import javax.enterprise.context.RequestScoped; import javax.inject.Named; /** + * Model for the details view of a {@link PhaseDefinition} of a + * {@link LifecycleDefinition}. * * @author Jens Pelzetter */ @@ -22,20 +41,46 @@ import javax.inject.Named; @Named("SelectedPhaseDefinitionModel") public class SelectedPhaseDefinitionModel { + /** + * The ID of the phase definition. + */ private long definitionId; - + + /** + * The localized labels of the phase definition. + */ private Map label; - + + /** + * The display label for the phase definition. This value is determined from + * {@link PhaseDefinition#label} using {@link GlobalizationHelper#getValueFromLocalizedString(org.libreccm.l10n.LocalizedString) + * }. + */ private String displayLabel; + /** + * Locales for which no localized label has been defined yet. + */ private List unusedLabelLocales; + /** + * The localized descriptions of the phase definition. + */ private Map description; + /** + * Locales for which no localized description has been defined yet. + */ private List unusedDescriptionLocales; + /** + * The default delay of the phase definition. + */ private Duration defaultDelay; + /** + * The default duration of the phase definition. + */ private Duration defaultDuration; public long getDefinitionId() { @@ -93,13 +138,14 @@ public class SelectedPhaseDefinitionModel { public void setUnusedDescriptionLocales( final List unusedDescriptionLocales ) { - this.unusedDescriptionLocales = new ArrayList<>(unusedDescriptionLocales); + this.unusedDescriptionLocales + = new ArrayList<>(unusedDescriptionLocales); } - + public boolean getHasUnusedLabelLocales() { return !unusedLabelLocales.isEmpty(); } - + public boolean getHasUnusedDescriptionLocales() { return !unusedDescriptionLocales.isEmpty(); } @@ -112,5 +158,4 @@ public class SelectedPhaseDefinitionModel { this.displayLabel = displayLabel; } - } diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/SelectedRoleModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/SelectedRoleModel.java index 0f0e4e9b0..1214a2e37 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/SelectedRoleModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/SelectedRoleModel.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; @@ -21,6 +34,7 @@ import javax.inject.Inject; import javax.inject.Named; /** + * Model for details view of a role providing the data of the selected role. * * @author Jens Pelzetter */ @@ -28,17 +42,38 @@ import javax.inject.Named; @Named("SelectedRoleModel") public class SelectedRoleModel { + /** + * Party repository for retrieving parties. + */ @Inject private PartyRepository partyRepository; + /** + * The name of the role. + */ private String name; + /** + * The localized descriptions of the role. + */ private Map description; + /** + * Locales for which not localized description has been defined yet. + */ private List unusedDescriptionLocales; + /** + * The members of the role. + */ private List members; + /** + * Builds {@link RolePartyFormEntry} objects for all parties. They are used + * to create the form for adding members and removing members from the role. + * + * @return A list of {@link RolePartyFormEntry} objects for all parties. + */ public List getRolePartyFormEnties() { return partyRepository .findAll() @@ -100,6 +135,14 @@ public class SelectedRoleModel { return !unusedDescriptionLocales.isEmpty(); } + /** + * Helper method for building a {@link RolePartyFormEntry} for the a + * {@link Party}. + * + * @param party The party. + * + * @return A {@link RolePartyFormEntry} for the {@code party}. + */ private RolePartyFormEntry buildRolePartyFormEntry(final Party party) { final RolePartyFormEntry entry = new RolePartyFormEntry(); entry.setPartyId(party.getPartyId()); diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/SelectedWorkflowTaskTemplateModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/SelectedWorkflowTaskTemplateModel.java index 74a601ce0..4c64d83c8 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/SelectedWorkflowTaskTemplateModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/SelectedWorkflowTaskTemplateModel.java @@ -1,10 +1,28 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; +import org.libreccm.l10n.GlobalizationHelper; +import org.libreccm.workflow.AssignableTask; +import org.libreccm.workflow.Task; +import org.libreccm.workflow.Workflow; + import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -15,6 +33,13 @@ import javax.enterprise.context.RequestScoped; import javax.inject.Named; /** + * Model providing the data of the selected task of a workflow template for the + * details view of a task. + * + * @see ConfigurationWorkflowController + * @see Workflow + * @see Task + * @see AssignableTask * * @author Jens Pelzetter */ @@ -22,24 +47,56 @@ import javax.inject.Named; @Named("SelectedWorkflowTaskTemplateModel") public class SelectedWorkflowTaskTemplateModel { + /** + * The ID of the task. + */ private long taskId; + /** + * The UUID of the task. + */ private String uuid; + /** + * The display label of the task. This value is determined from + * {@link Task#label} using {@link GlobalizationHelper#getValueFromLocalizedString(org.libreccm.l10n.LocalizedString) + * }. + */ private String displayLabel; + /** + * The localized labels of the task. + */ private Map label; + /** + * The locales for which no localized label has been defined yet. + */ private List unusedLabelLocales; + /** + * The localized descriptions of the task. + */ private Map description; + /** + * The locales for which no localized description has been defined yet. + */ private List unusedDescriptionLocales; + /** + * Tasks that block the selected task. + */ private List blockedTasks; + /** + * Task that are blocked by the selected tak. + */ private List blockingTasks; + /** + * Ohter that don't block the selected task. + */ private Map noneBlockingTasks; public long getTaskId() { diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/SelectedWorkflowTemplateModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/SelectedWorkflowTemplateModel.java index 17c33b161..9c5125139 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/SelectedWorkflowTemplateModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/SelectedWorkflowTemplateModel.java @@ -1,10 +1,25 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; +import org.libreccm.workflow.Workflow; + import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -15,6 +30,11 @@ import javax.enterprise.context.RequestScoped; import javax.inject.Named; /** + * Model providing the data about the selected workflow template for the + * workflow details view. + * + * @see ConfigurationWorkflowController + * @see Workflow * * @author Jens Pelzetter */ @@ -22,20 +42,44 @@ import javax.inject.Named; @Named("SelectedWorkflowTemplateModel") public class SelectedWorkflowTemplateModel { + /** + * The ID of the selected workflow template. + */ private long workflowId; + /** + * The UUID of the selected workflow template. + */ private String uuid; - + + /** + * The display name of the selected workflow template. + */ private String displayName; + /** + * The localized titles of the selected workflow template. + */ private Map name; + /** + * Locales for which no title value has been definied yet. + */ private List unusedNameLocales; + /** + * The localized descriptions of the selected workflow template. + */ private Map description; + /** + * The locales for which no localized description has definied yet. + */ private List unusedDescriptionLocales; + /** + * The tasks of the selected workflow template. + */ private List tasks; public long getWorkflowId() { @@ -96,11 +140,11 @@ public class SelectedWorkflowTemplateModel { this.unusedDescriptionLocales = new ArrayList<>(unusedDescriptionLocales); } - + public boolean getHasUnusedNameLocales() { return !unusedNameLocales.isEmpty(); } - + public boolean getHasUnusedDescriptionLocales() { return !unusedDescriptionLocales.isEmpty(); } @@ -113,5 +157,4 @@ public class SelectedWorkflowTemplateModel { this.displayName = displayName; } - } diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/TypePermissionsChecker.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/TypePermissionsChecker.java index e4bbecd27..e10fe9f5c 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/TypePermissionsChecker.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/TypePermissionsChecker.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; @@ -13,15 +26,29 @@ import javax.enterprise.context.RequestScoped; import javax.inject.Inject; /** + * Checks permissions on content types. * * @author Jens Pelzetter */ @RequestScoped public class TypePermissionsChecker { + /** + * {@link PermissionChecker} instance used for performing the permission + * check. + */ @Inject private PermissionChecker permissionChecker; + /** + * Checks if the current user is permitted to use the provided + * {@link ContentType}. + * + * @param type The content type. + * + * @return {@code true} if the current user is permitted to use the provided + * {@code type}, {@code false} otherwise. + */ public boolean canUseType(final ContentType type) { return permissionChecker.isPermitted( TypePrivileges.USE_TYPE, type diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/WorkflowTaskTemplateListModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/WorkflowTaskTemplateListModel.java index 816f90e64..a65b4340f 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/WorkflowTaskTemplateListModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/WorkflowTaskTemplateListModel.java @@ -1,30 +1,60 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import org.libreccm.l10n.GlobalizationHelper; +import org.libreccm.workflow.Task; /** + * Model for an item in the list tasks of a workflows template. * * @author Jens Pelzetter */ public class WorkflowTaskTemplateListModel { + /** + * The ID of the task. + */ private long taskId; + /** + * The UUID of the task. + */ private String uuid; + /** + * The label of the task. This value determined from {@link Task#label} + * using {@link GlobalizationHelper#getValueFromLocalizedString(org.libreccm.l10n.LocalizedString) + * }. + */ private String label; + /** + * The description of the task. This value determined from + * {@link Task#description} using {@link GlobalizationHelper#getValueFromLocalizedString(org.libreccm.l10n.LocalizedString) + * }. + */ private String description; - + + /** + * Does the task have any dependencies? + */ private boolean hasDependencies; public long getTaskId() { @@ -66,7 +96,5 @@ public class WorkflowTaskTemplateListModel { public void setHasDependencies(final boolean hasDependencies) { this.hasDependencies = hasDependencies; } - - } diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/WorkflowTemplateListModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/WorkflowTemplateListModel.java index a8031c7cd..90085ba55 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/WorkflowTemplateListModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/WorkflowTemplateListModel.java @@ -1,24 +1,61 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contentsections; +import org.libreccm.l10n.GlobalizationHelper; +import org.libreccm.workflow.Workflow; + /** + * Model for displaying data about a {@link Workflow} template in the view for + * managing the workflow templates of a content section. * * @author Jens Pelzetter */ public class WorkflowTemplateListModel { + /** + * The ID of the workflow template. + */ private long workflowId; + /** + * The UUID of the workflow template. + */ private String uuid; + /** + * The name of the workflow template. This value is determined from + * {@link Workflow#name} using {@link GlobalizationHelper#getValueFromLocalizedString(org.libreccm.l10n.LocalizedString) + * } + */ private String name; + /** + * The description of the workflow template. This value is determined from + * {@link Workflow#description} using {@link GlobalizationHelper#getValueFromLocalizedString(org.libreccm.l10n.LocalizedString) + * } + */ private String description; + /** + * Does the workflow template have any task templates? + */ private boolean hasTasks; public long getWorkflowId() { diff --git a/ccm-cms/src/main/java/org/librecms/ui/contenttypes/ArticleMessageBundle.java b/ccm-cms/src/main/java/org/librecms/ui/contenttypes/ArticleMessageBundle.java index 40a0d1391..68fc2fa3f 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contenttypes/ArticleMessageBundle.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contenttypes/ArticleMessageBundle.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contenttypes; diff --git a/ccm-cms/src/main/java/org/librecms/ui/contenttypes/ArticleStepsConstants.java b/ccm-cms/src/main/java/org/librecms/ui/contenttypes/ArticleStepsConstants.java index 6200b7c8d..5a0b4fc8f 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contenttypes/ArticleStepsConstants.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contenttypes/ArticleStepsConstants.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contenttypes; diff --git a/ccm-cms/src/main/java/org/librecms/ui/contenttypes/MvcArticleCreateStep.java b/ccm-cms/src/main/java/org/librecms/ui/contenttypes/MvcArticleCreateStep.java index 6b74b75fa..b63f20bd3 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contenttypes/MvcArticleCreateStep.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contenttypes/MvcArticleCreateStep.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contenttypes; diff --git a/ccm-cms/src/main/java/org/librecms/ui/contenttypes/MvcArticlePropertiesStep.java b/ccm-cms/src/main/java/org/librecms/ui/contenttypes/MvcArticlePropertiesStep.java index 3ef4821a1..3ff745f89 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contenttypes/MvcArticlePropertiesStep.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contenttypes/MvcArticlePropertiesStep.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contenttypes; diff --git a/ccm-cms/src/main/java/org/librecms/ui/contenttypes/MvcArticleTextBodyStep.java b/ccm-cms/src/main/java/org/librecms/ui/contenttypes/MvcArticleTextBodyStep.java index 99c965a70..9c7b761ce 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contenttypes/MvcArticleTextBodyStep.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contenttypes/MvcArticleTextBodyStep.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.librecms.ui.contenttypes; diff --git a/ccm-core/src/main/java/com/arsdigita/ui/admin/applications/ApplicationInstanceTreeCdiUtil.java b/ccm-core/src/main/java/com/arsdigita/ui/admin/applications/ApplicationInstanceTreeCdiUtil.java index b1458b506..4025a2ef1 100644 --- a/ccm-core/src/main/java/com/arsdigita/ui/admin/applications/ApplicationInstanceTreeCdiUtil.java +++ b/ccm-core/src/main/java/com/arsdigita/ui/admin/applications/ApplicationInstanceTreeCdiUtil.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package com.arsdigita.ui.admin.applications; diff --git a/ccm-core/src/main/java/org/libreccm/categorization/CategorizationImExporterDependenciesProvider.java b/ccm-core/src/main/java/org/libreccm/categorization/CategorizationImExporterDependenciesProvider.java index 9f6d8d626..83ec0bc07 100644 --- a/ccm-core/src/main/java/org/libreccm/categorization/CategorizationImExporterDependenciesProvider.java +++ b/ccm-core/src/main/java/org/libreccm/categorization/CategorizationImExporterDependenciesProvider.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.libreccm.categorization; diff --git a/ccm-core/src/main/java/org/libreccm/core/api/CcmCoreApi.java b/ccm-core/src/main/java/org/libreccm/core/api/CcmCoreApi.java index 10f91309c..b169b7616 100644 --- a/ccm-core/src/main/java/org/libreccm/core/api/CcmCoreApi.java +++ b/ccm-core/src/main/java/org/libreccm/core/api/CcmCoreApi.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.libreccm.core.api; diff --git a/ccm-core/src/main/java/org/libreccm/formbuilder/actions/ConfirmEmailListener.java b/ccm-core/src/main/java/org/libreccm/formbuilder/actions/ConfirmEmailListener.java index 7839c591c..448363084 100644 --- a/ccm-core/src/main/java/org/libreccm/formbuilder/actions/ConfirmEmailListener.java +++ b/ccm-core/src/main/java/org/libreccm/formbuilder/actions/ConfirmEmailListener.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.libreccm.formbuilder.actions; diff --git a/ccm-core/src/main/java/org/libreccm/formbuilder/actions/ConfirmRedirectListener.java b/ccm-core/src/main/java/org/libreccm/formbuilder/actions/ConfirmRedirectListener.java index 8418db0eb..649a0afc4 100644 --- a/ccm-core/src/main/java/org/libreccm/formbuilder/actions/ConfirmRedirectListener.java +++ b/ccm-core/src/main/java/org/libreccm/formbuilder/actions/ConfirmRedirectListener.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.libreccm.formbuilder.actions; diff --git a/ccm-core/src/main/java/org/libreccm/formbuilder/actions/RemoteServerPostListener.java b/ccm-core/src/main/java/org/libreccm/formbuilder/actions/RemoteServerPostListener.java index 83137801d..4295fb936 100644 --- a/ccm-core/src/main/java/org/libreccm/formbuilder/actions/RemoteServerPostListener.java +++ b/ccm-core/src/main/java/org/libreccm/formbuilder/actions/RemoteServerPostListener.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.libreccm.formbuilder.actions; diff --git a/ccm-core/src/main/java/org/libreccm/formbuilder/actions/SimpleEmailListener.java b/ccm-core/src/main/java/org/libreccm/formbuilder/actions/SimpleEmailListener.java index 4ef2f6c57..d28e28f4e 100644 --- a/ccm-core/src/main/java/org/libreccm/formbuilder/actions/SimpleEmailListener.java +++ b/ccm-core/src/main/java/org/libreccm/formbuilder/actions/SimpleEmailListener.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.libreccm.formbuilder.actions; diff --git a/ccm-core/src/main/java/org/libreccm/formbuilder/actions/TemplateEmailListener.java b/ccm-core/src/main/java/org/libreccm/formbuilder/actions/TemplateEmailListener.java index ece8c2c9b..8dd0a5d05 100644 --- a/ccm-core/src/main/java/org/libreccm/formbuilder/actions/TemplateEmailListener.java +++ b/ccm-core/src/main/java/org/libreccm/formbuilder/actions/TemplateEmailListener.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.libreccm.formbuilder.actions; diff --git a/ccm-core/src/main/java/org/libreccm/formbuilder/actions/XmlEmailListener.java b/ccm-core/src/main/java/org/libreccm/formbuilder/actions/XmlEmailListener.java index 72347b4e9..c16cbc594 100644 --- a/ccm-core/src/main/java/org/libreccm/formbuilder/actions/XmlEmailListener.java +++ b/ccm-core/src/main/java/org/libreccm/formbuilder/actions/XmlEmailListener.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.libreccm.formbuilder.actions; diff --git a/ccm-core/src/test/java/org/libreccm/core/EntitiesTestCore.java b/ccm-core/src/test/java/org/libreccm/core/EntitiesTestCore.java index 2e85a43f2..c2f5fdfcd 100644 --- a/ccm-core/src/test/java/org/libreccm/core/EntitiesTestCore.java +++ b/ccm-core/src/test/java/org/libreccm/core/EntitiesTestCore.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright (C) 2021 LibreCCM Foundation. + * + * 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. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA */ package org.libreccm.core;