Commit a3b6d4c1 by Jorem Magcawas

update schema handler on doctypes

parent ae5b8a3f
......@@ -26,7 +26,23 @@
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
......
......@@ -34,4 +34,15 @@
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>
<filteredResources>
<filter>
<id>1675315043043</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.apt.aptEnabled=false
......@@ -7,5 +7,6 @@ org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.processAnnotations=disabled
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="WebGde-0.0.1-SNAPSHOT">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/WebContent" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/annotations"/>
<property name="java-output-path" value="/WebGde/build/classes"/>
<property name="context-root" value="WebGde"/>
</wb-module>
</wb-module>
</project-modules>
......@@ -27,12 +27,35 @@ const displayFields = async (parentID) => {
clearFields(parentID) // make sure input fields are clear
await fetchSchema()
createDocTypeDropdown('DocType', div, schema)
await fetchSchema();
console.log(schema);
createDocTypeDropdown('DocType', div, schema)
createSection('Section', div)
const { ACCOUNTING_DOCUMENTS } = schema
Object.keys(schema).forEach(function(key) {
console.log(key + ": " + schema[key]); //doctypes in schema
let doctypes = schema[key];
const { valid, error } = validateSchema(key)
if(!valid){
div.textContent = error
div.style.color = '#ff3333'
}
for (let key in doctypes) {
if (doctypes.hasOwnProperty(key)) {
console.log(key + ": " + doctypes[key]); //sections on doctypes
let section = doctypes[key];
console.log(section);
div = deconstruct(section, div, key)
}
}
});
/* const { ACCOUNTING_DOCUMENTS } = schema
//getDocType = DOC_TYPE1 ;
......@@ -49,12 +72,9 @@ const displayFields = async (parentID) => {
const { HR_FILES } = schema
const { SECTION3 } = HR_FILES
div = deconstruct(SECTION3, div, 'SECTION3')
div = deconstruct(SECTION3, div, 'SECTION3')*/
if(!valid){
div.textContent = error
div.style.color = '#ff3333'
}
const submit = document.createElement('input')
submit.type = 'submit'
......
......@@ -275,16 +275,20 @@ function TIFFViewer(xhr, TiffViewerImageName) {
} else if (setheight > 800 && setwidth <= 1000) {
img.style = "width: 800;";
changed = true;
} else {
} else{
img.style = `width: {setwidth}; height: {setheight}`;
changed = true;
}
}
if (changed) {
hpercent = (parseInt(setheight, 10) * (10 / 100));
wpercent = (parseInt(setwidth, 10) * (10 / 100));
setwidth = parseInt(img.style.width, 10);
setheight = parseInt(img.style.height, 10) ;
if(TiffViewer_pages > 1){
hpercent = (parseInt(setheight, 10) * (10 / 100));
wpercent = (parseInt(setwidth, 10) * (10 / 100));
}
setwidth = parseInt(img.style.width, 10);
setheight = parseInt(img.style.height, 10);
document.getElementById("TiffViewer_FitButton").style.display = "inherit";
}
......@@ -308,10 +312,12 @@ function TIFFViewer(xhr, TiffViewerImageName) {
}
}
for (var j = 1; j <= TiffViewer_pages; j++) {
var img = document.getElementById("IMG" + j).style.display = "none";
}
if(TiffViewer_pages > 1){
for (var j = 1; j <= TiffViewer_pages; j++) {
var img = document.getElementById("IMG" + j).style.display = "none";
}
}
//getting the metadata of each TIFF page
function getMeta(url, callback) {
var img = new Image();
......
const validateSchema = () => {
const { ACCOUNTING_DOCUMENTS } = schema
const validateSchema = (doctype) => {
const validate = schema[doctype]
if(!ACCOUNTING_DOCUMENTS) return { valid: false, error: 'SECTION is missing!' }
if(!validate) return { valid: false, error: 'SECTION is missing!' }
return { valid: true }
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment