4using System.Threading.Tasks;
31 : base(
"Tokens/AddXmlNote",
32 new KeyValuePair<Type,
Expression>(typeof(Dictionary<string, object>), new
Expression(jsonPattern)),
51 string TokenId = (string)Parameters[
"PTokenId"].AssociatedObjectValue;
52 bool Personal = (bool)Parameters[
"PPersonal"].AssociatedObjectValue;
55 object Obj = Parameters[
"PNote"].AssociatedObjectValue;
60 if (Obj is
string Xml)
67 (string, Dictionary<string, ValidationSchema>) P = await
XmppServerModule.Legal.ValidateContent(Doc,
null);
68 if (!
string.IsNullOrEmpty(P.Item1))
71 LocalName = Doc.DocumentElement.LocalName;
72 Namespace = Doc.DocumentElement.NamespaceURI;
74 else if (Obj is XmlDocument Doc2)
76 Xml = Doc2.DocumentElement.OuterXml;
77 LocalName = Doc2.DocumentElement.LocalName;
78 Namespace = Doc2.DocumentElement.NamespaceURI;
80 (string, Dictionary<string, ValidationSchema>) P = await
XmppServerModule.Legal.ValidateContent(Doc2,
null);
81 if (!
string.IsNullOrEmpty(P.Item1))
84 else if (Obj is XmlElement E)
87 LocalName = E.LocalName;
88 Namespace = E.NamespaceURI;
92 (string, Dictionary<string, ValidationSchema>) P = await
XmppServerModule.Legal.ValidateContent(Doc,
null);
93 if (!
string.IsNullOrEmpty(P.Item1))
112 Timestamp = DateTime.UtcNow,
115 LocalName = LocalName,
116 Namespace = Namespace
129 Timestamp = DateTime.UtcNow,
132 LocalName = LocalName,
133 Namespace = Namespace,
141 StringBuilder sb =
new StringBuilder();
A Named dictionary is a dictionary, with a local name and a namespace. Use it to return content that ...
Helps with common XML-related tasks.
static XmlDocument ParseXml(string Xml)
Parses an XML Document from its string representation.
static bool IsValidXml(string Xml)
Checks if a string is valid XML
Static class managing the runtime environment of the IoT Gateway.
static CaseInsensitiveString Domain
Domain name.
The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repe...
Represents an HTTP request.
Represets a response of an HTTP client request.
Task Return(Exception ex)
Returns an error to the client.
The server has not found anything matching the Request-URI. No indication is given of whether the con...
Static interface for database persistence. In order to work, a database provider has to be assigned t...
static async Task Insert(object Object)
Inserts an object into the default collection of the database.
Static class managing loading of resources stored as embedded resources or in content files.
static string LoadResourceAsText(string ResourceName)
Loads a text resource from an embedded resource.
Class managing a script expression.
An xml note logged on the token from an external source.
An xml note logged on the token.
void Serialize(StringBuilder Xml)
Serializes the event to XML.
Abstract base class for token events containing notes made by the owner.
Marketplace processor, brokering sales of items via tenders and offers defined in smart contracts.
Duration? ArchiveOptional
Duration after which token expires, and the required archiving time, the token can optionally be arch...
CaseInsensitiveString OwnerJid
JID of Current owner of token
Duration? ArchiveRequired
Duration after which token expires, the token is required to be archived.
DateTime Expires
Expiry date of token.
CaseInsensitiveString TokenId
Token ID
Abstract base class for agent resources supporting the POST method.
static AccountUser AssertUserAuthenticated(HttpRequest Request)
Makes sure the request is made by an authenticated API user.
const string AgentNamespace
https://waher.se/Schema/BrokerAgent.xsd
Adds a text note on a token.
Adds an XML note on a token.
AddXmlNote()
Adds an XML note on a token.
override async Task POST(HttpRequest Request, HttpResponse Response, Dictionary< string, IElement > Parameters)
Executes the POST method on the resource.
Service Module hosting the XMPP broker and its components.