0.0.6 • Published 7 years ago
ng-appworks v0.0.6
Ng-Appworks
Ng-Appworks is an Angular library of Appworks, the OpenText Hybrid Applications Development Framework.
Get Started
npm install ng-appworks --saveUse as App-wise Singleton Services
app.module.ts
import { NgAppworksModule } from 'ng-appworks';
...,
@NgModule({
...,
imports: [
...,
NgAppworksModule.forRoot(),
...
]
...
})
...xxx.component.ts
import { AWAuthService } from 'ng-appworks';
...
@Component({...})
export class YourComponent {
constructor(authService: AWAuthService) {
...
}
}
...Use as Component-wise services
xxx.component.ts
import { AWAuthService } from 'ng-appworks';
...
@component({
...,
providers: [AWAuthService],
...
})
export class YourComponent {
constructor(authService: AWAuthService) {
...
}
}
...Table of Contents
Most API uses Observators, return Observerable
For Uses of Observerables
let ob = {
next: data => { ... }
error: err => { ... }
};
let obs = AWSomeService.someMethod();
obs.subscribe(ob);- AWAccelerometerService
- AWAppManagerService
- AWAuthService
- AWCacheService
- AWCalendarService
- AWCameraService
- AWCompassService
- AWComponentService
- AWContactsService
- AWDeviceService
- AWFileChooserService
- AWFileSystemService
- AWFileTransferService
- AWFinderService
- AWGlobalizationService
- AWHeaderBarService
- AWLauncherService
- AWLocationService
- AWMediaService
- AWMediaCaptureService
- AWMenuService
- AWMobileFileSystemService
- AWNotificationManagerService
- AWPageService
- AWOfflineManagerService
- AWScannerService
- AWVibrationService
- AWWebViewService
- AWQRReaderService
- AWSecureStorageService
- AWScannerService
- AWStorageService
- AWVibrationService
- AWWebViewService
AWAccelerometerService
Methods:
attach
attach(): Observable // create a new instance of AWAccelermoter with new callbacksgetCurrentAcceleration
getCurrentAcceleration(): Observablegateway
gateway(): ObservablewatchAcceleration
watchAcceleration(options?): watchId: numberclearWatch
clearWatch(watchId: number)AWAppManagerService
Methods:
closeActiveApp
closeActiveApp(): ObservableAWAuthService
Methods:
authenticate
authenticate(force?: boolean): ObservablegetAuthResponse
getAuthResponse(): Observablegateway
gateway(): Observableonline
online(): Observableotdsssoticket
otdsssoticket(): ObservableAWCacheService
Methods:
init
init(option?) // configure AWCache with optionsetItem
setItem(key: string, value: any)getItem
getItem(key: string): anyremoveItem
removeItem(key: string)clear
clear()AWCalendarService
Methods:
init
init(option?) // configure AWCache with optiongetCalendarOptions
getCalendarOptions(): OptionhasReadPermission
hasReadPermission(): ObservablerequestReadPermission
requestReadPermission(): ObservablehasWritePermission
hasWritePermission(): ObservablerequestReadWritePermission
requestReadWritePermission(): ObservablehasReadWritePermission
hasReadWritePermission(): ObservablecreateCalendar
createCalendar(option): ObservabledeleteCalendar
deleteCalendar(calendarName: string): ObservableopenCalendar
openCalendar(date: Date): ObservablecreateEventWithOptions
createEventWithOptions(title: string,
location: string,
notes: string,
startDate: Date,
endDate: Date,
options): ObservablecreateEvent
createEvent(title: string,
location: string,
notes: string,
startDate: Date,
endDate: Date): ObservablecreateEventInteractivelyWithOptions
createEventInteractivelyWithOptions(title: string,
location: string,
notes: string,
startDate: Date,
endDate: Date,
options: any): ObservablecreateEventInteractively
createEventInteractively(title: string,
location: string,
notes: string,
startDate: Date,
endDate: Date): ObservablefindEventWithOptions
findEventWithOptions(title: string,
location: string,
notes: string,
startDate: Date,
endDate: Date,
options: any): ObservablefindEvent
findEvent(title: string,
location: string,
notes: string,
startDate: Date,
endDate: Date): ObservablefindAllEventsInNamedCalendar
findAllEventsInNamedCalendar(name: string): ObservabledeleteEvent
deleteEvent(title: string,
location: string,
notes: string,
startDate: Date,
endDate: Date,
options: any): ObservabledeleteEventFromNamedCalendar
deleteEventFromNamedCalendar(title: string,
location: string,
notes: string,
startDate: Date,
endDate: Date,
calendarName: string): ObservablemodifyEventWithOptions
modifyEventWithOptions(title: string,
location: string,
notes: string,
startDate: Date,
endDate: Date,
newTitle: string,
newLocation: string,
newNotes: string,
newStartDate: Date,
newEndDate: Date,
options,
newOptions): ObservablemodifyEvent
modifyEvent(title: string,
location: string,
notes: string,
startDate: Date,
endDate: Date,
newTitle: string,
newLocation: string,
newNotes: string,
newStartDate: Date,
newEndDate: Date): ObservablemodifyEventInNamedCalendar
modifyEventInNamedCalendar(title: string,
location: string,
notes: string,
startDate: Date,
endDate: Date,
newTitle: string,
newLocation: string,
newNotes: string,
newStartDate: Date,
newEndDate: Date,
calendarName: string): ObservablelistCalendars
listCalendars(): ObservablelistEventsInRange
listEventsInRange(startDate: Date, endDate: Date): ObservableAWCameraService
Methods:
takePicture
takePicture(option?): ObservableopenGallery
openGallery(option?): ObservableAWCompassService
Methods:
attach
attach(): Observable //create a new instance of AWCompass with new callbacksgetCurrentHeading
getCurrentHeading(): ObservablewatchHeading
watchHeading(option?): watchId: numberclearWatch
clearWatch(watchId: number)AWComponentService
Methods:
open
open(args?: any[]): Observablelist
list(args?: any[]): Observablecheck
check(args?: any[]): Observableclose
close(args?: any[]): ObservableAWContactsService
Methods:
create
create(properties?: ContactProperties): Observablefind
find(contactFields: string[], options?: any): ObservablepickContact
pickContact(): ObservableAWDeviceService
Methods:
getDeviceInfo
getDeviceInfo()AWFileChooserService
Methods:
selectAndUpload
selectAndUpload(action: string): ObservableAWFileSystemService
Methods:
getPath
getPath(name: string): Observableexists
exists(path: string): ObservableisDir
isDir(path: string): ObservablecreateFile
createFile(path: string, data?: string, append?: boolean): ObservablereadFile
readFile(path: string): ObservablecreateDirectory
createDirectory(path: string): Observablecopy
copy(from: string, to: string): Observableopen
open(path: string): Observablereveal
reveal(path: string): ObservablegetDetails
getDetails(path: string): ObservablelistDirContents
listDirContents(path: string): ObservableshowSaveDialog
showSaveDialog(opts: SaveDialogOptions): ObservableshowDirSelector
showDirSelector(opts: SaveDialogOptions): ObservableshowFileSelector
showFileSelector(opts: FileDialogOptions): ObservableAWFileTransferService
Methods:
attach
attach(): Observable //create a new instance of AWFileTransfer with new callbacksdownload
download(url: string, target: string, options?: any, shared?: boolean): Observableupload
upload(source: string, url: string, options?: any, shared?: boolean): ObservableprogressHandler
progressHandler(): Observableabort
abort()AWFinderService
Methods:
open
open(path: string, filename: string): Observableshare
share(filename: string): Observablelist
list(filename: string): ObservableAWGlobalizationService
Methods:
getPreferredLanguage
getPreferredLanguage(): ObservableAWHeaderBarService
Methods:
setHeader
setHeader(config: any): ObservablegetHeader
getHeader(): ObservablesetHeaderButtons
setHeaderButtons(config: any): ObservablemaskHeader
maskHeader(shouldMaskHeader: boolean)AWKeyboardService
Methods:
hideKeyboardAccessoryBar
hideKeyboardAccessoryBar(hide: boolean)close
close()show
show()disableScroll
disableScroll(disable: boolean)AWLauncherService
Methods:
getLaunchURL
getLaunchURL(): ObservableclearLanuchUrl
clearLanuchUrl()AWLocationService
Methods:
attach
attach(): Observable //create a new instance of AWLocation with new callbacksplay
play()pause
pause()release
release()seekTo
seekTo(value: number)setVolume
setVolume(value: number)stop
stop()stopRecord
stopRecord()startRecord
startRecord()getDuration
getDuration()getCurrentPosition
getCurrentPosition(): ObserverAWMediaService
Methods:
attach
attach(filename: string): Observable //create a new instance of AWMedia with new callbacksgetCurrentPosition
getCurrentPosition(options?: any): ObservablewatchPosition
watchPosition(options?: any): watchId: numberclearWatch
clearWatch(watchID: number)AWMediaCaptureService
Methods:
captureAudio
captureAudio(options?: any): ObservablecaptureImage
captureImage(options?: any): ObservablecaptureVideo
captureVideo(options?: any): ObservableAWMenuService
Methods:
setMenu
setMenu(sections: any[]): ObservableAWMobileFileSystemService
Methods:
list
list(directory: string, shared: boolean): Observableexists
exists(src: string, shared: boolean): Observablerename
rename(src: string, destination: string, shared: boolean): Observablecopy
copy(src: string, shared: boolean, destination: string, destinationShared: boolean): Observablemove
move(src: string, shared: boolean, destination: string, destinationShared: boolean): Observableremove
remove(src: string, shared: boolean): ObservablelistImports
listImports()moveImport
moveImport(src: string, destination: string, shared: boolean): Observableopen
open(src: string, shared: boolean): Observableshare
share(src: string, shared: boolean): Observablequicklook
quicklook(src: string, shared: boolean): Observabledownload
download(source: string, destination: string, headers: any, shared: boolean): Observableupload
upload(source: string, destination: string, fileParameterName: string, formData: any, headers: any, shared: boolean): ObservableAWNotificationManagerService
Methods:
enablePushNotifications
enablePushNotifications(includeSeqNo: boolean): ObservablegetNotifications
getNotifications(includeSeqNo: boolean): ObservabledisablePushNotifications
disablePushNotifications()getOpeningNotification
getOpeningNotification(includeSeqNo: boolean): ObservableremoveNotification
removeNotification(seqNo: any): ObservableopenListener
openListener(includeSeqNo: boolean): ObservableAWOfflineManagerService
Methods:
init
init(options) //configure AWOfflineManager with optiondefer
defer(eventName: string, args: any)cancel
cancel(id: number)networkStatus
networkStatus()AWPageService
Methods:
setPageUrl
setPageUrl(url: string): ObservableopenModalAppWebView
openModalAppWebView(url: string, title: string, closetitle: string): ObservableopenModalExternalWebView
openModalExternalWebView(url: string, title: string, closetitle: string, options?: any): ObservablesetActionButtonCallback
setActionButtonCallback(actionTitle: string): ObservablecloseModalAppWebView
closeModalAppWebView(): Observablevideo
video(url: string): ObservableAWQRReaderService
Methods:
scan
scan(): ObservableAWScannerService
Methods:
scanDocument
scanDocument(returnType: Number): ObservableAWSecureStorageService
Methods:
store
store(url: string, filename: string, options?: any): Observableretrieve
retrieve(filename: string, options?: any): Observableremove
remove(target: string): ObservablefileExistsAtPath
fileExistsAtPath(target: string): ObservableAWStorageService
Methods:
clear
clear()getItem
getItem(key: string)key
key(index: number)removeItem
removeItem(target: string)setItem
setItem(key: string, data: any)AWVibrationService
Methods:
vibrate
vibrate(time: number)AWWebViewService
Methods:
open
open(url: string, target?: string, options?: string)addEventListener
addEventListener(type: string): ObservableremoveEventListener
removeEventListener(type: string): Observableshow
show()close
close()executeScript
executeScript(script: string): Observableclose
insertCSS(script: string): ObservableAppworks Documentation
For further details about Appwoks framework, visit OpenText Appworks-js
Build
Run npm install for both root projects and ng-appworks inside projects
Run ng build ng-appworks
Running unit tests
Run ng test to execute the unit tests via Karma.
For community support, please refer to https://developer.opentext.com.
Copyright © 2018 Open Text SA or Open Text ULC (in Canada). All rights reserved. Licensed under the Apache License, Version 2.0