Skip to content

finNetworkExt 扩展参考 ​

原文: https://finproducts.atlassian.net/wiki/spaces/JIDD3/pages/34793619721/FIN+5.3.1+finNetworkExt 中文整理基于 FIN 5.3.1

导读: FIN 网络扩展

以下为 API 参考,保留英文以便对照源码;目录已列出(英文标题便于检索);概述已尽量中译。


目录(导读) ​

  • mixins
  • classes
  • Slot Details
    • action
    • connObj
    • fromDict
    • make
    • makeOf
    • proxy
    • toDict
    • type
    • wrapFooter
    • wrapHeader
    • wrapInteraction
    • depends
    • fromDef
    • moduleField
    • toStore
    • filter
    • onFilterChange
    • onStart
    • onStartFilter
    • onStop
    • receive
    • fromStr
    • cookies
    • done
    • headers
    • isCommitted
    • isDone
    • out
    • redirect
    • sendErr
    • statusCode
    • statusPhrase
    • upgrade
    • pathPrefix
    • projName
    • ref
    • finNetworkBasicDragDrop
    • finNetworkConnectorsDragDrop
    • finNetworkEquipDragDrop
    • finNetworkErrForm
    • finNetworkSettingsDragDrop
    • finNetworkSnapshotsDragDrop
    • finNetworkTopicDragDrop
    • finNetworkTopicOnDupForm
    • alarm
    • cur
    • evalOverview
    • evalTree
    • modules
    • noOpAction
    • observables
    • onExt
    • onService
    • onServiceReq
    • onServiceRes
    • proxyObservable
    • resRoot
    • snapshot
    • finNetworkDragDrop
    • finNetworkSyncUsers
    • finNetworkTransferRecords
    • finNetworkTree
    • blacklistedTags
    • copyRecs
    • defaultBinResolveFn
    • defaultMakeDiffFn
    • removeNonLocalTags
    • name
    • onSubscribe
    • pollFreq
    • haystackConnRef
    • onPoll
    • onUnsubscribe
    • reEnable
    • subscriptionId
    • body
    • conn
    • reqPath
    • stripCodeSnippets
    • absUri
    • in
    • isGet
    • isPost
    • method
    • mod
    • nullHeaders
    • remoteAddr
    • remotePort
    • session
    • socket
    • socketOptions
    • uri

概述(中译) ​

抽象常量类 Action : Obj

构造函数

字段

方法

插槽详情


API 正文(英文) ​

action ​

const Str action


connObj ​

const ConnObj connObj


fromDict ​

static new fromDict(Dict dict, ConnObj conn)


make ​

new make(|This|? f := null)


makeOf ​

static new makeOf(Type type, |This|? f := null)


proxy ​

abstract Action proxy()


toDict ​

Dict toDict()


type ​

abstract Str type()


wrapFooter ​

const Int wrapFooter := 0


wrapHeader ​

const Int wrapHeader := 0


wrapInteraction ​

abstract Action wrapInteraction(Action defaultAction)


AlarmFilterSetting ​

const class AlarmFilterSetting : FinDefSetting, SyncSetting

Constructors

fromDef

Methods

depends
moduleField
toStore

Slot Details ​


depends ​

virtual override Str? depends()


fromDef ​

new fromDef(Proj proj, SettingDef def)


moduleField ​

virtual override Field moduleField()


toStore ​

virtual override Obj? toStore(Obj? val)


AlarmModule ​

const class AlarmModule : SyncDependModule

Constructors

make

Fields

filter

Methods

onFilterChange
onStart
onStartFilter
onStop
receive

Slot Details ​


filter ​

Str? filter


make ​

new make(FinNetworkExt ext)


onFilterChange ​

Void onFilterChange(Str? filter)


onStart ​

virtual override Void onStart()


onStartFilter ​

Void onStartFilter(Str? filter := this.filter)


onStop ​

virtual override Void onStop()


receive ​

virtual override Void receive()


AxonAction ​

