UGC 5

Weblibrary

Learn how to integrate Sophora's UGC add on with your apps using the Java web library.

<dependency>
 <groupId>com.subshell.sophora.ugc</groupId>
 <artifactId>ugc-weblib</artifactId>
 <version>X.X.X</version>
</dependency>

The weblibrary provides you with Spring Beans for you application.

ResultWriter

The ResultWriter provides you with the ability to write user input into the "normal" folder of a S3 bucket.

It needs a S3Configuration with the following fields:

S3Configuration
AttributesDescription
sophora.ugc.weblib.s3.accessKeyIdAccess key for your S3 bucket
sophora.ugc.weblib.s3.secretAccessKeySecret key, usually bundled with the previous access key
sophora.ugc.weblib.s3.hostHost for the S3 bucket, e.g. "storage.googleapis.com"
sophora.ugc.weblib.s3.bucketNameName of the bucket in which UGC submissions are stored

VotingReportService

The VotingReportService can be used to access the RankingVotingReports and SimpleVotingReports of votings. For both, it needs the sophoraIds of the corresponding votings.

The URL to access UGC needs to be configured in WeblibConfiguration. Additionally, there is an optional configuration option to configure a cache used by the VotingReportService.

WeblibConfiguration
AttributesDescription
sophora.ugc.weblib.ugcBaseUrlURL that points to the location of UGC, including the HTTP protocol
sophora.ugc.weblib.voting.cacheTimeDuration for which a cached report is returned. After the duration is elapsed the next request will call the UGC backend to get the report. Default PT10S

Last modified on 12/17/24

The content of this page is licensed under the CC BY 4.0 License. Code samples are licensed under the MIT License.

Icon