Title: Enabling FDC3 API within a Java App · Issue #38 · openfin/java-example · GitHub
Open Graph Title: Enabling FDC3 API within a Java App · Issue #38 · openfin/java-example
X Title: Enabling FDC3 API within a Java App · Issue #38 · openfin/java-example
Description: I'm following the example here (FDC3Example.java) in order to set up FDC3 communication for a proof of concept. I'm encountering an issue when trying to connect to the fdc3client using fdc3Client.connect (line 185 in the example). This n...
Open Graph Description: I'm following the example here (FDC3Example.java) in order to set up FDC3 communication for a proof of concept. I'm encountering an issue when trying to connect to the fdc3client using fdc3Client.c...
X Description: I'm following the example here (FDC3Example.java) in order to set up FDC3 communication for a proof of concept. I'm encountering an issue when trying to connect to the fdc3client using fdc3...
Opengraph URL: https://github.com/openfin/java-example/issues/38
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Enabling FDC3 API within a Java App","articleBody":"I'm following the example [here (FDC3Example.java)](https://github.com/openfin/java-example/blob/master/src/main/java/com/openfin/desktop/demo/FDC3Example.java) in order to set up FDC3 communication for a proof of concept. I'm encountering an issue when trying to connect to the fdc3client using `fdc3Client.connect` ([line 185 in the example](https://github.com/openfin/java-example/blob/master/src/main/java/com/openfin/desktop/demo/FDC3Example.java#L185)). This never gets to either the `onSuccess` or the `onError`. I ran into the same issue when trying to run the example. I was later going through the docs [here](https://developers.openfin.co/docs/getting-started-fdc3), and I found the following wrt JS:\r\n\r\n\u003e Enabling FDC3 is as simple as adding it to your application manifest.\r\n\r\nTherefore, I created a quick test JS app, and added `\"fdc3Api\": true` to my manifest.\r\nNow my Java app works, since the FDC3 service has been launched and my Java app is able to connect to it.\r\n\r\nAs such, I am now looking for some way to enable the FDC3 service directly in the Java app. I have found references in the .NET API to enabling FDC3 ([here](http://cdn.openfin.co/docs/csharp/latest/OpenfinDesktop/html/1DF280C2.htm) and [here](http://cdn.openfin.co/docs/csharp/latest/OpenfinDesktop/html/6328E454.htm)), however have been unable to find anything of the sort for the Java API.\r\n\r\nAny help would be appreciated, thanks in advance.\r\n\r\n------------------------\r\n\r\nThe below is an excerpt of my code. Entry point is `launchOpenFin` at the bottom.\r\n\r\n```JAVA\r\n\r\n private void setUpFDC3IntentListener(String intent, JTextField textField) {\r\n fdc3Client.addIntentListener(intent, new IntentListener() {\r\n @Override\r\n public JSONObject onIntent(Context context) {\r\n textField.setText(String.format(\"Received Intent: %s\", context.toString()));\r\n context.put(\"comment\", \"Java rules\");\r\n return context;\r\n }\r\n }, new AckListener() {\r\n @Override\r\n public void onSuccess(Ack ack) {\r\n if (ack.isSuccessful()) {\r\n System.out.println(\"Registered intent listener\");\r\n } else {\r\n System.out.println(String.format(\"Failed to register intent listener %s\", ack.getReason()));\r\n }\r\n }\r\n\r\n @Override\r\n public void onError(Ack ack) {\r\n System.out.println(String.format(\"Failed to register intent listener %s\", ack.getReason()));\r\n }\r\n });\r\n }\r\n \r\n void setUpFDC3() {\r\n OpenFinJavaDemo.this.fdc3Client = FDC3Client.getInstance(OpenFinJavaDemo.this.desktopConnection);\r\n\r\n OpenFinJavaDemo.this.fdc3Client.connect(new AckListener() {\r\n @Override\r\n public void onSuccess(Ack ack) {\r\n System.out.println(String.format(\"Connected to FDC3 service\"));\r\n setUpFDC3IntentListener(TOPIC, fdc3ReceiptTextField);\r\n }\r\n\r\n @Override\r\n public void onError(Ack ack) {\r\n System.out.println(String.format(\"Failed to Connect to FDC3 service\"));\r\n }\r\n });\r\n }\r\n\r\n void launchOpenFin() throws DesktopIOException, IOException, DesktopException {\r\n RuntimeConfiguration runtimeConfiguration = new RuntimeConfiguration();\r\n runtimeConfiguration.setRuntimeVersion(\"16.83.53.26\");\r\n runtimeConfiguration.setAdditionalRuntimeArguments(\"--v=1\");\r\n this.desktopConnection = new DesktopConnection(\"openfin-IAB-java-demo\");\r\n this.desktopConnection.connect(runtimeConfiguration, new DesktopStateListener() {\r\n\r\n @Override\r\n public void onReady() {\r\n OpenFinJavaDemo.this.openFinSystem = new OpenFinRuntime(OpenFinJavaDemo.this.desktopConnection);\r\n try {\r\n openFinSystem.addEventListener(\"application-platform-api-ready\", e -\u003e {\r\n System.out.println(\"application-platform-api-ready: \" + e.getEventObject());\r\n String uuid = e.getEventObject().getString(\"uuid\");\r\n System.out.println(uuid);\r\n }, null);\r\n\r\n setUpFDC3();\r\n\r\n } catch (DesktopException e) {\r\n e.printStackTrace();\r\n }\r\n SwingUtilities.invokeLater(() -\u003e {\r\n OpenFinJavaDemo.this.glassPane.setVisible(false);\r\n });\r\n }\r\n .\r\n .\r\n .\r\n .\r\n .\r\n });\r\n }\r\n\r\n```","author":{"url":"https://github.com/mark-buhagiar","@type":"Person","name":"mark-buhagiar"},"datePublished":"2020-09-01T14:24:54.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/38/java-example/issues/38"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:16a1d48b-61eb-4adf-9c18-1642cc2e8e83 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C7E8:4A6C3:9B016:DDAB4:696F9EA3 |
| html-safe-nonce | b8e474eb5858884c5ae1b08668ec6b7f391d6f5d1de833b954c61337521af867 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDN0U4OjRBNkMzOjlCMDE2OkREQUI0OjY5NkY5RUEzIiwidmlzaXRvcl9pZCI6IjIwMDEyODA4MDI2NDQ1MzI4OTkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 52b933d68c20a0deaf87a515ffc925d841c01425758edcbb42537318f41c75ec |
| hovercard-subject-tag | issue:690187804 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/openfin/java-example/38/issue_layout |
| twitter:image | https://opengraph.githubassets.com/667c6350e6c1f93c062da29eaab608a5f83122270f67c7428378544273a120a3/openfin/java-example/issues/38 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/667c6350e6c1f93c062da29eaab608a5f83122270f67c7428378544273a120a3/openfin/java-example/issues/38 |
| og:image:alt | I'm following the example here (FDC3Example.java) in order to set up FDC3 communication for a proof of concept. I'm encountering an issue when trying to connect to the fdc3client using fdc3Client.c... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mark-buhagiar |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0ca8d8c65612640b9a1a588b3eed68222ca723ed2d028b18fe81b28936d535eb |
| turbo-cache-control | no-preview |
| go-import | github.com/openfin/java-example git https://github.com/openfin/java-example.git |
| octolytics-dimension-user_id | 1569661 |
| octolytics-dimension-user_login | openfin |
| octolytics-dimension-repository_id | 28981196 |
| octolytics-dimension-repository_nwo | openfin/java-example |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 28981196 |
| octolytics-dimension-repository_network_root_nwo | openfin/java-example |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 95f60616ce2765d1114fe6da4af405a58c6d26d2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width