Sie sind auf Seite 1von 13

Tasklist : 1.

Resource Manager
2. Glyphs Generation
3. Issue Compilation
4. Package creator
5. Indesignsetter
6. Issue makeup
7. Image uploading

B. Hariprasad
EmpID 676
R&D Department
Resource manager
Objective: Handling all resources related to article like images, videos etc.

Resource manager modules


1. Uploading files
2. Processing images
3. Resources processing
4. Video processing
5. Converting Office files to HTML
6. Downloading files

Architecture

Resource Handler Processstack AWS

Server Server Server

Resource manager contains three servers


1. Resource Handler server, 2. Process stack server, 3. AWS server

1. Resource Handler server : Gets inputs from user evaluate required process need to do and transfer
input process stack.

URL: : http://localhost:9012/fileupload.html

End point for send input object


http://ip:port/upload
ex: http://localhost:9012/upload

Input Object for image process, resource process, video process


var inputInfo = {
"article": {
"cmsID": "",
"filePath": ""
},
"customer": "",
"requestType": "group",
"fileExtn": "",
"type": {
"image": {
"print": {
"format": "",
"dpi": "",
"colorprofile": "",
"colorspace": ""
},
"files": []
},
"resource": {
"files": []
},
"video": {
"files": []
},
"Office": {
"files": []
}
}
}

End point for file Download


http://ip:port/fileDownload
Input object for file download process
ftp AWS
{ {
"data":{ data: {
"clientName" : "elife", clientName: '',
"jobID":"12233", project: '',
"project":"ccss", jobID: '',
"downloadType":"ftp", downloadType: '',
"credentials":{ credentials: {
"host":"", accessKeyId: ,
"port":"", secretAccessKey:,
"username":"", Bucket: ',
"password":"", Key: '',
"path":"", region: ''
"fileName":"" }
} }
} }
}

endpoint for get status of the job


http://ip:port/jobStatus

input object
{
Data :{
id:jobid value
}
}
End point for download file
http://ip:port/getResources
{
"data": {
"Key": "4da9d941-ea4e-4229-8e69-59437e5a9aad.tif",
"Bucket": "frontiers/fevo.2017.00056/online"
}
}

2. process stack: Consist different processes 1. Images processing 2. Converting office files to html 3.
Downloading files from ftp / AWS. Process stack gets inputs from resource handler and perform
required process action. And transfer output files to AWS server.

Endpoint for perform various process like image process, resource process, video process etc.
http://ip:port/process
Input Object:
{
"date":{
"$reql_type$":"",
"epoch_time":"",
"timezone":""
},
"finished_at":"",
"id":"43cae51f-7d02-4f14-8007-556fb23847a9",
"inputInfo":{
"article":{
"cmsID":"12345",
"filePath":""
},
"asset":{
"extn":"JPEG",
"fileName":"43cae51f-7d02-4f14-8007-556fb23847a9.JPEG",
"filePath":"",
"id":,
"inputFile":"",
"subType":"",
"type":""
},
"customer":"",
"inDesign":{
"script":"",
"template":"",
"url":""
},
"jobID":"43cae51f-7d02-4f14-8007-556fb23847a9",
"jrnlName":"",
"processingInfo":{
"online":{
"colorprofile":"",
"colorspace":"sRGB",
"dpi":"200",
"format":"tif" },
"print":{
"colorprofile":"",
"colorspace":"CMYK",
"dpi":"200",
"format":"tif" },
"webversion":{
"colorprofile":"",
"colorspace":"sRGB",
"dpi":"150",
"format":"jpg"
}
},
"resize":"",
"resizeParams":""
},
"last_update":"",
"log":[],
"percent":,
"process":"image/resource/video",
"processTime":{
"timeInQueue":0,
"timeToProcess":0,
"timeToUpload":0,
"total":0
},
"start_at":"",
"status":"queued/in-progress/completed/failed",
"sub_process":"vector/raster/resource/glencoe"
}
End point for do file download process
http://ip:port/downloadProcess
input object same as in resourcehandler
{
"data":{
"clientName" : "elife",
"jobID":"12233",
"project":"ccss",
"downloadType":"ftp",
"credentials":{
"host":"",
"port":"",
"username":"",
"password":"",
"path":"",
"fileName":""
}
}
}
here this endpoint receive input from resource handler and perform zip file downloading from
either ftp or aws and extract it and look for docx files. Converts that all docx files into htmls and
generate xml and return xml to user.
3. AWS Server : Get inputs from process stack and do necessary action. This sever perform 2 actions
uploading , downloading.

Endpoint for upload file to AWS server


http://ip:port/AWSave
input object as same as for processStack additionally object consist jobid as key and value is
object type. Object consists file paths with we need to upload files.
examp:
aa9689e2-03b5-47a0-bb34-69d021d14bcc:{
original: file path,
online: file path,
print: file path,
webversion: file path
}
inputObject
{
"date":{
"$reql_type$":"",
"epoch_time":"",
"timezone":""
},
"finished_at":"",
"id":"43cae51f-7d02-4f14-8007-556fb23847a9",
"inputInfo":{
"article":{
"cmsID":"12345",
"filePath":""
},
"asset":{
"extn":"JPEG",
"fileName":"43cae51f-7d02-4f14-8007-556fb23847a9.JPEG",
"filePath":"",
"id":,
"inputFile":"",
"subType":"",
"type":""
},
"customer":"",
"inDesign":{
"script":"",
"template":"",
"url":""
},
43cae51f-7d02-4f14-8007-556fb23847a9:{
original: file path,
online: file path,
print: file path,
webversion: file path
}
"jobID":"43cae51f-7d02-4f14-8007-556fb23847a9",
"jrnlName":"",
"processingInfo":{
"online":{
"colorprofile":"",
"colorspace":"sRGB",
"dpi":"200",
"format":"tif" },
"print":{
"colorprofile":"",
"colorspace":"CMYK",
"dpi":"200",
"format":"tif" },
"webversion":{
"colorprofile":"",
"colorspace":"sRGB",
"dpi":"150",
"format":"jpg"
}
},
"resize":"",
"resizeParams":""
},
"last_update":"",
"log":[],
"percent":,
"process":"image/resource/video",
"processTime":{
"timeInQueue":0,
"timeToProcess":0,
"timeToUpload":0,
"total":0
},
"start_at":"",
"status":"queued/in-progress/completed/failed",
"sub_process":"vector/raster/resource/glencoe"
}
Gyphs finder
Objective: Generating glyphs object for selected fonts