const class AxonAction : Action

Constructors

fromStr
make

Methods

proxy
type
wrapInteraction

Slot Details ​


fromStr ​

static new fromStr(Str axon, ConnObj conn)


make ​

new make(|This|? f := null)


proxy ​

virtual override AxonAction proxy()


type ​

virtual override Str type()


wrapInteraction ​

virtual override Action wrapInteraction(Action defaultAction)


BlankRes ​

class BlankRes : WebRes

Fields

statusCode
statusPhrase

Methods

cookies
done
headers
isCommitted
isDone
out
redirect
sendErr
upgrade

Slot Details ​


cookies ​

virtual override Cookie[] cookies()


done ​

virtual override Void done()


headers ​

virtual override Str:Str headers()


isCommitted ​

virtual override Bool isCommitted()


isDone ​

virtual override Bool isDone()


out ​

virtual override WebOutStream out()


redirect ​

virtual override Void redirect(Uri uri, Int statusCode := 303)


sendErr ​

virtual override Void sendErr(Int statusCode, Str? msg := null)


statusCode ​

virtual override Int statusCode


statusPhrase ​

virtual override Str? statusPhrase


upgrade ​

virtual override TcpSocket upgrade(Int statusCode := 101)


ConnObj ​

const class ConnObj : Obj

Constructors

make

Fields

pathPrefix
projName
ref

Slot Details ​


make ​

new make(FinNetworkExt ext, Ref ref)


pathPrefix ​

const Str pathPrefix


projName ​

const Str? projName


ref ​

const Ref ref


FinNetworkDragDrop ​

const class FinNetworkDragDrop : Obj

Methods

finNetworkBasicDragDropThis is used by all the basic drag and drop trees that also implement folders E.g.
finNetworkConnectorsDragDrop
finNetworkEquipDragDrop
finNetworkErrForm
finNetworkSettingsDragDrop
finNetworkSnapshotsDragDrop
finNetworkTopicDragDrop
finNetworkTopicOnDupForm

Slot Details ​


finNetworkBasicDragDrop ​

static Obj? finNetworkBasicDragDrop(Str treeTagAndFolder, Str treeRootId, Ref targetId, Str targetRemote, Str targetTree, Str[] sourceIds, Str?[] sourceRemotes, Str[] sourceTrees)

This is used by all the basic drag and drop trees that also implement folders E.g. programs, schedules, jobs


finNetworkConnectorsDragDrop ​

static Obj? finNetworkConnectorsDragDrop(Ref targetId, Str targetRemote, Str targetTree, Str[] sourceIds, Str?[] sourceRemotes, Str[] sourceTrees)


finNetworkEquipDragDrop ​

static Obj? finNetworkEquipDragDrop(Ref targetId, Str targetRemote, Str targetTree, Str[] sourceIds, Str?[] sourceRemotes, Str[] sourceTrees)


finNetworkErrForm ​

static Grid finNetworkErrForm(Str title, Str text)


finNetworkSettingsDragDrop ​

static Obj? finNetworkSettingsDragDrop(Ref targetId, Str targetRemote, Str targetTree, Str[] sourceIds, Str?[] sourceRemotes, Str[] sourceTrees)


finNetworkSnapshotsDragDrop ​

static Obj? finNetworkSnapshotsDragDrop(Ref targetId, Str targetRemote, Str targetTree, Str[] sourceIds, Str?[] sourceRemotes, Str[] sourceTrees)


finNetworkTopicDragDrop ​

static Obj? finNetworkTopicDragDrop(Ref targetId, Str targetRemote, Str targetTree, Str[] sourceIds, Str?[] sourceRemotes, Str[] sourceTrees, Str[] topicOns)


finNetworkTopicOnDupForm ​

static Grid finNetworkTopicOnDupForm(Dict matchingTopic, Ref targetId, Str targetRemote, Str targetTree, Str[] sourceIds, Str?[] sourceRemotes, Str[] sourceTrees)


