Skip to content

Commit 822ea3f

Browse files
committed
Initial version
1 parent 714fd3d commit 822ea3f

File tree

10 files changed

+2797
-22
lines changed

10 files changed

+2797
-22
lines changed

.gitignore

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
build/
2+
3+
# Created by https://www.toptal.com/developers/gitignore/api/node,macos
4+
# Edit at https://www.toptal.com/developers/gitignore?templates=node,macos
5+
6+
### macOS ###
7+
# General
8+
.DS_Store
9+
.AppleDouble
10+
.LSOverride
11+
12+
# Icon must end with two \r
13+
Icon
14+
15+
# Thumbnails
16+
._*
17+
18+
# Files that might appear in the root of a volume
19+
.DocumentRevisions-V100
20+
.fseventsd
21+
.Spotlight-V100
22+
.TemporaryItems
23+
.Trashes
24+
.VolumeIcon.icns
25+
.com.apple.timemachine.donotpresent
26+
27+
# Directories potentially created on remote AFP share
28+
.AppleDB
29+
.AppleDesktop
30+
Network Trash Folder
31+
Temporary Items
32+
.apdisk
33+
34+
### macOS Patch ###
35+
# iCloud generated files
36+
*.icloud
37+
38+
### Node ###
39+
# Logs
40+
logs
41+
*.log
42+
npm-debug.log*
43+
yarn-debug.log*
44+
yarn-error.log*
45+
lerna-debug.log*
46+
.pnpm-debug.log*
47+
48+
# Diagnostic reports (https://nodejs.org/api/report.html)
49+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
50+
51+
# Runtime data
52+
pids
53+
*.pid
54+
*.seed
55+
*.pid.lock
56+
57+
# Directory for instrumented libs generated by jscoverage/JSCover
58+
lib-cov
59+
60+
# Coverage directory used by tools like istanbul
61+
coverage
62+
*.lcov
63+
64+
# nyc test coverage
65+
.nyc_output
66+
67+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
68+
.grunt
69+
70+
# Bower dependency directory (https://bower.io/)
71+
bower_components
72+
73+
# node-waf configuration
74+
.lock-wscript
75+
76+
# Compiled binary addons (https://nodejs.org/api/addons.html)
77+
build/Release
78+
79+
# Dependency directories
80+
node_modules/
81+
jspm_packages/
82+
83+
# Snowpack dependency directory (https://snowpack.dev/)
84+
web_modules/
85+
86+
# TypeScript cache
87+
*.tsbuildinfo
88+
89+
# Optional npm cache directory
90+
.npm
91+
92+
# Optional eslint cache
93+
.eslintcache
94+
95+
# Optional stylelint cache
96+
.stylelintcache
97+
98+
# Microbundle cache
99+
.rpt2_cache/
100+
.rts2_cache_cjs/
101+
.rts2_cache_es/
102+
.rts2_cache_umd/
103+
104+
# Optional REPL history
105+
.node_repl_history
106+
107+
# Output of 'npm pack'
108+
*.tgz
109+
110+
# Yarn Integrity file
111+
.yarn-integrity
112+
113+
# dotenv environment variable files
114+
.env
115+
.env.development.local
116+
.env.test.local
117+
.env.production.local
118+
.env.local
119+
120+
# parcel-bundler cache (https://parceljs.org/)
121+
.cache
122+
.parcel-cache
123+
124+
# Next.js build output
125+
.next
126+
out
127+
128+
# Nuxt.js build / generate output
129+
.nuxt
130+
dist
131+
132+
# Gatsby files
133+
.cache/
134+
# Comment in the public line in if your project uses Gatsby and not Next.js
135+
# https://nextjs.org/blog/next-9-1#public-directory-support
136+
# public
137+
138+
# vuepress build output
139+
.vuepress/dist
140+
141+
# vuepress v2.x temp and cache directory
142+
.temp
143+
144+
# Docusaurus cache and generated files
145+
.docusaurus
146+
147+
# Serverless directories
148+
.serverless/
149+
150+
# FuseBox cache
151+
.fusebox/
152+
153+
# DynamoDB Local files
154+
.dynamodb/
155+
156+
# TernJS port file
157+
.tern-port
158+
159+
# Stores VSCode versions used for testing VSCode extensions
160+
.vscode-test
161+
162+
# yarn v2
163+
.yarn/cache
164+
.yarn/unplugged
165+
.yarn/build-state.yml
166+
.yarn/install-state.gz
167+
.pnp.*
168+
169+
### Node Patch ###
170+
# Serverless Webpack directories
171+
.webpack/
172+
173+
# Optional stylelint cache
174+
175+
# SvelteKit build / generate output
176+
.svelte-kit
177+
178+
# End of https://www.toptal.com/developers/gitignore/api/node,macos
179+
test/credentials*.json

.npmignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
src/
2+
build/
3+
test/

README.md

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,25 @@
1-
# Project name
1+
# Oracle Field Service Plugin Core Library
22

3-
<!-- Describe your project's features, functionality and target audience -->
3+
This library provides an abstract class to quickstart the development of plugins for Oracle Field Service. It provides a core functionality that can be extended as needed.
44

