0.0.6 • Published 6 years ago

ng-appworks v0.0.6

Weekly downloads
30
License
LICENSE
Repository
-
Last release
6 years ago

Ng-Appworks

Ng-Appworks is an Angular library of Appworks, the OpenText Hybrid Applications Development Framework.

Get Started

npm install ng-appworks --save

Use 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

Methods:
attach
  attach(): Observable // create a new instance of AWAccelermoter with new callbacks
getCurrentAcceleration
  getCurrentAcceleration(): Observable
gateway
  gateway(): Observable
watchAcceleration
  watchAcceleration(options?): watchId: number
clearWatch
  clearWatch(watchId: number)

AWAppManagerService

Methods:
closeActiveApp
  closeActiveApp(): Observable

AWAuthService

Methods:
authenticate
  authenticate(force?: boolean): Observable
getAuthResponse
  getAuthResponse(): Observable
gateway
  gateway(): Observable
online
  online(): Observable
otdsssoticket
  otdsssoticket(): Observable

AWCacheService

Methods:
init
  init(option?) // configure AWCache with option
setItem
  setItem(key: string, value: any)
getItem
  getItem(key: string): any
removeItem
  removeItem(key: string)
clear
  clear()

AWCalendarService

Methods:
init
  init(option?) // configure AWCache with option
getCalendarOptions
  getCalendarOptions(): Option
hasReadPermission
  hasReadPermission(): Observable
requestReadPermission
  requestReadPermission(): Observable
hasWritePermission
  hasWritePermission(): Observable
requestReadWritePermission
  requestReadWritePermission(): Observable
hasReadWritePermission
  hasReadWritePermission(): Observable
createCalendar
  createCalendar(option): Observable
deleteCalendar
  deleteCalendar(calendarName: string): Observable
openCalendar
  openCalendar(date: Date): Observable
createEventWithOptions
  createEventWithOptions(title: string,
            location: string,
            notes: string,
            startDate: Date,
            endDate: Date,
            options): Observable
createEvent
  createEvent(title: string,
        location: string,
        notes: string,
        startDate: Date,
        endDate: Date): Observable
createEventInteractivelyWithOptions
  createEventInteractivelyWithOptions(title: string,
        location: string,
        notes: string,
        startDate: Date,
        endDate: Date,
        options: any): Observable
createEventInteractively
  createEventInteractively(title: string,
        location: string,
        notes: string,
        startDate: Date,
        endDate: Date): Observable
findEventWithOptions
  findEventWithOptions(title: string,
        location: string,
        notes: string,
        startDate: Date,
        endDate: Date,
        options: any): Observable
findEvent
  findEvent(title: string,
        location: string,
        notes: string,
        startDate: Date,
        endDate: Date): Observable
findAllEventsInNamedCalendar
  findAllEventsInNamedCalendar(name: string): Observable
deleteEvent
  deleteEvent(title: string,
        location: string,
        notes: string,
        startDate: Date,
        endDate: Date,
        options: any): Observable
deleteEventFromNamedCalendar
  deleteEventFromNamedCalendar(title: string,
        location: string,
        notes: string,
        startDate: Date,
        endDate: Date,
        calendarName: string): Observable
modifyEventWithOptions
  modifyEventWithOptions(title: string,
        location: string,
        notes: string,
        startDate: Date,
        endDate: Date,
        newTitle: string,
        newLocation: string,
        newNotes: string,
        newStartDate: Date,
        newEndDate: Date,
        options,
        newOptions): Observable
modifyEvent
  modifyEvent(title: string,
        location: string,
        notes: string,
        startDate: Date,
        endDate: Date,
        newTitle: string,
        newLocation: string,
        newNotes: string,
        newStartDate: Date,
        newEndDate: Date): Observable
modifyEventInNamedCalendar
  modifyEventInNamedCalendar(title: string,
        location: string,
        notes: string,
        startDate: Date,
        endDate: Date,
        newTitle: string,
        newLocation: string,
        newNotes: string,
        newStartDate: Date,
        newEndDate: Date,
        calendarName: string): Observable
listCalendars
  listCalendars(): Observable
listEventsInRange
  listEventsInRange(startDate: Date, endDate: Date): Observable

AWCameraService

Methods:
takePicture
  takePicture(option?): Observable
openGallery
  openGallery(option?): Observable

AWCompassService

Methods:
attach
  attach(): Observable //create a new instance of AWCompass with new callbacks
getCurrentHeading
  getCurrentHeading(): Observable
watchHeading
  watchHeading(option?): watchId: number
clearWatch
  clearWatch(watchId: number)

AWComponentService

Methods:
open
  open(args?: any[]): Observable
list
  list(args?: any[]): Observable
check
  check(args?: any[]): Observable
close
  close(args?: any[]): Observable

AWContactsService

Methods:
create
  create(properties?: ContactProperties): Observable
find
  find(contactFields: string[], options?: any): Observable
pickContact
  pickContact(): Observable

AWDeviceService

Methods:
getDeviceInfo
  getDeviceInfo()

AWFileChooserService

Methods:
selectAndUpload
  selectAndUpload(action: string): Observable

AWFileSystemService

Methods:
getPath
  getPath(name: string): Observable
exists
  exists(path: string): Observable
isDir
  isDir(path: string): Observable
createFile
  createFile(path: string, data?: string, append?: boolean): Observable
readFile
  readFile(path: string): Observable
createDirectory
  createDirectory(path: string): Observable
copy
  copy(from: string, to: string): Observable
open
  open(path: string): Observable
reveal
  reveal(path: string): Observable
getDetails
  getDetails(path: string): Observable
listDirContents
  listDirContents(path: string): Observable
showSaveDialog
  showSaveDialog(opts: SaveDialogOptions): Observable
showDirSelector
  showDirSelector(opts: SaveDialogOptions): Observable
showFileSelector
  showFileSelector(opts: FileDialogOptions): Observable

AWFileTransferService

Methods:
attach
  attach(): Observable //create a new instance of AWFileTransfer with new callbacks
download
  download(url: string, target: string, options?: any, shared?: boolean): Observable
upload
  upload(source: string, url: string, options?: any, shared?: boolean): Observable
progressHandler
  progressHandler(): Observable
abort
  abort()

AWFinderService

Methods:
open
  open(path: string, filename: string): Observable
share
  share(filename: string): Observable
list
  list(filename: string): Observable

AWGlobalizationService

Methods:
getPreferredLanguage
  getPreferredLanguage(): Observable

AWHeaderBarService

Methods:
setHeader
  setHeader(config: any): Observable
getHeader
  getHeader(): Observable
setHeaderButtons
  setHeaderButtons(config: any): Observable
maskHeader
  maskHeader(shouldMaskHeader: boolean)

AWKeyboardService

Methods:
hideKeyboardAccessoryBar
  hideKeyboardAccessoryBar(hide: boolean)
close
  close()
show
  show()
disableScroll
  disableScroll(disable: boolean)

AWLauncherService

Methods:
getLaunchURL
  getLaunchURL(): Observable
clearLanuchUrl
  clearLanuchUrl()

AWLocationService

Methods:
attach
  attach(): Observable //create a new instance of AWLocation with new callbacks
play
  play()
pause
  pause()
release
  release()
seekTo
  seekTo(value: number)
setVolume
  setVolume(value: number)
stop
  stop()
stopRecord
  stopRecord()
startRecord
  startRecord()
getDuration
  getDuration()
getCurrentPosition
  getCurrentPosition(): Observer

AWMediaService

Methods:
attach
  attach(filename: string): Observable //create a new instance of AWMedia with new callbacks
getCurrentPosition
  getCurrentPosition(options?: any): Observable
watchPosition
  watchPosition(options?: any): watchId: number
clearWatch
  clearWatch(watchID: number)

AWMediaCaptureService

Methods:
captureAudio
  captureAudio(options?: any): Observable
captureImage
  captureImage(options?: any): Observable
captureVideo
  captureVideo(options?: any): Observable

AWMenuService

Methods:
setMenu
  setMenu(sections: any[]): Observable

AWMobileFileSystemService

Methods:
list
  list(directory: string, shared: boolean): Observable
exists
  exists(src: string, shared: boolean): Observable
rename
  rename(src: string, destination: string, shared: boolean): Observable
copy
  copy(src: string, shared: boolean, destination: string, destinationShared: boolean): Observable
move
  move(src: string, shared: boolean, destination: string, destinationShared: boolean): Observable
remove
  remove(src: string, shared: boolean): Observable
listImports
  listImports()
moveImport
  moveImport(src: string, destination: string, shared: boolean): Observable
open
  open(src: string, shared: boolean): Observable
share
  share(src: string, shared: boolean): Observable
quicklook
  quicklook(src: string, shared: boolean): Observable
download
  download(source: string, destination: string, headers: any, shared: boolean): Observable
upload
  upload(source: string, destination: string, fileParameterName: string, formData: any, headers: any, shared: boolean): Observable

AWNotificationManagerService

Methods:
enablePushNotifications
  enablePushNotifications(includeSeqNo: boolean): Observable
getNotifications
  getNotifications(includeSeqNo: boolean): Observable
disablePushNotifications
  disablePushNotifications()
getOpeningNotification
  getOpeningNotification(includeSeqNo: boolean): Observable
removeNotification
  removeNotification(seqNo: any): Observable
openListener
  openListener(includeSeqNo: boolean): Observable

AWOfflineManagerService

Methods:
init
  init(options) //configure AWOfflineManager with option
defer
  defer(eventName: string, args: any)
cancel
  cancel(id: number)
networkStatus
  networkStatus()

AWPageService

Methods:
setPageUrl
  setPageUrl(url: string): Observable
openModalAppWebView
  openModalAppWebView(url: string, title: string, closetitle: string): Observable
openModalExternalWebView
  openModalExternalWebView(url: string, title: string, closetitle: string, options?: any): Observable
setActionButtonCallback
  setActionButtonCallback(actionTitle: string): Observable
closeModalAppWebView
  closeModalAppWebView(): Observable
video
  video(url: string): Observable

AWQRReaderService

Methods:
scan
  scan(): Observable

AWScannerService

Methods:
scanDocument
  scanDocument(returnType: Number): Observable

AWSecureStorageService

Methods:
store
  store(url: string, filename: string, options?: any): Observable
retrieve
  retrieve(filename: string, options?: any): Observable
remove
  remove(target: string): Observable
fileExistsAtPath
  fileExistsAtPath(target: string): Observable

AWStorageService

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): Observable
removeEventListener
  removeEventListener(type: string): Observable
show
  show()
close
  close()
executeScript
  executeScript(script: string): Observable
close
  insertCSS(script: string): Observable

Appworks 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

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago