Simple HTML editor example

29 Views Asked by At

I'm trying to create a simple html page to display the rules editor in Safari to demonstrated client independence from libraries etc. I have copied the ruleseditor.txt file into a javascript file called ruleseditor.js and used the following code from the demo as my html page to provide the divs:

<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Untitled Document</title>
<script src="ruleseditor.js" defer></script>
</head>
<body>
<div style="width:560px;margin:20px auto;">
  <h1 class="title">Rule Editor</h1>
  <div style="margin-top:10px;"> <span>Info:</span> <span id="Info" style="color:Red;">Demo        version. Evaluations are delayed for 6 second.</span> </div>
  <div id="divRuleEditor" style="margin-top:10px;"></div>
  <div style="margin-top:30px;">To simplify this demo project, we used a hard-coded instance of the Models.Patient class as a data object to evaluate your rules against (see HomeController.cs line 154 for details.) To test, create any rule in the Rule Area and click the Test button to evaluate it against that "hard-coded" Patient instance.</div>
  <div style="text-align:right;margin-top:30px;">
    <input type="submit" id="Button" name="Button" value="Test" />
  </div>
</div>
</body>
</html>

It renders the html but I dn't see the "rules editor" functinality in the "divRuleEditor" div. What am I missing?

I'm having a hard time parsing out the individual operation(s) required to instantiate the client side rule editor given the single comprehensive example (.NET7 and above) which is my situation) because it combines ALL of the operations, rule modeling, rule editor instantiation, rule execution, rule storage and retrieval, etc. in one big example that makes it hard to see the boundaries specific to the particlar component operations. We are evalutaing the product for use in a containerized (docker) microservice architecture where many of these functions would, in fact be separated into separate microservices instead of a larger single monolithic web application. So identifying the likely subdivisions of function with their respective dependencies is part of our evaluation.

The docs mention obtaining an XML source instance by instantiating the rule editor in a "test" web page and then calling a method to save off the generated XML. No example is given of doing that and perhaps that is obvious to the initiated but trying to reverse engineer that "piece" of the puzzle in isolation from the comprehensive example code that bundles all of the operations together has proven daunting thus far. My intent was to see what was minimally required to get a rule editor HTML "client" working as that "seemed" to be a likely place to start small and learn.

0

There are 0 best solutions below