Commit 408f4565 by Lynette Lizardo

fix next/previous page error

parent ff716e00
......@@ -5,6 +5,7 @@ export class ImageDocument {
imageID = null;
imageType = null;
imageStatus = null;
imageFileName = null;
/*@param
imageFile --- image Blob
......@@ -12,11 +13,12 @@ export class ImageDocument {
fileFormat --- attribute for the element
imageStatus --- 200 to display image, 415 for unsupported file , 500 for unable to display image
*/
constructor(imageFile, id, fileFormat, imageStatus) {
constructor(imageFile, id, fileName, fileFormat, imageStatus) {
this.imageFile = imageFile;
this.imageID = id;
this.imageType = fileFormat;
this.imageStatus = imageStatus;
this.imageFileName = fileName;
}
async init() {
......@@ -27,6 +29,7 @@ export class ImageDocument {
imageContainer.setAttribute("id", this.imageID);
imageContainer.setAttribute("num-of-pages", "1");
imageContainer.setAttribute("file-type", this.imageType);
imageContainer.setAttribute("file-name", this.imageFileName);
let imageElement = document.createElement("img");
imageElement.setAttribute("class", "image");
......@@ -47,6 +50,7 @@ export class ImageDocument {
container.setAttribute("id", id);
container.setAttribute("num-of-pages", "1");
container.setAttribute("file-type", format);
container.setAttribute("file-name", this.imageFileName);
let imageElement = document.createElement("img");
imageElement.setAttribute("class", "image unsupported-file");
......@@ -66,7 +70,8 @@ export class ImageDocument {
container.setAttribute("id", id);
container.setAttribute("num-of-pages", "1");
container.setAttribute("file-type", "");
container.setAttribute("file-name", this.imageFileName);
let imageElement = document.createElement("img");
imageElement.setAttribute("class", "image error-image");
imageElement.src = "."+ FOLDER_PATH + "/resources/error.png";
......
......@@ -9,11 +9,13 @@ export class PDFDocument {
ctx = null;
imageURL=null;
pdfContainerID = null;
fileName=null;
constructor(url, id){
constructor(url, id, fileName){
this.imageURL = url;
this.pdfContainerID = id;
this.fileName = fileName;
}
async init() {
let _this = this;
......@@ -43,6 +45,7 @@ export class PDFDocument {
pdfCanvas.setAttribute("num-of-pages", _this.pdfDoc.numPages);
pdfCanvas.setAttribute("file-type", "pdf");
_this.setPDFDoc(_this.pdfDoc);
pdfCanvas.setAttribute("file-name", _this.fileName);
// sessionStorage.setItem("current_page", 1);
// sessionStorage.setItem("total_pages", _this.pdfDoc.numPages);
});
......
......@@ -43,6 +43,7 @@ export class TiffDocument{
tiffContainer.setAttribute("id", this.tiffID);
tiffContainer.setAttribute("num-of-pages", TiffViewer_pages);
tiffContainer.setAttribute("file-type", "tiff");
tiffContainer.setAttribute("file-name", this.tiffImageName);
//creating blank image containers for each page and setting TIFF data as image source
for (var i = 1; i <= TiffViewer_pages; i++) {
......
......@@ -38,9 +38,9 @@ export const HIGH_LIGHT_SCHEMA = "./WebGde-Widgets/sample_schema/dbSchema_anno.
export const ROOT_FOLDER = "/WebGde-Widgets";
//this determines if the images will be retrieved from the gfs
export const DOMAIN = "http://184.73.93.160:8080"
export const DOMAIN = "http://54.173.201.199:8080"
export const CONTEXTROOT = "gfs-explorer-ws"
export const GFS_URL = "http://184.73.93.160:8080" + "/WebGde/svc/gfs-rest"
export const GFS_URL = "http://54.173.201.199:8080" + "/WebGde/svc/gfs-rest"
export const FOLDER_URL = DOMAIN + "/" + CONTEXTROOT + "/svc/gfs-rest/get-folder?parentPath=/Users/"
export const DOWNLOAD_URL = DOMAIN + "/" + CONTEXTROOT + "/svc/gfs-rest/get-download-link"
export const IS_RETRIEVE_FROM_GFS = "N"
......@@ -51,7 +51,7 @@ export const INVALID_KEYS = "F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12,PrintScreen
export const IS_RETRIEVE_FROM_BPO = "Y"
// export const BPO_URL = "http://35.171.20.94:8080/bpo-sqa/"
// export const CURRENT_NODE = "Web GDE"
export const BPO_URL = "http://184.73.93.160:8080/bpo/"
export const BPO_URL = "http://54.173.201.199:8080/bpo/"
export const CURRENT_NODE = "Web_GDE_DEV"
export const ENCODING_PASS = "PASS1"
export const NEXT_NODE = "Complete"
......
......@@ -48,8 +48,9 @@ async function initializeWebGDE(){
if(maxImagesToStore>1){
const url = urls[0];
let filename = url.split('/').pop();
let imageBlob = await INDEXED_DB_STORAGE.getStoreFile("imageNum_1");
let imageBlob = await INDEXED_DB_STORAGE.getStoreFile("imageNum_0");
await IMAGE_VIEWER_OBJECT.createCurrentImage(filename.split(".").pop(), filename, imageBlob);
sessionStorage.setItem("current_page", 1);
const nextUrl = urls[1];
let nextFilename = nextUrl.split('/').pop();
......@@ -60,6 +61,7 @@ async function initializeWebGDE(){
let filename = url.split('/').pop();
let imageBlob = await INDEXED_DB_STORAGE.getStoreFile("imageNum_0");
await IMAGE_VIEWER_OBJECT.addImage("currentImage", filename.split(".").pop(), filename, imageBlob);
sessionStorage.setItem("current_page", 1);
}
HIGHLIGHT_OBJECT = new Highlight("imageContainer", "currentImage", HIGH_LIGHT_SCHEMA)
......
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