You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updated README.md files for formatting & additional C# instructions. (#23)
* Java and C# Code Snippets for 4.0.0 Beta 2
* Updated CHANGELOG.md for C# examples and Java example updates
* Updated README.md files for formatting and additional C# instructions
Copy file name to clipboardExpand all lines: csharp/README.md
+6
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,12 @@
3
3
The C# snippets are contained in the `snippets` directory under various
4
4
directories -- each as its own assembly/project.
5
5
6
+
## Prerequisites
7
+
8
+
Before attempting to build the snippets you will need to make the make the
9
+
`Senzing.Sdk.[version].nupkg` file available to the `dotnet` executable so
10
+
it can be used as a dependency. This is done via these [instructions](https://github.com/senzing-garage/sz-sdk-csharp/blob/main/README.md#Usage).
11
+
6
12
## Building
7
13
8
14
The C# snippets can built using the `dotnet build [project-name]` command under each directory. They can be run using `dotnet run --project [project-name]` command. Attempting to run a snippet will also trigger building it.
Copy file name to clipboardExpand all lines: java/README.md
+20-9
Original file line number
Diff line number
Diff line change
@@ -3,8 +3,8 @@
3
3
The Java snippets are contained in the `snippets` directory under various Java package directories.
4
4
5
5
## Building
6
-
The Java snippets can built using the `pom.xml` in this directory using `mvn package`. The result will be the `sz-sdk-snippets.jar` file in the `target` directory.
7
6
7
+
The Java snippets can built using the `pom.xml` in this directory using `mvn package`. The result will be the `sz-sdk-snippets.jar` file in the `target` directory.
8
8
9
9
## Running
10
10
@@ -15,12 +15,14 @@ There are several ways to run the code snippets.
15
15
You may run any individual Snippet class directly providing you have a Senzing repository to run it with and the `SENZING_ENGINE_CONFIGURATION_JSON` environment variable set for connecting to that repository. Many of the snippets will find a default data file to run with if run from this directory, but also allow the caller to use a different data file if given by the first command-line argument.
16
16
17
17
1. Run a snippet that takes no command-line arguments.
@@ -32,29 +34,38 @@ then against. This is the `Main-Class` of the `sz-sdk-snippets.jar` file so it
32
34
**NOTE:** When code snippets are run this way you cannot specify command-line arguments for individual snippets, nor can you respond to command-line input requests (they will be automatically be responded by the runner -- including forced termination of a snippet that is intended to run indefinitely).
33
35
34
36
1. Execute all code snippets:
35
-
```
37
+
38
+
```console
36
39
java -jar target/sz-sdk-snippets.jar all
37
40
```
38
41
39
42
2. Execute all code snippets in a Java package:
40
-
```
43
+
44
+
```console
41
45
java -jar target/sz-sdk-snippets.jar loading
42
46
```
43
47
44
48
3. Execute all code snippets from multiple packages:
The configuration snippets outline how to modify the Senzing configuration, register the modified configuration with a configuration ID and update the default configuration ID for the repository.
2
+
3
+
The configuration snippets outline how to modify the Senzing configuration, register the modified configuration with a configuration ID and update the default configuration ID for the repository.
3
4
4
5
You may either `setDefaultConfigId()` or `replaceDefaultConfigId()`. Initially, the the default config ID must be set since there is no existing config ID to replace. However, when updating you may use `replaceDefaultConfigId()` to guard against race conditions of multiple threads or processes updating at the same time.
5
6
6
7
## Snippets
8
+
7
9
***AddDataSources.java**
8
-
* Gets the current default config, creates a modified config with additional data sources, registers that modified config and then replaces the default config ID.
10
+
* Gets the current default config, creates a modified config with additional data sources, registers that modified config and then replaces the default config ID.
9
11
***InitDefaultConfig.java**
10
-
* Initializes the repository with a default config ID using the template configuration provided by Senzing.
11
-
12
+
* Initializes the repository with a default config ID using the template configuration provided by Senzing.
0 commit comments