5-
## Installation
5+
An active environment of Oracle Field Service is needed to develop and execute plugins.
66

7-
<!-- Provide detailed step-by-step installation instructions -->
7+
## Installation
88

9-
## Documentation
9+
1. If installing it from GitHub: `npm install https://github.com/oracle-samples/ofs-plugin-core.git`
1010

11-
<!-- Developer-oriented documentation can be published on GitHub, but all product
12-
documentation must be published on <https://docs.oracle.com>. -->
11+
2. To use the library in your code:
1312

14-
## Examples
13+
`import {OFSPlugin} from "@ofs_users/plugin"`
1514

16-
<!-- Describe any included examples or provide a link to a demo/tutorial -->
15+
## Documentation and examples
1716

18-
## Help
17+
Please see the `docs/' directory for documentation and a simple example.
1918

20-
<!-- Inform users on where to get help or how to receive official support from Oracle
21-
(if applicable). -->
19+
The main documentation for developing Oracle Field Service plugins is [here](https://docs.oracle.com/en/cloud/saas/field-service/fasdk/index.html)
2220

2321
## Contributing
2422

25-
<!-- If your project has specific contribution requirements, update the
26-
CONTRIBUTING.md file to ensure those requirements are clearly explained. -->
27-
2823
This project welcomes contributions from the community. Before submitting a pull
2924
request, please [review our contribution guide](./CONTRIBUTING.md).
3025

@@ -35,15 +30,8 @@ vulnerability disclosure process.
3530

3631
## License
3732

38-
<!-- The correct copyright notice format for both documentation and software
39-
is "Copyright (c) [year,] year Oracle and/or its affiliates."
40-
You must include the year the content was first released (on any platform) and
41-
the most recent year in which it was revised. -->
42-
4333
Copyright (c) 2023 Oracle and/or its affiliates.
4434

45-
<!-- Replace this statement if your project is not licensed under the UPL -->
46-
4735
Released under the Universal Permissive License v1.0 as shown at
4836
<https://oss.oracle.com/licenses/upl/>.
4937

THIRD_PARTY_LICENSES.txt

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
This file was generated with the generate-license-file npm package!
2+
https://www.npmjs.com/package/generate-license-file
3+
4+
The following npm package may be included in this product:
5+
6+
- @ofs-users/proxy@1.3.0
7+
8+
This package contains the following license and notice below:
9+
10+
Copyright (c) 2016-2021 Oracle Corporation
11+
12+
The Universal Permissive License (UPL), Version 1.0
13+
14+
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
15+
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
16+
Works (as defined below), to deal in both
17+
18+
(a) the Software, and
19+
(b) any piece of software and/or hardware listed in the lrgrwrks.txt file if
20+
one is included with the Software (each a "Larger Work" to which the Software
21+
is contributed by such licensors),
22+
23+
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.
24+
25+
This license is subject to the following condition:
26+
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.
27+
28+
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.
29+
30+
-----------
31+
32+
The following npm package may be included in this product:
33+
34+
- tslib@2.5.1
35+
36+
This package contains the following license and notice below:
37+
38+
Copyright (c) Microsoft Corporation.
39+
40+
Permission to use, copy, modify, and/or distribute this software for any
41+
purpose with or without fee is hereby granted.
42+
43+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
44+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
45+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
46+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
47+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
48+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
49+
PERFORMANCE OF THIS SOFTWARE.
50+
51+
-----------
52+
53+
This file was generated with the generate-license-file npm package!
54+
https://www.npmjs.com/package/generate-license-file

docs/README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
## A simple example
2+
3+
A plugin usually consists in a HTML page (`index.html`) and a simple code (`plugin.js`).
4+
5+
**index.html**
6+
<!DOCTYPE html>
7+
<html lang="en">
8+
9+
<head>
10+
<meta charset="utf-8">
11+
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
12+
<title>plugin-template</title>
13+
</head>
14+
<body>
15+
<div id='output_data'>
16+
<hr>
17+
<div id="submit_button" type="submit">OK</button></div>
18+
<script src="./main.js" type="module"></script>
19+
</body>
20+
21+
**plugin.js**
22+
23+
import { OFSPlugin} from "@ofs-users/plugin"; ### Provided as example. Different frameworks will handle imports in a different way
24+
25+
class CustomPlugin extends OFSPlugin {
26+
27+
open(data) {
28+
document.getElementById("output_data").innerHTML = `<p> Hello World! Activity is ${data.activity.aid}</p>`
29+
var submit_button = document.getElementById("submit_button");
30+
if (!!submit_button) {
31+
submit_button.onclick = function (event) {
32+
var feedback = {
33+
aid: data.activity.aid,
34+
// BEGIN: ADD EXTRA PARAMETERS
35+
// END: ADD EXTRA PARAMETERS
36+
};
37+
plugin.close({ activity: feedback});
38+
};
39+
}
40+
}
41+
}
42+
43+
window.onload = function () {
44+
window.ofs = new CustomPlugin("HelloWorld");
45+
};

0 commit comments

Comments
 (0)