diff --git a/opengds2018prod/src/main/resources/application.yml b/opengds2018prod/src/main/resources/application.yml index bcd8b44c..4fbb15c3 100644 --- a/opengds2018prod/src/main/resources/application.yml +++ b/opengds2018prod/src/main/resources/application.yml @@ -1,19 +1,19 @@ spring: rabbitmq: - host: 175.116.181.42 - port: 5672 - virtual-host: only_opengds - username: qaproducer - password: qaproducer + host: 레빗엠큐 호스트 주소 EX)175.111.222.333 + port: 레빗엠큐 포트번호 EX)5672 + virtual-host: 레빗 엠큐 버추얼 호스트 + username: 레빗엠큐 계정명 + password: 레빗엠큐 비밀번호 template: - exchange: opengds_qa_exchange - routing-key: opengds_qa_key - routing-key-mobile: opengds_mobile_qa_key + exchange: 레빗엠큐 익스체인지 + routing-key: 레빗엠큐 라우팅키 + routing-key-mobile: 레빗엠큐 모바일용 라우팅키 datasource: type: com.zaxxer.hikari.HikariDataSource - url: jdbc:postgresql://175.116.181.42:5432/opengds_2018?charSet=UTF-8&prepareThreshold=1 - username: opensource - password: opensource + url: jdbc:postgresql://postgresql주소:포트번호/데이터베이스 이름?charSet=UTF-8&prepareThreshold=1 + username: 데이터베이스 계정명 + password: 데이터베이스 비밀번호 driver-class-name: org.postgresql.Driver hikari: connection-test-query: SELECT 1 @@ -30,7 +30,7 @@ spring: max-file-size: 10485760KB max-request-size: 10485760KB server: - port: 8080 + port: 프로젝트 접속 포트번호 context-path: /geodt servlet: session: @@ -42,12 +42,12 @@ server: whitelabel: enabled: false gitrnd: - serverhost: 175.116.181.34 + serverhost: 프로젝트 접속 주소 EX)175.111.222.333 apache: - host: 127.0.0.1 - port: 8888 - basedir: gdofiles - basedrive: C + host: 아파치 서버 주소 EX) 127.0.0.1 + port: 아파치 서버 포트 EX) 8888 + basedir: 디렉토리 이름 EX) gdofiles + basedrive: 드라이브 명 EX) C mybatis: config-location: classpath:config/mybatis.xml mapper-location: classpath:sql/*.xml diff --git a/opengds2018prod/src/main/resources/static/resources/js/gb/edit/layerhistory.js b/opengds2018prod/src/main/resources/static/resources/js/gb/edit/layerhistory.js deleted file mode 100644 index c3d3753a..00000000 --- a/opengds2018prod/src/main/resources/static/resources/js/gb/edit/layerhistory.js +++ /dev/null @@ -1,670 +0,0 @@ -/** - * 레이어 편집 이력을 관리하는 객체 - * - * @class gb.edit.LayerRecord - * @memberof gb.edit - * @param {Object} - * obj - 생성자 옵션을 담은 객체 - * @param {String} - * obj.id - 레이어의 ID - * @version 0.01 - * @author 소이준 - * @date 2017.05.18 - */ -gb.edit.LayerRecord = function(obj) { - this.created = {}; - this.modified = {}; - this.removed = {}; - this.id = obj.id ? obj.id : false; -} -/** - * 임시보관 중인 새로운 layer들을 반환한다. - * - * @method gb.edit.LayerRecord#getCreated - * @function - * @return {Object} 새로 생성한 Layer - */ -gb.edit.LayerRecord.prototype.getCreated = function() { - return this.created; -}; -/** - * 임시보관 중인 변경한 layer들을 반환한다. - * - * @method gb.edit.LayerRecord#getModified - * @function - * @return {Object} 변경한 Layer - */ -gb.edit.LayerRecord.prototype.getModified = function() { - return this.modified; -}; -/** - * 임시보관 중인 삭제한 layer들을 반환한다. - * - * @method gb.edit.LayerRecord#getRemoved - * @function - * @return {Object} 삭제한 Layer - */ -gb.edit.LayerRecord.prototype.getRemoved = function() { - return this.removed; -}; -/** - * 임시보관 중인 모든 레이어 이력을 삭제한다. - * - * @method gb.edit.LayerRecord#clearAll - * @function - */ -gb.edit.LayerRecord.prototype.clearAll = function() { - this.created = {}; - this.modified = {}; - this.removed = {}; -}; -/** - * 임시보관 중인 새로 만든 layer들의 이력을 삭제한다. - * - * @method gb.edit.LayerRecord#clearCreated - * @function - */ -gb.edit.LayerRecord.prototype.clearCreated = function() { - this.created = {}; -}; -/** - * 임시보관 중인 변경한 layer들의 이력을 삭제한다. - * - * @method gb.edit.LayerRecord#clearModified - * @function - */ -gb.edit.LayerRecord.prototype.clearModified = function() { - this.modified = {}; -}; -/** - * 임시보관 중인 삭제한 layer들의 이력을 삭제한다. - * - * @method gb.edit.LayerRecord#clearRemoved - * @function - */ -gb.edit.LayerRecord.prototype.clearRemoved = function() { - this.removed = {}; -}; -/** - * 해당 Layer가 삭제되었는지 임시보관 목록에서 조회한다. - * - * @method gb.edit.LayerRecord#isRemoved - * @function - * @param {ol.layer.Base} - * layer - 편집이력(삭제)에서 확인할 layer 객체 - * @return {Boolean} 해당 Layer의 편집이력(삭제) 존재 여부 - */ -gb.edit.LayerRecord.prototype.isRemoved = function(layer) { - var isRemoved = false; - if (this.removed.hasOwnProperty(layer.get("id"))) { - isRemoved = true; - } - return isRemoved; -}; -/** - * 도엽단위의 그룹 레이어 생성 이력을 추가한다. - * - * @method gb.edit.LayerRecord#createByMapsheet - * @function - * @param {ol.layer.Base} - * mapsheetLayer - 새로 생성할 도엽단위 layer 객체 - */ -gb.edit.LayerRecord.prototype.createByMapsheet = function(mapsheetLayer) { - if (mapsheetLayer instanceof ol.layer.Base) { - if (!mapsheetLayer.get("git")) { - console.error("no git property"); - return; - } - } - var git = mapsheetLayer.get("git"); - var info = git.information; - if (!info) { - console.error("no information"); - return; - } - var format = info.getFormat(); - var mapsheet = info.getSheetNumber(); - var layers; - if (mapsheetLayer instanceof ol.layer.Group) { - layers = mapsheetLayer.getLayers(); - } else if (mapsheetLayer instanceof ol.layer.Tile) { - layers = git.layers; - } - if (!this.created.hasOwnProperty(format)) { - this.created[format] = {}; - } - if (!this.created[format].hasOwnProperty(mapsheet)) { - this.created[format][mapsheet] = {}; - } - for (var i = 0; i < layers.getLength(); i++) { - this.created[format][mapsheet][layers.item(i).get("id")] = layers.item(i); - } - console.log(this.created); -} -/** - * 도엽내에 레이어를 생성이력을 추가한다. - * - * @method gb.edit.LayerRecord#create - * @function - * @param {String} - * format - 도엽의 원본 확장자 - * @param {String} - * mapsheet - 도엽번호 - * @param {ol.layer.Base} - * layer - 새로 생성할 도엽내 layer 객체 - */ -gb.edit.LayerRecord.prototype.create = function(format, mapsheet, layer) { - if (!this.created.hasOwnProperty(format)) { - this.created[format] = {}; - } - if (!this.created[format].hasOwnProperty(mapsheet)) { - this.created[format][mapsheet] = {}; - } - this.created[format][mapsheet][layer.get("id")] = layer; - console.log(this.created); -} -/** - * 도엽내에 레이어를 삭제한다. - * - * @method gb.edit.LayerRecord#remove - * @function - * @param {String} - * format - 도엽의 원본 확장자 - * @param {String} - * mapsheet - 도엽번호 - * @param {ol.layer.Base} - * layer - 삭제할 도엽내 layer 객체 - */ -gb.edit.LayerRecord.prototype.remove = function(format, mapsheet, layer) { - if (layer instanceof ol.layer.Group) { - var layers = layer.getLayers(); - for (var i = 0; i < layers.getLength().length; i++) { - var git = layers.item(i).get("git"); - if (!git) { - console.error("no git property"); - return; - } - var info = git.information; - if (!info) { - console.error("no information"); - return; - } - - if (info.getIsNew() === true) { - delete this.created[format][mapsheet][layers.item(i).get("id")]; - var mkeys = Object.keys(this.created[format][mapsheet]); - if (mkeys.length === 0) { - delete this.created[format][mapsheet]; - } - var fkeys = Object.keys(this.created[format]); - if (fkeys.length === 0) { - delete this.created[format]; - } - } else { - if (!this.removed.hasOwnProperty(format)) { - this.removed[format] = {}; - } - if (!this.removed[format].hasOwnProperty(mapsheet)) { - this.removed[format][mapsheet] = {}; - } - this.removed[format][mapsheet][layers.item(i).get("id")] = layers.item(i); - if (this.modified.hasOwnProperty(format)) { - if (this.modified[format].hasOwnProperty(mapsheet)) { - if (this.modified[format][mapsheet].hasOwnProperty(layers.item(i).get("id"))) { - delete this.modified[format][mapsheet][layers.item(i).get("id")]; - var mkeys = Object.keys(this.modified[format][mapsheet]); - if (mkeys.length === 0) { - delete this.modified[format][mapsheet]; - } - var fkeys = Object.keys(this.modified[format]); - if (fkeys.length === 0) { - delete this.modified[format]; - } - } - } - } - } - } - } else { - var git = layer.get("git"); - if (git.hasOwnProperty("fake")) { - if (git["fake"] === "parent") { - var layers = git.layers; - for (var i = 0; i < layers.getLength().length; i++) { - var git = layers.item(i).get("git"); - if (!git) { - console.error("no git property"); - return; - } - var info = git.information; - if (!info) { - console.error("no information"); - return; - } - - if (info.getIsNew() === true) { - delete this.created[format][mapsheet][layers.item(i).get("id")]; - var mkeys = Object.keys(this.created[format][mapsheet]); - if (mkeys.length === 0) { - delete this.created[format][mapsheet]; - } - var fkeys = Object.keys(this.created[format]); - if (fkeys.length === 0) { - delete this.created[format]; - } - } else { - if (!this.removed.hasOwnProperty(format)) { - this.removed[format] = {}; - } - if (!this.removed[format].hasOwnProperty(mapsheet)) { - this.removed[format][mapsheet] = {}; - } - this.removed[format][mapsheet][layers.item(i).get("id")] = layers.item(i); - if (this.modified.hasOwnProperty(format)) { - if (this.modified[format].hasOwnProperty(mapsheet)) { - if (this.modified[format][mapsheet].hasOwnProperty(layers.item(i).get("id"))) { - delete this.modified[format][mapsheet][layers.item(i).get("id")]; - var mkeys = Object.keys(this.modified[format][mapsheet]); - if (mkeys.length === 0) { - delete this.modified[format][mapsheet]; - } - var fkeys = Object.keys(this.modified[format]); - if (fkeys.length === 0) { - delete this.modified[format]; - } - } - } - } - } - } - } else if (git["fake"] === "child") { - var git = layer.get("git"); - if (!git) { - console.error("no git property"); - return; - } - var info = git.information; - if (!info) { - console.error("no information"); - return; - } - - if (info.getIsNew() === true) { - delete this.created[format][mapsheet][layer.get("id")]; - var mkeys = Object.keys(this.created[format][mapsheet]); - if (mkeys.length === 0) { - delete this.created[format][mapsheet]; - } - var fkeys = Object.keys(this.created[format]); - if (fkeys.length === 0) { - delete this.created[format]; - } - } else { - if (!this.removed.hasOwnProperty(format)) { - this.removed[format] = {}; - } - if (!this.removed[format].hasOwnProperty(mapsheet)) { - this.removed[format][mapsheet] = {}; - } - this.removed[format][mapsheet][layer.get("id")] = layer; - if (this.modified.hasOwnProperty(format)) { - if (this.modified[format].hasOwnProperty(mapsheet)) { - if (this.modified[format][mapsheet].hasOwnProperty(layer.get("id"))) { - delete this.modified[format][mapsheet][layer.get("id")]; - var mkeys = Object.keys(this.modified[format][mapsheet]); - if (mkeys.length === 0) { - delete this.modified[format][mapsheet]; - } - var fkeys = Object.keys(this.modified[format]); - if (fkeys.length === 0) { - delete this.modified[format]; - } - } - } - } - } - } - } else { - var git = layer.get("git"); - if (!git) { - console.error("no git property"); - return; - } - var info = git.information; - if (!info) { - console.error("no information"); - return; - } - - if (info.getIsNew() === true) { - delete this.created[format][mapsheet][layer.get("id")]; - var mkeys = Object.keys(this.created[format][mapsheet]); - if (mkeys.length === 0) { - delete this.created[format][mapsheet]; - } - var fkeys = Object.keys(this.created[format]); - if (fkeys.length === 0) { - delete this.created[format]; - } - } else { - if (!this.removed.hasOwnProperty(format)) { - this.removed[format] = {}; - } - if (!this.removed[format].hasOwnProperty(mapsheet)) { - this.removed[format][mapsheet] = {}; - } - this.removed[format][mapsheet][layer.get("id")] = layer; - if (this.modified.hasOwnProperty(format)) { - if (this.modified[format].hasOwnProperty(mapsheet)) { - if (this.modified[format][mapsheet].hasOwnProperty(layer.get("id"))) { - delete this.modified[format][mapsheet][layer.get("id")]; - var mkeys = Object.keys(this.modified[format][mapsheet]); - if (mkeys.length === 0) { - delete this.modified[format][mapsheet]; - } - var fkeys = Object.keys(this.modified[format]); - if (fkeys.length === 0) { - delete this.modified[format]; - } - } - } - } - } - } - } - - console.log(this.removed); - console.log(this.created); - console.log(this.modified); -} -/** - * 도엽내의 해당 Layer를 변경한다. - * - * @method gb.edit.LayerRecord#update - * @function - * @param {String} - * format - 도엽의 원본 확장자 - * @param {String} - * mapsheet - 도엽번호 - * @param {ol.layer.Base} - * layer - 새로 생성할 도엽내 layer 객체 - * @param {String} - * oldLayerId - 변경될 예전 Layer ID - */ -gb.edit.LayerRecord.prototype.update = function(format, mapsheet, layer, oldLayerId) { - if (!this.modified) { - this.modified = {}; - } - var info = layer.get("git").information; - if (info.getIsNew() === true) { - delete this.created[format][mapsheet][oldLayerId]; - this.created[format][mapsheet][layer.get("id")] = layer; - } else { - if (this.modified.hasOwnProperty(format)) { - if (this.modified[format].hasOwnProperty(mapsheet)) { - delete this.modified[format][mapsheet][oldLayerId]; - this.modified[format][mapsheet][layer.get("id")] = layer; - } - } - } - console.log(this.removed); - console.log(this.created); - console.log(this.modified); -} -/** - * 도엽 단위의 Layer 정보 변경이력을 JSON형태로 반환한다. - * - * @method gb.edit.LayerRecord#getStructure - * @function - * @return {Object} Layer 정보 편집이력 - */ -gb.edit.LayerRecord.prototype.getStructure = function() { - var obj = {}; - var created = this.getCreated(); - var cFormat = Object.keys(created); - for (var i = 0; i < cFormat.length; i++) { - if (!obj.hasOwnProperty(cFormat[i])) { - obj[cFormat[i]] = {}; - } - var cSheetNum = Object.keys(created[cFormat[i]]); - for (var j = 0; j < cSheetNum.length; j++) { - if (!obj[cFormat[i]].hasOwnProperty(cSheetNum[j])) { - obj[cFormat[i]][cSheetNum[j]] = {}; - obj[cFormat[i]][cSheetNum[j]]["create"] = []; - } - var cLayers = Object.keys(created[cFormat[i]][cSheetNum[j]]); - for (var k = 0; k < cLayers.length; k++) { - var cLayer = created[cFormat[i]][cSheetNum[j]][cLayers[k]]; - var cInfo = cLayer.get("git").information; - var cObj; - if (cInfo.getFormat() === "ngi") { - cObj = { - "layerName" : cInfo.getName() + "_" + (cInfo.getGeometry().toUpperCase()), - "layerType" : cInfo.getGeometry(), - "version" : cInfo.getNGIVersion(), - "dim" : cInfo.getNGIDim(), - "bound" : cInfo.getMbound(), - "represent" : cInfo.getNGIRep() - }; - var attrs = []; - var cAttrs = cInfo.getAttributes(); - if (!!cAttrs) { - for (var l = 0; l < cAttrs.length; l++) { - attrs.push(cAttrs[l].getStructure()); - } - cObj["attr"] = attrs; - } - } else if (cInfo.getFormat() === "dxf") { - cObj = { - "layerName" : cInfo.getName() + "_" + (cInfo.getGeometry().toUpperCase()), - "layerType" : cInfo.getGeometry() - }; - } - obj[cFormat[i]][cSheetNum[j]]["create"].push(cObj); - } - } - } - - var modified = this.getModified(); - var mFormat = Object.keys(modified); - for (var i = 0; i < mFormat.length; i++) { - if (!obj.hasOwnProperty(mFormat[i])) { - obj[mFormat[i]] = {}; - } - var mSheetNum = Object.keys(modified[mFormat[i]]); - for (var j = 0; j < mSheetNum.length; j++) { - if (!obj[mFormat[i]].hasOwnProperty(mSheetNum[j])) { - obj[mFormat[i]][mSheetNum[j]] = {}; - obj[mFormat[i]][mSheetNum[j]]["modify"] = []; - } - var mLayers = Object.keys(modified[mFormat[i]][mSheetNum[j]]); - for (var k = 0; k < mLayers.length; k++) { - var mLayer = modified[mFormat[i]][mSheetNum[j]][mLayers[k]]; - var mInfo = mLayer.get("git").information; - - var mObj = { - "nativeName" : mInfo.getId(), - "originLayerName" : mInfo.getOldName() + "_" + (mInfo.getGeometry().toUpperCase()), - "currentLayerName" : mInfo.getName() + "_" + (mInfo.getGeometry().toUpperCase()), - // "layerType" : mInfo.getGeometry(), - // "version" : mInfo.getNGIVersion(), - // "dim" : mInfo.getNGIDim(), - "bound" : mInfo.getMbound(), - "represent" : mInfo.getNGIRep() - }; - var attrs = []; - var mAttrs = mInfo.getAttributes(); - if (!!mAttrs) { - for (var l = 0; l < mAttrs.length; l++) { - attrs.push(mAttrs[l].getStructure()); - } - mObj["updateAttr"] = attrs; - } - obj[mFormat[i]][mSheetNum[j]]["modify"].push(mObj); - } - } - } - - var removed = this.getRemoved(); - var rFormat = Object.keys(removed); - for (var i = 0; i < rFormat.length; i++) { - if (!obj.hasOwnProperty(rFormat[i])) { - obj[rFormat[i]] = {}; - } - var rSheetNum = Object.keys(removed[rFormat[i]]); - for (var j = 0; j < rSheetNum.length; j++) { - if (!obj[rFormat[i]].hasOwnProperty(rSheetNum[j])) { - obj[rFormat[i]][rSheetNum[j]] = {}; - obj[rFormat[i]][rSheetNum[j]]["remove"] = {}; - } - var scope = "part"; - var layer = []; - var rLayers = Object.keys(removed[rFormat[i]][rSheetNum[j]]); - for (var k = 0; k < rLayers.length; k++) { - var rLayer = removed[rFormat[i]][rSheetNum[j]][rLayers[k]]; - var rInfo = rLayer.get("git").information; - var name = info.rInfo.getOldName() + "_" + (rInfo.getGeometry().toUpperCase()); - layer.push(name); - } - obj[rFormat[i]][rSheetNum[j]]["remove"]["scope"] = scope; - obj[rFormat[i]][rSheetNum[j]]["remove"]["layer"] = layer; - } - } - return obj; -} -/** - * 선택한 도엽 단위의 Layer 정보 변경이력을 JSON형태로 반환한다. - * - * @method gb.edit.LayerRecord#getPartStructure - * @function - * @param {String} - * bringLayer - Layer ID 배열 - * @return {Object} Layer 정보 편집이력 - */ -gb.edit.LayerRecord.prototype.getPartStructure = function(bringLayer) { - if (!Array.isArray(bringLayer)) { - console.error("type error"); - return; - } - var obj = {}; - var created = this.getCreated(); - var cFormat = Object.keys(created); - for (var i = 0; i < cFormat.length; i++) { - if (bringLayer.indexOf(cFormat[i]) === -1) { - continue; - } - if (!obj.hasOwnProperty(cFormat[i])) { - obj[cFormat[i]] = {}; - } - var cSheetNum = Object.keys(created[cFormat[i]]); - for (var j = 0; j < cSheetNum.length; j++) { - if (!obj[cFormat[i]].hasOwnProperty(cSheetNum[j])) { - obj[cFormat[i]][cSheetNum[j]] = {}; - obj[cFormat[i]][cSheetNum[j]]["create"] = []; - } - var cLayers = Object.keys(created[cFormat[i]][cSheetNum[j]]); - for (var k = 0; k < cLayers.length; k++) { - var cLayer = created[cFormat[i]][cSheetNum[j]][cLayers[k]]; - var cInfo = cLayer.get("git").information; - var cObj; - if (cInfo.getFormat() === "ngi") { - cObj = { - "layerName" : cInfo.getName() + "_" + (cInfo.getGeometry().toUpperCase()), - "layerType" : cInfo.getGeometry(), - "version" : cInfo.getNGIVersion(), - "dim" : cInfo.getNGIDim(), - "bound" : cInfo.getMbound(), - "represent" : cInfo.getNGIRep() - }; - var attrs = []; - var cAttrs = cInfo.getAttributes(); - if (!!cAttrs) { - for (var l = 0; l < cAttrs.length; l++) { - attrs.push(cAttrs[l].getStructure()); - } - cObj["attr"] = attrs; - } - } else if (cInfo.getFormat() === "dxf") { - cObj = { - "layerName" : cInfo.getName() + "_" + (cInfo.getGeometry().toUpperCase()), - "layerType" : cInfo.getGeometry() - }; - } - obj[cFormat[i]][cSheetNum[j]]["create"].push(cObj); - } - } - } - - var modified = this.getModified(); - var mFormat = Object.keys(modified); - for (var i = 0; i < mFormat.length; i++) { - if (bringLayer.indexOf(mFormat[i]) === -1) { - continue; - } - if (!obj.hasOwnProperty(mFormat[i])) { - obj[mFormat[i]] = {}; - } - var mSheetNum = Object.keys(modified[mFormat[i]]); - for (var j = 0; j < mSheetNum.length; j++) { - if (!obj[mFormat[i]].hasOwnProperty(mSheetNum[j])) { - obj[mFormat[i]][mSheetNum[j]] = {}; - obj[mFormat[i]][mSheetNum[j]]["modify"] = []; - } - var mLayers = Object.keys(modified[mFormat[i]][mSheetNum[j]]); - for (var k = 0; k < mLayers.length; k++) { - var mLayer = modified[mFormat[i]][mSheetNum[j]][mLayers[k]]; - var mInfo = mLayer.get("git").information; - - var mObj = { - "nativeName" : mInfo.getId(), - "originLayerName" : mInfo.getOldName() + "_" + (mInfo.getGeometry().toUpperCase()), - "currentLayerName" : mInfo.getName() + "_" + (mInfo.getGeometry().toUpperCase()), - // "layerType" : mInfo.getGeometry(), - // "version" : mInfo.getNGIVersion(), - // "dim" : mInfo.getNGIDim(), - "bound" : mInfo.getMbound(), - "represent" : mInfo.getNGIRep() - }; - var attrs = []; - var mAttrs = mInfo.getAttributes(); - if (!!mAttrs) { - for (var l = 0; l < mAttrs.length; l++) { - attrs.push(mAttrs[l].getStructure()); - } - mObj["updateAttr"] = attrs; - } - obj[mFormat[i]][mSheetNum[j]]["modify"].push(mObj); - } - } - } - - var removed = this.getRemoved(); - var rFormat = Object.keys(removed); - for (var i = 0; i < rFormat.length; i++) { - if (bringLayer.indexOf(rFormat[i]) === -1) { - continue; - } - if (!obj.hasOwnProperty(rFormat[i])) { - obj[rFormat[i]] = {}; - } - var rSheetNum = Object.keys(removed[rFormat[i]]); - for (var j = 0; j < rSheetNum.length; j++) { - if (!obj[rFormat[i]].hasOwnProperty(rSheetNum[j])) { - obj[rFormat[i]][rSheetNum[j]] = {}; - obj[rFormat[i]][rSheetNum[j]]["remove"] = {}; - } - var scope = "part"; - var layer = []; - var rLayers = Object.keys(removed[rFormat[i]][rSheetNum[j]]); - for (var k = 0; k < rLayers.length; k++) { - var rLayer = removed[rFormat[i]][rSheetNum[j]][rLayers[k]]; - var rInfo = rLayer.get("git").information; - var name = info.rInfo.getOldName() + "_" + (rInfo.getGeometry().toUpperCase()); - layer.push(name); - } - obj[rFormat[i]][rSheetNum[j]]["remove"]["scope"] = scope; - obj[rFormat[i]][rSheetNum[j]]["remove"]["layer"] = layer; - } - } - return obj; -} \ No newline at end of file diff --git a/opengds2018prod/src/main/resources/static/resources/js/gb/edit/recordtransfer.js b/opengds2018prod/src/main/resources/static/resources/js/gb/edit/recordtransfer.js deleted file mode 100644 index fb29f5cf..00000000 --- a/opengds2018prod/src/main/resources/static/resources/js/gb/edit/recordtransfer.js +++ /dev/null @@ -1,123 +0,0 @@ -/** - * 레이어 및 피처 편집 이력을 전송하는 객체 - * - * @param {Object} - * obj - 생성자 옵선을 담은 객체 - * @param {String} - * obj.url - 편집이력을 전송할 URL - * @param {gb.edit.LayerRecord} - * obj.layer - Layer 편집이력 저장 객체 - * @param {gb.edit.FeatureRecord} - * obj.feature - Feature 편집이력 저장 객체 - * @author 소이준 - * @date 2017.06.13 - */ -gb.edit.RecordTransfer = function(obj) { - this.feature = obj.feature; - this.layer = obj.layer; - this.url = obj.url; -} -gb.edit.RecordTransfer.prototype.getFeatureRecord = function() { - return this.feature; -}; -gb.edit.RecordTransfer.prototype.getLayerRecord = function() { - return this.layer; -}; -gb.edit.RecordTransfer.prototype.getPartStructure = function(savingLayer) { - var obj = {}; - // if (this.layer instanceof gb.edit.LayerRecord) { - // obj["layer"] = this.layer.getPartStructure(savingLayer); - // } - - if (this.feature instanceof gb.edit.FeatureRecord) { - obj["feature"] = this.feature.getPartStructure(savingLayer); - } - console.log(obj); - return obj; -}; - -gb.edit.RecordTransfer.prototype.getStructure = function() { - var obj = {}; - if (this.layer instanceof gb.edit.LayerRecord) { - obj["layer"] = this.layer.getStructure(); - } - - if (this.feature instanceof gb.edit.FeatureRecord) { - obj["feature"] = this.feature.getStructure(); - } - console.log(obj); - return obj; -}; -gb.edit.RecordTransfer.prototype.refresh = function(layer, editingTool) { - if (layer instanceof ol.layer.Group) { - var layers = layer.getLayers(); - for (var i = 0; i < layers.getLength(); i++) { - this.refresh(layers.item(i), editingTool); - } - } else if (layer instanceof ol.layer.Tile) { - var params = layer.getSource().getParams(); - params["time"] = Date.now(); - layer.getSource().updateParams(params); - layer.getSource().refresh(); - editingTool.removeFeatureFromUnmanaged(layer); - } -}; -gb.edit.RecordTransfer.prototype.sendStructure = function(ollayers, editingTool) { - var that = this; - var featureObj = this.getFeatureRecord(); - console.log(this.getStructure()); - $.ajax({ - url : this.url, - type : "POST", - data : JSON.stringify(this.getStructure()), - contentType : "application/json; charset=UTF-8", - dataType : 'json', - beforeSend : function() { - $("body").css("cursor", "wait"); - }, - complete : function() { - $("body").css("cursor", "default"); - }, - success : function(data) { - console.log(data); - featureObj.clearAll(); - for (var i = 0; i < ollayers.getLength(); i++) { - that.refresh(ollayers.item(i), editingTool); - } - } - }); -}; - -gb.edit.RecordTransfer.prototype.sendPartStructure = function(layers, ollayers, editingTool) { - console.log(this.getPartStructure(layers)); - var featureObj = this.getFeatureRecord(); - - $.ajax({ - url : this.url, - type : "POST", - data : JSON.stringify(this.getPartStructure(layers)), - contentType : "application/json; charset=UTF-8", - dataType : 'json', - beforeSend : function() { - $("body").css("cursor", "wait"); - }, - complete : function() { - $("body").css("cursor", "default"); - }, - success : function(data) { - console.log(data); - for (var i = 0; i < layers.length; i++) { - featureObj.removeByLayer(layers[i]); - } - for (var i = 0; i < ollayers.getLength(); i++) { - if (ollayers.item(i) instanceof ol.layer.Tile) { - var params = ollayers.item(i).getSource().getParams(); - params["time"] = Date.now(); - ollayers.item(i).getSource().updateParams(params); - ollayers.item(i).getSource().refresh(); - editingTool.removeFeatureFromUnmanaged(ollayers.item(i)); - } - } - } - }); -}; \ No newline at end of file diff --git a/opengds2018prod/src/main/resources/static/resources/js/gb/interaction/selectwms.js b/opengds2018prod/src/main/resources/static/resources/js/gb/interaction/selectwms.js deleted file mode 100644 index 9023435d..00000000 --- a/opengds2018prod/src/main/resources/static/resources/js/gb/interaction/selectwms.js +++ /dev/null @@ -1,347 +0,0 @@ -/** - * WMS레이어의 선택 위치의 피처를 요청한다. - * - * @param {ol.interaction.Select} - * select 연동할 실렉트 인터렉션 - * @param {ol.layer.Vector} - * destination 선택한 피처가 편입될 벡터레이어 - * @param {function || - * ol.layer.Tile} layer 선택한 레이어 또는 레이어를 반환할 함수 - */ -var gb; -if (!gb) - gb = {}; -if (!gb.interaction) - gb.interaction = {}; - -gb.interaction.SelectWMS = function(opt_options) { - var options = opt_options ? opt_options : {}; - this.map_ = null; - this.coordinate_ = null; - this.extent_ = null; - this.conLayer = options.layer ? options.layer : undefined; - this.layer = undefined; - this.source_ = new ol.source.Vector(); - this.features_ = new ol.Collection(); - this.select_ = options.select; - this.destination_ = options.destination ? options.destination : new ol.layer.Vector({ - source : this.source_ - }); - this.record = options.record; - ol.interaction.Interaction.call(this, { - handleEvent : gb.interaction.SelectWMS.prototype.handleEvent - }); - this.getFeature_ = options.getFeature ? options.getFeature : null; - this.getFeatureInfo_ = options.getFeatureInfo ? options.getFeatureInfo : null; -} -ol.inherits(gb.interaction.SelectWMS, ol.interaction.Interaction); - -gb.interaction.SelectWMS.prototype.handleEvent = function(evt) { - var that = this; - this.map_ = evt.map; - if (typeof this.conLayer === "function") { - this.layer = this.conLayer(); - } else if (this.conLayer instanceof ol.layer.Base) { - this.layer = this.conLayer; - } - if (evt.type === "singleclick") { - if (this.layer instanceof ol.layer.Vector) { - var lys = [ this.layer ]; - var layerFilter; - if (lys) { - if (typeof lys === 'function') { - layerFilter = lys; - } else { - var layers = lys; - layerFilter = function(layer) { - return ol.array.includes(lys, layer); - }; - } - } else { - layerFilter = ol.functions.TRUE; - } - - /** - * @private - * @type {function(ol.layer.Layer): boolean} - */ - this.select_.layerFilter_ = layerFilter; - - this.select_.handleEvent(evt); - } else if (this.layer instanceof ol.layer.Layer) { - var lys = [ this.destination_ ]; - var layerFilter; - if (lys) { - if (typeof lys === 'function') { - layerFilter = lys; - } else { - var layers = lys; - layerFilter = function(layer) { - return ol.array.includes(lys, layer); - }; - } - } else { - layerFilter = ol.functions.TRUE; - } - /** - * @private - * @type {function(ol.layer.Layer): boolean} - */ - this.select_.layerFilter_ = layerFilter; - - this.setCoordinate(evt); - } - } - return true; -}; - -gb.interaction.SelectWMS.prototype.getFeatures = function() { - return this.features_; -}; - -gb.interaction.SelectWMS.prototype.setExtent = function(extent) { - if (!this.getLayer().getVisible() || this.getLayer() instanceof ol.layer.Vector) { - return; - } - this.extent_ = extent; - var that = this; - var params; - if (that.layer instanceof ol.layer.Tile) { - params = { - "service" : "WFS", - "version" : gb.module.serviceVersion.WFS, - "request" : "GetFeature", - "typeName" : that.layer.getSource().getParams().LAYERS, - "outputformat" : "text/javascript", - "bbox" : extent.toString(), - "format_options" : "callback:getJson" - }; - } else if (that.layer instanceof ol.layer.Base && that.layer.get("git").hasOwnProperty("fake")) { - params = { - "service" : "WFS", - "version" : gb.module.serviceVersion.WFS, - "request" : "GetFeature", - "typeName" : that.layer.get("id"), - "outputformat" : "text/javascript", - "bbox" : extent.toString(), - "format_options" : "callback:getJson" - }; - } - console.log(extent); - var addr = this.getFeature_; - - $.ajax({ - url : addr, - data : params, - dataType : 'jsonp', - jsonpCallback : 'getJson', - beforeSend : function() { - $("body").css("cursor", "wait"); - }, - complete : function() { - $("body").css("cursor", "default"); - }, - success : function(data) { - that.features_.clear(); - var features = new ol.format.GeoJSON().readFeatures(JSON.stringify(data)); - - that.destination_.getSource().addFeatures(features); - that.destination_.setMap(that.map_); - that.select_.getFeatures().clear(); - - that.destination_.getSource().forEachFeatureIntersectingExtent(extent, function(feature) { - if (feature.getId().indexOf(that.layer.get("id")) !== -1 && !that.record.isRemoved(that.layer, feature)) { - that.select_.getFeatures().push(feature); - } - }); - } - }); -}; -gb.interaction.SelectWMS.prototype.setCoordinate = function(evt) { - if (!this.getLayer().getVisible() || this.getLayer() instanceof ol.layer.Vector) { - return; - } - var that = this; - this.coordinate_ = evt.coordinate; - var viewResolution = (this.map_.getView().getResolution()); - var wmsSource = new ol.source.TileWMS({ - url : this.getFeatureInfo_, - params : this.getLayer().getSource().getParams() - }); - var url = wmsSource.getGetFeatureInfoUrl(evt.coordinate, viewResolution, this.map_.getView().getProjection().getCode(), { - 'INFO_FORMAT' : 'text/javascript', - 'FORMAT_OPTIONS' : 'callback:getJson' - }); - if (url) { - this.getFeatureAJAX(url); - } -}; -gb.interaction.SelectWMS.prototype.setLayer = function(layer) { - this.layer = layer; -} -gb.interaction.SelectWMS.prototype.getLayer = function() { - return this.layer; -} -gb.interaction.SelectWMS.prototype.setFeatureId = function(fid) { - var that = this; - var params; - if (that.layer instanceof ol.layer.Tile) { - params = { - "service" : "WFS", - "version" : gb.module.serviceVersion.WFS, - "request" : "GetFeature", - "typeName" : this.layer.get("id"), - "outputformat" : "text/javascript", - "featureID" : fid, - "format_options" : "callback:getJson" - }; - } else if (that.layer instanceof ol.layer.Base && that.layer.get("git").hasOwnProperty("fake")) { - params = { - "service" : "WFS", - "version" : gb.module.serviceVersion.WFS, - "request" : "GetFeature", - "typeName" : this.layer.get("id"), - "outputformat" : "text/javascript", - "featureID" : fid, - "format_options" : "callback:getJson" - }; - } - - var addr = this.getFeature_; - - $.ajax({ - url : addr, - data : params, - dataType : 'jsonp', - jsonpCallback : 'getJson', - beforeSend : function() { - $("body").css("cursor", "wait"); - }, - complete : function() { - $("body").css("cursor", "default"); - }, - success : function(data) { - - that.features_.clear(); - var features = new ol.format.GeoJSON().readFeatures(JSON.stringify(data)); - var ids = []; - for (var i = 0; i < features.length; i++) { - ids.push(features[i].getId()); - } - that.destination_.getSource().addFeatures(features); - that.destination_.setMap(that.map_); - - console.log(that.select_.getFeatures()); - var vf = that.select_.getFeatures(); - for (var i = 0; i < vf.getLength(); i++) { - if (vf.item(i).getId().indexOf(that.layer.get("id")) !== -1) { - ids.push(vf.item(i).getId()); - } - } - that.select_.getFeatures().clear(); - - for (var i = 0; i < ids.length; i++) { - var f = that.destination_.getSource().getFeatureById(ids[i]); - if (f.getId().indexOf(that.layer.get("id")) !== -1 && !that.record.isRemoved(that.layer, f)) { - that.select_.getFeatures().push(f); - } - } - - // that.features_.clear(); - // var features = new - // ol.format.GeoJSON().readFeatures(JSON.stringify(data)); - // var ids = []; - // for (var i = 0; i < features.length; i++) { - // ids.push(features[i].getId()); - // } - // that.destination_.getSource().addFeatures(features); - // that.destination_.setMap(that.map_); - // - // var selFeatures = that.select_.getFeatures(); - // var cFeatures = []; - // for (var k = 0; k < selFeatures.getLength(); k++) { - // if (selFeatures.item(k).getId().search(that.layer.get("id") + - // ".new") !== -1) - // { - // cFeatures.push(selFeatures.item(k)); - // } else { - // if (!that.record.isRemoved(that.layer, selFeatures.item(k))) { - // cFeatures.push(selFeatures.item(k)); - // } - // } - // } - // that.select_.getFeatures().clear(); - // that.select_.getFeatures().extend(cFeatures); - // var newFeatures = []; - // for (var j = 0; j < ids.length; j++) { - // if (!that.record.isRemoved(that.layer, - // that.destination_.getSource().getFeatureById(ids[j]))) { - // newFeatures.push(that.destination_.getSource().getFeatureById(ids[j])); - // } - // } - // that.select_.getFeatures().extend(newFeatures); - } - }); -}; - -gb.interaction.SelectWMS.prototype.getFeatureAJAX = function(url) { - console.log(url); - console.log(url.substring(0, url.indexOf("?"))); - var ctrlr = url.substring(0, url.indexOf("?")); - var prm = url.substring(url.indexOf("?") + 1); - console.log(prm); - var QueryStringToJSON = function(str) { - var pairs = str.split('&'); - - var result = {}; - pairs.forEach(function(pair) { - pair = pair.split('='); - result[pair[0]] = decodeURIComponent(pair[1] || ''); - }); - - return JSON.parse(JSON.stringify(result)); - } - - console.log(QueryStringToJSON(prm)); - var that = this; - var params = QueryStringToJSON(prm); - $.ajax({ - url : ctrlr, - data : params, - dataType : 'jsonp', - jsonpCallback : 'getJson', - beforeSend : function() { - $("body").css("cursor", "wait"); - }, - complete : function() { - $("body").css("cursor", "default"); - }, - success : function(data) { - - that.features_.clear(); - var features = new ol.format.GeoJSON().readFeatures(JSON.stringify(data)); - var ids = []; - for (var i = 0; i < features.length; i++) { - ids.push(features[i].getId()); - } - that.destination_.getSource().addFeatures(features); - that.destination_.setMap(that.map_); - - console.log(that.select_.getFeatures()); - var vf = that.select_.getFeatures(); - for (var i = 0; i < vf.getLength(); i++) { - if (vf.item(i).getId().indexOf(that.layer.get("id")) !== -1) { - ids.push(vf.item(i).getId()); - } - } - that.select_.getFeatures().clear(); - - for (var i = 0; i < ids.length; i++) { - var f = that.destination_.getSource().getFeatureById(ids[i]); - if (f.getId().indexOf(that.layer.get("id")) !== -1 && !that.record.isRemoved(that.layer, f)) { - that.select_.getFeatures().push(f); - } - } - } - }); -} \ No newline at end of file diff --git a/opengds2018prod/src/main/resources/static/resources/js/gb/modal/createlayer.js b/opengds2018prod/src/main/resources/static/resources/js/gb/modal/createlayer.js deleted file mode 100644 index 464219fc..00000000 --- a/opengds2018prod/src/main/resources/static/resources/js/gb/modal/createlayer.js +++ /dev/null @@ -1,512 +0,0 @@ -/** - * 레이어 정보를 변경하는 객체를 정의한다. - * - * @author yijun.so - * @date 2017. 06. 16 - * @version 0.01 - */ -var gb; -if (!gb) - gb = {}; -if (!gb.geoserver) - gb.geoserver = {}; -gb.geoserver.CreateLayer = function(obj) { - var that = this; - var options = obj; - this.window; - this.url = options.URL ? options.URL : null; - this.format = undefined; - this.type = undefined; - this.refer = options.refer ? options.refer : undefined; - this.clientRefer = options.clientRefer ? options.clientRefer : undefined; - - var xSpan = $("").attr({ - "aria-hidden" : true - }).html("×"); - var xButton = $("