FinNetworkExt ​

@ExtMeta { name="finNetwork"; depends=...; icon="binding" } const class FinNetworkExt : Ext, Weblet

Fields

alarm
modules
noOpAction
observables
proxyObservable
resRoot
snapshot

Methods

cur
evalOverview
evalTree
onExt
onService
onServiceReq
onServiceRes
onStart
onStop

Slot Details ​


alarm ​

const AlarmModule alarm := AlarmModule.<ctor>(this)


cur ​

static FinNetworkExt? cur(Context cx := Context.cur(), Bool checked := true)


evalOverview ​

Grid evalOverview()


evalTree ​

Grid evalTree(Bool? isNext, Ref? conn, Expr expr, Context cx := Context.cur())


modules ​

const SyncModule[] modules := SyncModule[this.alarm,this.snapshot]


noOpAction ​

const static Dict noOpAction := ...


observables ​

virtual const override Observable[] observables := Observable[this.proxyObservable]


onExt ​

Void onExt(Dict msg)


onService ​

virtual override Void onService()


onServiceReq ​

HaystackRes onServiceReq(WebReq req := this.req())


onServiceRes ​

Void onServiceRes(HaystackRes proxyRes := this.onServiceReq(), WebRes res := this.res())


onStart ​

virtual override Void onStart()


onStop ​

virtual override Void onStop()


proxyObservable ​

const HaystackProxyObservable proxyObservable := HaystackProxyObservable.<ctor>(this)


resRoot ​

const Str:Obj? resRoot := ...


snapshot ​

const SnapshotModule snapshot := SnapshotModule.<ctor>(this)


FinNetworkLib ​

const class FinNetworkLib : Obj

Methods

finNetworkBasicDragDropExposes the functionality for basic drag and drop, like for programs and schedules and jobs
finNetworkConnectorsDragDropExposes the functionality for the connector tree drag and drop system
finNetworkDragDrop
finNetworkEquipDragDropExposes the functionality for the equip tree drag and drop system
finNetworkSettingsDragDropExposes the functionality for the settings tree drag and drop system
finNetworkSnapshotsDragDropExposes the functionality for the snapshots tree drag and drop system
finNetworkSyncUsersTakes a conn or list of conns (in a format used by toRecList) and syncs the users over to the children
finNetworkTopicDragDrop
finNetworkTransferRecords
finNetworkTree

Slot Details ​


finNetworkBasicDragDrop ​

@Axon static Obj? finNetworkBasicDragDrop(Str treeTag, Str treeRootId, Ref targetId, Str targetRemote, Str targetTree, Str[] sourceIds, Str?[] sourceRemotes, Str[] sourceTrees)

Exposes the functionality for basic drag and drop, like for programs and schedules and jobs


finNetworkConnectorsDragDrop ​

@Axon static Obj? finNetworkConnectorsDragDrop(Ref targetId, Str targetRemote, Str targetTree, Str[] sourceIds, Str?[] sourceRemotes, Str[] sourceTrees)

Exposes the functionality for the connector tree drag and drop system


finNetworkDragDrop ​

@Axon static Void finNetworkDragDrop(Str[] srcIds, Str?[] srcRemotes, Str[] srcTree, Ref destId, Str? destRemote, Str destTree)


finNetworkEquipDragDrop ​

@Axon static Obj? finNetworkEquipDragDrop(Ref targetId, Str targetRemote, Str targetTree, Str[] sourceIds, Str?[] sourceRemotes, Str[] sourceTrees)

Exposes the functionality for the equip tree drag and drop system


finNetworkSettingsDragDrop ​

@Axon static Obj? finNetworkSettingsDragDrop(Ref targetId, Str targetRemote, Str targetTree, Str[] sourceIds, Str?[] sourceRemotes, Str[] sourceTrees)

Exposes the functionality for the settings tree drag and drop system


finNetworkSnapshotsDragDrop ​

