Author Topic: Plattform SDK Java  (Read 4106 times)

Offline daniel_san

  • Jr. Member
  • **
  • Posts: 84
  • Karma: 1
Plattform SDK Java
« on: December 01, 2016, 10:01:54 AM »
Hi guys,

I´m having some problem with java plattform sdk samples. I have tested the plattform Net samples correctly (so easy, only create project import references to dll´s and go ahead), but i´m trying to do the same with java and eclipse without results...

How can i open current java sdk example projects on docs.genesys with eclipse to see something working? I can see only the classes, an xml, and no more... with .net you have to open sln, but what i have to do on that case? It´s weird, because, if you open the project on eclipse, the "imports" are working correctle, but i can´t see the references on the project!  ???

Regards.

Offline PeteHoyle

  • Full Member
  • ***
  • Posts: 126
  • Karma: 13
Re: Plattform SDK Java
« Reply #1 on: December 02, 2016, 02:42:24 PM »
Hi Daniel,

I just had a quick look at the Java PSDK samples and it looks like they are based on Maven.

That means you should be able to import the samples using the pom.xml in the main directory of the samples.

In Eclipse if you:

Open eclipse
Click File > Import
Type Maven in the search box under Select an import source:
Select Existing Maven Projects
Click Next
Click Browse and select the folder that is the root of the Maven project (probably contains the pom.xml file)
Click OK
Under Projects: click the checkbox next to the pom.xml file
Click Finish

(Reference http://stackoverflow.com/questions/2061094/importing-maven-project-into-eclipse)

That will import all the source code into Eclipse, in the Sample code the pom.xmls are configured with dependencies of various PSDK libraries

[code]          <dependency>
            <groupId>com.genesyslab.platform</groupId>
            <artifactId>appblocks-bom</artifactId>
            <version>851.2.2</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>[/code]

[code]  <dependencies>
      <dependency>
        <groupId>com.genesyslab.platform</groupId>
        <artifactId>reportingprotocol</artifactId>
      </dependency>
      <dependency>
        <groupId>com.genesyslab.platform</groupId>
        <artifactId>warmstandbyappblock</artifactId>
      </dependency>
  </dependencies>[/code]

However these dependencies are not on the public repository and need to be in your local Maven Repository.

To add the PSDK libraries to your local Maven Repository, f you download the PSDK Java Libraries there are pom.xmls that are provided to allow you to import the PSDK jar files into you local Maven Repository for example reportingprotocol.pom.

https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html

If you don't have Maven configured or don't want to add the PSDK libs to your local repository you can just add the PSDK libs to the Build path of each Project in Eclipse:

Right Mouse click on the Project.
Select Build Path > Configure Build Path.
Select the Libraries tab.
Click Add Library > User Library.
Click Next.
Click User Libraries
Click New, enter name for your library (psdk85), Click OK.
Depending where your libraries are either Click Add Jars(if you saved them to a folder in your project) or Add External if they are outside of your project.
Select all jars and Click Open.
Click Finish.

You will still see some errors in the pom.xml but the source code should compile (you might need to add the log4j-api-2.2.jar and log4j-core-2.2.jar if you don't have Maven configured).

Hope this helps.

Pete






Offline daniel_san

  • Jr. Member
  • **
  • Posts: 84
  • Karma: 1
Re: Plattform SDK Java
« Reply #2 on: December 07, 2016, 11:21:54 AM »
Thank you so much PeteHoyle.

I was figuring out that the pom.xml was related to maven, and i tried to download some plugin for eclipse, but the Lan on my current client considers dangerous the url (to download the plugin)  ;D

I will try to do it on another place.

Thank you again for the explanation, it will be so helpfull when i have the chance to test it.

Regards.