Fixed license headers, added JavaDoc

pull/10/head
Jens Pelzetter 2021-04-02 14:46:10 +02:00
parent b2b7d8d7b6
commit f79b6abe09
106 changed files with 4136 additions and 554 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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}.

View File

@ -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;

View File

@ -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;

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
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<String, String> 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<String, String> 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<CategoryModel> subCategories;
/**
* The objects assigned to which the category is assigned.
*/
private List<CategorizedObjectModel> objects;
/**
* The order of the category.
*/
private long categoryOrder;
/**
* Locales for which no localized title has been defined yet.
*/
private List<String> unusedTitleLocales;
/**
* Locales for which no localized description has been defined yet.
*/
private List<String> unusedDescriptionLocales;
public CategoryModel() {

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@ -20,12 +35,25 @@ import javax.inject.Named;
@Named("CategorySystemModel")
public class CategorySystemModel {
/**
* List of the category systems/{@link Domain} assigned to the current
* content section.
*/
private List<DomainListEntryModel> 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() {

View File

@ -1,29 +1,63 @@
/*
* 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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
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<CategoryTreeNodeModel> subCategories;
public CategoryTreeNodeModel() {
@ -72,5 +106,4 @@ public class CategoryTreeNodeModel {
this.active = active;
}
}

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@ -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

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@ -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<ContentSection> 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<ContentType> 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<Workflow> 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
) {

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@ -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
@ -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
@ -752,7 +961,7 @@ 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);
@ -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<LifecycleDefinition> 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<PhaseDefinition> 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,

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@ -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
* <strong>not</strong> 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
@ -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<Role> 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<RoleSectionPermissionModel> 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<Party> 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<Party> result = partyRepository.findByName(
removedMemberName

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@ -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<ContentSection> 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<ContentSection> 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<Workflow> 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
) {

View File

@ -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,6 +30,7 @@ import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
/**
* JAX-RS application for managing a content section.
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/

View File

@ -16,6 +16,7 @@ import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;
/**
* Controller for managing content sections.
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@ -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
@ -52,6 +61,13 @@ public class ContentSectionController {
}
}
/**
* 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

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@ -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<AssetFolderTreeNode> assetFolders;
/**
* The document folder tree of the section.
*/
private List<DocumentFolderTreeNode> 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
);
}

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@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<ContentSection> 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<String, String> identifiers) {
for (final Map.Entry<String, String> 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<ContentSection> retrieveContentSection(
// final String identifierParam
// ) {
// final Identifier sectionIdentifier = identifierParser.parseIdentifier(
// identifierParam
// );
//
// final Optional<ContentSection> 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"
// );
// }
// }
}

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/

View File

@ -1,15 +1,30 @@
/*
* 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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@ -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<FolderBreadcrumbsModel> 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
) {

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@ -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<DocumentFolderRowModel> rows;
/**
* The breadcrumb trail of the folder.
*/
private List<FolderBreadcrumbsModel> 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<GrantedPrivilegeModel> currentUserPermissions;
/**
* Privileges granted to the roles of the content section for the folder.
*/
private List<PrivilegesGrantedToRoleModel> grantedPermissions;
/**
* A list of the privileges that can be granted for a document folder.
*/
private List<String> privileges;
public long getCount() {

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
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<String> 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() {

View File

@ -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,13 +26,18 @@ import javax.inject.Inject;
import javax.transaction.Transactional;
/**
* The document folder tree of a {@link ContentSection}.
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@Dependent
public class DocumentFolderTree
extends AbstractFolderTree<DocumentFolderTreeNode, DocumentPermissionsModel>{
extends AbstractFolderTree<DocumentFolderTreeNode, DocumentPermissionsModel> {
/**
* {@link DocumentPermissions} instance used to check permissions on the
* documents.
*/
@Inject
private DocumentPermissions documentPermissions;
@ -39,6 +57,4 @@ public class DocumentFolderTree
return documentPermissions.buildDocumentPermissionsModel(folder);
}
}

View File

@ -1,11 +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.librecms.contentsection.ContentSection;
/**
* A node in the document folder tree of {@link ContentSection}.
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@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
) {

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
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() {

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
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() {

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
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() {

View File

@ -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,6 +29,7 @@ import javax.enterprise.context.RequestScoped;
import javax.inject.Named;
/**
* Model for the details view of a document type.
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@ -22,16 +37,34 @@ import javax.inject.Named;
@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<String, String> labels;
/**
* The localized descriptions of the type.
*/
private Map<String, String> descriptions;
/**
* The lifecycles of the type.
*/
private List<DocumentTypeLifecycleModel> lifecycles;
/**
* The workflows of the type.
*/
private List<DocumentTypeWorkflowModel> workflows;
public String getContentItemClass() {
@ -84,6 +117,4 @@ public class DocumentTypeModel {
this.displayName = displayName;
}
}

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
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() {

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
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() {

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@ -22,12 +39,24 @@ import javax.inject.Named;
@Named("CmsDocumentTypesModel")
public class DocumentTypesModel {
/**
* The content types assigned to the content section.
*/
private List<DocumentTypesTableRowModel> assignedTypes;
/**
* The available types thare are not assigned to the content section.
*/
private Map<String, DocumentTypeInfoModel> availableTypes;
/**
* The available lifecycles definitions.
*/
private Map<String, String> availableLifecycles;
/**
* The available workflow templates.
*/
private Map<String, String> availableWorkflows;
public List<DocumentTypesTableRowModel> getAssignedTypes() {

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*
* @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<String> 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<String> defaultWorkflowUuid;
/**
* The UUID of the type.
*/
private String uuid;
/**
* The permissions of the current user for the type.
*/
private List<DocumentTypePermissionModel> permissions;
public String getContentItemClass() {

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
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() {

View File

@ -1,22 +1,54 @@
/*
* 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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
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);
@ -58,5 +90,4 @@ public class Duration {
return days * 24 * 60 + hours * 60 + minutes;
}
}

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
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() {

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
* @param <T>
* @param <P>
* @param <T> The subtype of folder tree node.
* @param <P> The type of the permissions model to use.
*/
public class FolderTreeNode<T extends FolderTreeNode, P extends PermissionsModel> {
public class FolderTreeNode<T extends FolderTreeNode<T, P>, 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<T> 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() {

View File

@ -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.AssetPrivileges;
import javax.enterprise.context.Dependent;
/**
* Implementation of {@link AbstractGrantedPrivileges} for {@link Asset}s.
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
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() {

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@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

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
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() {

View File

@ -1,11 +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;
/**
* Used as super interface for {@link AssetPermissionsModel} and
* {@link DocumentPermissionsModel} so that both can be used in the same place.
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
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() {

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
public class PrivilegesGrantedToRoleModel {
/**
* The name of the role.
*/
private String grantee;
/**
* The privileges granted to the role.
*/
private List<GrantedPrivilegeModel> grantedPrivileges;
public String getGrantee() {

View File

@ -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;

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
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() {

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
public class RoleMembershipModel {
/**
* The name of the member.
*/
private String memberName;
/**
* The UUID of the member.
*/
private String memberUuid;
public String getMemberName() {

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
public class RoleSectionPermissionModel {
/**
* The privilege.
*/
private String privilege;
/**
* If the privilege granted?
*/
private boolean granted;
public String getPrivilege() {

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@ -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<String, String> label;
/**
* The locales for which no localized label has been defined yet.
*/
private List<String> unusedLabelLocales;
/**
* The localized descriptions of the lifecycle definition.
*/
private Map<String, String> description;
private List<PhaseDefinitionModel> phaseDefinitions;
/**
* The locales for which no localized description has been defined yet.
*/
private List<String> unusedDescriptionLocales;
/**
* The {@link PhaseDefinition}s of the {@link LifecycleDefinition}.
*/
private List<PhaseDefinitionModel> phaseDefinitions;
public Map<String, String> getLabel() {
return Collections.unmodifiableMap(label);
}

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@ -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<String, String> 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<String> unusedLabelLocales;
/**
* The localized descriptions of the phase definition.
*/
private Map<String, String> description;
/**
* Locales for which no localized description has been defined yet.
*/
private List<String> 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,7 +138,8 @@ public class SelectedPhaseDefinitionModel {
public void setUnusedDescriptionLocales(
final List<String> unusedDescriptionLocales
) {
this.unusedDescriptionLocales = new ArrayList<>(unusedDescriptionLocales);
this.unusedDescriptionLocales
= new ArrayList<>(unusedDescriptionLocales);
}
public boolean getHasUnusedLabelLocales() {
@ -112,5 +158,4 @@ public class SelectedPhaseDefinitionModel {
this.displayLabel = displayLabel;
}
}

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@ -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<String, String> description;
/**
* Locales for which not localized description has been defined yet.
*/
private List<String> unusedDescriptionLocales;
/**
* The members of the role.
*/
private List<RoleMembershipModel> 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<RolePartyFormEntry> 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());

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@ -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<String, String> label;
/**
* The locales for which no localized label has been defined yet.
*/
private List<String> unusedLabelLocales;
/**
* The localized descriptions of the task.
*/
private Map<String, String> description;
/**
* The locales for which no localized description has been defined yet.
*/
private List<String> unusedDescriptionLocales;
/**
* Tasks that block the selected task.
*/
private List<WorkflowTaskTemplateListModel> blockedTasks;
/**
* Task that are blocked by the selected tak.
*/
private List<WorkflowTaskTemplateListModel> blockingTasks;
/**
* Ohter that don't block the selected task.
*/
private Map<String, String> noneBlockingTasks;
public long getTaskId() {

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@ -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<String, String> name;
/**
* Locales for which no title value has been definied yet.
*/
private List<String> unusedNameLocales;
/**
* The localized descriptions of the selected workflow template.
*/
private Map<String, String> description;
/**
* The locales for which no localized description has definied yet.
*/
private List<String> unusedDescriptionLocales;
/**
* The tasks of the selected workflow template.
*/
private List<WorkflowTaskTemplateListModel> tasks;
public long getWorkflowId() {
@ -113,5 +157,4 @@ public class SelectedWorkflowTemplateModel {
this.displayName = displayName;
}
}

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@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

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
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() {
@ -67,6 +97,4 @@ public class WorkflowTaskTemplateListModel {
this.hasDependencies = hasDependencies;
}
}

View File

@ -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 <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
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() {

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

Some files were not shown because too many files have changed in this diff Show More