@Axon static Obj? finNetworkSnapshotsDragDrop(Ref targetId, Str targetRemote, Str targetTree, Str[] sourceIds, Str?[] sourceRemotes, Str[] sourceTrees)

Exposes the functionality for the snapshots tree drag and drop system


finNetworkSyncUsers ​

@Axon { admin=true } static Obj? finNetworkSyncUsers(Obj? conns)

Takes a conn or list of conns (in a format used by toRecList) and syncs the users over to the children


finNetworkTopicDragDrop ​

@Axon static Obj? finNetworkTopicDragDrop(Ref targetId, Str targetRemote, Str targetTree, Str[] sourceIds, Str?[] sourceRemotes, Str[] sourceTrees, Str[] topicOns := [,])


finNetworkTransferRecords ​

@Axon static Void finNetworkTransferRecords(Expr recs, Expr from, Expr to, Expr makeDiffFn := Literal.nullVal, Expr binResolveFn := Literal.nullVal)


finNetworkTree ​

@Axon { admin=true; meta=["finNavTree":Marker.<ctor>("")] } static Grid finNetworkTree(Expr isNext := Literal.nullVal, Expr conn := Literal.nullVal, Expr expr := Literal.nullVal)


FinNetworkTransferRecords ​

const class FinNetworkTransferRecords : Obj

Fields

blacklistedTags
defaultBinResolveFn
defaultMakeDiffFn

Methods

copyRecs
removeNonLocalTags

Slot Details ​


blacklistedTags ​

const static Str:Obj blacklistedTags := ...


copyRecs ​

static Void copyRecs(Expr recs, Ref[] fromList, Ref[] toList, Expr makeDiffFn, Expr binResolveFn)


defaultBinResolveFn ​

const static Str defaultBinResolveFn := "(oldId, newId, tag) => [oldId, tag]"


defaultMakeDiffFn ​

const static Str defaultMakeDiffFn := ...


removeNonLocalTags ​

static Void removeNonLocalTags()


HaystackProxyObservable ​

const class HaystackProxyObservable : Observable

Constructors

make

Fields

pollFreq

Methods

name
onSubscribe

Slot Details ​


make ​

new make(Ext ext)


name ​

virtual override Str name()


onSubscribe ​

virtual override HaystackProxySubscription onSubscribe(Observer observer, Dict config)


pollFreq ​

const Duration pollFreq := 5sec


HaystackProxySubscription ​

const class HaystackProxySubscription : Subscription

Constructors

make

Fields

haystackConnRef

Methods

onPoll
onUnsubscribe
reEnable
subscriptionId

Slot Details ​


haystackConnRef ​

const Ref haystackConnRef


make ​

new make(Observable observable, Observer observer, Dict config)


onPoll ​

Void onPoll()


onUnsubscribe ​

Void onUnsubscribe()


reEnable ​

Void reEnable(Observer observer)


subscriptionId ​

Obj? subscriptionId()


HaystackRes ​

const class HaystackRes : Obj

Constructors

make

Fields

body
conn
headers
reqPath
statusCode

Slot Details ​


body ​

const Buf? body


conn ​

const Ref? conn


headers ​

const Str:Str headers


make ​

new make(|This|? f := null)


reqPath ​

const Str[]? reqPath


statusCode ​

const Int statusCode


JsAction ​

const class JsAction : Action

Constructors

fromStr
make

Methods

proxy
stripCodeSnippets
type
wrapInteraction

Slot Details ​


fromStr ​

static new fromStr(Str js, ConnObj conn)


make ​

new make(|This|? f := null)


proxy ​

virtual override JsAction proxy()


stripCodeSnippets ​

static Str stripCodeSnippets(Str action)


type ​

virtual override Str type()


wrapInteraction ​

virtual override Action wrapInteraction(Action defaultAction)


MimicReq ​

class MimicReq : WebReq

Constructors

make

Fields

headers
isGet
isPost
method
mod
nullHeaders
uri
webIn

Methods

absUri
in
remoteAddr
remotePort
session
socket
socketOptions
version

