Skip to content

Commit b5950ec

Browse files
REL-1238691: initial commit
1 parent bdd2c4e commit b5950ec

39 files changed

Lines changed: 2845 additions & 1 deletion

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
################################################################################
2+
# This .gitignore file was automatically created by Microsoft(R) Visual Studio.
3+
################################################################################
4+
5+
/.vs
6+
/Source/.vs
7+
/Source/**/bin
8+
/Source/**/obj
9+
/Source/SampleRap.CustomPage/node_modules
10+
*.user
11+
/Artifacts
12+
/Source/SampleRap.CustomPage/SampleRap.CustomPage/node_modules/bootstrap/dist
13+
/Source/SampleRap.CustomPage/SampleRap.CustomPage

ApplicationsXML/application.xml

Lines changed: 1329 additions & 0 deletions
Large diffs are not rendered by default.

DevelopmentScripts/build.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<BuildTools>
2+
<RAPBuilder>
3+
<Applications>
4+
<Application name="SampleRap" >
5+
<Destination>Artifacts\SampleRap.rap</Destination>
6+
<ApplicationSchema>ApplicationsXML/application.xml</ApplicationSchema>
7+
<Assemblies>
8+
<Assembly>Source\SampleRap\bin\SampleRap.dll</Assembly>
9+
</Assemblies>
10+
<ResourceFiles />
11+
<CustomPages>
12+
<CustomPage guid="a412cfce-098d-4339-96ba-72933ac2e707">Source\SampleRap.CustomPage\SampleRap.CustomPage</CustomPage>
13+
</CustomPages>
14+
</Application>
15+
</Applications>
16+
</RAPBuilder>
17+
</BuildTools>

Directory.Build.props

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<!-- This file will be overwritten on the CI server -->
2+
<Project>
3+
</Project>

Directory.Build.targets

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!-- This file will be overwritten on the CI server -->
2+
<Project>
3+
<PropertyGroup>
4+
<!-- Build standards -->
5+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
6+
<WarningLevel>4</WarningLevel>
7+
<WarningsAsErrors />
8+
<WarningsNotAsErrors />
9+
<NoWarn />
10+
</PropertyGroup>
11+
<ItemGroup Condition="'$(TemplateLanguage)' == 'CSharp'">
12+
<Compile Remove="Properties\AssemblyInfo.cs" />
13+
<Compile Include="$(MSBuildThisFileDirectory)Source\Version\AssemblyInfo.cs">
14+
<Link>AssemblyInfo.cs</Link>
15+
</Compile>
16+
</ItemGroup>
17+
<ItemGroup Condition="'$(TemplateLanguage)' == 'VisualBasic'">
18+
<Compile Remove="My Project\AssemblyInfo.vb" />
19+
<Compile Include="$(MSBuildThisFileDirectory)Source\Version\AssemblyInfo.vb">
20+
<Link>AssemblyInfo.vb</Link>
21+
</Compile>
22+
</ItemGroup>
23+
</Project>

