Package com.gi.engine.server.service

Examples of com.gi.engine.server.service.MapServiceDesc


      jListLevelsModel.removeElement(items[i]);
    }
  }

  public void loadMapServiceDesc(MapServiceDescFile mapServiceDescFile) {
    MapServiceDesc desc = (MapServiceDesc) mapServiceDescFile.open();

    if (desc != null) {
      this.jCheckBoxAutoStart.setSelected(desc.isAutoStart());
      this.jCheckBoxNeedToken.setSelected(desc.isNeedToken());
      this.jTextFieldMinInstances.setText(String.valueOf(desc
          .getMinInstances()));
      this.jTextFieldMaxInstances.setText(String.valueOf(desc
          .getMaxInstances()));
      this.jTextFieldTimeout.setText(String.valueOf(desc.getTimeout()));
      this.jTextFieldMaxResults.setText(String.valueOf(desc
          .getMaxResults()));
      this.jTextFieldDPI.setText(String.valueOf(desc.getDpi()));
      this.jTextFieldOutputDir.setText(desc.getOutputDir());
      this.jCheckBoxUseTile.setSelected(desc.isUseTile());
      TileInfo tileInfo = desc.getTileInfo();
      if (tileInfo != null) {
        this.jTextFieldTileDir.setText(tileInfo.getTilesDir());
        this.jCheckBoxCreateOnDemand.setSelected(tileInfo
            .isCreateOnDemand());
        this.jCheckBoxReadCompact.setSelected(tileInfo
View Full Code Here


    }
  }

  private void saveMapServiceDesc() {
    try {
      MapServiceDesc desc = new MapServiceDesc();
      String password = this.jTextFieldPassword.getText();
      if (password != null && !"".equals(password)) {
        desc.setPassword(PasswordUtil.base64md5password(password));
      } else {
        desc.setPassword("");
      }
      desc.setAutoStart(this.jCheckBoxAutoStart.isSelected());
      desc.setNeedToken(this.jCheckBoxNeedToken.isSelected());
      desc.setMinInstances(Integer.valueOf(this.jTextFieldMinInstances
          .getText()));
      desc.setMaxInstances(Integer.valueOf(this.jTextFieldMaxInstances
          .getText()));
      desc.setTimeout(Integer.valueOf(this.jTextFieldTimeout.getText()));
      desc.setMaxResults(Integer.valueOf(this.jTextFieldMaxResults
          .getText()));
      desc.setDpi(Integer.valueOf(this.jTextFieldDPI.getText()));
      desc.setOutputDir(this.jTextFieldOutputDir.getText());
      desc.setUseTile(this.jCheckBoxUseTile.isSelected());
      if (this.jCheckBoxUseTile.isSelected()) {
        TileInfo tileInfo = new TileInfo();
        tileInfo.setTilesDir(this.jTextFieldTileDir.getText());
        tileInfo.setCreateOnDemand(this.jCheckBoxCreateOnDemand
            .isSelected());
        tileInfo.setReadCompact(this.jCheckBoxReadCompact
            .isSelected());
        tileInfo.setFormat(this.jComboBoxFormat.getSelectedItem()
            .toString());
        tileInfo.setOriginX(Double.valueOf(this.jTextFieldOriginX
            .getText()));
        tileInfo.setOriginY(Double.valueOf(this.jTextFieldOriginY
            .getText()));
        tileInfo.setWidth(Integer.valueOf(this.jTextFieldWidth
            .getText()));
        tileInfo.setHeight(Integer.valueOf(this.jTextFieldHeight
            .getText()));
        for (int i = 0, count = jListLevelsModel.getSize(); i < count; i++) {
          LodItem item = (LodItem) jListLevelsModel.getElementAt(i);
          TileLodInfo tileLodInfo = item.getTileLodInfo();
          tileLodInfo.setLevel(i);
          tileInfo.addTileLodInfo(tileLodInfo);
        }

        desc.setTileInfo(tileInfo);
      }

      MapServiceDescFile mapServiceDescFile = new MapServiceDescFile(app
          .getMapServiceDescFilePath());
      if (mapServiceDescFile.save(desc)) {
View Full Code Here

    try {
      MapService mapService = ServiceManager.getMapService(serviceName);

      if (mapService != null) {
        MapServiceDesc mapServiceDesc = mapService.getMapServiceDesc();
        if (mapServiceDesc.isNeedToken()) {
          boolean htmlNoParams = "html".equals(f) && adds == null
              && updates == null && deletes == null;
          if (!TokenService.verifyToken(token) && !htmlNoParams) {
            return TokenService.TOKEN_INVALID_TIP;
          }
View Full Code Here

    try {
      MapService mapService = ServiceManager.getMapService(serviceName);

      if (mapService != null) {
        MapServiceDesc mapServiceDesc = mapService.getMapServiceDesc();
        if (mapServiceDesc.isNeedToken()) {
          if (!TokenService.verifyToken(token)
              && !("html".equals(f) && features == null)) {
            return TokenService.TOKEN_INVALID_TIP;
          }
        }
View Full Code Here

    try {
      MapService mapService = ServiceManager.getMapService(serviceName);

      if (mapService != null) {
        MapDesc mapDesc = mapService.getMapDesc();
        MapServiceDesc mapServiceDesc = mapService.getMapServiceDesc();
        if (mapServiceDesc.isNeedToken()) {
          boolean htmlNoParams = "html".equals(f)
              && objectIds == null && geometry == null
              && geometryType == null && inSR == null
              && spatialRel == null && where == null
              && outFields == null && outSR == null;
View Full Code Here

    try {
      MapService mapService = ServiceManager.getMapService(serviceName);

      if (mapService != null) {
        MapDesc mapDesc = mapService.getMapDesc();
        MapServiceDesc mapServiceDesc = mapService.getMapServiceDesc();
        if (mapServiceDesc.isNeedToken()) {
          if (!TokenService.verifyToken(token)
              && !("html".equals(f) && searchText == null)) {
            return TokenService.TOKEN_INVALID_TIP;
          }
        }
View Full Code Here

    try {
      MapService mapService = ServiceManager.getMapService(serviceName);

      if (mapService != null) {
        MapServiceDesc mapServiceDesc = mapService.getMapServiceDesc();
        if (mapServiceDesc.isNeedToken()) {
          if (!TokenService.verifyToken(token)) {
            return TokenService.TOKEN_INVALID_TIP.getBytes();
          }
        }

        // Handle level, row, col
        // col may contains suffix
        if (col.contains(".")) {
          col = col.substring(0, col.indexOf("."));
        }
        int nLevel = Integer.parseInt(level);
        int nRow = Integer.parseInt(row);
        int nCol = Integer.parseInt(col);

        // Handle export
        MapServiceInstance instance = (MapServiceInstance) mapService
            .getMapServicePool().checkoutIdleInstance();
        try {
          if (mapServiceDesc.getTileInfo().isCreateOnDemand()) {
            result = instance.getOrCreateTile(nLevel, nRow, nCol);
          } else {
            result = instance.getTile(nLevel, nRow, nCol);
          }
        } finally {
View Full Code Here

    try {
      MapService mapService = ServiceManager.getMapService(serviceName);

      if (mapService != null) {
        MapDesc mapDesc = mapService.getMapDesc();
        MapServiceDesc mapServiceDesc = mapService.getMapServiceDesc();
        if (mapServiceDesc.isNeedToken()) {
          if (!TokenService.verifyToken(token)
              && !("html".equals(f) && bbox == null)) {
            return TokenService.TOKEN_INVALID_TIP.getBytes();
          }
        }
View Full Code Here

TOP

Related Classes of com.gi.engine.server.service.MapServiceDesc

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.