Slot Details ​


absUri ​

virtual override Uri absUri()


headers ​

virtual override Str:Str headers


in ​

virtual override InStream in()


isGet ​

virtual override Bool isGet { private set }


isPost ​

virtual override Bool isPost { private set }


make ​

new make(WebReq orig)


method ​

virtual override Str method


mod ​

virtual override WebMod mod


nullHeaders ​

const static Str:Str nullHeaders := [Str:Str][:]


remoteAddr ​

virtual override IpAddr remoteAddr()


remotePort ​

virtual override Int remotePort()


session ​

virtual override WebSession session()


socket ​

virtual override TcpSocket socket()


socketOptions ​

virtual override SocketOptions socketOptions()


uri ​

virtual override Uri uri := ``


version ​

virtual override Version version()


webIn ​

InStream? webIn


Session ​

const class Session : Obj

Constructors

make

Fields

id

Methods

toWebClient
validate

Slot Details ​


id ​

const Ref id


make ​

new make(Ref id)


toWebClient ​

WebClient toWebClient(Uri reqUri, Uri baseUri := ...)


validate ​

Void validate(ServerSession serverSession)


SessionStore ​

const class SessionStore : Obj

Methods

getOrAdd

Slot Details ​


getOrAdd ​

@Operator Session getOrAdd(Ref id)


SnapshotModule ​

const class SnapshotModule : SyncModule, SyncFreqModule

Constructors

make

Fields

subscriptionRef

Methods

receive
remoteSnapshotsTransferTransfer snapshots through a chain of connector refs The <snapshots> param is of the same format as what comes from finStackHost's FinSnapshotsLib.finSnapshotTreeData function

Slot Details ​


make ​

new make(FinNetworkExt ext)


receive ​

virtual override Void receive()


remoteSnapshotsTransfer ​

static Void remoteSnapshotsTransfer(Dict[] snapshots, Ref[] sourcePath, Ref[] destPath)

Transfer snapshots through a chain of connector refs The <snapshots> param is of the same format as what comes from finStackHost's FinSnapshotsLib.finSnapshotTreeData function


subscriptionRef ​

protected virtual const override AtomicRef subscriptionRef := AtomicRef.<ctor>(null)


SyncEtcSetting ​

const class SyncEtcSetting : FinDefSetting, SyncSetting

Fields

depends
moduleField
setter

Methods

toStore

Slot Details ​


depends ​

virtual const override Str? depends


moduleField ​

virtual const override Field moduleField


setter ​

const Field? setter


toStore ​

virtual override Obj? toStore(Obj? val)


SyncRunSetting ​

const class SyncRunSetting : FinSetting, SyncSetting

Fields

depends
moduleField
val

Slot Details ​


depends ​

virtual const override Str? depends


moduleField ​

virtual const override Field moduleField


val ​

virtual override Obj? val


SyncSetting ​

const mixin SyncSetting : FinSettingMixin

Constructors

fromDef

Methods

depends
enabled
ext
module
moduleField

Slot Details ​


depends ​

abstract Str? depends()


enabled ​

virtual override Bool enabled()


ext ​

FinNetworkExt ext()


fromDef ​

static new fromDef(Proj proj, SettingDef def)


module ​

SyncModule module()


moduleField ​

abstract Field moduleField()


UserSync ​

const class UserSync : Obj

Fields

userSyncFn

Methods

getHostGet the host with port of the URI
syncUsersFind all the users on the child node Delete those that don't exist on the parent Edit those that do exist on parent

Slot Details ​


getHost ​

static Str getHost(Uri? uri)

Get the host with port of the URI


syncUsers ​

static Obj? syncUsers(Obj? conn)

Find all the users on the child node Delete those that don't exist on the parent Edit those that do exist on parent

(They have to be exact copies, so remove any tags that 
 exist on the child's version but not the parent's version)

Create those that don't exist on the child


userSyncFn ​

const static Str userSyncFn := ...