modules
1. Font upload
2. Converting json for uploaded font
3. Generating glyph object for selected font

URL : http://localhost:3006/fontlist.html

UI consists two tabs 1. File Upload 2. Glyph Finder


1. Font Upload requires font Family, font variant, font type and needs to upload required files

Ex: Font Family : Times new Roman


Font variant : bold/italic/regular
Font Type: TTF/OTF/PSF
Upload files: upload files required 2 files 1. Font file 2. Related SVG file. (SVG
mandatory)
Ex: times.ttf times.svg
Once font uploaded all entities in svg file are converted into json object. Json object consists list of all
entities like below example.
Example for one entity :
"x{627}":{
"font-family":"Arial Unicode MS",
"font-variant":"Regular"
}
Json object saved into .json file.

Uploaded font object added into related font type json file. Examle if uploaded font type is TTF then the
font object is added into fonts/TTF.json
"Arial Unicode MS":{
"Regular":"ARIALUNI.TTF",
"Italic":"Arial-Unicode-Italic.ttf",
"Bold":"Arial-Unicode-Bold.ttf",
"Bold Italic":"Arial-Unicode-Bold-Italic.ttf"
}

2. Glyphs Finder

Glyph finder requires 3 inputs 1. Font type , 2. Main font, 3. Preferred font. Glyph finder generates glyph
json object and write it in final.json.

Functionality
Select Font type: TTF/OTF/PSF
Once font type selected corresponding will be loaded in main font.
Once main font selected all fonts(TTT/OTF/PSF) expect selected main font loaded into preferred
font.

UI consist + symbol represent add functionality. If pressed + then selected font set will be
added to input object.
Like this select all font sets. Finally click on process then json file download link will be appear.

inputObj :
{
"project":"bmj",
"fontSet":{
"ITC New Baskerville - Roman":{
"main":{
"ITC New Baskerville - Roman" : "43e82a6a6c1bfde399210966bbd5d215.otf"
},
"prefered":{
"Symbol (T1) - Medium":"sy___0.PFB,sy___0.pfm",
"ITC Zapf Dingbats - Medium":"itc-zapf-dingbats-medium-5881a43652629.otf",
"Arial Unicode MS - Regular":"ARIALUNI.TTF",
"Times New Roman - Regular":"times.ttf"
}
}
}
}

Endpoints:
http://ip:port/loadFonts
endpoint for load fonts into UI
http://ip:port/convertSVGtoJSON
endpoint for convert SVG file into JSON. This end point will call function
convertJSONforSVG to convert SVG to JSON. (this endpoint designed for
convert uploaded font to JSON manually );
http://ip:port/upload
endpoint for upload font files. Once uploaded convertJSONforSVG function will
call automatically.
http://ip:port/getGlyphs1
This function generates glyphcsObject = {
"ClassGarmnd BT":{
"Roman":{
"2190;":
{"font-family":"Symbol
(T1)",
"font-style":"Medium"
},
"2191;":{
"font-family":"Symbol
(T1)","
font-style": "Medium"}
, "2192;":{"font-family":
"Symbol (T1)", "font-
style":"Medium"}
}
}
Image Uploader
Objective: Upload images into aws server for proofing

modules
1. Image upload
URL: http://localhost:5001/imageUploader.html

Endpoint :
http://localhost:5001/upload
input :
type : form data
{
Client : bmj/elife/..
cmsid: 2xxxx
purpose: web/print
file:files-data
}

Image uploader supports single / multi images uploading. Once upload pressed images are
uploaded into AWS server in the bucket client/ecs/article/cmsid/resources
If purpose is print images uploaded into client/ecs/article/cmsid/resources/print bucket
If purpose is web images uploaded into client/ecs/article/cmsid/resourcest
Packagecreator
Objective: Generate package for highwire/pap/casereports etc

Modules:
1. Collecting files
2. Packaging
3. Uploading

1. Collecting files:
Here collecting all files information which needs to be download as an array called
packFiles. In this each element as a JSON object
Structure:
{
fromPath: // download file from
toPath: // save file to
alternatePath: // download file if file not found in fromPath
conversion: // conversion is also object but it is only valid for images(if file is
others conversion becomes false)
}
Like this collecting all files information and keeping into packFiles array.

These fromPath, toPath, alternatePath, conversion information are constructed from config
based on packaging Type.
Endpoint for call collectfiles
http://ip:port/collectfiles
input: {
"doi":"81502",
"issue":"0",
"volume":"0",
"type":"highwire-pap",
"jobid":123333,
"client":"bmj",
"statusUpdateEndpoint":"http://localhost:5000/updateProgress"
}
Endpoint for call packaging
http://ip:port/packaging
{"jobid":123333,"statusUpdateEndpoint":"http://localhost:5000/updateProgress","uploadType"
:"localftp"}

Endpoint for call packaging


http://ip:port/packaging
{"jobid":123333,"statusUpdateEndpoint":"http://localhost:5000/updateProgress","uploadType"
:"localftp"}

Das könnte Ihnen auch gefallen