Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update log4j and jaxb #78

Merged
merged 1 commit into from
Jan 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.pyc
/java/build/*
/java/.idea/*
/java/lib/*
51 changes: 18 additions & 33 deletions java/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

## Requirements

* Tableau Server
* Tableau Server, or an account on Tableau Cloud
* Java SDK
* Download: <http://www.oracle.com/technetwork/java/javase/downloads/index.html>
* Apache Ant
Expand All @@ -14,43 +14,28 @@
## Getting started

1. Install the tools listed in the "Requirements" section.
1. Download the REST API schema and save it in the `/res` folder under the folder where this README file is. For more information about the schema, see the following documentation:

<http://onlinehelp.tableau.com/current/api/rest_api/en-us/help.htm#REST/rest_api_concepts_schema.htm>

1. In the `/res` folder, open the `config.properties` file using a text editor.
1. Modify the configurations as instructed in the file. A sample workbook is already provided with this sample, but you can use any packaged workbook that you want.
1. Open the following file in a text editor:

```
src\com\tableausoftware\documentation\api\rest\util\RestApiUtils.java
```

1. Find the `getApiUriBuilder()` method, and replace the API URL with the correct version number.

For example, you might see the following URL:

```
/api/3.1/
```

If you want to use version 3.0 of the API, replace the URL with the following:

```
/api/3.0/
```

## Running the sample

1. Make sure that Tableau Server is running.
1. Make sure that Tableau Server is running if you are using your own server.
1. In the /res folder, open the config.properties file using a text editor.
1. Modify the configurations as instructed in the file.
2. A sample workbook is already provided with this sample, but you can use any packaged workbook that you want.
1. Open a command prompt or terminal.
1. In the command prompt window, change directory to the sample code's parent folder.
1. Enter `ant` in the command prompt to compile the sample code and download dependencies.
1. Enter `ant run` in the command prompt to run the sample code after compilation.
1. In the command prompt window, change directory to the sample code's parent folder.
1. Enter `ant` in the command prompt to compile the sample code and download dependencies.
1. Enter `ant run` in the command prompt to run the sample code after compilation.

## Possible problems

When `ant` is run in a command prompt, it may respond with "ant is not recognized as an internal or external command..."

Make sure that the `ANT_HOME` and `JAVA_HOME` variables are set as described in the installation guide for Apache Ant. Paths should not include quotes.
For more information, see <http://ant.apache.org/manual/install.html#windows>
------

The example code uses version 3.0 of the REST API and schema. If you want to use a different version:
1. Download the REST API schema and save it in the `/res` folder under the folder where this README file is. For more information about the schema, see the following documentation:

<http://onlinehelp.tableau.com/current/api/rest_api/en-us/help.htm#REST/rest_api_concepts_schema.htm>

1. In the `/res` folder, open the `config.properties` file using a text editor.
jacalata marked this conversation as resolved.
Show resolved Hide resolved
1. Update the schema configuration properties to match the new file.
------
13 changes: 3 additions & 10 deletions java/build.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
<!--
Ant build file for the project jar.

All functionality comes from the common-module.xml Ant script.
Do not add targets or properties here unless they are
only specific to this module.

Note that including the local ant.properties file must
happen before importing the common-module.xml to ensure
properties are overridden correctly.

Type "ant -p" to see the list of available targets.
-->
<project name="tab-documentation-api" basedir="." default="main" xmlns:ivy="antlib:org.apache.ivy.ant">
<property file="ant.properties"/>
<presetdef name="javac">
<javac includeantruntime="false" />
</presetdef>

<path id="classpath">
<fileset dir="${lib.dir}" includes="**/*.jar"/>
Expand Down
8 changes: 6 additions & 2 deletions java/ivy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@
<!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
<dependency org="com.google.guava" name="guava" rev="16.0.1"/>
<!-- https://mvnrepository.com/artifact/log4j/log4j -->
<dependency org="log4j" name="log4j" rev="1.2.17"/>
<dependency org="org.apache.logging.log4j" name="log4j-api" rev="2.19.0" />
<dependency org="org.apache.logging.log4j" name="log4j-core" rev="2.19.0" />
<!-- https://mvnrepository.com/artifact/com.sun.jersey/jersey-client -->
<dependency org="com.sun.jersey" name="jersey-client" rev="1.18.3"/>
<!-- https://mvnrepository.com/artifact/com.sun.jersey/jersey-core -->
<dependency org="com.sun.jersey" name="jersey-core" rev="1.18.3"/>
<!-- https://mvnrepository.com/artifact/com.sun.jersey.contribs/jersey-multipart -->
<dependency org="com.sun.jersey.contribs" name="jersey-multipart" rev="1.18.3"/>
<!-- https://mvnrepository.com/artifact/com.sun.jersey/jersey-server -->
<!-- https://mvnrepository.com/artifact/com.sun.jersey/jersey-server -->
<dependency org="com.sun.jersey" name="jersey-server" rev="1.18.3"/>
<!-- JAXB API only -->
<dependency org="jakarta.xml.bind" name="jakarta.xml.bind-api" rev="2.3.3"/>
<!-- JAXB RI, Jakarta XML Binding -->
<dependency org="com.sun.xml.bind" name="jaxb-ri" rev="2.3.3" />
</dependencies>
</ivy-module>
5 changes: 3 additions & 2 deletions java/res/config.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Set this to the name or IP address of the Tableau Server installation.
server.host=http://YOUR-SERVER

# Set where the REST API schema is located
# Set where the REST API schema is located and the version to use
# The latest schema can be downloaded from here:
# http://onlinehelp.tableau.com/current/api/rest_api/en-us/help.htm#REST/rest_api_concepts_schema.htm
server.schema.location=res/ts-api_X_X.xsd
server.schema.location=res/ts-api_3_0.xsd
server.schema.version=3.0

# Set this to the content URL of the default site.
# Not assigning a value to this configuration references the default site.
Expand Down
Loading