-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Book: attachments are now supported.
- Loading branch information
Showing
7 changed files
with
200 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...ss/src/main/resources/flyway/migrate/common/V7.5.1.3__7.5.1.3-RELEASE-BookAttachments.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
-- Attachment support for books. | ||
|
||
ALTER TABLE t_book ADD COLUMN attachments_names CHARACTER VARYING(10000); | ||
ALTER TABLE t_book ADD COLUMN attachments_ids CHARACTER VARYING(10000); | ||
ALTER TABLE t_book ADD COLUMN attachments_counter SMALLINT; | ||
ALTER TABLE t_book ADD COLUMN attachments_size BIGINT; | ||
ALTER TABLE t_book ADD COLUMN attachments_last_user_action CHARACTER VARYING(10000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
projectforge-rest/src/main/kotlin/org/projectforge/rest/dto/Book.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
///////////////////////////////////////////////////////////////////////////// | ||
// | ||
// Project ProjectForge Community Edition | ||
// www.projectforge.org | ||
// | ||
// Copyright (C) 2001-2023 Micromata GmbH, Germany (www.micromata.com) | ||
// | ||
// ProjectForge is dual-licensed. | ||
// | ||
// This community edition is free software; you can redistribute it and/or | ||
// modify it under the terms of the GNU General Public License as published | ||
// by the Free Software Foundation; version 3 of the License. | ||
// | ||
// This community edition 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 General | ||
// Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License along | ||
// with this program; if not, see http://www.gnu.org/licenses/. | ||
// | ||
///////////////////////////////////////////////////////////////////////////// | ||
|
||
package org.projectforge.rest.dto | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty | ||
import org.projectforge.business.book.BookDO | ||
import org.projectforge.business.book.BookStatus | ||
import org.projectforge.business.book.BookType | ||
import org.projectforge.framework.i18n.translate | ||
import org.projectforge.framework.jcr.Attachment | ||
import java.time.LocalDate | ||
|
||
class Book( | ||
id: Int? = null, | ||
var title: String? = null, | ||
var keywords: String? = null, | ||
var lendOutBy: User? = null, | ||
var lendOutDate: LocalDate? = null, | ||
var lendOutComment: String? = null, | ||
var isbn: String? = null, | ||
var signature: String? = null, | ||
var publisher: String? = null, | ||
var editor: String? = null, | ||
var yearOfPublishing: String? = null, | ||
var authors: String? = null, | ||
var abstractText: String? = null, | ||
var comment: String? = null, | ||
var status: BookStatus? = null, | ||
var type: BookType? = null, | ||
override var attachmentsCounter: Int? = null, | ||
override var attachmentsSize: Long? = null, | ||
override var attachments: List<Attachment>? = null | ||
) : BaseDTO<BookDO>(id), AttachmentsSupport { | ||
@get:JsonProperty | ||
val statusAsString: String? | ||
get() { | ||
status?.let { return translate(it.i18nKey) } | ||
return null | ||
} | ||
|
||
@get:JsonProperty | ||
val typeAsString: String? | ||
get() { | ||
type?.let { return translate(it.i18nKey) } | ||
return null | ||
} | ||
} |
Oops, something went wrong.