|
@@ -10,25 +10,31 @@ import { UAWriteMask } from "./UAWriteMask"; //TODO
|
|
|
import { UAAccessRestriction } from "./UAAccessRestriction"; //TODO
|
|
|
|
|
|
export class UABaseNode implements IToXML{
|
|
|
- constructor(public nodeId: NodeId,
|
|
|
- public browseName: string,
|
|
|
- public displayName: string,
|
|
|
- public displayName: string, //LocText
|
|
|
- public description: string, //LocText
|
|
|
- public symbolicName: string, //SymbolicName
|
|
|
- public releaseStatus: string, //ReleaseStatus
|
|
|
- public hasNoPermissions: boolean,
|
|
|
- public writeMask: UAWriteMask,
|
|
|
- public userWriteMask: UAUserWriteMask,
|
|
|
- public category: string,
|
|
|
- public documentation: string,
|
|
|
- public accessRestriction: UAAccessRestriction,
|
|
|
- public rolePermissions: UARolePermission[],
|
|
|
- public extensions: UAExtension[],
|
|
|
- public references: UAReference[]) {
|
|
|
+
|
|
|
+ public nodeId: NodeId;
|
|
|
+ public browseName: string;
|
|
|
+ public displayName?: string; //LocText
|
|
|
+ public description?: string; //LocText
|
|
|
+ public symbolicName?: string; //SymbolicName
|
|
|
+ public releaseStatus?: string; //ReleaseStatus
|
|
|
+ public hasNoPermissions?: boolean;
|
|
|
+ public writeMask?: UAWriteMask;
|
|
|
+ public userWriteMask?: UAUserWriteMask;
|
|
|
+ public category?: string;
|
|
|
+ public documentation?: string;
|
|
|
+ public accessRestriction?: UAAccessRestriction;
|
|
|
+ public rolePermissions: UARolePermission[]=[];
|
|
|
+ public extensions: UAExtension[]=[];
|
|
|
+ public references: UAReference[]=[];
|
|
|
+
|
|
|
+ constructor(options: UABaseNodeOptions) {
|
|
|
+ this.nodeId=options.nodeId;
|
|
|
+ this.browseName=options.browseName;
|
|
|
+ this.displayName=options.displayName;
|
|
|
+ this.references=options.references||[];
|
|
|
}
|
|
|
|
|
|
- public static nullBaseNode=new UABaseNode(NodeId.nullNodeId,"","",[]);
|
|
|
+ public static nullBaseNode=new UABaseNode({browseName: "", nodeId: NodeId.nullNodeId});
|
|
|
|
|
|
reIndex(nst: NamespaceTable, onst: NamespaceTable) {
|
|
|
const nsName=onst.getUri(this.nodeId.namespace);
|
|
@@ -91,11 +97,23 @@ export class UABaseNode implements IToXML{
|
|
|
for(const xmlref of xmlReferences.Reference) {
|
|
|
references.push(UAReference.fromXML(xmlref, nodeId));
|
|
|
}
|
|
|
- const ua=new UABaseNode(nodeId, xmlObject['@_BrowseName'], xmlObject['DisplayName']['#text'], references);
|
|
|
+ const ua=new UABaseNode({nodeId: nodeId,
|
|
|
+ browseName: xmlObject['@_BrowseName'],
|
|
|
+ displayName: xmlObject['DisplayName']['#text'],
|
|
|
+ references: references});
|
|
|
return ua;
|
|
|
}
|
|
|
|
|
|
toXML(): XMLElem {
|
|
|
throw new Error("UABaseNode has no xml rep; implement in subtype.");
|
|
|
}
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+export interface UABaseNodeOptions {
|
|
|
+ browseName: string;
|
|
|
+ nodeId: NodeId;
|
|
|
+ references?: UAReference[];
|
|
|
+ displayName?: string;
|
|
|
+ description?: string
|
|
|
}
|