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

Merge pull request #14 from oracle-devrel/cw24 #15

Merged
merged 8 commits into from
Oct 3, 2024
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
24 changes: 24 additions & 0 deletions OJET (VDOM) - OCI Vision/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*
55 changes: 55 additions & 0 deletions OJET (VDOM) - OCI Vision/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Contributing to this repository

We welcome your contributions! There are multiple ways to contribute.

## Opening issues

For bugs or enhancement requests, please file a GitHub issue unless it's
security related. When filing a bug remember that the better written the bug is,
the more likely it is to be fixed. If you think you've found a security
vulnerability, do not raise a GitHub issue and follow the instructions in our
[security policy](./SECURITY.md).

## Contributing code

We welcome your code contributions. Before submitting code via a pull request,
you will need to have signed the [Oracle Contributor Agreement][OCA] (OCA) and
your commits need to include the following line using the name and e-mail
address you used to sign the OCA:

```text
Signed-off-by: Your Name <[email protected]>
```

This can be automatically added to pull requests by committing with `--sign-off`
or `-s`, e.g.

```text
git commit --signoff
```

Only pull requests from committers that can be verified as having signed the OCA
can be accepted.

## Pull request process

1. Ensure there is an issue created to track and discuss the fix or enhancement
you intend to submit.
1. Fork this repository.
1. Create a branch in your fork to implement the changes. We recommend using
the issue number as part of your branch name, e.g. `1234-fixes`.
1. Ensure that any documentation is updated with the changes that are required
by your change.
1. Ensure that any samples are updated if the base image has been changed.
1. Submit the pull request. *Do not leave the pull request blank*. Explain exactly
what your changes are meant to do and provide simple steps on how to validate.
your changes. Ensure that you reference the issue you created as well.
1. We will assign the pull request to 2-3 people for review before it is merged.

## Code of conduct

