Skip to content

Commit

Permalink
Doc. Scripting: SSE technology is now configurable (seems not to work…
Browse files Browse the repository at this point in the history
… in all environment / firewalls?)
  • Loading branch information
kreinhard committed Dec 30, 2024
1 parent bca678f commit 6bc35ee
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 18 deletions.
15 changes: 1 addition & 14 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,14 +1 @@
Release 7.0

* REST API for full CRUD functionality for all entities implemented.
* Docker support
* Data transfer tool
* Easy installation (docker, setup wizard (console and GUI), ...)
* JCR support (attachments for contracts)
* Forecasts (Excel exports)
* Update frontend component (React introduced).
* Kotlin as development language introduced.
* Update backend REST Api.
* Some minor changes after/within frontend refactoring .
* Graphical and text base installer for first start-up.
* Java 8 and Java9+ support (tested also with OpenJDK 11).
Please visit https://projectforge.org/changelog-posts/
2 changes: 2 additions & 0 deletions ToDo.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Aktuell:
- Scripting: Ergebnis Unresolved reference 'memo', 'todo'.: line 94 to 94 (add only activated plugins)

- Groovy-scripts: remove or fix.
- AG-Grid: setColumnStates wird nicht in den UserPrefs gespeichert.
- Wicket: Auftragsbuch: org.apache.wicket.core.request.mapper.StalePageException: A request to page '[Page class = org.projectforge.web.fibu.AuftragEditPage, id = 9, render count = 3]' has been made with stale 'renderCount'. The page will be re-rendered.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ spring.servlet.multipart.max-request-size=110MB
projectforge.max-file-size.datev=3MB
projectforge.max-file-size.xml-dump-import=10MB
projectforge.address.maxImageSize=5MB
# Server-Sent Events (SSE) enabled? If not, pull requests will be used.
projectforge.rest.sseEnabled=true
# password to encrypt the links which are sent by email for event invitations, max 32 characters
pf.config.security.teamCalCryptPassword=enter-a-password-here
# This should be a randomized key for hashing all passwords in addition to salt.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/////////////////////////////////////////////////////////////////////////////
//
// Project ProjectForge Community Edition
// www.projectforge.org
//
// Copyright (C) 2001-2024 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.config

import jakarta.annotation.PostConstruct
import mu.KotlinLogging
import org.springframework.beans.factory.annotation.Value
import org.springframework.stereotype.Service

private val log = KotlinLogging.logger {}

@Service
open class RestConfiguration {
/**
* Server-Sent Events (SSE) enabled? If not, pull requests will be used.
*/
@Value("\${projectforge.rest.sseEnabled:true}")
open var sseEnabled: Boolean? = true
protected set

@PostConstruct
private fun postConstruct() {
log.info { "SSE enabled: $sseEnabled" }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import org.projectforge.common.DateFormatType
import org.projectforge.common.logging.LogLevel
import org.projectforge.framework.i18n.translate
import org.projectforge.framework.time.PFDateTime
import org.projectforge.rest.config.RestConfiguration
import org.projectforge.rest.config.RestUtils
import org.projectforge.rest.core.*
import org.projectforge.rest.dto.PostData
Expand All @@ -57,6 +58,9 @@ abstract class AbstractScriptExecutePageRest : AbstractDynamicPageRest() {

protected lateinit var scriptDao: AbstractScriptDao

@Autowired
private lateinit var restConfiguration: RestConfiguration

@Autowired
protected lateinit var scriptExecution: ScriptExecution

Expand Down Expand Up @@ -151,13 +155,20 @@ abstract class AbstractScriptExecutePageRest : AbstractDynamicPageRest() {
)
}

val method = if (restConfiguration.sseEnabled == true) UITable.RefreshMethod.SSE else UITable.RefreshMethod.GET
val refreshUrl = if (method == UITable.RefreshMethod.GET) {
"refresh/${script.id}"
} else {
"logs/${script.id}"
}

layout.add(
UIRow().add(
UITable(
"logging",
refreshUrl = RestResolver.getRestUrl(this::class.java, "logs/${script.id}"),
refreshIntervalSeconds = 1,
refreshMethod = UITable.RefreshMethod.SSE,
refreshUrl = RestResolver.getRestUrl(this::class.java, refreshUrl),
refreshIntervalSeconds = 2,
refreshMethod = method,
).also {
it.add(UITableColumn("timestamp", title = "time", sortable = false))
it.add(UITableColumn("level", sortable = false))
Expand Down
7 changes: 6 additions & 1 deletion site/_includes/download-link.html
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
<p>You can download the latest binaries from <a href="https://sourceforge.net/projects/pforge/files/ProjectForge/">Sourceforge</a> or <a href="https://hub.docker.com/r/micromata/projectforge">Docker Hub</a>.
<p>
You can download the latest binaries from
<a href="https://github.com/micromata/projectforge/releases">GitHub</a>,
<a href="https://sourceforge.net/projects/pforge/files/ProjectForge/">Sourceforge</a>,
or <a href="https://hub.docker.com/r/micromata/projectforge">Docker Hub</a>.
</p>

0 comments on commit 6bc35ee

Please sign in to comment.