├── jpro-mail ├── src │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── javamail.default.address.map │ │ └── java │ │ ├── module-info.java │ │ └── one │ │ └── jpro │ │ └── platform │ │ └── mail │ │ ├── StartTLSOption.java │ │ ├── config │ │ ├── GoogleMailConfig.java │ │ └── MailTrapConfig.java │ │ ├── impl │ │ └── MailClientImpl.java │ │ ├── MailException.java │ │ └── MailClient.java ├── example │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ └── one │ │ │ │ └── jpro │ │ │ │ └── platform │ │ │ │ └── mail │ │ │ │ └── example │ │ │ │ └── compose │ │ │ │ ├── img │ │ │ │ └── jpro-navy-orange-logo.png │ │ │ │ └── css │ │ │ │ └── compose-mail.css │ │ │ └── java │ │ │ └── module-info.java │ └── build.gradle └── build.gradle ├── .gitignore ├── deleteCache.sh ├── jpro-routing ├── core-test │ └── src │ │ └── test │ │ ├── resources │ │ └── testfiles │ │ │ ├── size-tester-test-css.css │ │ │ └── test.jpg │ │ └── scala │ │ └── one │ │ └── jpro │ │ └── platform │ │ └── routing │ │ ├── TestLinkUtil.scala │ │ ├── TestRouteApp.scala │ │ └── crawl │ │ └── TestSitemapGenerator.scala ├── core │ └── src │ │ └── main │ │ ├── scala │ │ └── one │ │ │ └── jpro │ │ │ └── platform │ │ │ └── routing │ │ │ ├── ResponseResult.scala │ │ │ ├── HistoryEntry.scala │ │ │ ├── Redirect.scala │ │ │ ├── NodeView.scala │ │ │ ├── SessionManagerContext.scala │ │ │ ├── Filter.scala │ │ │ ├── filter │ │ │ └── container │ │ │ │ ├── ContainerFactory.scala │ │ │ │ ├── Container.scala │ │ │ │ └── ContainerVBox.scala │ │ │ ├── sessionmanager │ │ │ └── SessionManagerDummy.scala │ │ │ ├── Response.scala │ │ │ ├── RouteNode.scala │ │ │ ├── server │ │ │ └── RouteHTTP.scala │ │ │ ├── RouteApp.scala │ │ │ └── View.scala │ │ ├── java │ │ ├── one │ │ │ └── jpro │ │ │ │ └── platform │ │ │ │ └── routing │ │ │ │ ├── filter │ │ │ │ └── container │ │ │ │ │ └── IgnoreMe.java │ │ │ │ ├── extensions │ │ │ │ └── linkheader │ │ │ │ │ └── IgnoreMe.java │ │ │ │ ├── IgnoreMe.java │ │ │ │ ├── crawl │ │ │ │ └── IgnoreMe.java │ │ │ │ ├── server │ │ │ │ └── IgnoreMe.java │ │ │ │ ├── performance │ │ │ │ └── IgnoreMe.java │ │ │ │ └── sessionmanager │ │ │ │ └── IgnoreMe.java │ │ └── module-info.java │ │ └── resources │ │ └── one │ │ └── jpro │ │ └── platform │ │ └── routing │ │ └── extensions │ │ └── linkheader │ │ └── css │ │ └── linkheader.css ├── example │ └── src │ │ └── main │ │ ├── resources │ │ ├── images │ │ │ └── img1.jpg │ │ ├── test.css │ │ ├── logback.xml │ │ ├── jpro │ │ │ └── html │ │ │ │ ├── defaultpage │ │ │ │ └── index.html │ │ └── example │ │ │ └── filters │ │ │ └── SimpleHamburgerMenu.css │ │ ├── java │ │ ├── example │ │ │ └── scala │ │ │ │ └── Dummy.java │ │ └── module-info.java │ │ └── scala │ │ └── example │ │ └── scala │ │ ├── TestWebApplicationHTTP.scala │ │ └── TestExtensions.scala ├── dev │ └── src │ │ └── main │ │ ├── java │ │ ├── one │ │ │ └── jpro │ │ │ │ └── platform │ │ │ │ └── routing │ │ │ │ └── dev │ │ │ │ └── IgnoreMe.java │ │ └── module-info.java │ │ ├── resources │ │ └── one │ │ │ └── jpro │ │ │ └── platform │ │ │ └── routing │ │ │ └── dev │ │ │ ├── devfilter.css │ │ │ └── statisticsfilter.css │ │ └── scala │ │ └── one │ │ └── jpro │ │ └── platform │ │ └── routing │ │ └── dev │ │ └── NodesHelper.scala └── popup │ ├── src │ └── main │ │ ├── java │ │ └── module-info.java │ │ └── resources │ │ └── one │ │ └── jpro │ │ └── platform │ │ └── routing │ │ └── popup │ │ └── simplepopup │ │ └── simplepopup.css │ └── build.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── jpro-image-manager ├── src │ ├── test │ │ ├── resources │ │ │ ├── logo.png │ │ │ └── testImage.png │ │ └── java │ │ │ └── one │ │ │ └── jpro │ │ │ └── platform │ │ │ └── image │ │ │ └── manager │ │ │ ├── transformer │ │ │ ├── ImageTransformerFitWidthTest.java │ │ │ ├── ImageTransformerScaleToAreaTest.java │ │ │ ├── ImageTransformerWHTest.java │ │ │ └── ImageTransformerFitHeightTest.java │ │ │ ├── ImageResultTest.java │ │ │ ├── encoder │ │ │ └── ImageEncoderPNGTest.java │ │ │ ├── ImageDefinitionTest.java │ │ │ └── source │ │ │ ├── ImageSourceFileTest.java │ │ │ └── ImageSourceURLTest.java │ └── main │ │ └── java │ │ ├── module-info.java │ │ └── one │ │ └── jpro │ │ └── platform │ │ └── image │ │ └── manager │ │ ├── JsonConvertible.java │ │ ├── transformer │ │ ├── ImageTransformer.java │ │ ├── ImageTransformerHelpers.java │ │ └── ImageTransformerIdentity.java │ │ ├── encoder │ │ ├── ImageEncoderException.java │ │ └── ImageEncoder.java │ │ ├── source │ │ ├── ImageSourceException.java │ │ └── ImageSource.java │ │ └── ImageUtils.java └── build.gradle ├── example ├── src │ └── main │ │ ├── resources │ │ ├── jpro │ │ │ └── html │ │ │ │ ├── favicon.png │ │ │ │ └── defaultpage │ │ └── one │ │ │ └── jpro │ │ │ └── platform │ │ │ └── example │ │ │ └── media │ │ │ └── css │ │ │ ├── main.css │ │ │ └── media_sample.css │ │ └── java │ │ └── module-info.java └── build.gradle ├── ensemble ├── samples │ ├── src │ │ └── main │ │ │ └── resources │ │ │ ├── MediaPlayerSample.png │ │ │ └── ensemble-samples.json │ └── build.gradle └── site │ └── build.gradle ├── jpro-auth ├── example │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ ├── images │ │ │ │ ├── Google_Logo.png │ │ │ │ ├── Keycloak_Logo.png │ │ │ │ └── Microsoft_Logo.png │ │ │ ├── logback.xml │ │ │ └── jpro │ │ │ │ └── html │ │ │ │ ├── defaultpage │ │ │ │ └── index.html │ │ │ └── java │ │ │ ├── one │ │ │ └── jpro │ │ │ │ └── platform │ │ │ │ └── auth │ │ │ │ └── example │ │ │ │ ├── basic │ │ │ │ └── page │ │ │ │ │ ├── Page.java │ │ │ │ │ ├── LoginPage.java │ │ │ │ │ ├── ErrorPage.java │ │ │ │ │ └── SignedInPage.java │ │ │ │ ├── login │ │ │ │ └── page │ │ │ │ │ ├── Page.java │ │ │ │ │ ├── ErrorPage.java │ │ │ │ │ └── LoginPage.java │ │ │ │ └── oauth │ │ │ │ └── page │ │ │ │ ├── Page.java │ │ │ │ ├── AuthInfoPage.java │ │ │ │ ├── UserInfoPage.java │ │ │ │ ├── RefreshTokenPage.java │ │ │ │ ├── IntrospectionTokenPage.java │ │ │ │ └── AuthProviderDiscoveryPage.java │ │ │ └── module-info.java │ └── build.gradle ├── core │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ └── one │ │ │ │ │ └── jpro │ │ │ │ │ └── platform │ │ │ │ │ └── auth │ │ │ │ │ └── core │ │ │ │ │ ├── basic │ │ │ │ │ └── login-pane.properties │ │ │ │ │ ├── http │ │ │ │ │ └── default-response.html │ │ │ │ │ └── crypto │ │ │ │ │ └── notice.txt │ │ │ └── java │ │ │ │ ├── one │ │ │ │ └── jpro │ │ │ │ │ └── platform │ │ │ │ │ └── auth │ │ │ │ │ └── core │ │ │ │ │ ├── http │ │ │ │ │ └── impl │ │ │ │ │ │ ├── Header.java │ │ │ │ │ │ ├── Cancellable.java │ │ │ │ │ │ ├── Clock.java │ │ │ │ │ │ ├── Handler.java │ │ │ │ │ │ ├── ByteMerger.java │ │ │ │ │ │ └── Request.java │ │ │ │ │ ├── authentication │ │ │ │ │ ├── Options.java │ │ │ │ │ ├── AuthenticationProvider.java │ │ │ │ │ ├── CredentialValidationException.java │ │ │ │ │ └── Credentials.java │ │ │ │ │ ├── jwt │ │ │ │ │ └── TokenExpiredException.java │ │ │ │ │ ├── oauth2 │ │ │ │ │ └── OAuth2Flow.java │ │ │ │ │ ├── api │ │ │ │ │ ├── FluentGoogleAuth.java │ │ │ │ │ ├── FluentGoogleAuthAPI.java │ │ │ │ │ ├── FluentMicrosoftAuth.java │ │ │ │ │ ├── FluentBasicAuth.java │ │ │ │ │ ├── FluentMicrosoftAuthAPI.java │ │ │ │ │ └── FluentBasicAuthAPI.java │ │ │ │ │ ├── AuthAPI.java │ │ │ │ │ └── basic │ │ │ │ │ └── UserNotFoundException.java │ │ │ │ └── module-info.java │ │ └── test │ │ │ └── java │ │ │ └── one │ │ │ └── jpro │ │ │ └── platform │ │ │ └── auth │ │ │ └── core │ │ │ ├── http │ │ │ ├── TestHttpServer.java │ │ │ └── HttpStatusTests.java │ │ │ └── oauth2 │ │ │ └── OAuth2FlowTests.java │ └── build.gradle └── routing │ ├── src │ └── main │ │ ├── resources │ │ └── one │ │ │ └── jpro │ │ │ └── platform │ │ │ └── auth │ │ │ └── routing │ │ │ └── buttons │ │ │ └── google │ │ │ ├── web_dark_sq_SI@2x.png │ │ │ ├── web_light_sq_SI@2x.png │ │ │ └── web_neutral_sq_SI@2x.png │ │ └── java │ │ ├── module-info.java │ │ └── one │ │ └── jpro │ │ └── platform │ │ └── auth │ │ └── routing │ │ ├── AuthUIProvider.java │ │ ├── buttons │ │ └── GoogleLoginButton.java │ │ └── AuthRestrictionFilter.java │ └── build.gradle ├── jpro-scenegraph ├── src │ └── main │ │ └── java │ │ └── module-info.java └── build.gradle ├── jpro-webrtc ├── src │ └── main │ │ └── java │ │ ├── module-info.java │ │ └── one │ │ └── jpro │ │ └── platform │ │ └── webrtc │ │ ├── MediaStream.java │ │ └── VideoFrame.java ├── example │ ├── src │ │ └── main │ │ │ ├── java │ │ │ ├── module-info.java │ │ │ └── one │ │ │ │ └── jpro │ │ │ │ └── platform │ │ │ │ └── webrtc │ │ │ │ └── example │ │ │ │ └── videoroom │ │ │ │ ├── page │ │ │ │ └── OverviewPage.java │ │ │ │ └── VideoRoomApp.java │ │ │ └── resources │ │ │ ├── jpro │ │ │ └── html │ │ │ │ └── defaultpage │ │ │ └── one │ │ │ └── jpro │ │ │ └── platform │ │ │ └── webrtc │ │ │ └── example │ │ │ └── videoroom │ │ │ └── videoroom.css │ └── build.gradle └── build.gradle ├── deleteCache.bat ├── jpro-media ├── src │ ├── main │ │ └── java │ │ │ ├── one │ │ │ └── jpro │ │ │ │ └── platform │ │ │ │ └── media │ │ │ │ ├── util │ │ │ │ └── package-info.java │ │ │ │ ├── event │ │ │ │ └── package-info.java │ │ │ │ ├── MediaEngine.java │ │ │ │ ├── WebMediaEngine.java │ │ │ │ ├── player │ │ │ │ ├── impl │ │ │ │ │ └── WebMediaPlayerView.java │ │ │ │ └── MediaPlayerException.java │ │ │ │ └── recorder │ │ │ │ └── impl │ │ │ │ └── WebMediaRecorderView.java │ │ │ └── module-info.java │ └── test │ │ ├── resources │ │ └── logback.xml │ │ └── java │ │ └── module-info.java └── example │ ├── src │ └── main │ │ ├── resources │ │ └── one │ │ │ └── jpro │ │ │ └── platform │ │ │ └── media │ │ │ └── example │ │ │ └── css │ │ │ ├── main.css │ │ │ └── media_sample.css │ │ └── java │ │ └── module-info.java │ └── build.gradle ├── jpro-youtube ├── src │ └── main │ │ └── java │ │ └── module-info.java ├── example │ ├── src │ │ └── main │ │ │ └── java │ │ │ ├── module-info.java │ │ │ └── one │ │ │ └── jpro │ │ │ └── platform │ │ │ └── youtube │ │ │ └── example │ │ │ └── YoutubeExample.java │ └── build.gradle └── build.gradle ├── deleteCache.ps1 ├── jpro-utils ├── example │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── module-info.java │ └── build.gradle ├── src │ ├── main │ │ └── java │ │ │ └── module-info.java │ └── test │ │ └── java │ │ ├── module-info.java │ │ └── one │ │ └── jpro │ │ └── platform │ │ └── utils │ │ └── test │ │ └── FreezeDetectorTests.java └── build.gradle ├── jpro-html-scrollpane ├── src │ └── main │ │ └── java │ │ └── module-info.java ├── example │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── module-info.java │ └── build.gradle └── build.gradle ├── jpro-session ├── src │ └── main │ │ └── java │ │ ├── module-info.java │ │ └── one │ │ └── jpro │ │ └── platform │ │ └── session │ │ └── SessionException.java ├── example │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── module-info.java │ └── build.gradle └── build.gradle ├── jpro-sipjs ├── src │ └── main │ │ └── java │ │ ├── module-info.java │ │ └── one │ │ └── jpro │ │ └── platform │ │ └── sipjs │ │ ├── api │ │ ├── session │ │ │ ├── Inviter.java │ │ │ └── Invitation.java │ │ └── options │ │ │ ├── MediaStreamConstraints.java │ │ │ └── SessionDescriptionHandlerOptions.java │ │ └── SipJSUtil.java ├── example │ ├── src │ │ └── main │ │ │ ├── java │ │ │ ├── module-info.java │ │ │ └── one │ │ │ │ └── jpro │ │ │ │ └── platform │ │ │ │ └── sipjs │ │ │ │ └── example │ │ │ │ ├── Variables.java │ │ │ │ ├── SIPJSApp.java │ │ │ │ └── page │ │ │ │ ├── BobPage.java │ │ │ │ ├── AlicePage.java │ │ │ │ ├── AliceAndBobPage.java │ │ │ │ └── SelectPage.java │ │ │ └── resources │ │ │ └── jpro │ │ │ └── html │ │ │ └── defaultpage │ └── build.gradle └── build.gradle ├── jpro-file ├── example │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ └── one │ │ │ │ └── jpro │ │ │ │ └── platform │ │ │ │ └── file │ │ │ │ └── example │ │ │ │ └── css │ │ │ │ ├── file_uploader.css │ │ │ │ └── text_editor.css │ │ │ └── java │ │ │ ├── module-info.java │ │ │ └── one │ │ │ └── jpro │ │ │ └── platform │ │ │ └── file │ │ │ └── example │ │ │ └── upload │ │ │ ├── FileSizeTableCell.java │ │ │ └── UploadIndicatorTableCell.java │ └── build.gradle ├── src │ └── main │ │ └── java │ │ ├── module-info.java │ │ └── one │ │ └── jpro │ │ └── platform │ │ └── file │ │ ├── picker │ │ └── FileOpenPicker.java │ │ ├── WebFileSource.java │ │ └── event │ │ └── FileEvent.java └── build.gradle ├── jpro-mdfx ├── example │ ├── src │ │ └── main │ │ │ ├── java │ │ │ └── module-info.java │ │ │ └── resources │ │ │ └── one │ │ │ └── jpro │ │ │ └── platform │ │ │ └── mdfx │ │ │ └── example │ │ │ └── mdfx-sample.css │ └── build.gradle ├── src │ └── main │ │ ├── resources │ │ └── one │ │ │ └── jpro │ │ │ └── platform │ │ │ └── mdfx │ │ │ └── mdfx-default.css │ │ └── java │ │ ├── module-info.java │ │ └── one │ │ └── jpro │ │ └── platform │ │ └── mdfx │ │ └── extensions │ │ ├── YoutubeExtension.java │ │ └── ImageExtension.java ├── build.gradle └── README.md ├── .github └── workflows │ ├── add-issues-to-project.yml │ └── release.yml ├── settings.gradle └── gradle.properties /jpro-mail/src/main/resources/META-INF/javamail.default.address.map: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .history 3 | .gradle 4 | bin/ 5 | build/ 6 | example/logs/ 7 | .DS_Store -------------------------------------------------------------------------------- /deleteCache.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | find ~/.m2 ~/.gradle | grep one.jpro.platform | xargs rm -r -------------------------------------------------------------------------------- /jpro-routing/core-test/src/test/resources/testfiles/size-tester-test-css.css: -------------------------------------------------------------------------------- 1 | .min-100 { 2 | -fx-min-width: 100; 3 | } -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPro-one/JPro-Platform/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /jpro-routing/core/src/main/scala/one/jpro/platform/routing/ResponseResult.scala: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.routing 2 | 3 | trait ResponseResult 4 | -------------------------------------------------------------------------------- /jpro-image-manager/src/test/resources/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPro-one/JPro-Platform/HEAD/jpro-image-manager/src/test/resources/logo.png -------------------------------------------------------------------------------- /example/src/main/resources/jpro/html/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPro-one/JPro-Platform/HEAD/example/src/main/resources/jpro/html/favicon.png -------------------------------------------------------------------------------- /jpro-image-manager/src/test/resources/testImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPro-one/JPro-Platform/HEAD/jpro-image-manager/src/test/resources/testImage.png -------------------------------------------------------------------------------- /jpro-routing/example/src/main/resources/images/img1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPro-one/JPro-Platform/HEAD/jpro-routing/example/src/main/resources/images/img1.jpg -------------------------------------------------------------------------------- /ensemble/samples/src/main/resources/MediaPlayerSample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPro-one/JPro-Platform/HEAD/ensemble/samples/src/main/resources/MediaPlayerSample.png -------------------------------------------------------------------------------- /jpro-auth/example/src/main/resources/images/Google_Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPro-one/JPro-Platform/HEAD/jpro-auth/example/src/main/resources/images/Google_Logo.png -------------------------------------------------------------------------------- /jpro-routing/core-test/src/test/resources/testfiles/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPro-one/JPro-Platform/HEAD/jpro-routing/core-test/src/test/resources/testfiles/test.jpg -------------------------------------------------------------------------------- /jpro-routing/core/src/main/scala/one/jpro/platform/routing/HistoryEntry.scala: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.routing 2 | 3 | case class HistoryEntry(path: String, title: String) 4 | -------------------------------------------------------------------------------- /jpro-routing/core/src/main/scala/one/jpro/platform/routing/Redirect.scala: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.routing 2 | 3 | case class Redirect(to: String) extends ResponseResult 4 | -------------------------------------------------------------------------------- /jpro-scenegraph/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | module jpro.platform.jpro.scenegraph { 2 | requires javafx.graphics; 3 | 4 | exports one.jpro.platform.scenegraph; 5 | } -------------------------------------------------------------------------------- /jpro-auth/example/src/main/resources/images/Keycloak_Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPro-one/JPro-Platform/HEAD/jpro-auth/example/src/main/resources/images/Keycloak_Logo.png -------------------------------------------------------------------------------- /jpro-auth/example/src/main/resources/images/Microsoft_Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPro-one/JPro-Platform/HEAD/jpro-auth/example/src/main/resources/images/Microsoft_Logo.png -------------------------------------------------------------------------------- /jpro-routing/core/src/main/java/one/jpro/platform/routing/filter/container/IgnoreMe.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.routing.filter.container; 2 | 3 | public class IgnoreMe { 4 | } 5 | -------------------------------------------------------------------------------- /jpro-routing/example/src/main/java/example/scala/Dummy.java: -------------------------------------------------------------------------------- 1 | package example.scala; 2 | 3 | public class Dummy { 4 | // Workaround for the module system to work with Scala 5 | } 6 | -------------------------------------------------------------------------------- /jpro-routing/core/src/main/java/one/jpro/platform/routing/extensions/linkheader/IgnoreMe.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.routing.extensions.linkheader; 2 | 3 | public class IgnoreMe { 4 | } 5 | -------------------------------------------------------------------------------- /jpro-webrtc/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | module one.jpro.platform.webrtc { 2 | requires javafx.controls; 3 | requires jpro.webapi; 4 | 5 | exports one.jpro.platform.webrtc; 6 | } -------------------------------------------------------------------------------- /deleteCache.bat: -------------------------------------------------------------------------------- 1 | CHCP 65001 2 | @echo off 3 | setLocal 4 | 5 | SET DIR=%~dp0 6 | cd /D "%DIR%" 7 | 8 | powershell.exe -NoProfile -ExecutionPolicy Bypass -File deleteCache.ps1 %* 9 | 10 | endLocal -------------------------------------------------------------------------------- /jpro-auth/core/src/main/resources/one/jpro/platform/auth/core/basic/login-pane.properties: -------------------------------------------------------------------------------- 1 | label.header=Basic Login Form 2 | label.username=Username : 3 | label.password=Password : 4 | button.submit=Sign In -------------------------------------------------------------------------------- /jpro-media/src/main/java/one/jpro/platform/media/util/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Utility classes for the media module. 3 | * 4 | * @author Besmir Beqiri 5 | */ 6 | package one.jpro.platform.media.util; -------------------------------------------------------------------------------- /jpro-youtube/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | module one.jpro.platform.youtube { 2 | 3 | requires jpro.webapi; 4 | requires javafx.graphics; 5 | requires javafx.web; 6 | exports one.jpro.platform.youtube; 7 | } -------------------------------------------------------------------------------- /jpro-routing/core/src/main/java/one/jpro/platform/routing/IgnoreMe.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.routing; 2 | 3 | /** 4 | * I only exist to allow the creation of a module-info.java file. 5 | */ 6 | public class IgnoreMe { 7 | } 8 | -------------------------------------------------------------------------------- /jpro-routing/dev/src/main/java/one/jpro/platform/routing/dev/IgnoreMe.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.routing.dev; 2 | 3 | /** 4 | * I only exist to allow the creation of a module-info.java file. 5 | */ 6 | public class IgnoreMe { 7 | } 8 | -------------------------------------------------------------------------------- /deleteCache.ps1: -------------------------------------------------------------------------------- 1 | Get-ChildItem -Path $env:USERPROFILE\.m2, $env:USERPROFILE\.gradle -Recurse | 2 | Where-Object { $_.FullName -match 'one.jpro.platform' } | 3 | ForEach-Object { Remove-Item -Path $_.FullName -Recurse -Force } 4 | -------------------------------------------------------------------------------- /jpro-routing/core/src/main/java/one/jpro/platform/routing/crawl/IgnoreMe.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.routing.crawl; 2 | 3 | /** 4 | * I only exist to allow the creation of a module-info.java file. 5 | */ 6 | public class IgnoreMe { 7 | } 8 | -------------------------------------------------------------------------------- /jpro-routing/core/src/main/java/one/jpro/platform/routing/server/IgnoreMe.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.routing.server; 2 | 3 | /** 4 | * I only exist to allow the creation of a module-info.java file. 5 | */ 6 | public class IgnoreMe { 7 | } 8 | -------------------------------------------------------------------------------- /jpro-utils/example/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | module one.jpro.platform.utils.example { 2 | requires one.jpro.platform.utils; 3 | requires jpro.webapi; 4 | requires javafx.controls; 5 | 6 | exports one.jpro.platform.utils.example; 7 | } -------------------------------------------------------------------------------- /jpro-routing/core/src/main/java/one/jpro/platform/routing/performance/IgnoreMe.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.routing.performance; 2 | 3 | /** 4 | * I only exist to allow the creation of a module-info.java file. 5 | */ 6 | public class IgnoreMe { 7 | } 8 | -------------------------------------------------------------------------------- /jpro-routing/core/src/main/scala/one/jpro/platform/routing/NodeView.scala: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.routing 2 | 3 | import simplefx.all._ 4 | 5 | trait NodeView extends View { this: Node => 6 | final override def content: NodeView with Node = this 7 | } 8 | -------------------------------------------------------------------------------- /jpro-youtube/example/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | module one.jpro.platform.youtube.example { 2 | requires one.jpro.platform.youtube; 3 | requires javafx.controls; 4 | requires jpro.webapi; 5 | 6 | exports one.jpro.platform.youtube.example; 7 | } -------------------------------------------------------------------------------- /jpro-auth/routing/src/main/resources/one/jpro/platform/auth/routing/buttons/google/web_dark_sq_SI@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPro-one/JPro-Platform/HEAD/jpro-auth/routing/src/main/resources/one/jpro/platform/auth/routing/buttons/google/web_dark_sq_SI@2x.png -------------------------------------------------------------------------------- /jpro-auth/routing/src/main/resources/one/jpro/platform/auth/routing/buttons/google/web_light_sq_SI@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPro-one/JPro-Platform/HEAD/jpro-auth/routing/src/main/resources/one/jpro/platform/auth/routing/buttons/google/web_light_sq_SI@2x.png -------------------------------------------------------------------------------- /jpro-mail/example/src/main/resources/one/jpro/platform/mail/example/compose/img/jpro-navy-orange-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPro-one/JPro-Platform/HEAD/jpro-mail/example/src/main/resources/one/jpro/platform/mail/example/compose/img/jpro-navy-orange-logo.png -------------------------------------------------------------------------------- /jpro-routing/core/src/main/java/one/jpro/platform/routing/sessionmanager/IgnoreMe.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.routing.sessionmanager; 2 | 3 | /** 4 | * I only exist to allow the creation of a module-info.java file. 5 | */ 6 | public class IgnoreMe { 7 | } 8 | -------------------------------------------------------------------------------- /jpro-auth/routing/src/main/resources/one/jpro/platform/auth/routing/buttons/google/web_neutral_sq_SI@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPro-one/JPro-Platform/HEAD/jpro-auth/routing/src/main/resources/one/jpro/platform/auth/routing/buttons/google/web_neutral_sq_SI@2x.png -------------------------------------------------------------------------------- /jpro-media/src/main/java/one/jpro/platform/media/event/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * {@link one.jpro.platform.media.player.MediaPlayer} and {@link one.jpro.platform.media.recorder.MediaRecorder} events. 3 | * 4 | * @author Besmir Beqiri 5 | */ 6 | package one.jpro.platform.media.event; -------------------------------------------------------------------------------- /jpro-routing/example/src/main/resources/test.css: -------------------------------------------------------------------------------- 1 | .header-link { 2 | -fx-background-radius: 5; 3 | -fx-insets: 4; 4 | -fx-font-size: 20; 5 | -fx-background-color: white; 6 | } 7 | 8 | .header-link:hover { 9 | -fx-font-size: 30; 10 | -fx-background-color: yellow; 11 | } -------------------------------------------------------------------------------- /jpro-routing/core/src/main/scala/one/jpro/platform/routing/SessionManagerContext.scala: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.routing 2 | 3 | import one.jpro.platform.routing.sessionmanager.SessionManager 4 | 5 | object SessionManagerContext extends de.sandec.jnodes.context.ContextManager[SessionManager] 6 | 7 | -------------------------------------------------------------------------------- /jpro-auth/core/src/main/java/one/jpro/platform/auth/core/http/impl/Header.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.core.http.impl; 2 | 3 | /** 4 | * HTTP header with the given name and value. 5 | * 6 | * @author Besmir Beqiri 7 | */ 8 | public record Header(String name, String value) { 9 | } 10 | -------------------------------------------------------------------------------- /jpro-html-scrollpane/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | module one.jpro.platform.htmlscrollpane { 2 | requires transitive one.jpro.platform.utils; 3 | requires jpro.webapi; 4 | requires one.jpro.jmemorybuddy; 5 | requires org.slf4j; 6 | 7 | exports one.jpro.platform.htmlscrollpane; 8 | } -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /jpro-routing/core/src/main/resources/one/jpro/platform/routing/extensions/linkheader/css/linkheader.css: -------------------------------------------------------------------------------- 1 | 2 | .linkheader-link-hbox { 3 | -fx-alignment: center; 4 | -fx-padding: 12px; 5 | -fx-spacing: 20px; 6 | } 7 | .linkheader-link { 8 | -fx-font-size: 24; 9 | } 10 | .linkheader-link.selected { 11 | -fx-underline: true; 12 | } -------------------------------------------------------------------------------- /jpro-routing/core/src/main/scala/one/jpro/platform/routing/Filter.scala: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.routing 2 | 3 | object Filter { 4 | def empty(): Filter = route => route 5 | } 6 | 7 | @FunctionalInterface 8 | trait Filter { 9 | def apply(route: Route): Route 10 | 11 | def compose(y: Filter): Filter = r => this.apply(y.apply(r)) 12 | } 13 | -------------------------------------------------------------------------------- /jpro-session/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Module descriptor for the Session module. 3 | * 4 | * @author Besmir Beqiri 5 | */ 6 | module one.jpro.platform.session { 7 | requires javafx.controls; 8 | requires jpro.webapi; 9 | requires org.slf4j; 10 | requires org.apache.commons.io; 11 | 12 | exports one.jpro.platform.session; 13 | } -------------------------------------------------------------------------------- /jpro-webrtc/example/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | module one.jpro.platform.webrtc.example { 2 | requires one.jpro.platform.webrtc; 3 | requires javafx.controls; 4 | requires jpro.webapi; 5 | requires one.jpro.platform.routing.core; 6 | 7 | exports one.jpro.platform.webrtc.example.simple; 8 | exports one.jpro.platform.webrtc.example.videoroom; 9 | } -------------------------------------------------------------------------------- /jpro-html-scrollpane/example/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Module descriptor for the example application. 3 | * 4 | * @author Besmir Beqiri 5 | */ 6 | module one.jpro.platform.htmlscrollpane.example { 7 | requires javafx.controls; 8 | requires one.jpro.platform.htmlscrollpane; 9 | 10 | exports one.jpro.platform.htmlscrollpane.example; 11 | } -------------------------------------------------------------------------------- /jpro-scenegraph/build.gradle: -------------------------------------------------------------------------------- 1 | publishing { 2 | publications { 3 | mavenJava(MavenPublication) { 4 | pom { 5 | name = 'JPro Scenegraph' 6 | description = 'A module that serializes a scene graph to a string representation making it both ' + 7 | 'human and AI friendly.' 8 | } 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /jpro-media/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /jpro-auth/example/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /jpro-media/src/main/java/one/jpro/platform/media/MediaEngine.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.media; 2 | 3 | import javafx.scene.media.MediaPlayer; 4 | import one.jpro.platform.media.recorder.MediaRecorder; 5 | 6 | /** 7 | * Media engine interface is the root type for both {@link MediaPlayer} and {@link MediaRecorder}. 8 | * 9 | * @author Besmir Beqiri 10 | */ 11 | public interface MediaEngine { 12 | } 13 | -------------------------------------------------------------------------------- /jpro-sipjs/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | module one.jpro.platform.sipjs { 2 | requires javafx.controls; 3 | requires jpro.webapi; 4 | requires org.json; 5 | requires one.jpro.platform.webrtc; 6 | 7 | exports one.jpro.platform.sipjs; 8 | exports one.jpro.platform.sipjs.api; 9 | exports one.jpro.platform.sipjs.api.session; 10 | exports one.jpro.platform.sipjs.api.options; 11 | } -------------------------------------------------------------------------------- /jpro-auth/routing/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Module descriptor for the Auth Routing module. 3 | * 4 | * @author Besmir Beqiri 5 | */ 6 | module one.jpro.platform.auth.routing { 7 | requires transitive one.jpro.platform.auth.core; 8 | requires transitive one.jpro.platform.routing.core; 9 | requires org.jetbrains.annotations; 10 | 11 | exports one.jpro.platform.auth.routing; 12 | } -------------------------------------------------------------------------------- /jpro-routing/example/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /jpro-utils/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The module descriptor for the JPro Utils module. 3 | * 4 | * @author Besmir Beqiri 5 | */ 6 | module one.jpro.platform.utils { 7 | requires transitive javafx.controls; 8 | requires org.jetbrains.annotations; 9 | requires org.slf4j; 10 | requires jpro.webapi; 11 | requires javafx.graphics; 12 | 13 | exports one.jpro.platform.utils; 14 | } -------------------------------------------------------------------------------- /jpro-sipjs/example/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | module one.jpro.platform.sipjs.example { 2 | requires one.jpro.platform.sipjs; 3 | requires javafx.controls; 4 | requires jpro.webapi; 5 | requires org.json; 6 | requires one.jpro.platform.routing.core; 7 | requires one.jpro.platform.webrtc; 8 | requires one.jpro.platform.routing.dev; 9 | 10 | exports one.jpro.platform.sipjs.example; 11 | } -------------------------------------------------------------------------------- /jpro-auth/core/src/main/java/one/jpro/platform/auth/core/http/impl/Cancellable.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.core.http.impl; 2 | 3 | /** 4 | * Task handle returned by {@link Scheduler} that facilitates task cancellation. 5 | * 6 | * @author Besmir Beqiri 7 | */ 8 | @FunctionalInterface 9 | interface Cancellable { 10 | 11 | /** 12 | * Cancel a scheduled task. 13 | */ 14 | void cancel(); 15 | } 16 | -------------------------------------------------------------------------------- /jpro-auth/core/src/main/java/one/jpro/platform/auth/core/http/impl/Clock.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.core.http.impl; 2 | 3 | /** 4 | * Simple clock abstraction that produces clock times suitable for calculating time deltas. 5 | * 6 | * @author Besmir Beqiri 7 | */ 8 | @FunctionalInterface 9 | interface Clock { 10 | 11 | /** 12 | * Time now in nanoseconds. 13 | */ 14 | long nanoTime(); 15 | } 16 | -------------------------------------------------------------------------------- /jpro-sipjs/example/src/main/java/one/jpro/platform/sipjs/example/Variables.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.sipjs.example; 2 | 3 | public class Variables { 4 | 5 | public static String server = "wss://edge.sip.onsip.com"; 6 | public static String sipAlice = "sip:alice.swCqVznyordTFItTopErJxcn2qxtdxR1@sipjs.onsip.com"; 7 | public static String sipBob = "sip:bob.swCqVznyordTFItTopErJxcn2qxtdxR1@sipjs.onsip.com"; 8 | 9 | } 10 | -------------------------------------------------------------------------------- /jpro-youtube/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | implementation "one.jpro:jpro-webapi:$JPRO_VERSION" 3 | } 4 | 5 | publishing { 6 | publications { 7 | mavenJava(MavenPublication) { 8 | pom { 9 | name = 'JPro Youtube' 10 | description = 'A module that makes easy to display Youtube videos inside your JPro/JavaFX applications.' 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /jpro-file/example/src/main/resources/one/jpro/platform/file/example/css/file_uploader.css: -------------------------------------------------------------------------------- 1 | .controls-box { 2 | -fx-spacing: 8; 3 | -fx-padding: 0 0 8 0; 4 | -fx-alignment: center; 5 | } 6 | 7 | .progress-box { 8 | -fx-spacing: 8; 9 | -fx-padding: 8 0 0 0; 10 | -fx-alignment: center; 11 | } 12 | 13 | .placeholder-pane { 14 | -fx-background-color: LightGrey; 15 | } 16 | 17 | .root-pane { 18 | -fx-padding: 12; 19 | } -------------------------------------------------------------------------------- /jpro-webrtc/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | implementation "one.jpro:jpro-webapi:$JPRO_VERSION" 3 | } 4 | 5 | publishing { 6 | publications { 7 | mavenJava(MavenPublication) { 8 | pom { 9 | name = 'JPro WebRTC' 10 | description = 'A module that makes easy to add real-time communication capabilities to your web applications running with JPro.' 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /jpro-session/example/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Module descriptor for the example application. 3 | * 4 | * @author Besmir Beqiri 5 | */ 6 | module one.jpro.platform.sessions.example { 7 | requires javafx.controls; 8 | requires jpro.webapi; 9 | requires atlantafx.base; 10 | requires one.jpro.platform.session; 11 | requires org.slf4j; 12 | requires org.apache.commons.io; 13 | 14 | exports one.jpro.platform.session.example; 15 | } -------------------------------------------------------------------------------- /jpro-mdfx/example/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Module descriptor for the example application. 3 | * 4 | * @author Besmir Beqiri 5 | */ 6 | module one.jpro.platform.mdfx.example { 7 | requires javafx.controls; 8 | requires org.slf4j; 9 | requires org.apache.commons.io; 10 | 11 | requires jpro.webapi; 12 | requires one.jpro.platform.mdfx; 13 | requires org.scenicview.scenicview; 14 | 15 | exports one.jpro.platform.mdfx.example; 16 | } -------------------------------------------------------------------------------- /jpro-media/src/test/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Module descriptor for the JPro Platform Media Test module. 3 | * 4 | * @author Besmir Beqiri 5 | */ 6 | open module one.jpro.platform.media.test { 7 | requires one.jpro.platform.media; 8 | requires org.slf4j; 9 | 10 | requires org.junit.jupiter; 11 | requires org.testfx.core; 12 | requires org.testfx.junit5; 13 | requires org.assertj.core; 14 | 15 | exports one.jpro.platform.media.test; 16 | } -------------------------------------------------------------------------------- /jpro-auth/example/src/main/java/one/jpro/platform/auth/example/basic/page/Page.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.example.basic.page; 2 | 3 | import javafx.scene.layout.StackPane; 4 | 5 | /** 6 | * Base page class. 7 | * 8 | * @author Besmir Beqiri 9 | */ 10 | public class Page extends StackPane { 11 | 12 | private static final String DEFAULT_STYLE_CLASS = "page"; 13 | 14 | public Page() { 15 | getStyleClass().add(DEFAULT_STYLE_CLASS); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /jpro-auth/example/src/main/java/one/jpro/platform/auth/example/login/page/Page.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.example.login.page; 2 | 3 | import javafx.scene.layout.StackPane; 4 | 5 | /** 6 | * Base page class. 7 | * 8 | * @author Besmir Beqiri 9 | */ 10 | public class Page extends StackPane { 11 | 12 | private static final String DEFAULT_STYLE_CLASS = "page"; 13 | 14 | public Page() { 15 | getStyleClass().add(DEFAULT_STYLE_CLASS); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /jpro-auth/example/src/main/java/one/jpro/platform/auth/example/oauth/page/Page.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.example.oauth.page; 2 | 3 | import javafx.scene.layout.StackPane; 4 | 5 | /** 6 | * Base page class. 7 | * 8 | * @author Besmir Beqiri 9 | */ 10 | public class Page extends StackPane { 11 | 12 | private static final String DEFAULT_STYLE_CLASS = "page"; 13 | 14 | public Page() { 15 | getStyleClass().add(DEFAULT_STYLE_CLASS); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /jpro-auth/core/src/main/resources/one/jpro/platform/auth/core/http/default-response.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Authentication 6 | 7 | 8 |
9 |

Authentication Successful

10 | Please close the page. 11 |
12 | 13 | -------------------------------------------------------------------------------- /jpro-mail/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Module descriptor for JPro Mail module. 3 | * 4 | * @author Besmir Beqiri 5 | */ 6 | module one.jpro.platform.mail { 7 | requires transitive org.slf4j; 8 | requires transitive org.eclipse.collections.api; 9 | 10 | requires jakarta.mail; 11 | requires org.eclipse.collections; 12 | requires org.jetbrains.annotations; 13 | 14 | exports one.jpro.platform.mail; 15 | exports one.jpro.platform.mail.config; 16 | } -------------------------------------------------------------------------------- /jpro-routing/core/src/main/scala/one/jpro/platform/routing/filter/container/ContainerFactory.scala: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.routing.filter.container 2 | 3 | import javafx.scene.Node 4 | import one.jpro.platform.routing.Request 5 | 6 | trait ContainerFactory { 7 | def isContainer(x: Node): Boolean 8 | 9 | def createContainer(): Node 10 | 11 | def setContent(c: Node, x: Node): Unit 12 | 13 | def getContent(c: Node): Node 14 | 15 | def setRequest(c: Node, r: Request): Unit 16 | } 17 | -------------------------------------------------------------------------------- /jpro-auth/core/src/main/java/one/jpro/platform/auth/core/authentication/Options.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.core.authentication; 2 | 3 | import org.json.JSONObject; 4 | 5 | /** 6 | * An Options object is used for configuration purpose. 7 | * 8 | * @author Besmir Beqiri 9 | */ 10 | public interface Options { 11 | 12 | /** 13 | * Convert all configuration information to JSON format. 14 | * 15 | * @return a JSON object. 16 | */ 17 | JSONObject toJSON(); 18 | } 19 | -------------------------------------------------------------------------------- /jpro-routing/popup/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Module descriptor for the Popup module. 3 | * 4 | * @author Besmir Beqiri 5 | */ 6 | module one.jpro.platform.routing.popup { 7 | requires javafx.controls; 8 | requires simplefx.extended; 9 | requires scala.library; 10 | requires org.kordamp.ikonli.javafx; 11 | requires one.jpro.platform.routing.core; 12 | 13 | exports one.jpro.platform.routing.popup.simplepopup; 14 | exports one.jpro.platform.routing.popup; 15 | } -------------------------------------------------------------------------------- /jpro-routing/example/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Module descriptor for the example module. 3 | */ 4 | module one.jpro.routing.example { 5 | requires org.controlsfx.controls; 6 | requires one.jpro.platform.routing.core; 7 | requires one.jpro.platform.routing.dev; 8 | requires one.jpro.platform.routing.popup; 9 | requires simplefx.extended; 10 | 11 | exports example.colors; 12 | exports example.filters; 13 | exports example.popup; 14 | exports example.scala; 15 | } -------------------------------------------------------------------------------- /jpro-mail/example/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Module descriptor for the example application. 3 | * 4 | * @author Besmir Beqiri 5 | */ 6 | module one.jpro.platform.mail.example { 7 | requires javafx.controls; 8 | requires jpro.webapi; 9 | requires org.kordamp.ikonli.javafx; 10 | requires org.kordamp.ikonli.material2; 11 | requires atlantafx.base; 12 | requires org.slf4j; 13 | requires one.jpro.platform.mail; 14 | 15 | exports one.jpro.platform.mail.example.compose; 16 | } -------------------------------------------------------------------------------- /jpro-routing/example/src/main/scala/example/scala/TestWebApplicationHTTP.scala: -------------------------------------------------------------------------------- 1 | package example.scala 2 | 3 | import one.jpro.platform.routing.Route 4 | import one.jpro.platform.routing.server.RouteHTTP 5 | 6 | 7 | object TestWebApplicationHTTP { 8 | def main(args: Array[String]): Unit = { 9 | new TestWebApplicationHTTP().start() 10 | } 11 | } 12 | class TestWebApplicationHTTP extends RouteHTTP { 13 | 14 | override def getRoute: Route = { 15 | new TestWebApplication().createRoute() 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /jpro-mail/example/src/main/resources/one/jpro/platform/mail/example/compose/css/compose-mail.css: -------------------------------------------------------------------------------- 1 | .new-message-label { 2 | -fx-font-family: 'Arial'; 3 | -fx-font-size: 20; 4 | -fx-font-weight: bold; 5 | } 6 | 7 | .top-pane { 8 | -fx-padding: 8; 9 | -fx-hgap: 8; 10 | -fx-vgap: 8; 11 | } 12 | 13 | .content-message-area { 14 | -fx-wrap-text: true; 15 | } 16 | 17 | .bottom-pane { 18 | -fx-padding: 8 0 0 0; 19 | -fx-spacing: 8; 20 | } 21 | 22 | .root-pane { 23 | -fx-padding: 0 12 12 12; 24 | } -------------------------------------------------------------------------------- /jpro-sipjs/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | implementation "one.jpro:jpro-webapi:$JPRO_VERSION" 3 | api project(':jpro-webrtc') // mainly to avoid duplicated code 4 | api "org.json:json:$JSON_VERSION" 5 | } 6 | 7 | publishing { 8 | publications { 9 | mavenJava(MavenPublication) { 10 | pom { 11 | name = 'JPro SipJS' 12 | description = 'A module that takes care of SIP signaling for web applications running with JPro.' 13 | } 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /example/src/main/resources/one/jpro/platform/example/media/css/main.css: -------------------------------------------------------------------------------- 1 | .linkheader-link-hbox { 2 | -fx-spacing: 8; 3 | -fx-alignment: center; 4 | -fx-padding: 4; 5 | -fx-pref-height: 48; 6 | -fx-max-height: 48; 7 | } 8 | 9 | .linkheader-link { 10 | -fx-alignment: center; 11 | -fx-pref-width: 192; 12 | -fx-padding: 8; 13 | } 14 | 15 | .linkheader-link:hover { 16 | -fx-background-radius: 4; 17 | -fx-border-radius: 4; 18 | -fx-background-color: #A5E7AFFF; 19 | -fx-border-color: #1EC337FF; 20 | } -------------------------------------------------------------------------------- /jpro-youtube/example/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.openjfx.javafxplugin' 3 | id 'jpro-gradle-plugin' 4 | } 5 | 6 | dependencies { 7 | implementation project(':jpro-youtube') 8 | } 9 | 10 | javafx { 11 | version = "$JAVAFX_EXAMPLES_VERSION" 12 | modules = ['javafx.graphics', 'javafx.controls', 'javafx.swing', 'javafx.fxml', 'javafx.media', 'javafx.web'] 13 | } 14 | 15 | application { 16 | mainClass = "one.jpro.platform.youtube.example.YoutubeExample" 17 | mainModule = "one.jpro.platform.youtube.example" 18 | } -------------------------------------------------------------------------------- /example/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | module one.jpro.platform.example { 2 | requires javafx.controls; 3 | requires javafx.media; 4 | requires atlantafx.base; 5 | requires org.slf4j; 6 | 7 | requires jpro.webapi; 8 | requires one.jpro.platform.routing.core; 9 | requires one.jpro.platform.mdfx.example; 10 | requires one.jpro.platform.media.example; 11 | requires one.jpro.platform.htmlscrollpane.example; 12 | requires one.jpro.platform.sessions.example; 13 | 14 | exports one.jpro.platform.example; 15 | } -------------------------------------------------------------------------------- /jpro-file/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Module descriptor for JPro File module. 3 | * 4 | * @author Besmir Beqiri 5 | */ 6 | module one.jpro.platform.file { 7 | requires javafx.controls; 8 | requires jpro.webapi; 9 | requires org.jetbrains.annotations; 10 | requires org.slf4j; 11 | 12 | exports one.jpro.platform.file; 13 | exports one.jpro.platform.file.dropper; 14 | exports one.jpro.platform.file.event; 15 | exports one.jpro.platform.file.picker; 16 | exports one.jpro.platform.file.util; 17 | } -------------------------------------------------------------------------------- /jpro-html-scrollpane/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | api project(":jpro-utils") 3 | implementation "one.jpro:jpro-webapi:$JPRO_VERSION" 4 | implementation "one.jpro:jmemorybuddy:$JMEMORYBUDDY_VERSION" 5 | implementation "org.slf4j:slf4j-api:$SLF4J_API_VERSION" 6 | } 7 | 8 | publishing { 9 | publications { 10 | mavenJava(MavenPublication) { 11 | pom { 12 | name = 'JPro HTML Scrollpane Skin' 13 | description = 'A module containing a ScrollPane skin for HTML content' 14 | } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /example/src/main/resources/one/jpro/platform/example/media/css/media_sample.css: -------------------------------------------------------------------------------- 1 | .root-pane { 2 | -fx-alignment: center; 3 | } 4 | 5 | .preview-pane { 6 | -fx-background-color: black, white; 7 | -fx-background-insets: 0, 1; 8 | -fx-max-height: infinity; 9 | } 10 | 11 | .media-view { 12 | -fx-background-color: black; 13 | } 14 | 15 | .controls-pane { 16 | -fx-alignment: center; 17 | -fx-hgap: 8; 18 | -fx-vgap: 8; 19 | -fx-padding: 8; 20 | } 21 | 22 | .controls-pane > .button { 23 | -fx-pref-width: 100; 24 | } -------------------------------------------------------------------------------- /jpro-image-manager/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Module descriptor for the JPro Image Manager module. 3 | */ 4 | module one.jpro.platform.image.manager { 5 | requires java.desktop; 6 | requires javafx.graphics; 7 | requires org.slf4j; 8 | requires jpro.webapi; 9 | requires org.json; 10 | 11 | exports one.jpro.platform.image.manager; 12 | exports one.jpro.platform.image.manager.encoder; 13 | exports one.jpro.platform.image.manager.source; 14 | exports one.jpro.platform.image.manager.transformer; 15 | } -------------------------------------------------------------------------------- /jpro-media/example/src/main/resources/one/jpro/platform/media/example/css/main.css: -------------------------------------------------------------------------------- 1 | .linkheader-link-hbox { 2 | -fx-spacing: 8; 3 | -fx-alignment: center; 4 | -fx-padding: 4; 5 | -fx-pref-height: 48; 6 | -fx-max-height: 48; 7 | } 8 | 9 | .linkheader-link { 10 | -fx-alignment: center; 11 | -fx-pref-width: 192; 12 | -fx-padding: 8; 13 | } 14 | 15 | .linkheader-link:hover { 16 | -fx-background-radius: 4; 17 | -fx-border-radius: 4; 18 | -fx-background-color: #A5E7AFFF; 19 | -fx-border-color: #1EC337FF; 20 | } -------------------------------------------------------------------------------- /jpro-auth/routing/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | api project(":jpro-auth:core") 3 | api project(":jpro-routing:core") 4 | implementation "org.jetbrains:annotations:$JETBRAINS_ANNOTATIONS_VERSION" 5 | } 6 | 7 | publishing { 8 | publications { 9 | mavenJava(MavenPublication) { 10 | pom { 11 | name = 'JPro Auth Routing' 12 | description = 'A module that makes it easy to combine and use the authentication and routing functionalities.' 13 | } 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /jpro-media/example/src/main/resources/one/jpro/platform/media/example/css/media_sample.css: -------------------------------------------------------------------------------- 1 | .root-pane { 2 | -fx-alignment: center; 3 | } 4 | 5 | .preview-pane { 6 | -fx-background-color: black, white; 7 | -fx-background-insets: 0, 1; 8 | -fx-max-height: infinity; 9 | } 10 | 11 | .media-view { 12 | -fx-background-color: black; 13 | } 14 | 15 | .controls-pane { 16 | -fx-alignment: center; 17 | -fx-hgap: 8; 18 | -fx-vgap: 8; 19 | -fx-padding: 8; 20 | } 21 | 22 | .controls-pane > .button { 23 | -fx-pref-width: 100; 24 | } -------------------------------------------------------------------------------- /.github/workflows/add-issues-to-project.yml: -------------------------------------------------------------------------------- 1 | name: Auto add to project 2 | 3 | on: 4 | issues: 5 | types: [opened] 6 | pull_request: 7 | types: [opened] 8 | 9 | jobs: 10 | add-to-project: 11 | name: Add ${{ github.event_name == 'issues' && 'Issue' || 'PR' }} to project 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - uses: actions/add-to-project@v1.0.2 16 | continue-on-error: true 17 | with: 18 | project-url: https://github.com/orgs/sandec/projects/1 19 | github-token: ${{ secrets.PAT }} 20 | -------------------------------------------------------------------------------- /jpro-image-manager/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | implementation "org.slf4j:slf4j-api:$SLF4J_API_VERSION" 3 | implementation "one.jpro:jpro-webapi:$JPRO_VERSION" 4 | implementation "org.json:json:$JSON_VERSION" 5 | } 6 | 7 | publishing { 8 | publications { 9 | mavenJava(MavenPublication) { 10 | pom { 11 | name = 'JPro Image Manager' 12 | description = 'A utility module for JPro/JavaFX applications that simplifies image loading and caching.' 13 | } 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /jpro-auth/example/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Module descriptor for the example module. 3 | */ 4 | module one.jpro.platform.auth.example { 5 | requires org.controlsfx.controls; 6 | requires one.jpro.platform.auth.routing; 7 | requires one.jpro.platform.routing.dev; 8 | requires one.jpro.platform.mdfx; 9 | requires one.jpro.platform.session; 10 | requires atlantafx.base; 11 | 12 | exports one.jpro.platform.auth.example.basic; 13 | exports one.jpro.platform.auth.example.login; 14 | exports one.jpro.platform.auth.example.oauth; 15 | } -------------------------------------------------------------------------------- /jpro-auth/routing/src/main/java/one/jpro/platform/auth/routing/AuthUIProvider.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.routing; 2 | 3 | import javafx.scene.Node; 4 | import one.jpro.platform.routing.Filter; 5 | 6 | /** 7 | * This class represents an Authentication Method, represented by: 8 | * 1. A Node that can be used to display the authentication UI. 9 | * 2. A Filter that can be used to integrate the authentication method 10 | * into theo RouteApp. 11 | */ 12 | public interface AuthUIProvider { 13 | Node createAuthenticationNode(); 14 | Filter createFilter(); 15 | } 16 | -------------------------------------------------------------------------------- /jpro-image-manager/src/main/java/one/jpro/platform/image/manager/JsonConvertible.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.image.manager; 2 | 3 | import org.json.JSONObject; 4 | 5 | /** 6 | * This interface defines a contract for objects that can be converted to a JSON representation. 7 | * 8 | * @author Florian Kirmaier 9 | * @author Besmir Beqiri 10 | */ 11 | public interface JsonConvertible { 12 | 13 | /** 14 | * Converts the object to a JSON representation. 15 | * 16 | * @return A JSONObject representing the object. 17 | */ 18 | JSONObject toJSON(); 19 | } -------------------------------------------------------------------------------- /jpro-sipjs/src/main/java/one/jpro/platform/sipjs/api/session/Inviter.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.sipjs.api.session; 2 | 3 | import com.jpro.webapi.JSVariable; 4 | import com.jpro.webapi.WebAPI; 5 | import one.jpro.platform.sipjs.api.session.Session; 6 | 7 | /** 8 | * Represents an outgoing call. 9 | */ 10 | public class Inviter extends Session { 11 | 12 | public Inviter(JSVariable session, WebAPI webapi) { 13 | super(session, webapi); 14 | } 15 | 16 | public void cancel() { 17 | webapi.js().eval(session.getName() + ".cancel();"); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /jpro-routing/core/src/main/scala/one/jpro/platform/routing/sessionmanager/SessionManagerDummy.scala: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.routing.sessionmanager 2 | 3 | import one.jpro.platform.routing.{Response, ResponseResult, RouteNode} 4 | 5 | class SessionManagerDummy(val webApp: RouteNode) extends SessionManager { 6 | 7 | override def goBack(): Unit = () 8 | 9 | override def goForward(): Unit = () 10 | 11 | override def gotoURL(_url: String, x: ResponseResult, pushState: Boolean): Response = { 12 | Response.fromResult(x) 13 | } 14 | 15 | override def start(): Response = Response.empty() 16 | } 17 | -------------------------------------------------------------------------------- /jpro-file/example/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Module descriptor for the example application. 3 | * 4 | * @author Besmir Beqiri 5 | */ 6 | module one.jpro.platform.file.example { 7 | requires javafx.controls; 8 | requires jpro.webapi; 9 | requires one.jpro.platform.file; 10 | requires org.kordamp.ikonli.javafx; 11 | requires org.kordamp.ikonli.material2; 12 | requires org.apache.commons.io; 13 | requires atlantafx.base; 14 | requires org.slf4j; 15 | 16 | exports one.jpro.platform.file.example.editor; 17 | exports one.jpro.platform.file.example.upload; 18 | } -------------------------------------------------------------------------------- /jpro-file/example/src/main/resources/one/jpro/platform/file/example/css/text_editor.css: -------------------------------------------------------------------------------- 1 | .controls-box { 2 | -fx-spacing: 8; 3 | -fx-padding: 0 0 8 0; 4 | -fx-alignment: center; 5 | } 6 | 7 | .drop-pane { 8 | -fx-border-color: Gray; 9 | -fx-border-width: 1; 10 | -fx-border-style: dashed; 11 | -fx-border-radius: 8; 12 | -fx-background-color: LightGray; 13 | -fx-background-radius: 8; 14 | } 15 | 16 | .drop-pane:files-drag-over { 17 | -fx-border-color: ForestGreen; 18 | -fx-background-color: LightGreen; 19 | -fx-opacity: 0.5; 20 | } 21 | 22 | .root-pane { 23 | -fx-padding: 12; 24 | } -------------------------------------------------------------------------------- /jpro-routing/dev/src/main/resources/one/jpro/platform/routing/dev/devfilter.css: -------------------------------------------------------------------------------- 1 | 2 | .devfilter-vbox { 3 | -fx-background-color: #f0f0f0; 4 | } 5 | 6 | .devfilter-hbox { 7 | -fx-alignment: center; 8 | -fx-padding: 6; 9 | -fx-spacing: 16; 10 | } 11 | 12 | .devfilter-icon-button, 13 | .devfilter-icon-button:focused { 14 | -fx-font-size: 24; 15 | -fx-padding: 0; 16 | -fx-background-radius: 18; 17 | -fx-min-width: 36; 18 | -fx-min-height: 36; 19 | 20 | -fx-border: transparent; 21 | /*-fx-background-color: transparent;*/ 22 | } 23 | 24 | .devfilter-focus-label { 25 | -fx-max-width: 200; 26 | } -------------------------------------------------------------------------------- /jpro-sipjs/example/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.openjfx.javafxplugin' 3 | id 'jpro-gradle-plugin' 4 | } 5 | 6 | dependencies { 7 | implementation project(':jpro-sipjs') 8 | implementation project(':jpro-routing:core') 9 | implementation project(':jpro-routing:dev') 10 | } 11 | 12 | javafx { 13 | version = "$JAVAFX_EXAMPLES_VERSION" 14 | modules = ['javafx.graphics', 'javafx.controls', 'javafx.swing', 'javafx.fxml', 'javafx.media', 'javafx.web'] 15 | } 16 | 17 | application { 18 | mainClass = "one.jpro.platform.sipjs.example.SIPJSApp" 19 | mainModule = 'one.jpro.platform.sipjs.example' 20 | } -------------------------------------------------------------------------------- /jpro-session/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | implementation "one.jpro:jpro-webapi:$JPRO_VERSION" 3 | implementation "commons-io:commons-io:$COMMONS_IO_VERSION" 4 | implementation "org.slf4j:slf4j-api:$SLF4J_API_VERSION" 5 | 6 | testRuntimeOnly "ch.qos.logback:logback-classic:$LOGBACK_VERSION" 7 | } 8 | 9 | publishing { 10 | publications { 11 | mavenJava(MavenPublication) { 12 | pom { 13 | name = 'JPro Session' 14 | description = 'A module that provides a simple implementation of a session manager for JavaFX/JPro applications.' 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /jpro-routing/dev/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Module descriptor for the Routing Dev module. 3 | * 4 | * @author Besmir Beqiri 5 | */ 6 | open module one.jpro.platform.routing.dev { 7 | requires transitive one.jpro.platform.routing.core; 8 | requires transitive javafx.controls; 9 | requires transitive javafx.swing; 10 | requires transitive javafx.web; 11 | requires org.kordamp.ikonli.javafx; 12 | requires org.kordamp.ikonli.evaicons; 13 | requires org.kordamp.ikonli.ionicons4; 14 | requires fr.brouillard.oss.cssfx; 15 | requires org.scenicview.scenicview; 16 | 17 | exports one.jpro.platform.routing.dev; 18 | } -------------------------------------------------------------------------------- /jpro-webrtc/example/src/main/resources/jpro/html/defaultpage: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | jpro Application: Hello JPro 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /jpro-mail/src/main/java/one/jpro/platform/mail/StartTLSOption.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.mail; 2 | 3 | /** 4 | * Possible options for a secure connection using TLS protocol. 5 | * 6 | * @author Besmir Beqiri 7 | */ 8 | public enum StartTLSOption { 9 | 10 | /** 11 | * StartTLS is disabled and will not be used in any case. 12 | */ 13 | DISABLED, 14 | 15 | /** 16 | * StartTLS is enabled and will be used if the server supports it. 17 | */ 18 | ENABLED, 19 | 20 | /** 21 | * StartTLS is required and will be used if the server supports it and the send operation will fail otherwise. 22 | */ 23 | REQUIRED 24 | } 25 | -------------------------------------------------------------------------------- /jpro-routing/core/src/main/scala/one/jpro/platform/routing/filter/container/Container.scala: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.routing.filter.container 2 | 3 | import javafx.beans.property.ObjectProperty 4 | import one.jpro.platform.routing.Request 5 | 6 | trait Container { 7 | 8 | def contentProperty(): ObjectProperty[javafx.scene.Node] 9 | def getContent(): javafx.scene.Node = contentProperty().get() 10 | def setContent(x: javafx.scene.Node): Unit = contentProperty().set(x) 11 | 12 | def requestProperty(): ObjectProperty[Request] 13 | def getRequest(): Request = requestProperty().get() 14 | def setRequest(x: Request): Unit = requestProperty().set(x) 15 | 16 | } 17 | -------------------------------------------------------------------------------- /jpro-webrtc/example/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.openjfx.javafxplugin' 3 | id 'jpro-gradle-plugin' 4 | } 5 | 6 | dependencies { 7 | implementation project(':jpro-webrtc') 8 | implementation project(':jpro-routing:core') 9 | } 10 | 11 | javafx { 12 | version = "$JAVAFX_EXAMPLES_VERSION" 13 | modules = ['javafx.graphics', 'javafx.controls', 'javafx.swing', 'javafx.fxml', 'javafx.media', 'javafx.web'] 14 | } 15 | 16 | 17 | application { 18 | //mainClass = "one.jpro.platform.webrtc.example.simple.WebRTCSimple" 19 | mainClass = "one.jpro.platform.webrtc.example.videoroom.VideoRoomApp" 20 | mainModule = 'one.jpro.platform.webrtc.example' 21 | } -------------------------------------------------------------------------------- /jpro-sipjs/src/main/java/one/jpro/platform/sipjs/SipJSUtil.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.sipjs; 2 | 3 | import com.jpro.webapi.WebAPI; 4 | 5 | public class SipJSUtil { 6 | 7 | /** 8 | * Loads the sip.js library into the given webapi. 9 | * This method is used internally by jpro-sipjs. 10 | * This method is indempotent. Calling it multiple times will not load the library multiple times. 11 | * @param webapi 12 | */ 13 | public static void loadSipJS(WebAPI webapi) { 14 | webapi.js().eval("window.root = typeof window !== 'undefined' ? window : this;"); 15 | webapi.loadJSFile(SipJSUtil.class.getResource("sip-0.21.2.js")); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /jpro-auth/routing/src/main/java/one/jpro/platform/auth/routing/buttons/GoogleLoginButton.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.routing.buttons; 2 | 3 | import javafx.scene.control.Button; 4 | import javafx.scene.image.Image; 5 | 6 | import java.net.URL; 7 | 8 | public class GoogleLoginButton extends Button { 9 | 10 | public GoogleLoginButton() { 11 | 12 | setStyle("-fx-background-color: transparent; " + 13 | "-fx-background-image: url(/one/jpro/platform/auth/routing/buttons/google/web_light_sq_SI@2x.png);" + 14 | "-fx-background-size: cover;" + 15 | "-fx-pref-width: 175;" + 16 | "-fx-pref-height: 40;"); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /jpro-routing/popup/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | api project(':jpro-routing:core') 3 | api "one.jpro:jpro-webapi:$JPRO_VERSION" 4 | api "SANDEC:jnodes:$JNODES_VERSION" 5 | api "one.jpro:jmemorybuddy:$JMEMORYBUDDY_VERSION" 6 | api "org.kordamp.ikonli:ikonli-javafx:$IKONLI_VERSION" 7 | api "org.kordamp.ikonli:ikonli-evaicons-pack:$IKONLI_VERSION" 8 | } 9 | 10 | publishing { 11 | publications { 12 | mavenJava(MavenPublication) { 13 | pom { 14 | name = 'JPro Routing Popup' 15 | description = 'A module that provides utility methods for managing popups in a JPro/JavaFX application.' 16 | } 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /example/src/main/resources/jpro/html/defaultpage: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JPro Platform Example 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /jpro-auth/core/src/main/java/one/jpro/platform/auth/core/jwt/TokenExpiredException.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.core.jwt; 2 | 3 | import one.jpro.platform.auth.core.authentication.AuthenticationException; 4 | 5 | import java.time.Instant; 6 | 7 | /** 8 | * Token expired exception. 9 | * 10 | * @author Besmir Beqiri 11 | */ 12 | public class TokenExpiredException extends AuthenticationException { 13 | 14 | private final Instant expiredAt; 15 | 16 | public TokenExpiredException(String message, Instant expiredAt) { 17 | super(message); 18 | this.expiredAt = expiredAt; 19 | } 20 | 21 | public Instant getExpiredAt() { 22 | return expiredAt; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /jpro-html-scrollpane/example/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.openjfx.javafxplugin' 3 | id 'jpro-gradle-plugin' 4 | } 5 | 6 | dependencies { 7 | implementation(project(":jpro-html-scrollpane")) 8 | implementation "io.github.mkpaz:atlantafx-base:$ATLANTAFX_VERSION" 9 | implementation "org.slf4j:slf4j-api:$SLF4J_API_VERSION" 10 | runtimeOnly "ch.qos.logback:logback-classic:$LOGBACK_VERSION" 11 | } 12 | 13 | javafx { 14 | version = "$JAVAFX_EXAMPLES_VERSION" 15 | modules = ['javafx.controls'] 16 | } 17 | 18 | application { 19 | mainClass = 'one.jpro.platform.htmlscrollpane.example.HTMLScrollPaneSample' 20 | mainModule = "one.jpro.platform.htmlscrollpane.example" 21 | } 22 | -------------------------------------------------------------------------------- /jpro-mdfx/src/main/resources/one/jpro/platform/mdfx/mdfx-default.css: -------------------------------------------------------------------------------- 1 | * { 2 | -mdfx-font-color: black; 3 | -mdfx-link-color: blue; 4 | -mdfx-border-color-1: #888; 5 | 6 | -mdfx-bg-color-1: #ccc; 7 | -mdfx-bg-color-2: #ddd; 8 | -mdfx-bg-color-3: #eee; 9 | 10 | -mdfx-bq-color-border: #4488cc; /* the blockquote's border color */ 11 | -mdfx-bq-color-background: #0000ff0c; /* the blockquote's background color */ 12 | } 13 | 14 | .markdown-text { 15 | -fx-font-family: ARIAL; 16 | } 17 | 18 | .markdown-italic { 19 | -fx-font-style: italic; 20 | } 21 | 22 | .markdown-bold { 23 | -fx-font-weight: bold; 24 | } 25 | 26 | .markdown-strikethrough { 27 | -fx-strikethrough: true; 28 | } -------------------------------------------------------------------------------- /jpro-mdfx/example/src/main/resources/one/jpro/platform/mdfx/example/mdfx-sample.css: -------------------------------------------------------------------------------- 1 | * { 2 | -mdfx-font-color: green; 3 | -mdfx-link-color: blue; 4 | -mdfx-border-color-1: #888; 5 | 6 | -mdfx-bg-color-1: #ccc; 7 | -mdfx-bg-color-2: #ddd; 8 | -mdfx-bg-color-3: #eee; 9 | 10 | -mdfx-bq-color-border: #4488cc; /* the blockquote's border color */ 11 | -mdfx-bq-color-background: #0000ff0c; /* the blockquote's background color */ 12 | } 13 | 14 | .markdown-text { 15 | -fx-font-family: ARIAL; 16 | } 17 | 18 | .markdown-italic { 19 | -fx-font-style: italic; 20 | } 21 | 22 | .markdown-bold { 23 | -fx-font-weight: bold; 24 | } 25 | 26 | .markdown-strikethrough { 27 | -fx-strikethrough: true; 28 | } -------------------------------------------------------------------------------- /jpro-media/src/main/java/one/jpro/platform/media/WebMediaEngine.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.media; 2 | 3 | import com.jpro.webapi.JSVariable; 4 | import com.jpro.webapi.WebAPI; 5 | 6 | /** 7 | * Media engine interface for the web. 8 | * 9 | * @author Besmir Beqiri 10 | */ 11 | public interface WebMediaEngine extends MediaEngine { 12 | 13 | /** 14 | * Returns the {@link WebAPI} instance. 15 | * 16 | * @return the {@link WebAPI} instance 17 | */ 18 | WebAPI getWebAPI(); 19 | 20 | /** 21 | * Returns the video element used to both play and record media on the browser. 22 | * 23 | * @return the video element as a {@link JSVariable} 24 | */ 25 | JSVariable getVideoElement(); 26 | } 27 | -------------------------------------------------------------------------------- /jpro-utils/src/test/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Module descriptor for the JPro Utils Test module. 3 | * 4 | * @author Besmir Beqiri 5 | */ 6 | module one.jpro.platform.utils.test { 7 | requires one.jpro.platform.utils; 8 | requires one.jpro.jmemorybuddy; 9 | requires org.slf4j; 10 | 11 | requires org.junit.jupiter; 12 | requires org.testfx.core; 13 | requires org.testfx.junit5; 14 | requires org.assertj.core; 15 | requires org.mockito; 16 | requires org.mockito.junit.jupiter; 17 | requires jdk.attach; // Required by Mockito, for Java 21 and later seems to not be required anymore since transitive 18 | 19 | exports one.jpro.platform.utils.test; 20 | opens one.jpro.platform.utils.test; 21 | } -------------------------------------------------------------------------------- /jpro-auth/example/src/main/resources/jpro/html/defaultpage: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /jpro-auth/example/src/main/resources/jpro/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /jpro-routing/core/src/main/scala/one/jpro/platform/routing/filter/container/ContainerVBox.scala: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.routing.filter.container 2 | 3 | import javafx.beans.property.{ObjectProperty, SimpleObjectProperty} 4 | import javafx.scene.Node 5 | import javafx.scene.layout.VBox 6 | import one.jpro.platform.routing.Request 7 | 8 | class ContainerVBox extends VBox with Container { 9 | 10 | private val content: ObjectProperty[Node] = new SimpleObjectProperty[Node](this, "content", null) 11 | private val request: ObjectProperty[Request] = new SimpleObjectProperty[Request](this, "request", null) 12 | override def contentProperty(): ObjectProperty[Node] = content 13 | 14 | override def requestProperty(): ObjectProperty[Request] = request 15 | } 16 | -------------------------------------------------------------------------------- /jpro-routing/example/src/main/resources/jpro/html/defaultpage: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /jpro-routing/example/src/main/resources/jpro/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /jpro-session/example/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.openjfx.javafxplugin' 3 | id 'jpro-gradle-plugin' 4 | } 5 | 6 | dependencies { 7 | implementation(project(":jpro-session")) 8 | implementation "commons-io:commons-io:$COMMONS_IO_VERSION" 9 | implementation "io.github.mkpaz:atlantafx-base:$ATLANTAFX_VERSION" 10 | implementation "org.slf4j:slf4j-api:$SLF4J_API_VERSION" 11 | runtimeOnly "ch.qos.logback:logback-classic:$LOGBACK_VERSION" 12 | } 13 | 14 | javafx { 15 | version = "$JAVAFX_EXAMPLES_VERSION" 16 | modules = ['javafx.graphics', 'javafx.controls'] 17 | } 18 | 19 | application { 20 | mainClass = 'one.jpro.platform.session.example.SessionManagerSample' 21 | mainModule = "one.jpro.platform.sessions.example" 22 | } -------------------------------------------------------------------------------- /jpro-media/src/main/java/one/jpro/platform/media/player/impl/WebMediaPlayerView.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.media.player.impl; 2 | 3 | import com.jpro.webapi.WebAPI; 4 | import one.jpro.platform.media.MediaView; 5 | import one.jpro.platform.media.WebMediaView; 6 | import one.jpro.platform.media.player.MediaPlayer; 7 | 8 | /** 9 | * {@link MediaView} implementation for a web {@link MediaPlayer}. 10 | * 11 | * @author Besmir Beqiri 12 | */ 13 | public class WebMediaPlayerView extends WebMediaView { 14 | 15 | public WebMediaPlayerView(WebAPI webAPI) { 16 | super(webAPI); 17 | } 18 | 19 | public WebMediaPlayerView(WebMediaPlayer webMediaPlayer) { 20 | this(webMediaPlayer.getWebAPI()); 21 | setMediaEngine(webMediaPlayer); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /jpro-sipjs/src/main/java/one/jpro/platform/sipjs/api/options/MediaStreamConstraints.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.sipjs.api.options; 2 | 3 | import org.json.JSONObject; 4 | 5 | public class MediaStreamConstraints { 6 | 7 | boolean audio; 8 | boolean video; 9 | 10 | /** 11 | * Creates a new instance of MediaStreamConstraints. 12 | * @param audio 13 | * @param video 14 | */ 15 | public MediaStreamConstraints(boolean audio, boolean video) { 16 | this.audio = audio; 17 | this.video = video; 18 | } 19 | 20 | public JSONObject asJSONObject() { 21 | JSONObject jsonObject = new JSONObject(); 22 | jsonObject.put("audio", audio); 23 | jsonObject.put("video", video); 24 | return jsonObject; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /jpro-sipjs/src/main/java/one/jpro/platform/sipjs/api/session/Invitation.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.sipjs.api.session; 2 | 3 | import com.jpro.webapi.JSVariable; 4 | import com.jpro.webapi.WebAPI; 5 | import one.jpro.platform.sipjs.api.options.InvitationAcceptOptions; 6 | 7 | /** 8 | * Represents an incoming call. 9 | */ 10 | public class Invitation extends Session { 11 | public Invitation(JSVariable session, WebAPI webapi) { 12 | super(session, webapi); 13 | } 14 | 15 | public void accept(InvitationAcceptOptions options) { 16 | webapi.js().eval(session.getName() + ".accept(" + options.asJSVariable(webapi).getName() + ");"); 17 | } 18 | 19 | public void reject() { 20 | webapi.js().eval(session.getName() + ".reject();"); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /jpro-sipjs/example/src/main/resources/jpro/html/defaultpage: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | jpro Application: Hello JPro 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /jpro-media/src/main/java/one/jpro/platform/media/recorder/impl/WebMediaRecorderView.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.media.recorder.impl; 2 | 3 | import com.jpro.webapi.WebAPI; 4 | import one.jpro.platform.media.MediaView; 5 | import one.jpro.platform.media.WebMediaView; 6 | import one.jpro.platform.media.recorder.MediaRecorder; 7 | 8 | /** 9 | * {@link MediaView} implementation for a web {@link MediaRecorder}. 10 | * 11 | * @author Besmir Beqiri 12 | */ 13 | public class WebMediaRecorderView extends WebMediaView { 14 | 15 | public WebMediaRecorderView(WebAPI webAPI) { 16 | super(webAPI); 17 | } 18 | 19 | public WebMediaRecorderView(WebMediaRecorder webMediaRecorder) { 20 | this(webMediaRecorder.getWebAPI()); 21 | setMediaEngine(webMediaRecorder); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /jpro-auth/core/src/main/java/one/jpro/platform/auth/core/authentication/AuthenticationProvider.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.core.authentication; 2 | 3 | import org.jetbrains.annotations.NotNull; 4 | 5 | import java.util.concurrent.CompletableFuture; 6 | 7 | /** 8 | * Defines an authentication provider. 9 | * 10 | * @author Besmir Beqiri 11 | */ 12 | @FunctionalInterface 13 | public interface AuthenticationProvider { 14 | 15 | /** 16 | * Authenticate a user with the given credentials. 17 | * 18 | * @param credentials a {@link Credentials} object containing the 19 | * information for authenticating the user. 20 | * @return the result future 21 | */ 22 | CompletableFuture authenticate(@NotNull T credentials); 23 | } 24 | -------------------------------------------------------------------------------- /jpro-youtube/example/src/main/java/one/jpro/platform/youtube/example/YoutubeExample.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.youtube.example; 2 | 3 | import javafx.application.Application; 4 | import javafx.scene.control.Label; 5 | import javafx.scene.layout.StackPane; 6 | import javafx.scene.layout.VBox; 7 | import one.jpro.platform.youtube.YoutubeNode; 8 | 9 | public class YoutubeExample extends Application { 10 | 11 | @Override 12 | public void start(javafx.stage.Stage stage) throws Exception { 13 | var pin = new VBox(); 14 | 15 | pin.getChildren().add(new StackPane(new YoutubeNode("dQw4w9WgXcQ"))); 16 | pin.getChildren().add(new StackPane(new YoutubeNode("oqAsIcoN9MY"))); 17 | stage.setScene(new javafx.scene.Scene(new VBox(pin))); 18 | 19 | stage.show(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /jpro-mdfx/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | module one.jpro.platform.mdfx { 2 | requires javafx.controls; 3 | requires javafx.fxml; 4 | requires flexmark; 5 | requires flexmark.ext.attributes; 6 | requires flexmark.ext.tables; 7 | requires flexmark.ext.gfm.strikethrough; 8 | requires flexmark.ext.gfm.tasklist; 9 | requires flexmark.util; 10 | requires flexmark.util.ast; 11 | requires flexmark.util.builder; 12 | requires flexmark.util.misc; 13 | requires flexmark.util.sequence; 14 | requires flexmark.util.data; 15 | requires flexmark.util.collection; 16 | requires one.jpro.platform.youtube; 17 | 18 | opens one.jpro.platform.mdfx; 19 | exports one.jpro.platform.mdfx; 20 | exports one.jpro.platform.mdfx.extensions; 21 | opens one.jpro.platform.mdfx.extensions; 22 | } -------------------------------------------------------------------------------- /jpro-utils/example/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.javamodularity.moduleplugin' version "$MODULE_PLUGIN_VERSION" 3 | id 'org.openjfx.javafxplugin' 4 | id 'jpro-gradle-plugin' 5 | } 6 | 7 | 8 | dependencies { 9 | implementation project(":jpro-utils") 10 | } 11 | 12 | def examples = [ 13 | 'copy' : 'one.jpro.platform.utils.example.CopyExample', 14 | 'user-platform' : 'one.jpro.platform.utils.example.UserPlatformExample' 15 | ] 16 | 17 | javafx { 18 | version = "$JAVAFX_EXAMPLES_VERSION" 19 | modules = ['javafx.graphics', 'javafx.controls', 'javafx.fxml', 'javafx.media', 'javafx.swing', 'javafx.web'] 20 | } 21 | 22 | application { 23 | mainClass = examples.getOrDefault(project.getProperties().get("sample"), "UnknownApp") 24 | mainModule = 'one.jpro.platform.utils.example' 25 | } 26 | -------------------------------------------------------------------------------- /jpro-mdfx/src/main/java/one/jpro/platform/mdfx/extensions/YoutubeExtension.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.mdfx.extensions; 2 | 3 | import javafx.scene.control.Label; 4 | import javafx.scene.layout.VBox; 5 | import one.jpro.platform.youtube.YoutubeNode; 6 | 7 | public class YoutubeExtension { 8 | 9 | public static ImageExtension create() { 10 | return new ImageExtension( 11 | "youtube", (url, view) -> { 12 | var uri = java.net.URI.create(url); 13 | var schemeSpecificPart = uri.getSchemeSpecificPart(); 14 | var node = new VBox(new Label(""), new YoutubeNode(schemeSpecificPart)); 15 | node.prefWidthProperty().bind(view.widthProperty()); 16 | node.maxWidthProperty().bind(view.widthProperty()); 17 | return node; 18 | }); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /jpro-mdfx/example/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.javamodularity.moduleplugin' version "$MODULE_PLUGIN_VERSION" 3 | id 'org.openjfx.javafxplugin' 4 | id 'jpro-gradle-plugin' 5 | } 6 | 7 | dependencies { 8 | implementation(project(":jpro-mdfx")) 9 | implementation "commons-io:commons-io:$COMMONS_IO_VERSION" 10 | implementation "org.slf4j:slf4j-api:$SLF4J_API_VERSION" 11 | runtimeOnly "ch.qos.logback:logback-classic:$LOGBACK_VERSION" 12 | implementation "org.scenic-view:scenic-view:$SCENIC_VIEW_VERSION" 13 | } 14 | 15 | javafx { 16 | version = "$JAVAFX_EXAMPLES_VERSION" 17 | modules = ['javafx.controls', 'javafx.fxml', 'javafx.web', 'javafx.swing'] 18 | } 19 | 20 | application { 21 | mainClass = 'one.jpro.platform.mdfx.example.MarkdownViewSample' 22 | mainModule = "one.jpro.platform.mdfx.example" 23 | } -------------------------------------------------------------------------------- /jpro-routing/core-test/src/test/scala/one/jpro/platform/routing/TestLinkUtil.scala: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.routing 2 | 3 | import org.junit.jupiter.api.Test 4 | 5 | class TestLinkUtil { 6 | 7 | @Test 8 | def testValidLink1(): Unit = { 9 | assert(LinkUtil.isValidLink("http://localhost:8081/d")) 10 | } 11 | 12 | @Test 13 | def testValidLink2(): Unit = { 14 | assert(!LinkUtil.isValidLink("http://localhost:8081/d a")) 15 | assert(LinkUtil.isValidLink("http://localhost:8081/d%20a")) 16 | } 17 | 18 | @Test 19 | def testValidLink3(): Unit = { 20 | assert(LinkUtil.isValidLink("tel:+923020506910")) 21 | assert(LinkUtil.isValidLink("mailto:aaa@domain.com")) 22 | } 23 | 24 | @Test 25 | def testValidLink4(): Unit = { 26 | assert(LinkUtil.isValidLink("http://localhost:8070/info?name=Abid%26Aqib")) 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ensemble/site/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | gradlePluginPortal() 4 | 5 | maven { 6 | url "https://sandec.jfrog.io/artifactory/repo" 7 | } 8 | } 9 | 10 | dependencies { 11 | classpath "one.jpro:jpro-gradle-plugin:$JPRO_VERSION" 12 | classpath "org.openjfx:javafx-plugin:$JAVAFX_PLUGIN_VERSION" 13 | classpath "com.javafxensemble.website:ensemble-gradle-plugin:$ENSEMBLE_GRADLE_PLUGIN_VERSION" 14 | } 15 | } 16 | 17 | repositories { 18 | mavenCentral() 19 | } 20 | 21 | apply plugin: 'ensemble' 22 | 23 | dependencies { 24 | compileOnly project(":ensemble:samples") 25 | } 26 | 27 | ensemble { 28 | log = true 29 | includeProject("jpro-samples", project(":ensemble:samples")) 30 | } 31 | 32 | afterEvaluate { 33 | println("jpro.localJVMArgs: " + jpro.localJVMArgs) 34 | } -------------------------------------------------------------------------------- /jpro-webrtc/example/src/main/java/one/jpro/platform/webrtc/example/videoroom/page/OverviewPage.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.webrtc.example.videoroom.page; 2 | 3 | import javafx.scene.control.Button; 4 | import javafx.scene.control.Label; 5 | import javafx.scene.layout.VBox; 6 | import one.jpro.platform.routing.LinkUtil; 7 | 8 | public class OverviewPage extends VBox { 9 | 10 | public OverviewPage() { 11 | getStyleClass().add("page"); 12 | getStyleClass().add("overview-page"); 13 | var overview = new Label("Overview"); 14 | overview.getStyleClass().add("title"); 15 | getChildren().add(overview); 16 | 17 | int randomId = (int) (Math.random() * 1000); 18 | var button = new Button("Create Room"); 19 | LinkUtil.setLink(button, "/room/" + randomId); 20 | getChildren().add(button); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /jpro-auth/core/src/main/java/one/jpro/platform/auth/core/http/impl/Handler.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.core.http.impl; 2 | 3 | import org.jetbrains.annotations.NotNull; 4 | 5 | import java.util.function.Consumer; 6 | 7 | /** 8 | * HTTP request handler. 9 | * 10 | * @author Besmir Beqiri 11 | */ 12 | @FunctionalInterface 13 | interface Handler { 14 | 15 | /** 16 | * HTTP request handle. 17 | * This method is called on the event loop thread. It must be non-blocking! 18 | * The callee must invoke the callback once and only once. 19 | * The callback may either be invoked synchronously before handle terminates or 20 | * asynchronously in a background thread. 21 | * The provided callback object has a reference to internal connection state. 22 | */ 23 | void handle(@NotNull Request request, @NotNull Consumer callback); 24 | } 25 | -------------------------------------------------------------------------------- /jpro-image-manager/src/main/java/one/jpro/platform/image/manager/transformer/ImageTransformer.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.image.manager.transformer; 2 | 3 | import one.jpro.platform.image.manager.JsonConvertible; 4 | 5 | import java.awt.image.BufferedImage; 6 | 7 | /** 8 | * An interface for transforming images. Implementers of this interface should provide 9 | * functionality to apply specific transformations to BufferedImage objects. 10 | * 11 | * @author Florian Kirmaier 12 | */ 13 | public interface ImageTransformer extends JsonConvertible { 14 | 15 | /** 16 | * Transforms the given image according to some specific criteria or logic. 17 | * 18 | * @param image The BufferedImage to be transformed. 19 | * @return A new BufferedImage resulting from the applied transformation. 20 | */ 21 | BufferedImage transform(BufferedImage image); 22 | } 23 | -------------------------------------------------------------------------------- /jpro-routing/dev/src/main/scala/one/jpro/platform/routing/dev/NodesHelper.scala: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.routing.dev 2 | 3 | import simplefx.core._ 4 | import simplefx.all._ 5 | import simplefx.experimental._ 6 | import simplefx.util.Predef.extension 7 | object NodesHelper { 8 | @extension class ExtNode(node: Node) { 9 | val isParent = node.isInstanceOf[Parent] 10 | lazy val parent = node.asInstanceOf[Parent] 11 | 12 | @Bind var treeSize: Int = <-- { 13 | if(!isParent) { 14 | 1 15 | } else { 16 | 1 + parent.childrenUnmodifiable.map(_.treeSize).sum 17 | } 18 | } 19 | @Bind var visibleTreeSize: Int = <--{ 20 | if(!visible) { 21 | 0 22 | } else if(!isParent) { 23 | 1 24 | } else { 25 | 1 + parent.childrenUnmodifiable.map(_.visibleTreeSize).sum 26 | } 27 | } 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /ensemble/samples/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'org.openjfx.javafxplugin' 2 | 3 | repositories { 4 | mavenCentral() 5 | maven { 6 | url "https://sandec.jfrog.io/artifactory/repo" 7 | } 8 | } 9 | 10 | dependencies { 11 | implementation project(":jpro-html-scrollpane:example") 12 | implementation project(":jpro-mdfx:example") 13 | implementation project(":jpro-media:example") 14 | } 15 | 16 | javafx { 17 | version = "$JAVAFX_VERSION" 18 | modules = [ 'javafx.graphics', 'javafx.controls','javafx.swing', 'javafx.fxml', 'javafx.media', 'javafx.web' ] 19 | } 20 | 21 | //publishing { 22 | // publications { 23 | // mavenJava(MavenPublication) { 24 | // from components.java 25 | // groupId "one.jpro.samples" 26 | // artifactId project.name 27 | // version JPRO_PLATFORM_VERSION 28 | // } 29 | // } 30 | //} -------------------------------------------------------------------------------- /jpro-auth/example/src/main/java/one/jpro/platform/auth/example/basic/page/LoginPage.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.example.basic.page; 2 | 3 | import one.jpro.platform.auth.core.basic.LoginPane; 4 | import one.jpro.platform.auth.core.basic.UsernamePasswordCredentials; 5 | import one.jpro.platform.auth.core.basic.provider.BasicAuthenticationProvider; 6 | import one.jpro.platform.auth.routing.AuthBasicFilter; 7 | import one.jpro.platform.auth.routing.AuthUIProvider; 8 | 9 | /** 10 | * Basic login page with username and password. 11 | * 12 | * @author Besmir Beqiri 13 | */ 14 | public class LoginPage extends Page { 15 | 16 | public LoginPage(BasicAuthenticationProvider authProvider, 17 | AuthUIProvider authUIProvider, 18 | UsernamePasswordCredentials credentials) { 19 | getChildren().add(authUIProvider.createAuthenticationNode()); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /jpro-sipjs/src/main/java/one/jpro/platform/sipjs/api/options/SessionDescriptionHandlerOptions.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.sipjs.api.options; 2 | 3 | import org.json.JSONObject; 4 | 5 | public class SessionDescriptionHandlerOptions { 6 | 7 | public MediaStreamConstraints mediaStreamConstraints; 8 | 9 | /** 10 | * Creates a new instance of SessionDescriptionHandlerOptions. 11 | * @param mediaStreamConstraints 12 | */ 13 | public SessionDescriptionHandlerOptions(MediaStreamConstraints mediaStreamConstraints) { 14 | this.mediaStreamConstraints = mediaStreamConstraints; 15 | } 16 | 17 | /** 18 | * Creates a JSON representation of this object. 19 | */ 20 | public JSONObject asJSONObject() { 21 | JSONObject jsonObject = new JSONObject(); 22 | jsonObject.put("constraints", mediaStreamConstraints.asJSONObject()); 23 | return jsonObject; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ensemble/samples/src/main/resources/ensemble-samples.json: -------------------------------------------------------------------------------- 1 | { 2 | "samples": [ 3 | { 4 | "category": "jpro-html-scrollpane", 5 | "name": "HTMLScrollPaneSample", 6 | "desc": "An html scrollpane sample.", 7 | "project": "jpro-platform", 8 | "classname": "one.jpro.platform.htmlscrollpane.example.HTMLScrollPaneSample" 9 | }, 10 | { 11 | "category": "jpro-mdfx", 12 | "name": "MarkdownViewSample", 13 | "desc": "A simple markdown view sample.", 14 | "project": "jpro-platform", 15 | "classname": "one.jpro.platform.mdfx.example.MarkdownViewSample" 16 | }, 17 | { 18 | "category": "jpro-media", 19 | "name": "MediaPlayerSample", 20 | "desc": "A simple media player sample.", 21 | "project": "jpro-platform", 22 | "preview": "MediaPlayerSample.png", 23 | "classname": "one.jpro.platform.media.example.MediaPlayerSample" 24 | } 25 | ] 26 | } -------------------------------------------------------------------------------- /jpro-mdfx/src/main/java/one/jpro/platform/mdfx/extensions/ImageExtension.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.mdfx.extensions; 2 | 3 | import javafx.scene.Node; 4 | import one.jpro.platform.mdfx.MarkdownView; 5 | 6 | import java.util.function.BiFunction; 7 | 8 | /** 9 | * An extension for the MarkdownView. 10 | * The scheme is used to identify the extension in the markdown string. 11 | * 12 | * An scheme of null is used to identify the default image extension. 13 | */ 14 | public class ImageExtension { 15 | String scheme; 16 | BiFunction function; 17 | 18 | public ImageExtension(String scheme, BiFunction function) { 19 | this.scheme = scheme; 20 | this.function = function; 21 | } 22 | 23 | public String getScheme() { 24 | return scheme; 25 | } 26 | 27 | public BiFunction getFunction() { 28 | return function; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /jpro-image-manager/src/main/java/one/jpro/platform/image/manager/encoder/ImageEncoderException.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.image.manager.encoder; 2 | 3 | /** 4 | * A runtime exception that is thrown when an error occurs during image encoding. 5 | * 6 | * @author Besmir Beqiri 7 | */ 8 | public class ImageEncoderException extends RuntimeException { 9 | 10 | /** 11 | * Constructs a new image encoder exception with the specified message. 12 | * 13 | * @param message the exception message. 14 | */ 15 | public ImageEncoderException(String message) { 16 | super(message); 17 | } 18 | 19 | /** 20 | * Constructs a new image encoder exception with the specified message and cause. 21 | * 22 | * @param message the exception message. 23 | * @param cause the cause of the exception. 24 | */ 25 | public ImageEncoderException(String message, Throwable cause) { 26 | super(message, cause); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /jpro-image-manager/src/main/java/one/jpro/platform/image/manager/source/ImageSourceException.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.image.manager.source; 2 | 3 | /** 4 | * A runtime exception that is thrown when an error occurs during image source loading. 5 | * 6 | * @author Besmir Beqiri 7 | */ 8 | public class ImageSourceException extends RuntimeException { 9 | 10 | /** 11 | * Constructs a new image source exception with the specified message. 12 | * 13 | * @param message the exception message. 14 | */ 15 | public ImageSourceException(String message) { 16 | super(message); 17 | } 18 | 19 | /** 20 | * Constructs a new image source exception with the specified message and cause. 21 | * 22 | * @param message the exception message. 23 | * @param cause the cause of the exception. 24 | */ 25 | public ImageSourceException(String message, Throwable cause) { 26 | super(message, cause); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /jpro-image-manager/src/test/java/one/jpro/platform/image/manager/transformer/ImageTransformerFitWidthTest.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.image.manager.transformer; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | import javax.imageio.ImageIO; 6 | import java.awt.image.BufferedImage; 7 | import java.io.File; 8 | 9 | import static org.junit.jupiter.api.Assertions.assertEquals; 10 | 11 | public class ImageTransformerFitWidthTest { 12 | 13 | @Test 14 | public void testFitWidthTransformation() throws Exception { 15 | BufferedImage originalImage = ImageIO.read(new File("src/test/resources/testImage.png")); 16 | ImageTransformerFitWidth transformer = new ImageTransformerFitWidth(100); 17 | 18 | BufferedImage transformedImage = transformer.transform(originalImage); 19 | 20 | assertEquals(100, transformedImage.getWidth()); 21 | assertEquals((originalImage.getHeight() * 100) / originalImage.getWidth(), transformedImage.getHeight()); 22 | } 23 | } -------------------------------------------------------------------------------- /jpro-mail/example/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.openjfx.javafxplugin' 3 | id 'jpro-gradle-plugin' 4 | } 5 | 6 | dependencies { 7 | implementation project(":jpro-mail") 8 | implementation "io.github.mkpaz:atlantafx-base:$ATLANTAFX_VERSION" 9 | implementation "org.kordamp.ikonli:ikonli-javafx:$IKONLI_VERSION" 10 | implementation "org.kordamp.ikonli:ikonli-material2-pack:$IKONLI_VERSION" 11 | implementation "org.slf4j:slf4j-api:$SLF4J_API_VERSION" 12 | runtimeOnly "ch.qos.logback:logback-classic:$LOGBACK_VERSION" 13 | } 14 | 15 | javafx { 16 | version = "$JAVAFX_EXAMPLES_VERSION" 17 | modules = ['javafx.controls'] 18 | } 19 | 20 | def examples = [ 21 | 'compose-mail' : 'one.jpro.platform.mail.example.compose.ComposeMailSample' 22 | ] 23 | 24 | application { 25 | mainClass = project.hasProperty("sample") ? examples[project.getProperties().get("sample")] : examples["compose-mail"] 26 | mainModule = "one.jpro.platform.mail.example" 27 | } -------------------------------------------------------------------------------- /jpro-routing/core/src/main/scala/one/jpro/platform/routing/Response.scala: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.routing 2 | 3 | import simplefx.experimental.FXFuture 4 | 5 | case class Response(future: FXFuture[ResponseResult]) { 6 | assert(future != null, "future must not be null - but it's value can be null") 7 | } 8 | object Response { 9 | def empty(): Response = Response(FXFuture.unit(null)) 10 | def redirect(to: String): Response = Response(FXFuture.unit(Redirect(to))) 11 | def error(ex: Exception): Response = Response(FXFuture.error(ex)) 12 | 13 | def view(view: View): Response = Response(FXFuture.unit(view)) 14 | def node(node: javafx.scene.Node): Response = Response(FXFuture.unit(View.fromNode(node))) 15 | def fromFuture(future: FXFuture[Response]): Response = Response(future.flatMap(_.future)) 16 | def fromResult(result: ResponseResult): Response = Response(FXFuture.unit(result)) 17 | def fromFutureResult(future: FXFuture[ResponseResult]): Response = Response(future) 18 | } 19 | -------------------------------------------------------------------------------- /jpro-auth/core/src/main/java/one/jpro/platform/auth/core/oauth2/OAuth2Flow.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.core.oauth2; 2 | 3 | /** 4 | * OAuth2 flows. 5 | * 6 | * @author Besmir Beqiri 7 | */ 8 | public enum OAuth2Flow { 9 | 10 | AUTH_CODE("authorization_code"), 11 | PASSWORD("password"), 12 | CLIENT("client_credentials"), 13 | AUTH_JWT("urn:ietf:params:oauth:grant-type:jwt-bearer"); 14 | 15 | private final String grantType; 16 | 17 | OAuth2Flow(String grantType) { 18 | this.grantType = grantType; 19 | } 20 | 21 | public String getGrantType() { 22 | return grantType; 23 | } 24 | 25 | public static OAuth2Flow getFlow(String grantType) { 26 | for (var flow : values()) { 27 | if (flow.getGrantType().equals(grantType)) { 28 | return flow; 29 | } 30 | } 31 | return null; 32 | } 33 | 34 | @Override 35 | public String toString() { 36 | return name() + " [" + grantType + "]"; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /jpro-mail/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | implementation "jakarta.mail:jakarta.mail-api:$JAKARTA_MAIL_API_VERSION" 3 | runtimeOnly "org.eclipse.angus:angus-mail:$ECLIPSE_ANGUS_MAIL_VERSION" 4 | implementation "org.jetbrains:annotations:$JETBRAINS_ANNOTATIONS_VERSION" 5 | api "one.jpro.platform.jpms:eclipse-collections-api:$ECLIPSE_COLLECTIONS_VERSION" 6 | implementation "one.jpro.platform.jpms:eclipse-collections:$ECLIPSE_COLLECTIONS_VERSION" 7 | api "org.slf4j:slf4j-api:$SLF4J_API_VERSION" 8 | } 9 | 10 | javadoc { 11 | options { 12 | encoding = 'UTF-8' 13 | version = true 14 | author = true 15 | // addStringOption('Xdoclint:none', '-quiet') 16 | } 17 | } 18 | 19 | publishing { 20 | publications { 21 | mavenJava(MavenPublication) { 22 | pom { 23 | name = 'JPro Mail' 24 | description = 'A module that provides platform-independent and protocol-independent API for sending emails.' 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /jpro-webrtc/src/main/java/one/jpro/platform/webrtc/MediaStream.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.webrtc; 2 | 3 | import com.jpro.webapi.JSVariable; 4 | import com.jpro.webapi.WebAPI; 5 | 6 | import java.util.concurrent.CompletableFuture; 7 | 8 | public class MediaStream { 9 | 10 | public CompletableFuture js; 11 | MediaStream(WebAPI webAPI, CompletableFuture js) { 12 | this.js = js; 13 | } 14 | 15 | public static MediaStream getCameraStream(WebAPI webAPI) { 16 | var js = webAPI.executeJSAsync("return await navigator.mediaDevices.getUserMedia({video: true, audio: false});"); 17 | return new MediaStream(webAPI, js); 18 | } 19 | 20 | public static MediaStream getScreenStream(WebAPI webAPI) { 21 | var js = webAPI.executeJSAsync("return await navigator.mediaDevices.getDisplayMedia({video: {\n" + 22 | " displaySurface: \"window\",\n" + 23 | " }, audio: false});"); 24 | return new MediaStream(webAPI, js); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /jpro-auth/core/src/test/java/one/jpro/platform/auth/core/http/TestHttpServer.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.core.http; 2 | 3 | import one.jpro.platform.auth.core.http.impl.HttpServerImpl; 4 | 5 | import java.io.IOException; 6 | 7 | /** 8 | * Test HTTP server. 9 | * 10 | * @author Besmir Beqiri 11 | */ 12 | public interface TestHttpServer { 13 | 14 | /** 15 | * Creates a local http server. This method must be used 16 | * only for desktop/mobile applications that run locally. 17 | * 18 | * @return the HTTP server instance 19 | * @throws HttpServerException if an error occurs 20 | */ 21 | static HttpServer create() { 22 | try { 23 | HttpServer httpServer = new HttpServerImpl(null, new HttpOptions() 24 | .setReuseAddr(true) 25 | .setReusePort(true)); 26 | httpServer.start(); 27 | return httpServer; 28 | } catch (IOException ex) { 29 | throw new HttpServerException(ex); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /jpro-media/src/main/java/one/jpro/platform/media/player/MediaPlayerException.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.media.player; 2 | 3 | import java.util.Optional; 4 | 5 | /** 6 | * Media player exception. 7 | * 8 | * @author Besmir Beqiri 9 | */ 10 | public class MediaPlayerException extends RuntimeException { 11 | 12 | public MediaPlayerException(String message) { 13 | super(message); 14 | } 15 | 16 | public MediaPlayerException(String message, Throwable cause) { 17 | super(message, cause); 18 | } 19 | 20 | @Override 21 | public String toString() { 22 | final StringBuilder errStrBuilder = new StringBuilder(getClass().getName() + " ["); 23 | Optional.ofNullable(getMessage()).filter(message -> !message.isBlank()) 24 | .ifPresent(message -> errStrBuilder.append("message: ").append(message)); 25 | Optional.ofNullable(getCause()).ifPresent(cause -> errStrBuilder.append(", cause: ").append(cause)); 26 | return errStrBuilder.append(']').toString(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /jpro-routing/core/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | module one.jpro.platform.routing.core { 2 | requires transitive javafx.controls; 3 | requires transitive org.slf4j; 4 | 5 | requires transitive de.sandec.jnodes; 6 | requires transitive one.jpro.jmemorybuddy; 7 | requires transitive one.jpro.platform.utils; 8 | requires transitive jpro.webapi; 9 | requires transitive simplefx.core; 10 | requires transitive simplefx.utility; 11 | requires transitive simplefx.wrapping; 12 | requires transitive simplefx.extended; 13 | requires transitive scala.library; 14 | 15 | exports one.jpro.platform.routing; 16 | exports one.jpro.platform.routing.crawl; 17 | exports one.jpro.platform.routing.performance; 18 | exports one.jpro.platform.routing.filter.container; 19 | exports one.jpro.platform.routing.sessionmanager; 20 | exports one.jpro.platform.routing.extensions.linkheader; 21 | exports one.jpro.platform.routing.server; 22 | 23 | opens one.jpro.platform.routing.extensions.linkheader.css; 24 | } -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include "jpro-auth:core" 2 | include "jpro-auth:routing" 3 | include "jpro-auth:example" 4 | include "jpro-file" 5 | include "jpro-file:example" 6 | include "jpro-image-manager" 7 | include "jpro-mail" 8 | include "jpro-mail:example" 9 | include "jpro-mdfx" 10 | include "jpro-mdfx:example" 11 | include "jpro-media" 12 | include "jpro-media:example" 13 | include "jpro-routing:core" 14 | include "jpro-routing:core-test" 15 | include "jpro-routing:dev" 16 | include "jpro-routing:example" 17 | include "jpro-routing:popup" 18 | include "jpro-scenegraph" 19 | include "jpro-session" 20 | include "jpro-session:example" 21 | include "jpro-html-scrollpane" 22 | include "jpro-html-scrollpane:example" 23 | include "jpro-youtube" 24 | include "jpro-youtube:example" 25 | include "jpro-webrtc" 26 | include "jpro-webrtc:example" 27 | include "jpro-sipjs" 28 | include "jpro-sipjs:example" 29 | include "jpro-utils" 30 | include "jpro-utils:example" 31 | include "example" 32 | //include "ensemble:samples" 33 | //include "ensemble:site" 34 | 35 | rootProject.name = "jpro-platform" -------------------------------------------------------------------------------- /jpro-mdfx/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.javamodularity.moduleplugin' version "$MODULE_PLUGIN_VERSION" 3 | } 4 | 5 | dependencies { 6 | implementation project(':jpro-youtube') 7 | implementation "com.vladsch.flexmark:flexmark-ext-gfm-strikethrough:$FLEXMARK_VERSION" 8 | implementation "com.vladsch.flexmark:flexmark-ext-gfm-tasklist:$FLEXMARK_VERSION" 9 | implementation "com.vladsch.flexmark:flexmark-ext-tables:$FLEXMARK_VERSION" 10 | implementation "com.vladsch.flexmark:flexmark-ext-attributes:$FLEXMARK_VERSION" 11 | } 12 | 13 | javadoc { 14 | options { 15 | encoding = 'UTF-8' 16 | version = true 17 | author = true 18 | // addStringOption('Xdoclint:none', '-quiet') 19 | } 20 | } 21 | 22 | publishing { 23 | publications { 24 | mavenJava(MavenPublication) { 25 | pom { 26 | name = 'JPro Markdown' 27 | description = 'A module that allows you to render Markdown formatted content in your JPro/JavaFX applications.' 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /jpro-image-manager/src/main/java/one/jpro/platform/image/manager/encoder/ImageEncoder.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.image.manager.encoder; 2 | 3 | import one.jpro.platform.image.manager.JsonConvertible; 4 | 5 | import java.awt.image.BufferedImage; 6 | import java.io.File; 7 | 8 | /** 9 | * Interface for encoding and saving images. 10 | * Implementing classes must provide methods for saving a BufferedImage to a File, 11 | * and returning the file extension of the encoded image. 12 | * 13 | * @author Florian Kirmaier 14 | * @see JsonConvertible 15 | */ 16 | public interface ImageEncoder extends JsonConvertible { 17 | 18 | /** 19 | * Saves a {@link BufferedImage} to a specified {@link File}. 20 | * 21 | * @param image the image to be saved 22 | * @param target the target file to save the image 23 | */ 24 | void saveImage(BufferedImage image, File target); 25 | 26 | /** 27 | * Returns the file extension of the encoded image. 28 | * 29 | * @return The file extension as a string. 30 | */ 31 | String getFileExtension(); 32 | } -------------------------------------------------------------------------------- /jpro-auth/routing/src/main/java/one/jpro/platform/auth/routing/AuthRestrictionFilter.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.routing; 2 | 3 | import one.jpro.platform.routing.Filter; 4 | import one.jpro.platform.routing.Response; 5 | import org.jetbrains.annotations.NotNull; 6 | 7 | public class AuthRestrictionFilter { 8 | /** 9 | * This makes the whole UI only accessible to authenticated users. 10 | */ 11 | public static Filter create(AuthUIProvider routingAuthenticationProvider, 12 | @NotNull UserSession userSession) { 13 | var filter = routingAuthenticationProvider.createFilter(); 14 | Filter result1 = (route) -> (request) -> { 15 | System.out.println("Got user: " + userSession.getUser()); 16 | if (userSession.getUser() != null) { 17 | return route.apply(request); 18 | } else { 19 | return Response.node(routingAuthenticationProvider.createAuthenticationNode()); 20 | } 21 | }; 22 | return filter.compose(result1); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /jpro-image-manager/src/main/java/one/jpro/platform/image/manager/source/ImageSource.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.image.manager.source; 2 | 3 | import one.jpro.platform.image.manager.JsonConvertible; 4 | 5 | import java.awt.image.BufferedImage; 6 | 7 | /** 8 | * The ImageSource interface represents a source of images that can be loaded and manipulated. 9 | * 10 | * @author Florian Kirmaier 11 | * @see JsonConvertible 12 | */ 13 | public interface ImageSource extends JsonConvertible { 14 | 15 | /** 16 | * Loads an image and returns it as BufferedImage. 17 | * 18 | * @return The loaded image as a BufferedImage object. 19 | */ 20 | BufferedImage loadImage(); 21 | 22 | /** 23 | * Returns the identity hash code associated with this image source. 24 | * 25 | * @return The identity hash value corresponding to this object. 26 | */ 27 | long identityHashValue(); 28 | 29 | /** 30 | * Returns the file name associated with this image source. 31 | * 32 | * @return The file name as a string. 33 | */ 34 | String getFileName(); 35 | } 36 | -------------------------------------------------------------------------------- /jpro-sipjs/example/src/main/java/one/jpro/platform/sipjs/example/SIPJSApp.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.sipjs.example; 2 | 3 | import one.jpro.platform.routing.Response; 4 | import one.jpro.platform.routing.Route; 5 | import one.jpro.platform.routing.RouteApp; 6 | import one.jpro.platform.routing.dev.DevFilter; 7 | import one.jpro.platform.sipjs.example.page.*; 8 | 9 | public class SIPJSApp extends RouteApp { 10 | 11 | @Override 12 | public Route createRoute() { 13 | 14 | getScene().getStylesheets().add(getClass().getResource("sipjsapp.css").toString()); 15 | 16 | return Route.empty() 17 | .and(Route.get("/", r -> Response.node(new SelectPage()))) 18 | .and(Route.get("/echo", r -> Response.node(new EchoPage()))) 19 | .and(Route.get("/aliceAndBob", r -> Response.node(new AliceAndBobPage()))) 20 | .and(Route.get("/alice", r -> Response.node(new AlicePage()))) 21 | .and(Route.get("/bob", r -> Response.node(new BobPage()))) 22 | .filter(DevFilter.create()) 23 | .and(Route.empty()); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /jpro-sipjs/example/src/main/java/one/jpro/platform/sipjs/example/page/BobPage.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.sipjs.example.page; 2 | 3 | import com.jpro.webapi.WebAPI; 4 | import javafx.scene.control.Label; 5 | import javafx.scene.layout.HBox; 6 | import one.jpro.platform.sipjs.example.component.User; 7 | import javafx.scene.layout.VBox; 8 | import static one.jpro.platform.sipjs.example.Variables.*; 9 | import static one.jpro.platform.sipjs.example.Variables.sipAlice; 10 | 11 | public class BobPage extends VBox { 12 | public BobPage() { 13 | // Add title 14 | var title = new Label("Bob"); 15 | title.getStyleClass().add("title"); 16 | getChildren().add(title); 17 | WebAPI.getWebAPI(this, webapi -> { 18 | setup(webapi); 19 | }); 20 | getStyleClass().add("jpro-sipjs-example-page"); 21 | } 22 | 23 | public void setup(WebAPI webapi) { 24 | var user1 = new User(webapi, server, sipBob, "Bob", sipAlice); 25 | 26 | var hbox = new HBox(user1); 27 | hbox.getStyleClass().add("alice-and-bob-hbox"); 28 | 29 | getChildren().addAll(hbox); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /jpro-auth/core/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.javamodularity.moduleplugin' version "$MODULE_PLUGIN_VERSION" 3 | } 4 | 5 | dependencies { 6 | api project(":jpro-utils") 7 | implementation "one.jpro:jpro-webapi:$JPRO_VERSION" 8 | implementation "one.jpro.platform.jpms:jjwt-api:$JJWT_VERSION" 9 | runtimeOnly "one.jpro.platform.jpms:jjwt-impl:$JJWT_VERSION" 10 | runtimeOnly "one.jpro.platform.jpms:jjwt-orgjson:$JJWT_VERSION" 11 | implementation "org.jetbrains:annotations:$JETBRAINS_ANNOTATIONS_VERSION" 12 | api "org.slf4j:slf4j-api:$SLF4J_API_VERSION" 13 | api "org.json:json:$JSON_VERSION" 14 | } 15 | 16 | publishing { 17 | publications { 18 | mavenJava(MavenPublication) { 19 | pom { 20 | name = 'JPro Auth Core' 21 | description = 'A module for adding advanced authentication and authorization to JPro/JavaFX ' + 22 | 'applications, supporting OAuth 2.0, OpenID Connect, integration with multiple identity ' + 23 | 'providers and asynchronous operations for enhanced performance.' 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /jpro-image-manager/src/test/java/one/jpro/platform/image/manager/transformer/ImageTransformerScaleToAreaTest.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.image.manager.transformer; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | import javax.imageio.ImageIO; 6 | import java.awt.image.BufferedImage; 7 | import java.io.File; 8 | import java.io.IOException; 9 | 10 | import static org.junit.jupiter.api.Assertions.assertEquals; 11 | import static org.junit.jupiter.api.Assertions.assertNotNull; 12 | 13 | public class ImageTransformerScaleToAreaTest { 14 | 15 | @Test 16 | public void testTransform() throws IOException { 17 | BufferedImage testImage = ImageIO.read(new File("src/test/resources/testImage.png")); 18 | ImageTransformer transformer = new ImageTransformerScaleToArea(40000); // Area of 200x200 19 | 20 | BufferedImage transformedImage = transformer.transform(testImage); 21 | assertNotNull(transformedImage); 22 | 23 | int newArea = transformedImage.getWidth() * transformedImage.getHeight(); 24 | // we need a tolerance of about 2% because of rounding errors 25 | assertEquals(40000, newArea, 800); 26 | } 27 | } -------------------------------------------------------------------------------- /jpro-sipjs/example/src/main/java/one/jpro/platform/sipjs/example/page/AlicePage.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.sipjs.example.page; 2 | 3 | import com.jpro.webapi.WebAPI; 4 | import javafx.scene.control.Label; 5 | import javafx.scene.layout.HBox; 6 | import one.jpro.platform.sipjs.example.component.User; 7 | import javafx.scene.layout.VBox; 8 | import static one.jpro.platform.sipjs.example.Variables.*; 9 | import static one.jpro.platform.sipjs.example.Variables.sipAlice; 10 | 11 | public class AlicePage extends VBox { 12 | public AlicePage() { 13 | // Add title 14 | var title = new Label("Alice"); 15 | title.getStyleClass().add("title"); 16 | getChildren().add(title); 17 | WebAPI.getWebAPI(this, webapi -> { 18 | setup(webapi); 19 | }); 20 | getStyleClass().add("jpro-sipjs-example-page"); 21 | } 22 | 23 | public void setup(WebAPI webapi) { 24 | var user1 = new User(webapi, server, sipAlice, "Alice", sipBob); 25 | 26 | var hbox = new HBox(user1); 27 | hbox.getStyleClass().add("alice-and-bob-hbox"); 28 | 29 | getChildren().addAll(hbox); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /jpro-auth/core/src/test/java/one/jpro/platform/auth/core/http/HttpStatusTests.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.core.http; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | import static org.junit.jupiter.api.Assertions.assertEquals; 6 | 7 | /** 8 | * HttpStatus tests. 9 | * 10 | * @author Besmir Beqiri 11 | */ 12 | public class HttpStatusTests { 13 | 14 | @Test 15 | public void fetchingHttpStatusByCodeShouldGetTheRightOne() { 16 | for (HttpStatus httpStatus : HttpStatus.values()) { 17 | assertEquals(HttpStatus.fromCode(httpStatus.getCode()), httpStatus); 18 | } 19 | } 20 | 21 | @Test 22 | public void fetchingHttpStatusByCodeOutsideOfRangeShouldNotThrowErrors() { 23 | assertEquals(HttpStatus.fromCode(-1), HttpStatus.UNKNOWN); 24 | assertEquals(HttpStatus.fromCode(542345), HttpStatus.UNKNOWN); 25 | } 26 | 27 | @Test 28 | public void httpStatusProvidesFormattedImplementationOfToStringMethod() { 29 | for (HttpStatus httpStatus : HttpStatus.values()) { 30 | assertEquals(httpStatus.getCode() + " " + httpStatus.getMessage(), httpStatus.toString()); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /jpro-auth/core/src/test/java/one/jpro/platform/auth/core/oauth2/OAuth2FlowTests.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.core.oauth2; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | import static org.junit.jupiter.api.Assertions.assertEquals; 6 | import static org.junit.jupiter.api.Assertions.assertNull; 7 | 8 | /** 9 | * OAuth2Flow tests. 10 | * 11 | * @author Besmir Beqiri 12 | */ 13 | public class OAuth2FlowTests { 14 | 15 | @Test 16 | public void fetchingOAuth2FlowByGrantTypeShouldGetTheRightOne() { 17 | for (OAuth2Flow flow : OAuth2Flow.values()) { 18 | assertEquals(OAuth2Flow.getFlow(flow.getGrantType()), flow); 19 | } 20 | } 21 | 22 | @Test 23 | public void fetchingOAuth2FlowByGrantTypeOutsideOfRangeShouldReturnNull() { 24 | assertNull(OAuth2Flow.getFlow("")); 25 | assertNull(OAuth2Flow.getFlow("grant_type")); 26 | } 27 | 28 | @Test 29 | public void oauth2FlowProvidesFormattedImplementationOfToStringMethod() { 30 | for (OAuth2Flow flow : OAuth2Flow.values()) { 31 | assertEquals(flow.name() + " [" + flow.getGrantType() + "]", flow.toString()); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /jpro-auth/core/src/main/resources/one/jpro/platform/auth/core/crypto/notice.txt: -------------------------------------------------------------------------------- 1 | ====================================================================== 2 | == NOTICE file corresponding to section 4(d) of the Apache License, == 3 | == Version 2.0, in this case for the Spring Security distribution. == 4 | ====================================================================== 5 | 6 | The end-user documentation included with a redistribution, if any, 7 | must include the following acknowledgement: 8 | 9 | "This product includes software developed by Spring Security 10 | Project (https://www.springframework.org/security)." 11 | 12 | Alternately, this acknowledgement may appear in the software itself, 13 | if and wherever such third-party acknowledgements normally appear. 14 | 15 | The names "Spring", "Spring Security", "Spring Security System", 16 | "SpringSource", "Acegi", "Acegi Security", "Acegi Security System", 17 | "Acegi" or any derivatives thereof may not be used to endorse or 18 | promote products derived from this software without prior written 19 | permission. For written permission, please contact 20 | ben.alex@springsource.com. 21 | -------------------------------------------------------------------------------- /jpro-routing/dev/src/main/resources/one/jpro/platform/routing/dev/statisticsfilter.css: -------------------------------------------------------------------------------- 1 | .statisticsfilter-vbox { 2 | -fx-background-color: #f0f0f0; 3 | } 4 | .statisticsfilter-hbox { 5 | -fx-alignment: center; 6 | -fx-padding: 6; 7 | -fx-spacing: 8; 8 | } 9 | 10 | .statisticsfilter-statbox { 11 | -fx-alignment: center-left; 12 | -fx-padding: 6; 13 | -fx-background-radius: 6; 14 | } 15 | 16 | .statisticsfilter-statbox-labels { 17 | -fx-alignment: center-right; 18 | } 19 | 20 | .statisticsfilter-statbox-labels .label { 21 | -fx-font-size: 12px; 22 | -fx-text-alignment: right; 23 | } 24 | 25 | .statisticsfilter-statbox-values { 26 | -fx-padding: 0 4 0 4; 27 | -fx-alignment: center-right; 28 | } 29 | 30 | .statisticsfilter-statbox-values .label { 31 | -fx-font-size: 12px; 32 | -fx-font-weight: bold; 33 | -fx-text-alignment: right; 34 | -fx-min-width: 18px; 35 | } 36 | 37 | .statisticsfilter-statbox-units { 38 | -fx-alignment: center-right; 39 | } 40 | 41 | .statisticsfilter-statbox-units .label { 42 | -fx-font-size: 12px; 43 | -fx-font-weight: bold; 44 | -fx-text-alignment: right; 45 | -fx-min-width: 36px; 46 | } 47 | -------------------------------------------------------------------------------- /jpro-image-manager/src/main/java/one/jpro/platform/image/manager/transformer/ImageTransformerHelpers.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.image.manager.transformer; 2 | 3 | import java.awt.*; 4 | 5 | /** 6 | * Provides helper methods for image transformation tasks. 7 | * 8 | * @author Florian Kirmaier 9 | */ 10 | public class ImageTransformerHelpers { 11 | 12 | /** 13 | * Configures the provided Graphics2D object with default rendering settings. 14 | * These settings improve the quality of the rendered image with: 15 | * - Bilinear interpolation for smoother image scaling 16 | * - Anti-aliasing to smooth out jagged edges 17 | * - High-quality rendering hints for improved output quality 18 | * 19 | * @param g2d The Graphics2D object to be configured. 20 | */ 21 | public static void graphicsDefaultConfiguration(Graphics2D g2d) { 22 | g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); 23 | g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); 24 | g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /jpro-auth/example/src/main/java/one/jpro/platform/auth/example/oauth/page/AuthInfoPage.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.example.oauth.page; 2 | 3 | import javafx.beans.binding.Bindings; 4 | import javafx.scene.control.Label; 5 | import javafx.scene.layout.VBox; 6 | import one.jpro.platform.auth.example.oauth.OAuthApp; 7 | import one.jpro.platform.mdfx.MarkdownView; 8 | 9 | /** 10 | * Authorization info page. 11 | * 12 | * @author Besmir Beqiri 13 | */ 14 | public class AuthInfoPage extends Page { 15 | 16 | public AuthInfoPage(OAuthApp loginApp) { 17 | final var headerLabel = new Label("Authentication information:"); 18 | headerLabel.getStyleClass().add("header-label"); 19 | 20 | MarkdownView markdownView = new MarkdownView(); 21 | markdownView.mdStringProperty().bind(Bindings.createStringBinding(() -> { 22 | final var user = loginApp.getUserSession().getUser(); 23 | return user == null ? "" : loginApp.jsonToMarkdown(user.toJSON()); 24 | })); 25 | 26 | final var pane = new VBox(headerLabel, markdownView); 27 | pane.getStyleClass().add("auth-info-pane"); 28 | 29 | getChildren().add(pane); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /jpro-auth/example/src/main/java/one/jpro/platform/auth/example/oauth/page/UserInfoPage.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.example.oauth.page; 2 | 3 | import javafx.beans.binding.Bindings; 4 | import javafx.scene.control.Label; 5 | import javafx.scene.layout.VBox; 6 | import one.jpro.platform.auth.example.oauth.OAuthApp; 7 | import one.jpro.platform.mdfx.MarkdownView; 8 | 9 | /** 10 | * User info page. 11 | * 12 | * @author Besmir Beqiri 13 | */ 14 | public class UserInfoPage extends Page { 15 | 16 | public UserInfoPage(OAuthApp loginApp) { 17 | final var headerLabel = new Label("UserInfo metadata:"); 18 | headerLabel.getStyleClass().add("header-label"); 19 | 20 | MarkdownView markdownView = new MarkdownView(); 21 | markdownView.mdStringProperty().bind(Bindings.createStringBinding(() -> { 22 | final var userInfo = loginApp.getUserInfo(); 23 | return userInfo == null ? "" : loginApp.jsonToMarkdown(userInfo); 24 | }, loginApp.userInfoProperty())); 25 | 26 | final var pane = new VBox(headerLabel, markdownView); 27 | pane.getStyleClass().add("user-info-pane"); 28 | 29 | getChildren().add(pane); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /jpro-image-manager/src/main/java/one/jpro/platform/image/manager/transformer/ImageTransformerIdentity.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.image.manager.transformer; 2 | 3 | import org.json.JSONObject; 4 | 5 | import java.awt.image.BufferedImage; 6 | 7 | /** 8 | * This class implements an identity transformer for images. When applied, 9 | * it will return the original image without any modification. 10 | * 11 | * @author Florian Kirmaier 12 | * @author Besmir Beqiri 13 | * @see ImageTransformer 14 | */ 15 | public class ImageTransformerIdentity implements ImageTransformer { 16 | 17 | /** 18 | * Transforms the provided image. In the case of this identity transformer, 19 | * the original image is returned without any modifications. 20 | * 21 | * @param image The image to be transformed. 22 | * @return The same image that was passed as a parameter. 23 | */ 24 | public BufferedImage transform(BufferedImage image) { 25 | return image; 26 | } 27 | 28 | @Override 29 | public JSONObject toJSON() { 30 | JSONObject json = new JSONObject(); 31 | json.put("type", getClass().getSimpleName()); 32 | return json; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /jpro-media/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Defines APIs for playback and recording of video and audio content. 3 | *

4 | * The APIs are much similar to the JavaFX APIs, but besides 5 | * being used in JavaFX applications running on desktop/mobile devices, 6 | * they can also be used in web applications running via JPro server, 7 | * without changing a single line of code. 8 | *

9 | * The principal classes are {@link MediaSource}, {@link MediaView}, 10 | * {@link MediaPlayer} and {@link MediaRecorder}. 11 | * 12 | * @author Besmir Beqiri 13 | */ 14 | module one.jpro.platform.media { 15 | requires transitive javafx.controls; 16 | requires transitive javafx.media; 17 | requires javafx.swing; 18 | requires jpro.webapi; 19 | requires org.json; 20 | requires org.slf4j; 21 | 22 | requires org.bytedeco.javacv; 23 | requires org.bytedeco.opencv; 24 | requires org.bytedeco.ffmpeg; 25 | 26 | opens one.jpro.platform.media; 27 | exports one.jpro.platform.media; 28 | exports one.jpro.platform.media.event; 29 | exports one.jpro.platform.media.player; 30 | exports one.jpro.platform.media.recorder; 31 | exports one.jpro.platform.media.util; 32 | } -------------------------------------------------------------------------------- /jpro-routing/popup/src/main/resources/one/jpro/platform/routing/popup/simplepopup/simplepopup.css: -------------------------------------------------------------------------------- 1 | * { 2 | SHADOW_COLOR_DEFAULT: #88888880; 3 | } 4 | 5 | .simple-popup-background { 6 | -fx-background-color: #0000001c; 7 | } 8 | 9 | .simple-popup-content { 10 | -fx-background-color: white; 11 | -fx-background-radius: 16; 12 | -fx-effect: dropshadow(three-pass-box, SHADOW_COLOR_DEFAULT, 16px, 0.5, 0, 2); 13 | -fx-padding: 24; 14 | -fx-spacing: 32; 15 | -fx-min-width: 400; 16 | -fx-min-height: 400; 17 | } 18 | 19 | .simple-popup-title { 20 | -fx-font-size: 24; 21 | -fx-font-weight: bold; 22 | } 23 | 24 | .simple-popup-top-area { 25 | -fx-padding: -12 -12 0 -12; 26 | } 27 | 28 | .simple-popup-close-button { 29 | -fx-background-color: #00000000; 30 | -fx-background-radius: 16; 31 | -fx-padding: 4; 32 | } 33 | 34 | .simple-popup-close-button .ikonli-font-icon { 35 | -fx-icon-size: 28; 36 | } 37 | 38 | .simple-popup-close-button:hover { 39 | -fx-background-color: #00000022; 40 | } 41 | 42 | .simple-popup-button-area { 43 | -fx-padding: 0 -12 -12 -12; 44 | -fx-alignment: center; 45 | } 46 | 47 | .simple-popup-text { 48 | -fx-font-size: 16; 49 | } -------------------------------------------------------------------------------- /jpro-sipjs/example/src/main/java/one/jpro/platform/sipjs/example/page/AliceAndBobPage.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.sipjs.example.page; 2 | 3 | import com.jpro.webapi.WebAPI; 4 | import javafx.scene.control.Label; 5 | import javafx.scene.layout.HBox; 6 | import javafx.scene.layout.VBox; 7 | import one.jpro.platform.sipjs.example.component.User; 8 | import static one.jpro.platform.sipjs.example.Variables.*; 9 | 10 | public class AliceAndBobPage extends VBox { 11 | 12 | 13 | public AliceAndBobPage() { 14 | // Add title 15 | var title = new Label("Alice and Bob"); 16 | title.getStyleClass().add("title"); 17 | getChildren().add(title); 18 | WebAPI.getWebAPI(this, webapi -> { 19 | setup(webapi); 20 | }); 21 | getStyleClass().add("jpro-sipjs-example-page"); 22 | } 23 | 24 | public void setup(WebAPI webapi) { 25 | var user1 = new User(webapi, server, sipAlice, "Alice", sipBob); 26 | var user2 = new User(webapi, server, sipBob, "Bob", sipAlice); 27 | 28 | var hbox = new HBox(user1, user2); 29 | hbox.getStyleClass().add("alice-and-bob-hbox"); 30 | 31 | getChildren().addAll(hbox); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /jpro-routing/example/src/main/resources/example/filters/SimpleHamburgerMenu.css: -------------------------------------------------------------------------------- 1 | 2 | .top-box { 3 | /*-fx-background-color: orange;*/ 4 | -fx-background-color: linear-gradient(to left, #f46b45, #eea849); 5 | -fx-min-height: 50; 6 | -fx-pref-height: 50; 7 | -fx-max-height: 50; 8 | -fx-padding: 0 20 0 20; 9 | -fx-alignment: center-left; 10 | } 11 | 12 | .simplehamburgermenu-burger { 13 | -fx-pref-width: 30; 14 | -fx-alignment: center; 15 | -fx-font-size: 30px; 16 | -fx-text-fill: white; 17 | } 18 | 19 | .simplehamburgermenu-top-links { 20 | -fx-alignment: center-right; 21 | -fx-spacing: 28; 22 | } 23 | .simplehamburgermenu-top-link { 24 | -fx-font-size: 24px; 25 | -fx-text-fill: white; 26 | } 27 | .simplehamburgermenu-top-link.selected, 28 | .simplehamburgermenu-top-link:hover { 29 | -fx-underline: true; 30 | } 31 | 32 | .simplehamburgermenu-expanded-links { 33 | -fx-alignment: center; 34 | -fx-background-color: #000000DD; 35 | -fx-spacing: 20; 36 | -fx-padding: 20; 37 | } 38 | 39 | .simplehamburgermenu-expanded-link { 40 | -fx-font-size: 20px; 41 | -fx-text-fill: white; 42 | } 43 | .simplehamburgermenu-expanded-link.selected, 44 | .simplehamburgermenu-expanded-link:hover { 45 | -fx-underline: true; 46 | } -------------------------------------------------------------------------------- /jpro-auth/core/src/main/java/one/jpro/platform/auth/core/api/FluentGoogleAuth.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.core.api; 2 | 3 | import javafx.stage.Stage; 4 | import one.jpro.platform.auth.core.oauth2.provider.GoogleAuthenticationProvider; 5 | 6 | /** 7 | * Fluent Google Authentication interface. 8 | * 9 | * @author Besmir Beqiri 10 | */ 11 | public interface FluentGoogleAuth { 12 | 13 | /** 14 | * Set the client id. 15 | * 16 | * @param clientId the client id 17 | * @return self 18 | */ 19 | FluentGoogleAuth clientId(String clientId); 20 | 21 | /** 22 | * Set the client secret. 23 | * 24 | * @param clientSecret the client secret 25 | * @return self 26 | */ 27 | FluentGoogleAuth clientSecret(String clientSecret); 28 | 29 | /** 30 | * Set the redirect uri. 31 | * 32 | * @param redirectUri the redirect uri 33 | * @return self 34 | */ 35 | FluentGoogleAuth redirectUri(String redirectUri); 36 | 37 | /** 38 | * Create a Google authentication provider. 39 | * 40 | * @param stage the stage 41 | * @return a {@link GoogleAuthenticationProvider} instance 42 | */ 43 | GoogleAuthenticationProvider create(Stage stage); 44 | } 45 | -------------------------------------------------------------------------------- /jpro-file/src/main/java/one/jpro/platform/file/picker/FileOpenPicker.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.file.picker; 2 | 3 | import com.jpro.webapi.WebAPI; 4 | import javafx.scene.Node; 5 | import one.jpro.platform.file.MultipleFileSelector; 6 | 7 | import java.util.Objects; 8 | 9 | /** 10 | * {@link FilePicker} interface extension for file open operations. 11 | * 12 | * @author Besmir Beqiri 13 | */ 14 | public interface FileOpenPicker extends FilePicker, MultipleFileSelector { 15 | 16 | /** 17 | * Creates a file picker. If the application is running in a 18 | * browser via JPro server, then a web version of the file 19 | * picker is returned. If the application is not running inside 20 | * the browser than a desktop version is returned. 21 | * 22 | * @param node the associated node for this file picker 23 | * @return a {@link FileOpenPicker} object. 24 | * @throws NullPointerException if the node is null 25 | */ 26 | static FileOpenPicker create(Node node) { 27 | Objects.requireNonNull(node, "node must not be null"); 28 | if (WebAPI.isBrowser()) { 29 | return new WebFileOpenPicker(node); 30 | } 31 | return new NativeFileOpenPicker(node); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /jpro-image-manager/src/test/java/one/jpro/platform/image/manager/ImageResultTest.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.image.manager; 2 | 3 | import javafx.application.Platform; 4 | import javafx.scene.image.Image; 5 | import org.junit.jupiter.api.BeforeEach; 6 | import org.junit.jupiter.api.Test; 7 | 8 | import java.io.File; 9 | import java.util.concurrent.CountDownLatch; 10 | 11 | import static org.junit.jupiter.api.Assertions.assertEquals; 12 | 13 | public class ImageResultTest { 14 | 15 | @BeforeEach 16 | void setUp() throws InterruptedException { 17 | CountDownLatch latch = new CountDownLatch(1); 18 | try { 19 | Platform.startup(latch::countDown); 20 | latch.await(); 21 | } catch (IllegalStateException ignored) { 22 | } 23 | } 24 | 25 | @Test 26 | public void testToFXImage() { 27 | File testFile = new File("src/test/resources/testImage.png"); 28 | ImageResult result = new ImageResult(testFile, 100, 100); 29 | Image fxImage = result.toFXImage(); 30 | 31 | // The following assertions could be more detailed depending on the requirements 32 | assertEquals(100, fxImage.getWidth()); 33 | assertEquals(100, fxImage.getHeight()); 34 | } 35 | } -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | JPRO_PLATFORM_VERSION = 0.5.8-SNAPSHOT 2 | 3 | JPRO_VERSION = 2025.3.1 4 | JAVAFX_BUILD_VERSION = 17.0.15 5 | JAVAFX_EXAMPLES_VERSION = 23.0.2 6 | SIMPLEFX_VERSION = 3.2.40 7 | JMEMORYBUDDY_VERSION = 0.5.6 8 | JNODES_VERSION = 0.8.3 9 | SCENIC_VIEW_VERSION = 11.0.3-SNAPSHOT-FORK 10 | 11 | JAVAFX_PLUGIN_VERSION = 0.1.0 12 | MODULE_PLUGIN_VERSION = 2.0.0 13 | OSDETECTOR_PLUGIN_VERSION = 1.7.3 14 | ENSEMBLE_GRADLE_PLUGIN_VERSION = 0.1.0-SNAPSHOT 15 | DEPENDENCY_CHECK_PLUGIN_VERSION = 9.1.0 16 | MAVEN_CENTRAL_PUBLISH_PLUGIN_VERSION = 1.3.0 17 | 18 | JAVACPP_VERSION = 1.5.10 19 | JAVACV_VERSION = 1.5.10 20 | JSON_VERSION = 20250517 21 | CONTROLSFX_VERSION = 11.2.2 22 | FLEXMARK_VERSION = 0.64.8 23 | JETBRAINS_ANNOTATIONS_VERSION = 26.0.1 24 | JJWT_VERSION = 0.12.6-jpms 25 | JAKARTA_MAIL_API_VERSION = 2.1.3 26 | ECLIPSE_ANGUS_MAIL_VERSION = 2.0.3 27 | ECLIPSE_COLLECTIONS_VERSION = 11.1.0-jpms 28 | CSSFX_VERSION = 11.5.1-jpms 29 | IKONLI_VERSION = 12.4.0 30 | ATLANTAFX_VERSION = 2.0.1 31 | COMMONS_IO_VERSION = 2.19.0 32 | JUNIT_VERSION = 5.13.4 33 | ASSERTJ_VERSION = 3.27.3 34 | HAMCREST_VERSION = 3.0 35 | MOCKITO_VERSION = 5.18.0 36 | TESTFX_VERSION = 4.0.18-jpms 37 | MONOCLE_VERSION = jfx-21-sandec 38 | SLF4J_API_VERSION = 2.0.17 39 | LOGBACK_VERSION = 1.5.18 -------------------------------------------------------------------------------- /jpro-auth/example/src/main/java/one/jpro/platform/auth/example/oauth/page/RefreshTokenPage.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.example.oauth.page; 2 | 3 | import javafx.beans.binding.Bindings; 4 | import javafx.scene.control.Label; 5 | import javafx.scene.layout.VBox; 6 | import one.jpro.platform.auth.example.oauth.OAuthApp; 7 | import one.jpro.platform.mdfx.MarkdownView; 8 | 9 | /** 10 | * Refresh token page. 11 | * 12 | * @author Besmir Beqiri 13 | */ 14 | public class RefreshTokenPage extends Page { 15 | 16 | public RefreshTokenPage(OAuthApp loginApp) { 17 | final var headerLabel = new Label("Authentication information\n" + 18 | "after refreshing the access token:"); 19 | headerLabel.getStyleClass().add("header-label"); 20 | 21 | MarkdownView markdownView = new MarkdownView(); 22 | markdownView.mdStringProperty().bind(Bindings.createStringBinding(() -> { 23 | final var user = loginApp.getUserSession().getUser(); 24 | return user == null ? "" : loginApp.jsonToMarkdown(user.toJSON()); 25 | })); 26 | 27 | final var pane = new VBox(headerLabel, markdownView); 28 | pane.getStyleClass().add("auth-info-pane"); 29 | 30 | getChildren().add(pane); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /jpro-file/example/src/main/java/one/jpro/platform/file/example/upload/FileSizeTableCell.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.file.example.upload; 2 | 3 | import javafx.geometry.Pos; 4 | import javafx.scene.control.ContentDisplay; 5 | import javafx.scene.control.TableCell; 6 | import javafx.scene.text.TextAlignment; 7 | import one.jpro.platform.file.FileSource; 8 | import org.apache.commons.io.FileUtils; 9 | 10 | /** 11 | * A custom TableCell for displaying file sizes. 12 | * 13 | * @param The type of the TableView source 14 | * @author Besmir Beqiri 15 | */ 16 | public class FileSizeTableCell extends TableCell { 17 | 18 | /** 19 | * Constructs a custom table cell for displaying file size information in a table cell. 20 | */ 21 | public FileSizeTableCell() { 22 | setTextAlignment(TextAlignment.RIGHT); 23 | setContentDisplay(ContentDisplay.TEXT_ONLY); 24 | setAlignment(Pos.CENTER_RIGHT); 25 | } 26 | 27 | @Override 28 | protected void updateItem(Long size, boolean empty) { 29 | super.updateItem(size, empty); 30 | 31 | if (empty) { 32 | setText(null); 33 | } else { 34 | setText(FileUtils.byteCountToDisplaySize(size)); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /jpro-auth/example/src/main/java/one/jpro/platform/auth/example/oauth/page/IntrospectionTokenPage.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.example.oauth.page; 2 | 3 | import javafx.beans.binding.Bindings; 4 | import javafx.scene.control.Label; 5 | import javafx.scene.layout.VBox; 6 | import one.jpro.platform.auth.example.oauth.OAuthApp; 7 | import one.jpro.platform.mdfx.MarkdownView; 8 | 9 | /** 10 | * Introspection token page. 11 | * 12 | * @author Besmir Beqiri 13 | */ 14 | public class IntrospectionTokenPage extends Page { 15 | 16 | public IntrospectionTokenPage(OAuthApp loginApp) { 17 | final var headerLabel = new Label("Introspect token:"); 18 | headerLabel.getStyleClass().add("header-label"); 19 | 20 | MarkdownView markdownView = new MarkdownView(); 21 | markdownView.mdStringProperty().bind(Bindings.createStringBinding(() -> { 22 | final var introspectionInfo = loginApp.getIntrospectionInfo(); 23 | return introspectionInfo == null ? "" : loginApp.jsonToMarkdown(introspectionInfo); 24 | }, loginApp.introspectionInfoProperty())); 25 | 26 | final var pane = new VBox(headerLabel, markdownView); 27 | pane.getStyleClass().add("user-info-pane"); 28 | 29 | getChildren().add(pane); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /jpro-auth/core/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Module descriptor for the Auth Core module. 3 | * 4 | * @author Besmir Beqiri 5 | */ 6 | module one.jpro.platform.auth.core { 7 | requires transitive javafx.graphics; 8 | requires transitive javafx.controls; 9 | requires transitive org.json; 10 | requires transitive org.slf4j; 11 | requires transitive one.jpro.platform.utils; 12 | 13 | requires org.jetbrains.annotations; 14 | requires java.net.http; 15 | requires jpro.webapi; 16 | requires jjwt.api; 17 | 18 | opens one.jpro.platform.auth.core; 19 | opens one.jpro.platform.auth.core.authentication; 20 | opens one.jpro.platform.auth.core.basic; 21 | 22 | exports one.jpro.platform.auth.core; 23 | exports one.jpro.platform.auth.core.api; 24 | exports one.jpro.platform.auth.core.authentication; 25 | exports one.jpro.platform.auth.core.basic; 26 | exports one.jpro.platform.auth.core.basic.provider; 27 | exports one.jpro.platform.auth.core.crypto; 28 | exports one.jpro.platform.auth.core.crypto.bcrypt; 29 | exports one.jpro.platform.auth.core.http; 30 | exports one.jpro.platform.auth.core.jwt; 31 | exports one.jpro.platform.auth.core.oauth2; 32 | exports one.jpro.platform.auth.core.oauth2.provider; 33 | exports one.jpro.platform.auth.core.utils; 34 | } -------------------------------------------------------------------------------- /jpro-mail/src/main/java/one/jpro/platform/mail/config/GoogleMailConfig.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.mail.config; 2 | 3 | import one.jpro.platform.mail.StartTLSOption; 4 | import one.jpro.platform.mail.impl.MailConfigImpl; 5 | 6 | /** 7 | * The GoogleMailConfig class provides a predefined configuration for connecting to the Google Mail (Gmail) SMTP server. 8 | * It sets specific properties required to use Gmail's SMTP server for sending emails. 9 | * 10 | *

Example usage:

11 | *
{@code
12 |  * MailConfig config = new GoogleMailConfig();
13 |  * // Further configuration or usage of config
14 |  * }
15 | * 16 | * @author Besmir Beqiri 17 | * @see StartTLSOption 18 | */ 19 | public class GoogleMailConfig extends MailConfigImpl { 20 | 21 | /** 22 | * Constructs a new GoogleMailConfig instance with default settings for connecting to 23 | * Google's SMTP server. The configuration includes enabling SMTP authentication, 24 | * enabling STARTTLS, setting the SMTP host to Google's SMTP server, and setting the 25 | * SMTP port to the standard port for TLS/STARTTLS. 26 | */ 27 | public GoogleMailConfig() { 28 | setMailSmtpAuth(true); 29 | setMailSmtpStartTLS(StartTLSOption.ENABLED); 30 | setMailSmtpHost("smtp.gmail.com"); 31 | setMailSmtpPort(587); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /jpro-mdfx/README.md: -------------------------------------------------------------------------------- 1 | 2 | ## JPro MDFX 3 | 4 | ### Introduction 5 | 6 | 7 | JPro MDFX is a simple markdown-renderer for JavaFX. 8 | It's based on [flexmark-java](https://github.com/vsch/flexmark-java). 9 | It is used to render the [documentation for jpro](https://www.jpro.one/?page=docs/current/1.1/) at [jpro.one](https://www.jpro.one/). 10 | 11 | 12 | Usage: 13 | ``` 14 | import one.jpro.platform.mdfx.MarkdownView; 15 | 16 | MarkdownView mdfx = new MarkdownView("your-markdown"); 17 | ``` 18 | 19 | Simple Application: 20 | [Source Code](https://github.com/jpro-one/markdown-javafx-renderer/blob/master/example/src/main/java/com/sandec/mdfx/ExampleMDFX.java) 21 | 22 | Feature Overview: 23 | [Reference-Markdown-File](https://github.com/jpro-one/markdown-javafx-renderer/blob/master/example/src/main/resources/com/sandec/mdfx/sample.md) 24 | 25 | 26 | You can personalize the looking of your markdown via css. 27 | [Minimal default-file](https://github.com/jpro-one/markdown-javafx-renderer/blob/master/src/main/resources/com/sandec/mdfx/mdfx-default.css) 28 | To use your own css, you have to overwrite the `getDefaultStylesheets`. 29 | ```java 30 | protected List getDefaultStylesheets() { 31 | return List.of("/your-css.css"); 32 | } 33 | ``` 34 | Alternatively, you can also return an empty list, and add your css via the `getStylesheets` of the Scene. -------------------------------------------------------------------------------- /jpro-auth/core/src/main/java/one/jpro/platform/auth/core/api/FluentGoogleAuthAPI.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.core.api; 2 | 3 | import javafx.stage.Stage; 4 | import one.jpro.platform.auth.core.oauth2.provider.GoogleAuthenticationProvider; 5 | 6 | /** 7 | * Fluent Google Authentication API. 8 | * 9 | * @author Besmir Beqiri 10 | */ 11 | public class FluentGoogleAuthAPI implements FluentGoogleAuth { 12 | 13 | private String clientId; 14 | private String clientSecret; 15 | private String redirectUri; 16 | 17 | @Override 18 | public FluentGoogleAuth clientId(String clientId) { 19 | this.clientId = clientId; 20 | return this; 21 | } 22 | 23 | @Override 24 | public FluentGoogleAuth clientSecret(String clientSecret) { 25 | this.clientSecret = clientSecret; 26 | return this; 27 | } 28 | 29 | @Override 30 | public FluentGoogleAuth redirectUri(String redirectUri) { 31 | this.redirectUri = redirectUri; 32 | return this; 33 | } 34 | 35 | @Override 36 | public GoogleAuthenticationProvider create(Stage stage) { 37 | final var googleAuthProvider = new GoogleAuthenticationProvider(stage, clientId, clientSecret); 38 | googleAuthProvider.getCredentials().setRedirectUri(redirectUri); 39 | return googleAuthProvider; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /jpro-media/example/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Module descriptor for the example application. 3 | * 4 | * @author Besmir Beqiri 5 | */ 6 | module one.jpro.platform.media.example { 7 | requires javafx.controls; 8 | requires javafx.media; 9 | requires atlantafx.base; 10 | requires org.slf4j; 11 | 12 | requires jpro.webapi; 13 | requires one.jpro.platform.media; 14 | requires one.jpro.platform.file; 15 | 16 | requires org.bytedeco.ffmpeg.windows.x86_64; 17 | requires org.bytedeco.opencv.windows.x86_64; 18 | requires org.bytedeco.openblas.windows.x86_64; 19 | requires org.bytedeco.videoinput.windows.x86_64; 20 | 21 | requires org.bytedeco.ffmpeg.linux.x86_64; 22 | requires org.bytedeco.opencv.linux.x86_64; 23 | requires org.bytedeco.openblas.linux.x86_64; 24 | 25 | requires org.bytedeco.ffmpeg.linux.arm64; 26 | requires org.bytedeco.opencv.linux.arm64; 27 | requires org.bytedeco.openblas.linux.arm64; 28 | 29 | requires org.bytedeco.ffmpeg.macosx.x86_64; 30 | requires org.bytedeco.opencv.macosx.x86_64; 31 | requires org.bytedeco.openblas.macosx.x86_64; 32 | 33 | requires org.bytedeco.ffmpeg.macosx.arm64; 34 | requires org.bytedeco.opencv.macosx.arm64; 35 | requires org.bytedeco.openblas.macosx.arm64; 36 | 37 | exports one.jpro.platform.media.example; 38 | } -------------------------------------------------------------------------------- /jpro-file/example/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.openjfx.javafxplugin' 3 | id 'jpro-gradle-plugin' 4 | } 5 | 6 | dependencies { 7 | implementation project(":jpro-file") 8 | implementation "one.jpro:jpro-webapi:$JPRO_VERSION" 9 | implementation "commons-io:commons-io:$COMMONS_IO_VERSION" 10 | implementation "io.github.mkpaz:atlantafx-base:$ATLANTAFX_VERSION" 11 | implementation "org.kordamp.ikonli:ikonli-javafx:$IKONLI_VERSION" 12 | implementation "org.kordamp.ikonli:ikonli-material2-pack:$IKONLI_VERSION" 13 | implementation "org.slf4j:slf4j-api:$SLF4J_API_VERSION" 14 | runtimeOnly "ch.qos.logback:logback-classic:$LOGBACK_VERSION" 15 | } 16 | 17 | javafx { 18 | version = "$JAVAFX_EXAMPLES_VERSION" 19 | modules = ['javafx.controls', 'javafx.swing', 'javafx.media'] 20 | } 21 | 22 | def examples = [ 23 | 'text-editor' : 'one.jpro.platform.file.example.editor.TextEditorSample', 24 | 'file-uploader' : 'one.jpro.platform.file.example.upload.FileUploaderSample' 25 | ] 26 | 27 | 28 | application { 29 | mainClass = project.hasProperty("sample") ? examples[project.getProperties().get("sample")] : examples["text-editor"] 30 | mainModule = "one.jpro.platform.file.example" 31 | applicationDefaultJvmArgs = [ 32 | "--add-exports", "javafx.base/com.sun.javafx.event=one.jpro.platform.file" 33 | ] 34 | } -------------------------------------------------------------------------------- /jpro-mail/src/main/java/one/jpro/platform/mail/impl/MailClientImpl.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.mail.impl; 2 | 3 | import jakarta.mail.Authenticator; 4 | import jakarta.mail.PasswordAuthentication; 5 | import jakarta.mail.Session; 6 | import one.jpro.platform.mail.MailClient; 7 | import one.jpro.platform.mail.MailConfig; 8 | import one.jpro.platform.mail.MailMessage; 9 | import org.jetbrains.annotations.NotNull; 10 | 11 | /** 12 | * Mail client implementation. 13 | * 14 | * @author Besmir Beqiri 15 | */ 16 | public class MailClientImpl implements MailClient { 17 | 18 | private final Session session; 19 | 20 | public MailClientImpl(MailConfig mailConfig) { 21 | session = Session.getInstance(mailConfig.getProperties()); 22 | } 23 | 24 | public MailClientImpl(MailConfig mailConfig, String username, String password) { 25 | final Authenticator authenticator = new Authenticator() { 26 | @Override 27 | protected PasswordAuthentication getPasswordAuthentication() { 28 | return new PasswordAuthentication(username, password); 29 | } 30 | }; 31 | session = Session.getInstance(mailConfig.getProperties(), authenticator); 32 | } 33 | 34 | @NotNull 35 | @Override 36 | public MailMessage createMessage() { 37 | return new MailMessageImpl(session); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /jpro-routing/core-test/src/test/scala/one/jpro/platform/routing/TestRouteApp.scala: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.routing 2 | 3 | import javafx.scene.layout.StackPane 4 | import javafx.stage.Stage 5 | import org.junit.jupiter.api.Test 6 | import simplefx.core._ 7 | 8 | class TestRouteApp { 9 | 10 | @Test 11 | def testAccessingSessionManager1(): Unit = inFX { 12 | new RouteApp { 13 | override def createRoute(): Route = { 14 | assert(getSessionManager() != null) 15 | Route.get("/", r => Response.node(new StackPane())) 16 | } 17 | }.start(new Stage()) 18 | } 19 | 20 | @Test 21 | def testAccessingSessionManager2(): Unit = inFX { 22 | new RouteApp { 23 | override def createRoute(): Route = { 24 | assert(LinkUtil.getSessionManager(getRouteNode()) != null) 25 | Route.get("/", r => Response.node(new StackPane())) 26 | } 27 | }.start(new Stage()) 28 | } 29 | 30 | @Test 31 | def testAccessingSessionManager3(): Unit = inFX { 32 | new RouteApp { 33 | override def createRoute(): Route = { 34 | assert(getRouteNode().getSessionManager() != null) 35 | Route.get("/", r => Response.node(new StackPane())) 36 | } 37 | }.start(new Stage()) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /jpro-auth/core/src/main/java/one/jpro/platform/auth/core/AuthAPI.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.core; 2 | 3 | import one.jpro.platform.auth.core.api.*; 4 | 5 | /** 6 | * Access and configure supported authentication providers via simplified and fluent style API. 7 | * 8 | * @author Besmir Beqiri 9 | */ 10 | public interface AuthAPI { 11 | 12 | /** 13 | * Configure and create a basic (username and password) authentication provider. 14 | * 15 | * @return fluent style api 16 | */ 17 | static FluentBasicAuth basicAuth() { 18 | return new FluentBasicAuthAPI(); 19 | } 20 | 21 | /** 22 | * Configure and create a Google authentication provider. 23 | * 24 | * @return fluent style api 25 | */ 26 | static FluentGoogleAuth googleAuth() { 27 | return new FluentGoogleAuthAPI(); 28 | } 29 | 30 | /** 31 | * Configure and create a Keycloak authentication provider. 32 | * 33 | * @return fluent style api 34 | */ 35 | static FluentKeycloakAuth keycloakAuth() { 36 | return new FluentKeycloakAuthAPI(); 37 | } 38 | 39 | /** 40 | * Configure and create a Microsoft authentication provider. 41 | * 42 | * @return fluent style api 43 | */ 44 | static FluentMicrosoftAuth microsoftAuth() { 45 | return new FluentMicrosoftAuthAPI(); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /example/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.bytedeco.gradle-javacpp-platform' version "$JAVACPP_VERSION" 3 | id 'org.javamodularity.moduleplugin' version "$MODULE_PLUGIN_VERSION" 4 | id 'org.openjfx.javafxplugin' 5 | id 'jpro-gradle-plugin' 6 | } 7 | 8 | ext { 9 | // Add more needed platforms here 10 | javacppPlatform = 'linux-x86_64,linux-arm64,macosx-x86_64,macosx-arm64,windows-x86_64' 11 | } 12 | 13 | dependencies { 14 | implementation project(":jpro-routing:core") 15 | implementation project(":jpro-routing:dev") 16 | implementation project(":jpro-mdfx:example") 17 | implementation project(":jpro-media:example") 18 | implementation project(":jpro-html-scrollpane:example") 19 | implementation project(":jpro-session:example") 20 | implementation "io.github.mkpaz:atlantafx-base:$ATLANTAFX_VERSION" 21 | runtimeOnly "ch.qos.logback:logback-classic:$LOGBACK_VERSION" 22 | } 23 | 24 | javafx { 25 | version = "$JAVAFX_EXAMPLES_VERSION" 26 | modules = ['javafx.graphics', 'javafx.controls', 'javafx.fxml', 'javafx.media', 'javafx.swing', 'javafx.web'] 27 | } 28 | 29 | application { 30 | mainClass = 'one.jpro.platform.example.Main' 31 | mainModule = 'one.jpro.platform.example' 32 | applicationDefaultJvmArgs = [ 33 | "--add-exports", "javafx.base/com.sun.javafx.event=one.jpro.platform.media" 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /jpro-image-manager/src/test/java/one/jpro/platform/image/manager/encoder/ImageEncoderPNGTest.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.image.manager.encoder; 2 | 3 | import org.junit.jupiter.api.BeforeEach; 4 | import org.junit.jupiter.api.Test; 5 | import javax.imageio.ImageIO; 6 | import java.awt.image.BufferedImage; 7 | import java.io.File; 8 | 9 | import static org.junit.jupiter.api.Assertions.*; 10 | 11 | public class ImageEncoderPNGTest { 12 | 13 | private ImageEncoderPNG encoder; 14 | 15 | @BeforeEach 16 | public void setup() { 17 | encoder = new ImageEncoderPNG(); 18 | } 19 | 20 | @Test 21 | public void testSaveImage() throws Exception { 22 | BufferedImage testImage = ImageIO.read(new File("src/test/resources/testImage.png")); 23 | File outputFile = new File("src/test/resources/testOutputImage.png"); 24 | 25 | encoder.saveImage(testImage, outputFile); 26 | 27 | assertTrue(outputFile.exists()); 28 | 29 | BufferedImage loadedOutput = ImageIO.read(outputFile); 30 | assertEquals(testImage.getWidth(), loadedOutput.getWidth()); 31 | assertEquals(testImage.getHeight(), loadedOutput.getHeight()); 32 | 33 | // Cleanup 34 | outputFile.delete(); 35 | } 36 | 37 | @Test 38 | public void testFileExtension() { 39 | assertEquals("png", encoder.getFileExtension()); 40 | } 41 | } -------------------------------------------------------------------------------- /jpro-image-manager/src/test/java/one/jpro/platform/image/manager/transformer/ImageTransformerWHTest.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.image.manager.transformer; 2 | 3 | import org.json.JSONObject; 4 | import org.junit.jupiter.api.Test; 5 | import javax.imageio.ImageIO; 6 | import java.awt.image.BufferedImage; 7 | import java.io.File; 8 | 9 | import static org.junit.jupiter.api.Assertions.assertEquals; 10 | import static org.junit.jupiter.api.Assertions.assertTrue; 11 | 12 | public class ImageTransformerWHTest { 13 | 14 | @Test 15 | public void testImageTransformerWH() throws Exception { 16 | BufferedImage originalImage = ImageIO.read(new File("src/test/resources/testImage.png")); 17 | ImageTransformer transformer = new ImageTransformerWH(200, 300); 18 | BufferedImage transformedImage = transformer.transform(originalImage); 19 | 20 | assertEquals(200, transformedImage.getWidth()); 21 | assertEquals(300, transformedImage.getHeight()); 22 | } 23 | 24 | @Test 25 | public void testToJson() { 26 | ImageTransformer transformer = new ImageTransformerWH(200, 300); 27 | 28 | JSONObject json = new JSONObject(); 29 | json.put("type", "ImageTransformerWH"); 30 | json.put("targetWidth", 200); 31 | json.put("targetHeight", 300); 32 | assertTrue(transformer.toJSON().similar(json)); 33 | } 34 | } -------------------------------------------------------------------------------- /jpro-image-manager/src/test/java/one/jpro/platform/image/manager/transformer/ImageTransformerFitHeightTest.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.image.manager.transformer; 2 | 3 | import org.json.JSONObject; 4 | import org.junit.jupiter.api.Test; 5 | import javax.imageio.ImageIO; 6 | import java.awt.image.BufferedImage; 7 | import java.io.File; 8 | import java.io.IOException; 9 | 10 | import static org.junit.jupiter.api.Assertions.assertEquals; 11 | import static org.junit.jupiter.api.Assertions.assertTrue; 12 | 13 | public class ImageTransformerFitHeightTest { 14 | 15 | @Test 16 | public void testTransform() throws IOException { 17 | File testImageFile = new File("src/test/resources/testImage.png"); 18 | BufferedImage originalImage = ImageIO.read(testImageFile); 19 | 20 | ImageTransformer transformer = new ImageTransformerFitHeight(500); 21 | BufferedImage transformedImage = transformer.transform(originalImage); 22 | 23 | assertEquals(500, transformedImage.getHeight()); 24 | } 25 | 26 | @Test 27 | public void testToJson() { 28 | ImageTransformer transformer = new ImageTransformerFitHeight(500); 29 | 30 | JSONObject json = new JSONObject(); 31 | json.put("type", ImageTransformerFitHeight.class.getSimpleName()); 32 | json.put("targetHeight", 500); 33 | assertTrue(transformer.toJSON().similar(json)); 34 | } 35 | } -------------------------------------------------------------------------------- /jpro-image-manager/src/test/java/one/jpro/platform/image/manager/ImageDefinitionTest.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.image.manager; 2 | 3 | import one.jpro.platform.image.manager.encoder.ImageEncoder; 4 | import one.jpro.platform.image.manager.encoder.ImageEncoderPNG; 5 | import one.jpro.platform.image.manager.source.ImageSource; 6 | import one.jpro.platform.image.manager.source.ImageSourceFile; 7 | import one.jpro.platform.image.manager.transformer.ImageTransformer; 8 | import one.jpro.platform.image.manager.transformer.ImageTransformerFitWidth; 9 | import org.json.JSONObject; 10 | import org.junit.jupiter.api.Test; 11 | 12 | import java.io.File; 13 | 14 | import static org.junit.jupiter.api.Assertions.assertTrue; 15 | 16 | class ImageDefinitionTest { 17 | 18 | @Test 19 | void testToJson() { 20 | ImageSource source = new ImageSourceFile(new File("path/to/file.png")); 21 | ImageTransformer transformer = new ImageTransformerFitWidth(500); 22 | ImageEncoder encoder = new ImageEncoderPNG(); 23 | 24 | ImageDefinition definition = new ImageDefinition(source, transformer, encoder); 25 | 26 | JSONObject json = new JSONObject(); 27 | json.put("source", source.toJSON()); 28 | json.put("transformer", transformer.toJSON()); 29 | json.put("encoder", encoder.toJSON()); 30 | 31 | assertTrue(definition.toJSON().similar(json)); 32 | } 33 | 34 | } -------------------------------------------------------------------------------- /jpro-mail/src/main/java/one/jpro/platform/mail/config/MailTrapConfig.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.mail.config; 2 | 3 | import one.jpro.platform.mail.StartTLSOption; 4 | import one.jpro.platform.mail.impl.MailConfigImpl; 5 | 6 | /** 7 | * The MailTrapConfig class provides a predefined configuration for connecting to the MailTrap SMTP server. 8 | * It sets specific properties required to use MailTrap's sandbox environment for sending emails. 9 | * 10 | *

Example usage:

11 | *
{@code
12 |  * MailConfig config = new MailTrapConfig();
13 |  * // Further configuration or usage of config
14 |  * }
15 | * 16 | * @author Besmir Beqiri 17 | * @see StartTLSOption 18 | */ 19 | public class MailTrapConfig extends MailConfigImpl { 20 | 21 | /** 22 | * Constructs a new MailTrapConfig instance with default settings for connecting to 23 | * MailTrap's SMTP server. The configuration includes enabling SMTP authentication, 24 | * enabling STARTTLS, setting the SMTP host to MailTrap's sandbox server, setting the 25 | * SMTP port and trusting the MailTrap sandbox host for SSL connections. 26 | */ 27 | public MailTrapConfig() { 28 | setMailSmtpAuth(true); 29 | setMailSmtpStartTLS(StartTLSOption.ENABLED); 30 | setMailSmtpHost("sandbox.smtp.mailtrap.io"); 31 | setMailSmtpPort(25); 32 | setMailSmtpSslTrust("sandbox.smtp.mailtrap.io"); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /jpro-auth/core/src/main/java/one/jpro/platform/auth/core/basic/UserNotFoundException.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.core.basic; 2 | 3 | import one.jpro.platform.auth.core.authentication.User; 4 | 5 | /** 6 | * Represents an exception that is thrown when a {@link User} cannot be located. 7 | * 8 | * @author Besmir Beqiri 9 | */ 10 | public class UserNotFoundException extends RuntimeException { 11 | 12 | /** 13 | * Constructs a new UserNotFoundException with the specified detail message. 14 | * 15 | * @param msg the detail message. The detail message is saved for 16 | * later retrieval by the {@link Throwable#getMessage()} method. 17 | */ 18 | public UserNotFoundException(String msg) { 19 | super(msg); 20 | } 21 | 22 | /** 23 | * Constructs a new UserNotFoundException with the specified detail message and cause. 24 | * 25 | * @param msg the detail message. The detail message is saved for 26 | * later retrieval by the {@link Throwable#getMessage()} method. 27 | * @param cause the cause (which is saved for later retrieval by the 28 | * {@link Throwable#getCause()} method). (A null value is 29 | * permitted, and indicates that the cause is nonexistent or unknown.) 30 | */ 31 | public UserNotFoundException(String msg, Throwable cause) { 32 | super(msg, cause); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /jpro-routing/core/src/main/scala/one/jpro/platform/routing/RouteNode.scala: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.routing 2 | 3 | import com.jpro.webapi.WebAPI 4 | import one.jpro.platform.routing.sessionmanager.SessionManager 5 | import simplefx.core._ 6 | import simplefx.all._ 7 | import simplefx.experimental._ 8 | 9 | import java.lang.ref.WeakReference 10 | 11 | class RouteNode(stage: Stage, route: Route) extends StackPane { THIS => 12 | 13 | def this(stage: Stage) = { 14 | this(stage, Route.empty()) 15 | } 16 | 17 | styleClass ::= "jpro-web-app" 18 | private[routing] var sessionManager: SessionManager = null 19 | 20 | def getSessionManager(): SessionManager = sessionManager 21 | 22 | @Bind private var layoutCounter = 0 23 | def getLayoutCounter(): Int = layoutCounter 24 | 25 | override def layoutChildren(): Unit = { 26 | layoutCounter += 1 27 | if ((this.scene ne null) && WebAPI.isBrowser) { 28 | webAPI.layoutRoot(this.scene) 29 | super.layoutChildren() 30 | } else { 31 | super.layoutChildren() 32 | } 33 | } 34 | 35 | lazy val webAPI: WebAPI = if(WebAPI.isBrowser) com.jpro.webapi.WebAPI.getWebAPI(stage) else null 36 | 37 | var newRoute: Route = route 38 | def getRoute(): Route = newRoute 39 | def setRoute(x: Route): Unit = newRoute = x 40 | 41 | 42 | def start(sessionManager: SessionManager): Response = { 43 | sessionManager.start() 44 | } 45 | 46 | 47 | 48 | } 49 | -------------------------------------------------------------------------------- /jpro-auth/example/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.javamodularity.moduleplugin' version "$MODULE_PLUGIN_VERSION" 3 | id 'org.openjfx.javafxplugin' 4 | id 'jpro-gradle-plugin' 5 | } 6 | 7 | dependencies { 8 | implementation project(':jpro-auth:core') 9 | implementation project(':jpro-auth:routing') 10 | implementation project(':jpro-routing:core') 11 | implementation project(':jpro-routing:dev') 12 | implementation project(':jpro-mdfx') 13 | implementation project(':jpro-session') 14 | 15 | implementation "org.controlsfx:controlsfx:$CONTROLSFX_VERSION" 16 | implementation "one.jpro.platform.jpms:cssfx:$CSSFX_VERSION" 17 | implementation "io.github.mkpaz:atlantafx-base:$ATLANTAFX_VERSION" 18 | runtimeOnly "ch.qos.logback:logback-classic:$LOGBACK_VERSION" 19 | } 20 | 21 | javafx { 22 | version = "$JAVAFX_EXAMPLES_VERSION" 23 | modules = ['javafx.controls', 'javafx.fxml', 'javafx.swing', 'javafx.web'] 24 | } 25 | 26 | def examples = [ 27 | 'basic-login' : 'one.jpro.platform.auth.example.basic.BasicLoginApp', 28 | 'google-login': 'one.jpro.platform.auth.example.login.GoogleLoginApp', 29 | 'oauth' : 'one.jpro.platform.auth.example.oauth.OAuthApp' 30 | ] 31 | 32 | application { 33 | mainClass = project.hasProperty("sample") ? examples[project.getProperties().get("sample")] : examples["google-login"] 34 | mainModule = "one.jpro.platform.auth.example" 35 | } -------------------------------------------------------------------------------- /jpro-utils/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | implementation "org.jetbrains:annotations:$JETBRAINS_ANNOTATIONS_VERSION" 3 | implementation "org.slf4j:slf4j-api:$SLF4J_API_VERSION" 4 | implementation "one.jpro:jpro-webapi:$JPRO_VERSION" 5 | 6 | testImplementation "one.jpro:jmemorybuddy:$JMEMORYBUDDY_VERSION" 7 | } 8 | 9 | test { 10 | jvmArgs = [ 11 | "-Dglass.platform=Monocle", "-Dmonocle.platform=Headless", 12 | "-Dtestfx.headless=true", "-Djava.awt.headless=true", 13 | "--add-opens", "javafx.graphics/com.sun.glass.ui=org.testfx.core", 14 | "--add-opens", "javafx.graphics/com.sun.javafx.application=org.testfx.core", 15 | "--add-exports", "javafx.graphics/com.sun.javafx.application=org.testfx.core", 16 | "--add-exports", "javafx.graphics/com.sun.glass.ui=org.testfx.monocle", 17 | "--add-exports", "javafx.graphics/com.sun.javafx.util=org.testfx.monocle", 18 | "--add-exports", "javafx.base/com.sun.javafx.logging=org.testfx.monocle" 19 | ] 20 | } 21 | 22 | publishing { 23 | publications { 24 | mavenJava(MavenPublication) { 25 | pom { 26 | name = 'JPro Utils' 27 | description = 'A utility module offering essential tools for various functionalities to enhance the ' + 28 | 'development of **JPro/JavaFX** applications' 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /jpro-auth/core/src/main/java/one/jpro/platform/auth/core/api/FluentMicrosoftAuth.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.core.api; 2 | 3 | import javafx.stage.Stage; 4 | import one.jpro.platform.auth.core.oauth2.provider.MicrosoftAuthenticationProvider; 5 | 6 | /** 7 | * Fluent Microsoft Authentication interface. 8 | * 9 | * @author Besmir Beqiri 10 | */ 11 | public interface FluentMicrosoftAuth { 12 | 13 | /** 14 | * Set the client id. 15 | * 16 | * @param clientId the client id 17 | * @return self 18 | */ 19 | FluentMicrosoftAuth clientId(String clientId); 20 | 21 | /** 22 | * Set the client secret. 23 | * 24 | * @param clientSecret the client secret 25 | * @return self 26 | */ 27 | FluentMicrosoftAuth clientSecret(String clientSecret); 28 | 29 | /** 30 | * Set the tenant. 31 | * 32 | * @param tenant the tenant 33 | * @return self 34 | */ 35 | FluentMicrosoftAuth tenant(String tenant); 36 | 37 | /** 38 | * Set the redirect uri. 39 | * 40 | * @param redirectUri the redirect uri 41 | * @return self 42 | */ 43 | FluentMicrosoftAuth redirectUri(String redirectUri); 44 | 45 | /** 46 | * Create a Microsoft authentication provider. 47 | * 48 | * @param stage the stage 49 | * @return a {@link MicrosoftAuthenticationProvider} instance 50 | */ 51 | MicrosoftAuthenticationProvider create(Stage stage); 52 | } 53 | -------------------------------------------------------------------------------- /jpro-auth/core/src/main/java/one/jpro/platform/auth/core/authentication/CredentialValidationException.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.core.authentication; 2 | 3 | /** 4 | * Represents an exception that is thrown when {@link Credentials} validation fails. 5 | * 6 | * @author Besmir Beqiri 7 | */ 8 | public class CredentialValidationException extends RuntimeException { 9 | 10 | /** 11 | * Constructs a new CredentialValidationException with the specified detail message. 12 | * 13 | * @param message the detail message. The detail message is saved for 14 | * later retrieval by the {@link Throwable#getMessage()} method. 15 | */ 16 | public CredentialValidationException(String message) { 17 | super(message); 18 | } 19 | 20 | /** 21 | * Constructs a new CredentialValidationException with the specified detail message and cause. 22 | * 23 | * @param message the detail message. The detail message is saved for 24 | * later retrieval by the {@link Throwable#getMessage()} method. 25 | * @param cause the cause (which is saved for later retrieval by the 26 | * {@link Throwable#getCause()} method). (A null value is 27 | * permitted, and indicates that the cause is nonexistent or unknown.) 28 | */ 29 | public CredentialValidationException(String message, Throwable cause) { 30 | super(message, cause); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /jpro-auth/core/src/main/java/one/jpro/platform/auth/core/authentication/Credentials.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.core.authentication; 2 | 3 | import org.json.JSONObject; 4 | 5 | /** 6 | * Abstract representation of a Credentials object. 7 | * 8 | * @author Besmir Beqiri 9 | */ 10 | public interface Credentials { 11 | 12 | /** 13 | * Convert the credential information to JSON format. 14 | * 15 | * @return a JSON object. 16 | */ 17 | JSONObject toJSON(); 18 | 19 | /** 20 | * Implementors should override this method to perform validation. 21 | * An argument is allowed to allow custom validation. 22 | * 23 | * @param arg optional argument or null. 24 | * @param the generic type of the argument 25 | * @throws CredentialValidationException when the validation fails 26 | */ 27 | default void validate(V arg) throws CredentialValidationException { 28 | } 29 | 30 | /** 31 | * Encodes this credential as an HTTP Authorization 32 | * https://tools.ietf.org/html/rfc7235. 33 | * 34 | * @throws UnsupportedOperationException when the credential object cannot be converted to an HTTP Authorization. 35 | * @return HTTP header including scheme. 36 | */ 37 | default String toHttpAuthorization() { 38 | throw new UnsupportedOperationException(getClass().getName() + " cannot be converted to HTTP Authorization"); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /jpro-webrtc/example/src/main/resources/one/jpro/platform/webrtc/example/videoroom/videoroom.css: -------------------------------------------------------------------------------- 1 | .page { 2 | -fx-background-color: #ffffff; 3 | -fx-alignment: center; 4 | } 5 | 6 | .title { 7 | -fx-font-size: 20px; 8 | } 9 | 10 | .video-room-page { 11 | -fx-alignment: center; 12 | -fx-spacing: 16; 13 | } 14 | 15 | .room-name { 16 | -fx-font-size: 20px; 17 | -fx-font-weight: bold; 18 | } 19 | 20 | .user-name-label { 21 | -fx-font-size: 20px; 22 | -fx-font-weight: bold; 23 | } 24 | .user-name-field { 25 | -fx-font-size: 20px; 26 | -fx-font-weight: bold; 27 | -fx-pref-width: 200; 28 | // Cool javafx border 29 | -fx-border-color: #000000; 30 | -fx-border-width: 2; 31 | -fx-border-radius: 4; 32 | -fx-background-color: #ffffff; 33 | -fx-background-radius: 4; 34 | } 35 | .user-name-box { 36 | -fx-alignment: center; 37 | -fx-spacing: 16; 38 | } 39 | 40 | .other-views { 41 | -fx-alignment: center; 42 | -fx-spacing: 16; 43 | } 44 | 45 | .video-frame-wrapper { 46 | -fx-background-color: #000000; 47 | -fx-pref-width: 400; 48 | -fx-max-width: 400; 49 | -fx-pref-height: 300; 50 | } 51 | 52 | .video-frame-box { 53 | -fx-max-width: 400; 54 | -fx-alignment: center; 55 | -fx-background-color: #ddddff; 56 | -fx-background-radius: 16; 57 | -fx-padding: 24; 58 | -fx-spacing: 16; 59 | } 60 | .video-frame-name { 61 | -fx-font-size: 20px; 62 | -fx-font-weight: bold; 63 | } 64 | 65 | .buttons { 66 | -fx-alignment: center; 67 | -fx-spacing: 16; 68 | } -------------------------------------------------------------------------------- /jpro-auth/core/src/main/java/one/jpro/platform/auth/core/api/FluentBasicAuth.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.core.api; 2 | 3 | import one.jpro.platform.auth.core.basic.UserManager; 4 | import one.jpro.platform.auth.core.basic.provider.BasicAuthenticationProvider; 5 | 6 | import java.util.Map; 7 | 8 | /** 9 | * Fluent Basic (username and password) Authentication interface. 10 | * 11 | * @author Besmir Beqiri 12 | */ 13 | public interface FluentBasicAuth { 14 | 15 | /** 16 | * Set the user manager. 17 | * 18 | * @param userManager the user manager 19 | * @return self 20 | */ 21 | FluentBasicAuth userManager(UserManager userManager); 22 | 23 | /** 24 | * Set the roles. 25 | * 26 | * @param roles the roles 27 | * @return self 28 | */ 29 | FluentBasicAuth roles(String... roles); 30 | 31 | /** 32 | * Set the attributes. 33 | * 34 | * @param attributes the attributes 35 | * @return self 36 | */ 37 | FluentBasicAuth attributes(Map attributes); 38 | 39 | /** 40 | * Set the authorization path. 41 | * 42 | * @param authorizationPath the authorization path 43 | * @return self 44 | */ 45 | FluentBasicAuth authorizationPath(String authorizationPath); 46 | 47 | /** 48 | * Create a simple authentication provider. 49 | * 50 | * @return a {@link BasicAuthenticationProvider} instance 51 | */ 52 | BasicAuthenticationProvider create(); 53 | } 54 | -------------------------------------------------------------------------------- /jpro-auth/core/src/main/java/one/jpro/platform/auth/core/http/impl/ByteMerger.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.core.http.impl; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | /** 7 | * ByteMerger is a utility that accumulates a sequence of byte arrays 8 | * and merges them into a single flat array upon request. 9 | * 10 | * @author Besmir Beqiri 11 | */ 12 | final class ByteMerger { 13 | 14 | private final List arrays = new ArrayList<>(); 15 | 16 | /** 17 | * Adds a byte array to the merger. 18 | * 19 | * @param array the byte array to add 20 | */ 21 | void add(byte[] array) { 22 | arrays.add(array); 23 | } 24 | 25 | /** 26 | * Merges all the added byte arrays into a single byte array. 27 | * 28 | * @return the merged byte array 29 | */ 30 | byte[] merge() { 31 | int size = sumOfLengths(); 32 | byte[] result = new byte[size]; 33 | int offset = 0; 34 | for (byte[] array : arrays) { 35 | System.arraycopy(array, 0, result, offset, array.length); 36 | offset += array.length; 37 | } 38 | return result; 39 | } 40 | 41 | /** 42 | * Calculates the sum of lengths of all the added byte arrays. 43 | * 44 | * @return the sum of lengths 45 | */ 46 | int sumOfLengths() { 47 | int sum = 0; 48 | for (byte[] array : arrays) { 49 | sum += array.length; 50 | } 51 | return sum; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /jpro-auth/core/src/main/java/one/jpro/platform/auth/core/http/impl/Request.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.core.http.impl; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * This class represents discrete HTTP requests with request line, headers, and body. 7 | * 8 | * @author Besmir Beqiri 9 | */ 10 | public record Request(String method, String uri, String version, List
headers, byte[] body) { 11 | 12 | /** 13 | * Retrieves the value of the specified header. 14 | * 15 | * @param name The name of the header. 16 | * @return The value of the header, or null if the header is not found. 17 | */ 18 | public String header(String name) { 19 | for (Header header : headers) { 20 | if (header.name().equalsIgnoreCase(name)) { 21 | return header.value(); 22 | } 23 | } 24 | return null; 25 | } 26 | 27 | /** 28 | * Checks if the request has a header with the specified name and value. 29 | * 30 | * @param name The name of the header. 31 | * @param value The value of the header. 32 | * @return true if the request has a header with the specified name and value, false otherwise. 33 | */ 34 | public boolean hasHeader(String name, String value) { 35 | for (Header header : headers) { 36 | if (header.name().equalsIgnoreCase(name) && header.value().equalsIgnoreCase(value)) { 37 | return true; 38 | } 39 | } 40 | return false; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /jpro-auth/example/src/main/java/one/jpro/platform/auth/example/oauth/page/AuthProviderDiscoveryPage.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.example.oauth.page; 2 | 3 | import javafx.beans.binding.Bindings; 4 | import javafx.scene.control.Label; 5 | import javafx.scene.layout.VBox; 6 | import one.jpro.platform.auth.example.oauth.OAuthApp; 7 | import one.jpro.platform.auth.core.oauth2.OAuth2AuthenticationProvider; 8 | import one.jpro.platform.mdfx.MarkdownView; 9 | 10 | /** 11 | * Authorization provider discovery page. 12 | * 13 | * @author Besmir Beqiri 14 | */ 15 | public class AuthProviderDiscoveryPage extends Page { 16 | 17 | public AuthProviderDiscoveryPage(OAuthApp loginApp, 18 | OAuth2AuthenticationProvider authProvider) { 19 | final var headerLabel = new Label("OpenID Connect Discovery: " + loginApp.getAuthProviderName(authProvider)); 20 | headerLabel.getStyleClass().add("header-label"); 21 | 22 | MarkdownView providerDiscoveryView = new MarkdownView(); 23 | providerDiscoveryView.mdStringProperty().bind(Bindings.createStringBinding(() -> { 24 | final var authOptions = loginApp.getAuthOptions(); 25 | return authOptions == null ? "" : loginApp.jsonToMarkdown(authOptions.toJSON()); 26 | }, loginApp.authOptionsProperty())); 27 | 28 | final var pane = new VBox(headerLabel, providerDiscoveryView); 29 | pane.getStyleClass().add("openid-provider-discovery-pane"); 30 | 31 | getChildren().add(pane); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /jpro-webrtc/src/main/java/one/jpro/platform/webrtc/VideoFrame.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.webrtc; 2 | 3 | import com.jpro.webapi.HTMLView; 4 | import com.jpro.webapi.JSVariable; 5 | import com.jpro.webapi.WebAPI; 6 | 7 | public class VideoFrame extends HTMLView { 8 | 9 | private WebAPI webAPI; 10 | JSVariable elem; 11 | 12 | JSVariable videoElem; 13 | 14 | 15 | public VideoFrame(WebAPI webAPI) { 16 | super(""); 17 | this.webAPI = webAPI; 18 | elem = webAPI.getHTMLViewElement(this); 19 | videoElem = webAPI.executeScriptWithVariable(elem.getName()+".firstElementChild"); 20 | 21 | setPrefSize(100,100); 22 | 23 | widthProperty().addListener((observable, oldValue, newValue) -> { 24 | webAPI.executeScript(videoElem.getName()+".width = "+newValue.intValue()+";"); 25 | }); 26 | heightProperty().addListener((observable, oldValue, newValue) -> { 27 | webAPI.executeScript(videoElem.getName()+".height = "+newValue.intValue()+";"); 28 | }); 29 | } 30 | 31 | public JSVariable getVideoElem() { 32 | return videoElem; 33 | } 34 | 35 | public void setStream(MediaStream stream) { 36 | stream.js.thenAccept(s -> { 37 | webAPI.executeScript(videoElem.getName()+".srcObject = "+s.getName()+";"); 38 | }); 39 | } 40 | 41 | public void setStream(JSVariable stream) { 42 | webAPI.executeScript(videoElem.getName()+".srcObject = "+stream.getName()+";"); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /jpro-webrtc/example/src/main/java/one/jpro/platform/webrtc/example/videoroom/VideoRoomApp.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.webrtc.example.videoroom; 2 | 3 | import one.jpro.platform.routing.*; 4 | import one.jpro.platform.webrtc.example.videoroom.page.OverviewPage; 5 | import one.jpro.platform.webrtc.example.videoroom.page.VideoRoomPage; 6 | import simplefx.experimental.parts.FXFuture; 7 | 8 | import java.util.regex.Pattern; 9 | 10 | import static one.jpro.platform.routing.RouteUtils.viewFromNode; 11 | 12 | public class VideoRoomApp extends RouteApp { 13 | 14 | static Pattern roomPattern = Pattern.compile("/room/([0-9a-fA-F]*)"); 15 | 16 | @Override 17 | public Route createRoute() { 18 | 19 | getScene().getStylesheets().add("/one/jpro/platform/webrtc/example/videoroom/videoroom.css"); 20 | 21 | // / -> overview 22 | // /room/id -> room 23 | return Route.empty() 24 | .and(Route.get("/", (r) -> Response.node(new OverviewPage()))) 25 | .and(r -> { 26 | System.out.println("path: " + r.getPath()); 27 | var matcher = roomPattern.matcher(r.getPath()); 28 | if(matcher.matches()) { 29 | var roomID = matcher.group(1); 30 | return Response.node(new VideoRoomPage(roomID, getWebAPI())); 31 | } else { 32 | return Response.empty(); 33 | } 34 | }) 35 | .filter(Filters.FullscreenFilter(true)); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /jpro-routing/core/src/main/scala/one/jpro/platform/routing/server/RouteHTTP.scala: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.routing.server 2 | 3 | import com.jpro.webapi.server.{Response, ServerAPI} 4 | import one.jpro.platform.routing.{Route, RouteApp} 5 | import one.jpro.platform.routing.crawl.{AppCrawler, SitemapGenerator} 6 | 7 | object RouteHTTP { 8 | var initialized = false 9 | 10 | def main(args: Array[String]): Unit = { 11 | // System.out.println("Hello, world!"); 12 | // val route = getRoute(); 13 | // CrawlReportApp report = AppCrawler.generate(route); 14 | // SiteMapGenerator siteMapGenerator = new SiteMapGenerator(); 15 | } 16 | } 17 | 18 | abstract class RouteHTTP { 19 | 20 | def start(): Unit = { 21 | 22 | new Thread(() => { 23 | val prefix = "localhost" 24 | 25 | if(RouteHTTP.initialized) { 26 | throw new IllegalStateException("RouteHTTP already initialized") 27 | } 28 | 29 | //val appCrawler = new AppCrawler(prefix, () => AppCrawler.routeToRouteNode(getRoute())) 30 | 31 | val report = AppCrawler.crawlRoute(prefix, () => getRoute()) 32 | 33 | ServerAPI.getServerAPI().addRequestHandler( 34 | r => { 35 | println("RouteHTTP> request: " + r.getPath()) 36 | r.getPath() match { 37 | case "/sitemap.xml" => 38 | Response.of(SitemapGenerator.createSitemap(prefix, report).getBytes()) 39 | case _ => 40 | Response.empty() 41 | } 42 | } 43 | ) 44 | }).start() 45 | 46 | 47 | } 48 | def getRoute(): Route 49 | } 50 | -------------------------------------------------------------------------------- /jpro-auth/core/src/main/java/one/jpro/platform/auth/core/api/FluentMicrosoftAuthAPI.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.core.api; 2 | 3 | import javafx.stage.Stage; 4 | import one.jpro.platform.auth.core.oauth2.provider.MicrosoftAuthenticationProvider; 5 | 6 | /** 7 | * Fluent Microsoft Authentication API. 8 | * 9 | * @author Besmir Beqiri 10 | */ 11 | public class FluentMicrosoftAuthAPI implements FluentMicrosoftAuth { 12 | 13 | private String clientId; 14 | private String clientSecret; 15 | private String tenant; 16 | private String redirectUri; 17 | 18 | @Override 19 | public FluentMicrosoftAuth clientId(String clientId) { 20 | this.clientId = clientId; 21 | return this; 22 | } 23 | 24 | @Override 25 | public FluentMicrosoftAuth clientSecret(String clientSecret) { 26 | this.clientSecret = clientSecret; 27 | return this; 28 | } 29 | 30 | @Override 31 | public FluentMicrosoftAuth tenant(String tenant) { 32 | this.tenant = tenant; 33 | return this; 34 | } 35 | 36 | @Override 37 | public FluentMicrosoftAuth redirectUri(String redirectUri) { 38 | this.redirectUri = redirectUri; 39 | return this; 40 | } 41 | 42 | @Override 43 | public MicrosoftAuthenticationProvider create(Stage stage) { 44 | final var microsoftAuthProvider = new MicrosoftAuthenticationProvider(stage, clientId, clientSecret, tenant); 45 | microsoftAuthProvider.getCredentials().setRedirectUri(redirectUri); 46 | return microsoftAuthProvider; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: CI Release 2 | 3 | on: 4 | release: 5 | types: [published] 6 | workflow_dispatch: 7 | 8 | env: 9 | SANDEC_ARTIFACTORY_USERNAME: ${{secrets.SANDEC_ARTIFACTORY_USERNAME}} 10 | SANDEC_ARTIFACTORY_PASSWORD: ${{secrets.SANDEC_ARTIFACTORY_PASSWORD}} 11 | SANDEC_SIGNING_KEY_ID: ${{secrets.SANDEC_SIGNING_KEY_ID}} 12 | SANDEC_SIGNING_SECRET_KEY: ${{secrets.SANDEC_SIGNING_SECRET_KEY}} 13 | SANDEC_SIGNING_PASSWORD: ${{secrets.SANDEC_SIGNING_PASSWORD}} 14 | SANDEC_SONATYPE_USERNAME: ${{secrets.SANDEC_SONATYPE_USERNAME}} 15 | SANDEC_SONATYPE_PASSWORD: ${{secrets.SANDEC_SONATYPE_PASSWORD}} 16 | MAVEN_CENTRAL_AUTH_TOKEN: ${{secrets.MAVEN_CENTRAL_AUTH_TOKEN}} 17 | MAVEN_CENTRAL_PUBLISHING_TYPE: 'USER_MANAGED' 18 | 19 | jobs: 20 | release: 21 | name: 'Release' 22 | runs-on: ubuntu-latest 23 | if: github.repository_owner == 'JPro-one' 24 | steps: 25 | - name: Checkout 26 | uses: actions/checkout@v4 27 | 28 | - name: Setup Java 21 29 | uses: actions/setup-java@v4 30 | with: 31 | distribution: 'temurin' 32 | java-version: 21 33 | 34 | - name: Print Release Version 35 | run: | 36 | RELEASE_VERSION=$(grep '^JPRO_PLATFORM_VERSION' gradle.properties | cut -d'=' -f2) 37 | echo "Release Version: $RELEASE_VERSION" 38 | 39 | - name: Publish to Sandec Public Repository 40 | run: | 41 | ./gradlew clean publish 42 | 43 | - name: Publish to Maven Central Sonatype 44 | run: | 45 | ./gradlew publishToMavenCentralPortal -------------------------------------------------------------------------------- /jpro-session/src/main/java/one/jpro/platform/session/SessionException.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.session; 2 | 3 | /** 4 | * SessionException is a runtime exception class that is used to indicate an error or exceptional condition 5 | * that occurs during session handling. 6 | * 7 | * @author Besmir Beqiri 8 | */ 9 | public class SessionException extends RuntimeException { 10 | 11 | /** 12 | * Constructs a new SessionException with no detail message. 13 | */ 14 | public SessionException() { 15 | super(); 16 | } 17 | 18 | /** 19 | * Constructs a new SessionException with the specified detail message. 20 | * 21 | * @param message the detail message (which is saved for later retrieval by the getMessage() method) 22 | */ 23 | public SessionException(String message) { 24 | super(message); 25 | } 26 | 27 | /** 28 | * Constructs a new SessionException with the specified detail message and cause. 29 | * 30 | * @param message the detail message (which is saved for later retrieval by the getMessage() method) 31 | * @param cause the cause (which is saved for later retrieval by the getCause() method) 32 | */ 33 | public SessionException(String message, Throwable cause) { 34 | super(message, cause); 35 | } 36 | 37 | /** 38 | * Constructs a new SessionException with the specified cause. 39 | * 40 | * @param cause the cause (which is saved for later retrieval by the getCause() method) 41 | */ 42 | public SessionException(Throwable cause) { 43 | super(cause); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /jpro-routing/example/src/main/scala/example/scala/TestExtensions.scala: -------------------------------------------------------------------------------- 1 | package example.scala 2 | 3 | 4 | import one.jpro.platform.routing.Route.{get, redirect} 5 | import com.jpro.webapi.WebAPI 6 | import simplefx.all._ 7 | import simplefx.core._ 8 | import simplefx.experimental._ 9 | 10 | import java.util.function.Supplier 11 | import one.jpro.platform.routing.extensions.linkheader.LinkHeaderFilter.Link 12 | import fr.brouillard.oss.cssfx.CSSFX 13 | import one.jpro.platform.routing.{Filters, LinkUtil, Redirect, Request, Response, Route, RouteNode, RouteUtils} 14 | import one.jpro.platform.routing.extensions.linkheader.LinkHeaderFilter 15 | import one.jpro.platform.routing.filter.container.ContainerFactory 16 | import one.jpro.platform.routing.sessionmanager.SessionManager 17 | 18 | class TestExtensionsApp(stage: Stage) extends RouteNode(stage) { 19 | stylesheets <++ "/one/jpro/platform/routing/extensions/linkheader/css/linkheader.css" 20 | 21 | setRoute( 22 | Route.empty() /* StartRoute? */ 23 | .and(redirect("/", "/home")) 24 | .and(get("/home", (r) => Response.node(new Label("HOME")))) 25 | .and(get("/secret", (r) => Response.node(new Label("SECRET")))) 26 | .filter(LinkHeaderFilter.create(Link("HOME","/home"), Link("SECRET","/secret"))) 27 | ) 28 | 29 | CSSFX.start() 30 | } 31 | 32 | 33 | object TestExtensions extends App 34 | @SimpleFXApp class TestExtensions { 35 | val app = new TestExtensionsApp(stage) 36 | if(WebAPI.isBrowser) { 37 | root = app 38 | } else { 39 | scene = new Scene(app, 1400,800) 40 | } 41 | app.start(SessionManager.getDefault(app,stage)) 42 | } 43 | 44 | 45 | -------------------------------------------------------------------------------- /jpro-auth/example/src/main/java/one/jpro/platform/auth/example/basic/page/ErrorPage.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.example.basic.page; 2 | 3 | import javafx.scene.control.Label; 4 | import javafx.scene.control.TextArea; 5 | import javafx.scene.layout.Priority; 6 | import javafx.scene.layout.VBox; 7 | 8 | import java.io.PrintWriter; 9 | import java.io.StringWriter; 10 | 11 | /** 12 | * Error page. 13 | * 14 | * @author Besmir Beqiri 15 | */ 16 | public class ErrorPage extends Page { 17 | 18 | public ErrorPage(Throwable throwable) { 19 | final var headerLabel = new Label("Something unexpected happen:"); 20 | headerLabel.getStyleClass().add("header-label"); 21 | 22 | final var errorLabel = new Label(); 23 | errorLabel.setWrapText(true); 24 | errorLabel.getStyleClass().add("error-label"); 25 | errorLabel.setText(throwable == null ? "" : throwable.getMessage()); 26 | 27 | final var errorTextArea = new TextArea(); 28 | errorTextArea.getStyleClass().add("error-text-area"); 29 | VBox.setVgrow(errorTextArea, Priority.ALWAYS); 30 | errorTextArea.setText((throwable == null) ? "" : printStackTrace(throwable)); 31 | 32 | final var pane = new VBox(headerLabel, errorLabel, errorTextArea); 33 | pane.getStyleClass().add("error-pane"); 34 | 35 | getChildren().add(pane); 36 | } 37 | 38 | private String printStackTrace(Throwable throwable) { 39 | final StringWriter sw = new StringWriter(); 40 | final PrintWriter pw = new PrintWriter(sw); 41 | throwable.printStackTrace(pw); 42 | return sw.toString(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /jpro-auth/example/src/main/java/one/jpro/platform/auth/example/login/page/ErrorPage.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.example.login.page; 2 | 3 | import javafx.scene.control.Label; 4 | import javafx.scene.control.TextArea; 5 | import javafx.scene.layout.Priority; 6 | import javafx.scene.layout.VBox; 7 | 8 | import java.io.PrintWriter; 9 | import java.io.StringWriter; 10 | 11 | /** 12 | * Error page. 13 | * 14 | * @author Besmir Beqiri 15 | */ 16 | public class ErrorPage extends Page { 17 | 18 | public ErrorPage(Throwable throwable) { 19 | final var headerLabel = new Label("Something unexpected happen:"); 20 | headerLabel.getStyleClass().add("header-label"); 21 | 22 | final var errorLabel = new Label(); 23 | errorLabel.setWrapText(true); 24 | errorLabel.getStyleClass().add("error-label"); 25 | errorLabel.setText(throwable == null ? "" : throwable.getMessage()); 26 | 27 | final var errorTextArea = new TextArea(); 28 | errorTextArea.getStyleClass().add("error-text-area"); 29 | VBox.setVgrow(errorTextArea, Priority.ALWAYS); 30 | errorTextArea.setText((throwable == null) ? "" : printStackTrace(throwable)); 31 | 32 | final var pane = new VBox(headerLabel, errorLabel, errorTextArea); 33 | pane.getStyleClass().add("error-pane"); 34 | 35 | getChildren().add(pane); 36 | } 37 | 38 | private String printStackTrace(Throwable throwable) { 39 | final StringWriter sw = new StringWriter(); 40 | final PrintWriter pw = new PrintWriter(sw); 41 | throwable.printStackTrace(pw); 42 | return sw.toString(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /jpro-image-manager/src/test/java/one/jpro/platform/image/manager/source/ImageSourceFileTest.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.image.manager.source; 2 | 3 | import one.jpro.platform.image.manager.ImageUtils; 4 | import org.json.JSONObject; 5 | import org.junit.jupiter.api.Test; 6 | import static org.junit.jupiter.api.Assertions.*; 7 | 8 | import java.awt.image.BufferedImage; 9 | import java.io.File; 10 | 11 | public class ImageSourceFileTest { 12 | 13 | @Test 14 | public void testLoadImage() { 15 | File testImageFile = new File("src/test/resources/testImage.png"); 16 | ImageSourceFile imageSource = new ImageSourceFile(testImageFile); 17 | 18 | BufferedImage image = imageSource.loadImage(); 19 | assertNotNull(image); 20 | } 21 | 22 | @Test 23 | public void testIdentityHashValue() { 24 | File testImageFile = new File("src/test/resources/testImage.png"); 25 | ImageSourceFile imageSource = new ImageSourceFile(testImageFile); 26 | 27 | long hashValue = imageSource.identityHashValue(); 28 | assertTrue(hashValue != 0); 29 | } 30 | 31 | @Test 32 | public void testToJson() { 33 | final File testImageFile = new File("src/test/resources/testImage.png"); 34 | final ImageSourceFile imageSource = new ImageSourceFile(testImageFile); 35 | 36 | JSONObject json = new JSONObject(); 37 | json.put("type", "ImageSourceFile"); 38 | json.put("path", ImageUtils.escapeJson(testImageFile.getAbsolutePath())); 39 | json.put("modified", testImageFile.lastModified()); 40 | 41 | assertTrue(imageSource.toJSON().similar(json)); 42 | } 43 | } -------------------------------------------------------------------------------- /jpro-mail/src/main/java/one/jpro/platform/mail/MailException.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.mail; 2 | 3 | /** 4 | * An exception thrown when an error occurs while sending an email. 5 | * 6 | * @author Besmir Beqiri 7 | */ 8 | public class MailException extends RuntimeException { 9 | 10 | /** 11 | * Constructs a new {@link MailException} with the specified 12 | * detail message. 13 | * The cause is not initialized, and may subsequently be initialized by a 14 | * call to {@link #initCause}. 15 | * 16 | * @param message the detail message. The detail message is saved for 17 | * later retrieval by the {@link #getMessage()} method. 18 | */ 19 | public MailException(String message) { 20 | super(message); 21 | } 22 | 23 | /** 24 | * Constructs a new {@link MailException} exception with the specified 25 | * detail message and cause. 26 | *

27 | * Note that the detail message associated with {@code cause} is not 28 | * automatically incorporated in this runtime exception's detail message. 29 | * 30 | * @param message the detail message (which is saved for later retrieval 31 | * by the {@link #getMessage()} method). 32 | * @param cause the cause which is saved for later retrieval by the 33 | * {@link #getCause()} method. A {@code null} value is 34 | * permitted, and indicates that the cause is nonexistent or 35 | * unknown. 36 | */ 37 | public MailException(String message, Throwable cause) { 38 | super(message, cause); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /jpro-utils/src/test/java/one/jpro/platform/utils/test/FreezeDetectorTests.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.utils.test; 2 | 3 | import one.jpro.platform.utils.FreezeDetector; 4 | import org.junit.jupiter.api.Test; 5 | import org.testfx.framework.junit5.ApplicationTest; 6 | 7 | import java.time.Duration; 8 | import java.util.concurrent.atomic.AtomicInteger; 9 | 10 | import static org.assertj.core.api.Assertions.assertThat; 11 | 12 | /** 13 | * Tests the freeze detector. 14 | * 15 | * @author Florian Kirmaier 16 | */ 17 | public class FreezeDetectorTests extends ApplicationTest { 18 | 19 | @Test 20 | public void testFreezeDetector() throws InterruptedException { 21 | AtomicInteger counter = new AtomicInteger(0); 22 | interact(() -> new FreezeDetector(Duration.ofMillis(100), 23 | (thread, duration) -> counter.incrementAndGet())); 24 | 25 | assertThat(counter.get()).isEqualTo(0); 26 | Thread.sleep(200); 27 | assertThat(counter.get()).isEqualTo(0); 28 | interact(() -> { 29 | try { 30 | Thread.sleep(150); 31 | } catch (InterruptedException ex) { 32 | ex.printStackTrace(); 33 | } 34 | }); 35 | assertThat(counter.get()).isEqualTo(1); 36 | Thread.sleep(200); 37 | assertThat(counter.get()).isEqualTo(1); 38 | interact(() -> { 39 | try { 40 | Thread.sleep(150); 41 | } catch (InterruptedException ex) { 42 | ex.printStackTrace(); 43 | } 44 | }); 45 | assertThat(counter.get()).isEqualTo(2); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /jpro-image-manager/src/test/java/one/jpro/platform/image/manager/source/ImageSourceURLTest.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.image.manager.source; 2 | 3 | import one.jpro.platform.image.manager.ImageUtils; 4 | import org.json.JSONObject; 5 | import org.junit.jupiter.api.Test; 6 | 7 | import java.awt.image.BufferedImage; 8 | import java.net.URL; 9 | 10 | import static org.junit.jupiter.api.Assertions.*; 11 | 12 | public class ImageSourceURLTest { 13 | @Test 14 | public void testLoadImageFromURL() { 15 | URL testURL = this.getClass().getResource("/testImage.png"); 16 | ImageSourceURL source = new ImageSourceURL(testURL); 17 | 18 | BufferedImage image = source.loadImage(); 19 | assertNotNull(image, "Image should be loaded from URL"); 20 | } 21 | 22 | @Test 23 | public void testIdentityHashValue() { 24 | URL testURL = this.getClass().getResource("/testImage.png"); 25 | ImageSourceURL source = new ImageSourceURL(testURL); 26 | 27 | long hashValue = source.identityHashValue(); 28 | assertNotEquals(0, hashValue, "Hash value should be generated from URL"); 29 | } 30 | 31 | @Test 32 | public void testJsonSerialization() { 33 | final URL testURL = this.getClass().getResource("/testImage.png"); 34 | final ImageSourceURL source = new ImageSourceURL(testURL); 35 | 36 | JSONObject json = new JSONObject(); 37 | json.put("type", ImageSourceURL.class.getSimpleName()); 38 | json.put("url", ImageUtils.escapeJson(testURL.toString())); 39 | 40 | assertTrue(source.toJSON().similar(json), "JSON representation should contain the URL"); 41 | } 42 | } -------------------------------------------------------------------------------- /jpro-file/example/src/main/java/one/jpro/platform/file/example/upload/UploadIndicatorTableCell.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.file.example.upload; 2 | 3 | import atlantafx.base.theme.Styles; 4 | import javafx.geometry.Pos; 5 | import javafx.scene.control.ContentDisplay; 6 | import javafx.scene.control.ProgressBar; 7 | import javafx.scene.control.TableCell; 8 | import one.jpro.platform.file.FileSource; 9 | 10 | /** 11 | * Represents a custom table cell used to display an upload progress indicator. 12 | * After calling {@link FileSource#uploadFile()} method on the corresponding item, 13 | * the progress bar will indicate the current uploading progress. 14 | * 15 | * @param The type of the TableView items. 16 | * @author Besmir Beqiri 17 | */ 18 | public class UploadIndicatorTableCell extends TableCell { 19 | 20 | private final ProgressBar progressBar; 21 | 22 | /** 23 | * Constructs a custom table cell that displays the upload progress bar. 24 | */ 25 | public UploadIndicatorTableCell() { 26 | setContentDisplay(ContentDisplay.GRAPHIC_ONLY); 27 | setAlignment(Pos.CENTER); 28 | 29 | progressBar = new ProgressBar(); 30 | progressBar.getStyleClass().add(Styles.MEDIUM); 31 | } 32 | 33 | @Override 34 | protected void updateItem(Double progress, boolean empty) { 35 | super.updateItem(progress, empty); 36 | 37 | if (progress == null || empty) { 38 | progressBar.setProgress(0.0); 39 | setGraphic(null); 40 | } else { 41 | progressBar.setProgress(progress); 42 | setGraphic(progressBar); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /jpro-sipjs/example/src/main/java/one/jpro/platform/sipjs/example/page/SelectPage.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.sipjs.example.page; 2 | 3 | import javafx.scene.control.Button; 4 | import javafx.scene.control.Label; 5 | import javafx.scene.layout.HBox; 6 | import javafx.scene.layout.VBox; 7 | import one.jpro.platform.routing.LinkUtil; 8 | 9 | public class SelectPage extends VBox { 10 | 11 | public SelectPage() { 12 | var button1 = new Button("Echo"); 13 | var button2 = new Button("Auto"); 14 | var button3 = new Button("Alice and Bob"); 15 | var button4 = new Button("Alice"); 16 | var button5 = new Button("Bob"); 17 | button1.getStyleClass().add("select-button"); 18 | button2.getStyleClass().add("select-button"); 19 | button3.getStyleClass().add("select-button"); 20 | button4.getStyleClass().add("select-button"); 21 | button5.getStyleClass().add("select-button"); 22 | LinkUtil.setLink(button1, "/echo"); 23 | LinkUtil.setLink(button2, "/auto"); 24 | LinkUtil.setLink(button3, "/aliceAndBob"); 25 | LinkUtil.setLink(button4, "/alice"); 26 | LinkUtil.setLink(button5, "/bob"); 27 | 28 | var hbox = new HBox(); 29 | hbox.getStyleClass().add("select-page-hbox"); 30 | hbox.setAlignment(javafx.geometry.Pos.CENTER); 31 | hbox.getChildren().addAll(button1, button2, button3, button4, button5); 32 | 33 | var title = new Label("Select a demo"); 34 | title.getStyleClass().add("select-page-title"); 35 | 36 | getChildren().add(title); 37 | getChildren().add(hbox); 38 | getStyleClass().add("jpro-sipjs-example-page"); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /jpro-auth/example/src/main/java/one/jpro/platform/auth/example/login/page/LoginPage.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.example.login.page; 2 | 3 | import javafx.scene.control.Button; 4 | import javafx.scene.image.Image; 5 | import javafx.scene.image.ImageView; 6 | import one.jpro.platform.auth.core.oauth2.provider.GoogleAuthenticationProvider; 7 | import one.jpro.platform.auth.routing.AuthBasicOAuth2Filter; 8 | import one.jpro.platform.auth.routing.AuthUIProvider; 9 | 10 | import java.util.Optional; 11 | 12 | /** 13 | * Login page. 14 | * 15 | * @author Besmir Beqiri 16 | */ 17 | public class LoginPage extends Page { 18 | 19 | public LoginPage(GoogleAuthenticationProvider authProvider, AuthUIProvider uiProvider) { 20 | getStyleClass().add("simple-page"); 21 | 22 | final var googleProviderButton = uiProvider.createAuthenticationNode(); 23 | 24 | getChildren().add(googleProviderButton); 25 | } 26 | 27 | /** 28 | * Create a button for the given provider. 29 | * 30 | * @param text the provider name 31 | * @return a button node 32 | */ 33 | public Button createAuthProviderButton(String text) { 34 | final var iconView = new ImageView(); 35 | iconView.setFitWidth(56); 36 | iconView.setFitHeight(56); 37 | Optional.ofNullable(getClass().getResourceAsStream("/images/" + text + "_Logo.png")) 38 | .map(inputStream -> new Image(inputStream, 0, 0, true, true)) 39 | .ifPresent(iconView::setImage); 40 | 41 | final var loginButton = new Button("Login with\n" + text, iconView); 42 | loginButton.getStyleClass().addAll("login-button"); 43 | return loginButton; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /jpro-routing/core/src/main/scala/one/jpro/platform/routing/RouteApp.scala: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.routing 2 | 3 | import com.jpro.webapi.WebAPI 4 | import javafx.application.Application 5 | import javafx.scene.Scene 6 | import javafx.scene.layout.StackPane 7 | import javafx.stage.{Stage, StageStyle} 8 | import one.jpro.platform.routing.sessionmanager.SessionManager 9 | import simplefx.core._ 10 | import simplefx.all._ 11 | import simplefx.experimental.FXFuture 12 | 13 | abstract class RouteApp extends Application { 14 | 15 | private var _stage: Stage = null 16 | private var routeNode: RouteNode = null 17 | private var _scene: Scene = null 18 | private var _sessionManager: SessionManager = null 19 | def stageStyle(): StageStyle = StageStyle.DECORATED 20 | def getStage(): Stage = _stage 21 | def getScene(): Scene = _scene 22 | def getSessionManager(): SessionManager = _sessionManager 23 | def getRouteNode(): RouteNode = routeNode 24 | def getWebAPI(): WebAPI = if(WebAPI.isBrowser) WebAPI.getWebAPI(getStage()) else null 25 | 26 | override def start(stage: Stage): Unit = { 27 | startFuture(stage) 28 | } 29 | def startFuture(stage: Stage): Response = { 30 | _stage = stage 31 | stage.initStyle(stageStyle()) 32 | routeNode = new RouteNode(stage) 33 | 34 | // Add node between RouteNode and Scene, so Popups work correctly with ScenicView 35 | val root = new StackPane(routeNode) 36 | 37 | _scene = new Scene(root, 1400, 800) 38 | stage.setScene(_scene) 39 | _sessionManager = SessionManager.getDefault(routeNode, stage) 40 | routeNode.setRoute(createRoute()) 41 | stage.show() 42 | routeNode.start(_sessionManager) 43 | } 44 | 45 | def createRoute(): Route 46 | } 47 | -------------------------------------------------------------------------------- /jpro-file/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | implementation "one.jpro:jpro-webapi:$JPRO_VERSION" 3 | implementation "org.jetbrains:annotations:$JETBRAINS_ANNOTATIONS_VERSION" 4 | implementation "org.slf4j:slf4j-api:$SLF4J_API_VERSION" 5 | } 6 | 7 | compileJava { 8 | options.compilerArgs = ["--add-exports", "javafx.base/com.sun.javafx.event=one.jpro.platform.file"] 9 | } 10 | 11 | test { 12 | jvmArgs = [ 13 | "--add-exports", "javafx.base/com.sun.javafx.event=one.jpro.platform.file" 14 | ] 15 | } 16 | 17 | javadoc { 18 | options { 19 | encoding = 'UTF-8' 20 | version = true 21 | author = true 22 | addMultilineStringsOption("-add-exports").setValue([ 23 | "javafx.base/com.sun.javafx.event=one.jpro.platform.file" 24 | ]) 25 | // addStringOption('Xdoclint:none', '-quiet') 26 | } 27 | } 28 | 29 | publishing { 30 | publications { 31 | mavenJava(MavenPublication) { 32 | // Add README.md as an artifact named DOCUMENTATION.md 33 | artifact(source: file('build/docs/DOCUMENTATION.md')) { 34 | classifier 'DOCUMENTATION' 35 | extension 'md' 36 | } 37 | 38 | pom { 39 | name = 'JPro File' 40 | description = 'A module for handling file related operations in JPro/JavaFX applications ' + 41 | 'running natively and via JPro server.' 42 | } 43 | } 44 | } 45 | } 46 | 47 | tasks.register('renameReadme', Copy) { 48 | from 'README.md' 49 | into layout.buildDirectory.dir('docs') 50 | rename 'README.md', 'DOCUMENTATION.md' 51 | } 52 | 53 | javadocJar.dependsOn renameReadme 54 | -------------------------------------------------------------------------------- /jpro-image-manager/src/main/java/one/jpro/platform/image/manager/ImageUtils.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.image.manager; 2 | 3 | import java.nio.ByteBuffer; 4 | import java.security.MessageDigest; 5 | 6 | /** 7 | * This class provides utility methods for various image operations. 8 | * 9 | * @author Florian Kirmaier 10 | */ 11 | public class ImageUtils { 12 | 13 | /** 14 | * Computes the MD5 hash of the given data and returns the first 8 bytes 15 | * of the hash as a long value. 16 | * 17 | * @param data The input data for which the hash needs to be computed. 18 | * @return The first 8 bytes of the MD5 hash as a long value. 19 | * @throws RuntimeException if there's an error computing the hash. 20 | */ 21 | public static long computeHashValue(byte[] data) { 22 | try { 23 | MessageDigest md = MessageDigest.getInstance("MD5"); 24 | byte[] digest = md.digest(data); 25 | 26 | // Using ByteBuffer to transform the first 8 bytes of the hash into a long value. 27 | return ByteBuffer.wrap(digest, 0, 8).getLong(); 28 | } catch (Exception ex) { 29 | throw new RuntimeException("Error computing hash value", ex); 30 | } 31 | } 32 | 33 | /** 34 | * Escapes certain special characters in a JSON string to ensure it's valid. 35 | * Specifically, it escapes backslashes and double quotes. 36 | * 37 | * @param str The input JSON string that might contain characters to be escaped. 38 | * @return The input string with necessary characters escaped. 39 | */ 40 | public static String escapeJson(String str) { 41 | return str.replace("\\", "\\\\").replace("\"", "\\\""); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /jpro-media/example/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.bytedeco.gradle-javacpp-platform' version "$JAVACPP_VERSION" 3 | id 'org.openjfx.javafxplugin' 4 | id 'jpro-gradle-plugin' 5 | } 6 | 7 | ext { 8 | // Add more needed platforms here 9 | javacppPlatform = 'linux-x86_64,linux-arm64,macosx-x86_64,macosx-arm64,windows-x86_64' 10 | } 11 | 12 | dependencies { 13 | implementation project(":jpro-media") 14 | implementation project(":jpro-file") 15 | implementation "one.jpro:jpro-webapi:$JPRO_VERSION" 16 | implementation "org.slf4j:slf4j-api:$SLF4J_API_VERSION" 17 | runtimeOnly "ch.qos.logback:logback-classic:$LOGBACK_VERSION" 18 | 19 | implementation "org.bytedeco:javacv-platform:$JAVACV_VERSION" 20 | // compileOnly "org.bytedeco:javacv-platform:$JAVACV_VERSION" // when running on JPro 21 | implementation "io.github.mkpaz:atlantafx-base:$ATLANTAFX_VERSION" 22 | } 23 | 24 | javafx { 25 | version = "$JAVAFX_EXAMPLES_VERSION" 26 | modules = ['javafx.controls', 'javafx.swing', 'javafx.media'] 27 | } 28 | 29 | def examples = [ 30 | 'media-player' : 'one.jpro.platform.media.example.MediaPlayerSample', 31 | 'media-recorder' : 'one.jpro.platform.media.example.MediaRecorderSample', 32 | 'media-recorder-and-player': 'one.jpro.platform.media.example.MediaRecorderAndPlayerSample' 33 | ] 34 | 35 | application { 36 | mainClass = project.hasProperty("sample") ? examples[project.getProperties().get("sample")] : examples["media-recorder-and-player"] 37 | mainModule = 'one.jpro.platform.media.example' 38 | applicationDefaultJvmArgs = [ 39 | "--add-exports", "javafx.base/com.sun.javafx.event=one.jpro.platform.media" 40 | ] 41 | } 42 | -------------------------------------------------------------------------------- /jpro-auth/example/src/main/java/one/jpro/platform/auth/example/basic/page/SignedInPage.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.example.basic.page; 2 | 3 | import javafx.scene.control.Button; 4 | import javafx.scene.control.Label; 5 | import javafx.scene.control.TextArea; 6 | import javafx.scene.layout.VBox; 7 | import one.jpro.platform.auth.example.basic.BasicLoginApp; 8 | 9 | /** 10 | * Signed in page. 11 | * 12 | * @author Besmir Beqiri 13 | */ 14 | public class SignedInPage extends Page { 15 | 16 | public SignedInPage(BasicLoginApp app) { 17 | final var headerLabel = new Label("Not signed in."); 18 | headerLabel.getStyleClass().add("header-label"); 19 | 20 | final var user = app.userSession.getUser(); 21 | if (user == null) { 22 | getChildren().add(headerLabel); 23 | } else { 24 | headerLabel.setText("Signed in as: " + user.getName()); 25 | 26 | final var userInfoTextArea = new TextArea(); 27 | userInfoTextArea.setWrapText(true); 28 | userInfoTextArea.setEditable(false); 29 | userInfoTextArea.setPrefHeight(600.0); 30 | userInfoTextArea.setText(user.toJSON().toString()); 31 | 32 | final var signOutButton = new Button("Sign out"); 33 | signOutButton.setOnAction(event -> { 34 | app.userSession.setUser(null); 35 | app.getSessionManager().gotoURL("/"); 36 | }); 37 | signOutButton.setDefaultButton(true); 38 | 39 | final var pane = new VBox(headerLabel, userInfoTextArea, signOutButton); 40 | pane.getStyleClass().add("signed-in-user-pane"); 41 | 42 | getChildren().add(pane); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /jpro-auth/core/src/main/java/one/jpro/platform/auth/core/api/FluentBasicAuthAPI.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.auth.core.api; 2 | 3 | import one.jpro.platform.auth.core.basic.UserManager; 4 | import one.jpro.platform.auth.core.basic.provider.BasicAuthenticationProvider; 5 | 6 | import java.util.Map; 7 | import java.util.Set; 8 | 9 | /** 10 | * Fluent Basic (username and password) Authentication API. 11 | * 12 | * @author Besmir Beqiri 13 | */ 14 | public class FluentBasicAuthAPI implements FluentBasicAuth { 15 | 16 | private UserManager userManager; 17 | private Set roles; 18 | private Map attributes; 19 | private String authorizationPath = BasicAuthenticationProvider.DEFAULT_AUTHORIZATION_PATH; 20 | 21 | @Override 22 | public FluentBasicAuth userManager(UserManager userManager) { 23 | this.userManager = userManager; 24 | return this; 25 | } 26 | 27 | @Override 28 | public FluentBasicAuth roles(String... roles) { 29 | this.roles = Set.of(roles); 30 | return this; 31 | } 32 | 33 | @Override 34 | public FluentBasicAuth attributes(Map attributes) { 35 | this.attributes = attributes; 36 | return this; 37 | } 38 | 39 | @Override 40 | public FluentBasicAuth authorizationPath(String authorizationPath) { 41 | this.authorizationPath = authorizationPath; 42 | return this; 43 | } 44 | 45 | @Override 46 | public BasicAuthenticationProvider create() { 47 | final var basicAuthProvider = new BasicAuthenticationProvider(userManager, roles, attributes); 48 | basicAuthProvider.setAuthorizationPath(authorizationPath); 49 | return basicAuthProvider; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /jpro-file/src/main/java/one/jpro/platform/file/WebFileSource.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.file; 2 | 3 | import com.jpro.webapi.WebAPI; 4 | import javafx.beans.property.ReadOnlyDoubleProperty; 5 | import javafx.beans.property.ReadOnlyObjectProperty; 6 | 7 | import java.io.File; 8 | import java.util.concurrent.CompletableFuture; 9 | 10 | /** 11 | * Web file source. 12 | * 13 | * @author Besmir Beqiri 14 | */ 15 | public final class WebFileSource extends FileSource { 16 | 17 | public WebFileSource(WebAPI.JSFile jsFile) { 18 | super(jsFile); 19 | } 20 | 21 | @Override 22 | public WebAPI.JSFile getPlatformFile() { 23 | return (WebAPI.JSFile) super.getPlatformFile(); 24 | } 25 | 26 | @Override 27 | String _getName() { 28 | return getPlatformFile().getFilename(); 29 | } 30 | 31 | @Override 32 | long _getSize() { 33 | return getPlatformFile().getFileSize(); 34 | } 35 | 36 | @Override 37 | public double getProgress() { 38 | return getPlatformFile().getProgress(); 39 | } 40 | 41 | @Override 42 | public ReadOnlyDoubleProperty progressProperty() { 43 | return getPlatformFile().progressProperty(); 44 | } 45 | 46 | @Override 47 | public File getUploadedFile() { 48 | return getPlatformFile().getUploadedFile(); 49 | } 50 | 51 | @Override 52 | public ReadOnlyObjectProperty uploadedFileProperty() { 53 | return getPlatformFile().uploadedFileProperty(); 54 | } 55 | 56 | @Override 57 | public void uploadFile() { 58 | getPlatformFile().uploadFile(); 59 | } 60 | 61 | @Override 62 | public CompletableFuture uploadFileAsync() { 63 | return getPlatformFile().getUploadedFileFuture(); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /jpro-routing/core-test/src/test/scala/one/jpro/platform/routing/crawl/TestSitemapGenerator.scala: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.routing.crawl 2 | 3 | import one.jpro.platform.routing.Route._ 4 | import one.jpro.platform.routing.crawl.TestUtils._ 5 | import one.jpro.platform.routing.{Redirect, Response, Route, RouteNode} 6 | import org.junit.jupiter.api.Test 7 | import simplefx.experimental._ 8 | 9 | class TestSitemapGenerator { 10 | @Test 11 | def test(): Unit = { 12 | def route = Route.empty() 13 | .and(get("/", r => Response.view(new Page1))) 14 | .and(get("/page2", r => Response.view(new Page2))) 15 | .and(get("/page4", r => Response.view(new Page2))) 16 | .and(r => Response.view(new Page1)) 17 | val result = AppCrawler.crawlRoute("http://localhost", () => route) 18 | val sm = SitemapGenerator.createSitemap("http://localhost", result) 19 | println("Crawl Report: " + result) 20 | println("SiteMap: " + sm) 21 | 22 | assert(sm.contains("http://localhost/page4"), "sitemap did not contain page4") 23 | assert(!sm.contains("http://external/link"), "sitemap contained external link") 24 | assert(!sm.contains("mailto")) 25 | } 26 | 27 | @Test 28 | def testMailToRedirect(): Unit = { 29 | def route = Route.empty() 30 | .and(get("/", r => Response.view(pageWithLink(List("/page2", "/page3", "mailto:something"))))) 31 | .and(get("/page2", r => Response.redirect("mailto:something-2"))) 32 | val result = AppCrawler.crawlRoute("http://localhost", () => route) 33 | println("got result: " + result) 34 | val sm = SitemapGenerator.createSitemap("http://localhost", result) 35 | println("SiteMap2: " + sm) 36 | assert(!sm.contains("mailto"), "sitemap contained mailto!") 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /jpro-file/src/main/java/one/jpro/platform/file/event/FileEvent.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.file.event; 2 | 3 | import javafx.beans.NamedArg; 4 | import javafx.event.EventTarget; 5 | import javafx.event.EventType; 6 | import javafx.scene.input.InputEvent; 7 | 8 | /** 9 | * File event. 10 | * 11 | * @author Besmir Beqiri 12 | */ 13 | public class FileEvent extends InputEvent { 14 | 15 | /** 16 | * Common supertype for all file event types. 17 | */ 18 | public static final EventType ANY = new EventType<>(InputEvent.ANY, "FILE"); 19 | 20 | private final transient DataTransfer dataTransfer; 21 | 22 | /** 23 | * Creates a new instance of the {@code FileEvent} with the 24 | * specified event source, target and type. 25 | * 26 | * @param source the source object that fired the event 27 | * @param target the target object to associate with the event 28 | * @param eventType the type of the event 29 | */ 30 | public FileEvent(final @NamedArg("source") Object source, 31 | final @NamedArg("target") EventTarget target, 32 | final @NamedArg("eventType") EventType eventType) { 33 | super(source, target, eventType); 34 | this.dataTransfer = new DataTransfer(); 35 | } 36 | 37 | /** 38 | * Returns the data transfer instance associated with this event. 39 | * 40 | * @return the data transfer instance 41 | */ 42 | public final DataTransfer getDataTransfer() { 43 | return dataTransfer; 44 | } 45 | 46 | @Override 47 | @SuppressWarnings("unchecked") 48 | public EventType getEventType() { 49 | return (EventType) super.getEventType(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /jpro-routing/core/src/main/scala/one/jpro/platform/routing/View.scala: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.routing 2 | 3 | import one.jpro.platform.routing.sessionmanager.SessionManager 4 | import simplefx.all 5 | import simplefx.all._ 6 | 7 | object View { 8 | def fromNode(node: javafx.scene.Node): View = RouteUtils.viewFromNode(node) 9 | } 10 | abstract class View extends ResponseResult { THIS => 11 | def title: String 12 | def description: String 13 | var url: String = null 14 | var isMobile: Boolean = false 15 | 16 | private var sessionManager: SessionManager = null 17 | def getSessionManager(): SessionManager = sessionManager 18 | def setSessionManager(x: SessionManager): Unit = { 19 | sessionManager = x 20 | } 21 | 22 | lazy val realContent: Node = content 23 | protected def content: Node 24 | def saveScrollPosition = true 25 | def fullscreen = false 26 | def onClose(): Unit = {} 27 | def subView(): View = null 28 | 29 | override def toString: String = s"View(title: $title, url: $url, description: $description)" 30 | 31 | /** 32 | * Only overwrite this method, if you handle the url-change by yourself. 33 | * @param x path 34 | * @return whether the view handles the url change 35 | */ 36 | def handleRequest(x: Request): Boolean = false 37 | def mapContent(f: Node => Node): View = new View { 38 | override def title: String = THIS.title 39 | 40 | override def description: String = THIS.description 41 | 42 | override def content: all.Node = f(THIS.realContent) 43 | 44 | override def fullscreen: Boolean = THIS.fullscreen 45 | 46 | override def setSessionManager(x: SessionManager): Unit = { 47 | super.setSessionManager(x) 48 | THIS.setSessionManager(x) 49 | } 50 | 51 | override def subView(): View = THIS 52 | } 53 | } 54 | 55 | -------------------------------------------------------------------------------- /jpro-mail/src/main/java/one/jpro/platform/mail/MailClient.java: -------------------------------------------------------------------------------- 1 | package one.jpro.platform.mail; 2 | 3 | import one.jpro.platform.mail.impl.MailClientImpl; 4 | import org.jetbrains.annotations.NotNull; 5 | 6 | /** 7 | * The MailClient interface provides methods for creating and managing mail clients. 8 | * It includes static methods to create instances of MailClient and a method to create mail messages. 9 | * 10 | * @author Besmir Beqiri 11 | */ 12 | public interface MailClient { 13 | 14 | /** 15 | * Creates a new MailClient instance with the given mail configuration. 16 | * 17 | * @param mailConfig the {@link MailConfig} object containing the mail configuration 18 | * @return a new MailClient instance 19 | */ 20 | @NotNull 21 | static MailClient create(@NotNull MailConfig mailConfig) { 22 | return new MailClientImpl(mailConfig); 23 | } 24 | 25 | /** 26 | * Creates a new MailClient instance with the given mail configuration, username, and password. 27 | * 28 | * @param mailConfig the {@link MailConfig} object containing the mail configuration 29 | * @param username the username for authentication 30 | * @param password the password for authentication 31 | * @return a new MailClient instance 32 | */ 33 | @NotNull 34 | static MailClient create(@NotNull MailConfig mailConfig, 35 | @NotNull String username, 36 | @NotNull String password) { 37 | return new MailClientImpl(mailConfig, username, password); 38 | } 39 | 40 | /** 41 | * Creates a new mail message. 42 | * 43 | * @return a new MailMessage instance 44 | */ 45 | @NotNull 46 | MailMessage createMessage(); 47 | } 48 | --------------------------------------------------------------------------------