Follow the [Golden Rule](https://en.wikipedia.org/wiki/Golden_Rule). If you'd
like more specific guidelines, see the [Contributor Covenant Code of Conduct][COC].

[OCA]: https://oca.opensource.oracle.com
[COC]: https://www.contributor-covenant.org/version/1/4/code-of-conduct/
35 changes: 35 additions & 0 deletions OJET (VDOM) - OCI Vision/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Copyright (c) 2024 Oracle and/or its affiliates.

The Universal Permissive License (UPL), Version 1.0

Subject to the condition set forth below, permission is hereby granted to any
person obtaining a copy of this software, associated documentation and/or data
(collectively the "Software"), free of charge and under any and all copyright
rights in the Software, and any and all patent rights owned or freely
licensable by each licensor hereunder covering either (i) the unmodified
Software as contributed to or provided by such licensor, or (ii) the Larger
Works (as defined below), to deal in both

(a) the Software, and
(b) any piece of software and/or hardware listed in the lrgrwrks.txt file if
one is included with the Software (each a "Larger Work" to which the Software
is contributed by such licensors),

without restriction, including without limitation the rights to copy, create
derivative works of, display, perform, and distribute the Software and make,
use, sell, offer for sale, import, export, have made, and have sold the
Software and the Larger Work(s), and to sublicense the foregoing rights on
either these or other terms.

This license is subject to the following condition:
The above copyright notice and either this complete permission notice or at
a minimum a reference to the UPL must be included in all copies or
substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
88 changes: 88 additions & 0 deletions OJET (VDOM) - OCI Vision/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Build an Application That Can “See” and “Understand” Visual Data.

[![License: UPL](https://img.shields.io/badge/license-UPL-green)](https://img.shields.io/badge/license-UPL-green) [![Quality gate](https://sonarcloud.io/api/project_badges/quality_gate?project=oracle-devrel_test)](https://sonarcloud.io/dashboard?id=oracle-devrel_test)



## Introduction
Oracle JET uses the Virtual DOM (VDOM) architecture and integrates OCI Vision services for enhanced functionality. The Oracle JET VDOM UI application consumes responses from the OCI Vision service. This code is for Oracle JET applications based on the Virtual DOM architecture. This project is developed for use with the Oracle JavaScript Extension Toolkit (JET) coding environment.


## Getting Started

There are three parts of the application. The code for part 3 is in this repository.

• Part 1: Upload images to OCI bucket.

1. Login to your Oracle Cloud Account. If you don't have one yet, sign up at cloud.oracle.com.
2. Create a compartment from the OCI “Identity and Security” menu and note the CompartmentID.
3. From the Storage menu, choose the “Bucket” option. Create a bucket the compartment you created above and name it “ORACLE_DEMO_BUCKET” .
4. Upload sample images.
5. Set up an API signing key and OCI profile mentioned in OCI documentation.

![OCI bucket](https://github.com/user-attachments/assets/d9e29dce-2088-4dc3-9b20-c3b65c0f74e5)


• Part 2: Integration of OCI Java SDK with OCI Vision service to handle image processing within a Spring Boot application.

• Clone the repository below and follow its instructions mentioned in part 2 section of [oracle-jet-vdom-and-oci-vision](https://blogs.oracle.com/developers/post/oracle-jet-vdom-and-oci-vision) to run the code locally.

[oci-sdk-java-samples](https://github.com/user-attachments/assets/c12954b7-56b5-4c86-b680-2625364ed1fb)


• Part 3: Developing an Oracle JET (VDOM) application to consume and display the results from OCI Vision Service.
Clone the repository below and execute the command below in the local terminal.


npx ojet serve
**The final application should look as follows on a localhost server:**
Our blog will feature a one-page application with Object Storage Details and OCI Vision Result sections. In the Object Storage Details section, users enter Tenancy Region and Bucket Name. After validating the inputs, the application fetches the images stored in the provided object storage, which are then displayed in object lists. Upon submission, the OCI Vision API analyzes the selected image, displaying both the object and text in the OCI Vision Result section.

![OJET VDOM application](https://github.com/user-attachments/assets/c12954b7-56b5-4c86-b680-2625364ed1fb)


Note: image courtesy of pixabay.com

### Prerequisites


• Nodejs

• Java 17

• Integrated Development Environment (IDE)

• Oracle Cloud Account (free oracle cloud services should be sufficient)



## Contributors
Author: Kulraj Singh Chouhan
Collaborators: NA
Last Review: Sept 2024

## References
[oracle-jet-vdom-and-oci-vision](https://blogs.oracle.com/developers/post/oracle-jet-vdom-and-oci-vision)

[OCI Vision ](https://docs.oracle.com/en/solutions/ai-vision-extract-data/index.html#GUID-FA774176-6223-4E78-89D0-887BB6BCA4E4)

## Contributing
<!-- If your project has specific contribution requirements, update the
CONTRIBUTING.md file to ensure those requirements are clearly explained. -->

This project welcomes contributions from the community. Before submitting a pull
request, please [review our contribution guide](./CONTRIBUTING.md).

## Security

Please consult the [security guide](./SECURITY.md) for our responsible security
vulnerability disclosure process.

## License
Copyright (c) 2024 Oracle and/or its affiliates.

Licensed under the Universal Permissive License (UPL), Version 1.0.

See [LICENSE](LICENSE.txt) for more details.

ORACLE AND ITS AFFILIATES DO NOT PROVIDE ANY WARRANTY WHATSOEVER, EXPRESS OR IMPLIED, FOR ANY SOFTWARE, MATERIAL OR CONTENT OF ANY KIND CONTAINED OR PRODUCED WITHIN THIS REPOSITORY, AND IN PARTICULAR SPECIFICALLY DISCLAIM ANY AND ALL IMPLIED WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. FURTHERMORE, ORACLE AND ITS AFFILIATES DO NOT REPRESENT THAT ANY CUSTOMARY SECURITY REVIEW HAS BEEN PERFORMED WITH RESPECT TO ANY SOFTWARE, MATERIAL OR CONTENT CONTAINED OR PRODUCED WITHIN THIS REPOSITORY. IN ADDITION, AND WITHOUT LIMITING THE FOREGOING, THIRD PARTIES MAY HAVE POSTED SOFTWARE, MATERIAL OR CONTENT TO THIS REPOSITORY WITHOUT ANY REVIEW. USE AT YOUR OWN RISK.
38 changes: 38 additions & 0 deletions OJET (VDOM) - OCI Vision/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Reporting security vulnerabilities

Oracle values the independent security research community and believes that
responsible disclosure of security vulnerabilities helps us ensure the security
and privacy of all our users.

Please do NOT raise a GitHub Issue to report a security vulnerability. If you
believe you have found a security vulnerability, please submit a report to
[[email protected]][1] preferably with a proof of concept. Please review
some additional information on [how to report security vulnerabilities to Oracle][2].
We encourage people who contact Oracle Security to use email encryption using
[our encryption key][3].

We ask that you do not use other channels or contact the project maintainers
directly.

Non-vulnerability related security issues including ideas for new or improved
security features are welcome on GitHub Issues.

## Security updates, alerts and bulletins

Security updates will be released on a regular cadence. Many of our projects
will typically release security fixes in conjunction with the
Oracle Critical Patch Update program. Additional
information, including past advisories, is available on our [security alerts][4]
page.

## Security-related information

We will provide security related information such as a threat model, considerations
for secure use, or any known security issues in our documentation. Please note
that labs and sample code are intended to demonstrate a concept and may not be
sufficiently hardened for production use.

[1]: mailto:[email protected]
[2]: https://www.oracle.com/corporate/security-practices/assurance/vulnerability/reporting.html
[3]: https://www.oracle.com/security-alerts/encryptionkey.html
[4]: https://www.oracle.com/security-alerts/
27 changes: 27 additions & 0 deletions OJET (VDOM) - OCI Vision/jet_virtual_dom_app/oraclejetconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"paths": {
"source": {
"common": "src",
"web": "src-web",
"javascript": ".",
"typescript": ".",
"styles": "styles",
"themes": "themes",
"components": "components",
"exchangeComponents": "exchange_components"
},
"staging": {
"web": "web",
"themes": "staged-themes"
}
},
"defaultBrowser": "chrome",
"sassVer": "8.0.0",
"defaultTheme": "redwood",
"typescriptLibraries": "[email protected] yargs-parser@~13.1.2",
"webpackLibraries": "[email protected] @types/[email protected] webpack-dev-server style-loader css-loader sass-loader sass [email protected] raw-loader noop-loader html-webpack-plugin html-replace-webpack-plugin copy-webpack-plugin @prefresh/webpack @prefresh/babel-plugin webpack-merge compression-webpack-plugin mini-css-extract-plugin clean-webpack-plugin css-fix-url-loader",
"mochaTestingLibraries": "karma mocha sinon chai coverage [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] @types/[email protected] @types/[email protected] @types/[email protected] @types/[email protected]",
"jestTestingLibraries": "[email protected] @testing-library/[email protected] @types/[email protected] [email protected] @oracle/oraclejet-jest-preset@~16.0.0",
"architecture": "vdom",
"watchInterval": 1000
}
Loading
Loading