README.md

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,59 @@
11
# server-sample-rap
2-
This repository contains an example Relativity Application (RAP) that shows the basic structure of project files used to create a RAP with the relsvr-rap tool.
2+
3+
This repository is a sample Relativity Application Package (RAP) project targeting Relativity Server. It demonstrates the structure and tooling required to build a RAP that includes a compiled .NET assembly and an ASP.NET MVC custom page. It is intended as a reference for developers building Relativity Server applications.
4+
5+
## Prerequisites
6+
7+
Before running the build, ensure the following tools are installed and available on your `PATH`:
8+
9+
- **[.NET SDK](https://dotnet.microsoft.com/download)** — required for `dotnet restore`
10+
- **[MSBuild](https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild)** — required to compile the solution (included with Visual Studio or the Build Tools for Visual Studio)
11+
- **[Node.js and npm](https://nodejs.org/)** — required to install front-end dependencies for the custom page
12+
- **[relsvr-rap CLI](relsvr-rap-Usage-Guide.md)** — Relativity's RAP build tool; This should be installed from the Relativity.Server.RAPTool NuGet package using `dotnet tool install`
13+
14+
## Building
15+
16+
Run the build script from the repository root in PowerShell:
17+
18+
```powershell
19+
.\build.ps1
20+
```
21+
22+
### Parameters
23+
24+
| Parameter | Default | Description |
25+
|-----------|---------|-------------|
26+
| `-Version` | `1.0.0.0` | The version number to assign to the RAP package |
27+
| `-RelativityServerRelease` | `2024` | The target Relativity Server release year (e.g., `2024`, `2025`) |
28+
| `-Configuration` | `Release` | The MSBuild build configuration |
29+
30+
**Example with custom parameters:**
31+
32+
```powershell
33+
.\build.ps1 -Version 2.0.0.0 -RelativityServerRelease 2025 -Configuration Debug
34+
```
35+
36+
### What the build script does
37+
38+
1. Runs `dotnet restore` to restore NuGet packages for the solution
39+
2. Runs `npm install` in the `SampleRap.CustomPage` project to install front-end dependencies
40+
3. Runs `msbuild` to compile the full solution, writing build logs to `Artifacts/Logs/`
41+
4. Runs `relsvr-rap build` to package the compiled outputs into a RAP file
42+
43+
## Build Artifacts
44+
45+
After a successful build, the following files are created under the `Artifacts/` directory:
46+
47+
```
48+
Artifacts/
49+
├── Logs/
50+
│ ├── buildsummary.log # General MSBuild output summary
51+
│ ├── builderrors.log # MSBuild errors only
52+
│ └── rapbuild.log # Output from the relsvr-rap build step
53+
└── SampleRap.rap # The final Relativity Application Package
54+
```
55+
56+
**`SampleRap.rap`** is the primary output. It is a ZIP-based package that can be installed into a Relativity Server environment. It contains:
57+
- `SampleRap.dll` — the main .NET assembly (agents, event handlers, services)
58+
- The compiled `SampleRap.CustomPage` ASP.NET MVC application (zipped as a custom page)
59+
- `application.xml` — the Relativity application schema defining the app's components

Source/Directory.packages.props

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
5+
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
6+
</PropertyGroup>
7+
<ItemGroup>
8+
<PackageVersion Include="BCrypt-Official" Version="0.1.109" />
9+
<PackageVersion Include="BCrypt.Net-Core" Version="1.6.0" />
10+
<PackageVersion Include="Castle.Core" Version="3.3.0" />
11+
<PackageVersion Include="Castle.Windsor" Version="3.3.0" />
12+
<PackageVersion Include="jQuery" Version="3.6.0" />
13+
<PackageVersion Include="Microsoft.AspNet.Mvc" Version="5.2.3" />
14+
<PackageVersion Include="Microsoft.AspNet.Razor" Version="3.2.3" />
15+
<PackageVersion Include="Microsoft.AspNet.WebPages" Version="3.2.3" />
16+
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
17+
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
18+
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
19+
<PackageVersion Include="Microsoft.Web.Infrastructure" Version="1.0.0.0" />
20+
<PackageVersion Include="Newtonsoft.Json" Version="6.0.8" />
21+
<PackageVersion Include="popper.js" Version="1.14.0" />
22+
<PackageVersion Include="Relativity.Platform.Agent.WorkloadDiscovery.SDK" Version="0.2.1"/>
23+
<PackageVersion Include="Relativity.Server.Agent.SDK" Version="5000.0.2"/>
24+
<PackageVersion Include="Relativity.Server.API.SDK" Version="5000.0.3"/>
25+
<PackageVersion Include="Relativity.Server.Application.SDK" Version="5000.0.4"/>
26+
<PackageVersion Include="Relativity.Server.ARM.SDK" Version="24000.0.4"/>
27+
<PackageVersion Include="Relativity.Server.Audit.SDK" Version="5000.0.2"/>
28+
<PackageVersion Include="Relativity.Server.CustomPages.SDK" Version="5000.0.2"/>
29+
<PackageVersion Include="Relativity.Server.DataTransfer.SDK" Version="24000.1.1"/>
30+
<PackageVersion Include="Relativity.Server.DataVisualization.SDK" Version="5000.0.1"/>
31+
<PackageVersion Include="Relativity.Server.DocumentViewer.SDK" Version="5000.0.4"/>
32+
<PackageVersion Include="Relativity.Server.DtSearch.SDK" Version="5000.0.1"/>
33+
<PackageVersion Include="Relativity.Server.Environment.SDK" Version="5000.0.2"/>
34+
<PackageVersion Include="Relativity.Server.EventHandler.SDK" Version="5000.0.3"/>
35+
<PackageVersion Include="Relativity.Server.Extensibility.SDK" Version="5000.0.2"/>
36+
<PackageVersion Include="Relativity.Server.Identity.SDK" Version="5000.0.1"/>
37+
<PackageVersion Include="Relativity.Server.Imaging.SDK" Version="24000.1.0"/>
38+
<PackageVersion Include="Relativity.Server.Import.SDK" Version="24000.1.1"/>
39+
<PackageVersion Include="Relativity.Server.Infrastructure.SDK" Version="5000.0.1"/>
40+
<PackageVersion Include="Relativity.Server.Kepler.Client.SDK" Version="5000.0.2"/>
41+
<PackageVersion Include="Relativity.Server.Kepler.SDK" Version="5000.0.2"/>
42+
<PackageVersion Include="Relativity.Server.Logging.Interfaces.SDK" Version="5000.1.1"/>
43+
<PackageVersion Include="Relativity.Server.Logging.SDK" Version="5000.1.1"/>
44+
<PackageVersion Include="Relativity.Server.Notifications.SDK" Version="24000.2.0"/>
45+
<PackageVersion Include="Relativity.Server.OAuth2.Implicit.SDK" Version="5000.0.1"/>
46+
<PackageVersion Include="Relativity.Server.OAuth2.Interfaces.SDK" Version="5000.0.1"/>
47+
<PackageVersion Include="Relativity.Server.OAuth2.SDK" Version="5000.0.1"/>
48+
<PackageVersion Include="Relativity.Server.ObjectManager.SDK" Version="5000.0.2"/>
49+
<PackageVersion Include="Relativity.Server.ObjectModel.SDK" Version="5000.0.2"/>
50+
<PackageVersion Include="Relativity.Server.OutsideIn.FI.Win32.SDK" Version="2024.11.0" />
51+
<PackageVersion Include="Relativity.Server.Processing.SDK" Version="5000.0.2"/>
52+
<PackageVersion Include="Relativity.Server.Productions.SDK" Version="24000.0.0"/>
53+
<PackageVersion Include="Relativity.Server.Review.SDK" Version="5000.0.1"/>
54+
<PackageVersion Include="Relativity.Server.Rsapi.SDK" Version="5000.0.3"/>
55+
<PackageVersion Include="Relativity.Server.SDK" Version="5000.0.2"/>
56+
<PackageVersion Include="Relativity.Server.SearchTermsReport.SDK" Version="5000.0.1"/>
57+
<PackageVersion Include="Relativity.Server.Services.DataContracts.SDK" Version="5000.0.2"/>
58+
<PackageVersion Include="Relativity.Server.Services.Interfaces.SDK" Version="5000.0.2"/>
59+
<PackageVersion Include="Relativity.Server.Shared.SDK" Version="5000.0.1"/>
60+
<PackageVersion Include="Relativity.Server.Telemetry.APM.SDK" Version="5000.0.3"/>
61+
<PackageVersion Include="Relativity.Server.Telemetry.DataContracts.Shared.SDK" Version="5000.0.0"/>
62+
<PackageVersion Include="Relativity.Server.Telemetry.MetricsCollection.Interfaces.SDK" Version="5000.0.1"/>
63+
<PackageVersion Include="Relativity.Server.Telemetry.MetricsCollection.SDK" Version="5000.0.0"/>
64+
<PackageVersion Include="Relativity.Server.Telemetry.Services.Interfaces.SDK" Version="5000.0.1"/>
65+
<PackageVersion Include="Relativity.Server.Testing.Framework.Api.SDK" Version="5000.1.0"/>
66+
<PackageVersion Include="Relativity.Server.Testing.Framework.SDK" Version="5000.1.0"/>
67+
<PackageVersion Include="Relativity.Server.Transfer.SDK" Version="24000.0.1"/>
68+
<PackageVersion Include="Relativity.Server.Utility.SDK" Version="5000.0.0"/>
69+
<PackageVersion Include="Relativity.Toggles" Version="1.5.0"/>
70+
<PackageVersion Include="System.Buffers" Version="4.5.1" />
71+
<PackageVersion Include="System.Memory" Version="4.5.5" />
72+
<PackageVersion Include="System.Numerics.Vectors" Version="4.5.0" />
73+
<PackageVersion Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
74+
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
75+
</ItemGroup>
76+
</Project>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using System.Web.Mvc;
2+
using System.Web.Routing;
3+
4+
namespace SuccessfulRAPBuild.CustomPage
5+
{
6+
public class RouteConfig
7+
{
8+
public static void RegisterRoutes(RouteCollection routes)
9+
{
10+
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
11+
12+
routes.MapRoute(
13+
name: "Default",
14+
url: "{controller}/{action}/{id}",
15+
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
16+
);
17+
}
18+
}
19+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
body {
2+
padding-top: 60px;
3+
padding-bottom: 20px;
4+
}
5+
6+
/* Set padding to keep content from hitting the edges */
7+
.body-content {
8+
padding-left: 15px;
9+
padding-right: 15px;
10+
}
11+
12+
/* Set width on the form input elements since they're 100% wide by default */
13+
input,
14+
select,
15+
textarea {
16+
max-width: 280px;
17+
}
18+
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using System;
2+
using System.Web.Mvc;
3+
using Relativity.API;
4+
5+
namespace SuccessfulRAPBuild.CustomPage.Controllers
6+
{
7+
public class HomeController : Controller
8+
{
9+
// GET: Home
10+
public ActionResult Index()
11+
{
12+
ICPHelper customPageHelper = Relativity.CustomPages.ConnectionHelper.Helper();
13+
IAPILog logger = customPageHelper.GetLoggerFactory().GetLogger();
14+
15+
logger.LogInformation("Starting CustomPage.HomeController.Index");
16+
17+
try
18+
{
19+
logger.LogInformation("Running Verifiers for Custom Page runtime components");
20+
21+
logger.LogInformation("Finishing CustomPage.HomeController.Index");
22+
}
23+
catch (Exception ex)
24+
{
25+
//Your custom page caught an exception
26+
logger.LogError(ex, "There was an exception in the Custom Page.");
27+
}
28+
29+
return View();
30+
}
31+
}
32+
}

0 commit comments

Comments
 (0)