Alejandro Galue avatar Alejandro Galue committed 96c7bc9

Adding an asset record for country.

All the create.sql and database-schema.xml used on several packages have
been updated to support country and geolocation.

The AssetManagementMaintStrategy.jrxml has been updated to support
country and geolocation.

Comments (0)

Files changed (27)

core/schema/src/main/liquibase/1.11.4/changelog.xml

       </rollback>
     </changeSet>
 
+    <changeSet author="agalue" id="1.11.4-add-country-to-assets">
+      <addColumn tableName="assets">
+        <column name="country" type="varchar(32)" />
+      </addColumn>
+      <rollback>
+        <dropColumn tableName="assets" columnName="country" />
+      </rollback>
+    </changeSet>
+
 </databaseChangeLog>

core/test-api/db/src/main/resources/org/opennms/netmgt/config/test-database-schema.xml

 		<column name="managedobjectinstance"/>
 		<column name="managedobjecttype"/>
 		<column name="geolocation"/>
+		<column name="country"/>
 	</table>
 
 	<table name="applications">

opennms-base-assembly/src/main/filtered/etc/create.sql

         city            varchar(64),
         state           varchar(64),
         zip             varchar(64),
+        country         varchar(64),
         building        varchar(64),
         floor           varchar(64),
         room            varchar(64),

opennms-base-assembly/src/main/filtered/etc/database-schema.xml

 		<column name="city"/>
 		<column name="state"/>
 		<column name="zip"/>
+		<column name="country"/>
+		<column name="geolocation"/>
 		<column name="building"/>
 		<column name="floor"/>
 		<column name="room"/>

opennms-base-assembly/src/main/filtered/etc/report-templates/AssetManagementMaintStrategy.jrxml

 		<field name="city" class="java.lang.String"/>
 		<field name="state" class="java.lang.String"/>
 		<field name="zip" class="java.lang.String"/>
+		<field name="country" class="java.lang.String"/>
+		<field name="geolocation" class="java.lang.String"/>
 		<field name="building" class="java.lang.String"/>
 		<field name="floor" class="java.lang.String"/>
 		<field name="room" class="java.lang.String"/>

opennms-config/src/test/resources/etc/database-schema.xml

 		<column name="city"/>
 		<column name="state"/>
 		<column name="zip"/>
+		<column name="country"/>
+		<column name="geolocation"/>
 		<column name="building"/>
 		<column name="floor"/>
 		<column name="room"/>

opennms-correlation/drools-correlation-engine/src/test/opennms-home/etc/database-schema.xml

 		<column name="city"/>
 		<column name="state"/>
 		<column name="zip"/>
+		<column name="country"/>
+		<column name="geolocation"/>
 		<column name="building"/>
 		<column name="floor"/>
 		<column name="room"/>

opennms-correlation/opennms-correlator/src/test/opennms-home/etc/database-schema.xml

 		<column name="city"/>
 		<column name="state"/>
 		<column name="zip"/>
+		<column name="country"/>
+		<column name="geolocation"/>
 		<column name="building"/>
 		<column name="floor"/>
 		<column name="room"/>

opennms-dao/src/test/opennms-home/etc/database-schema.xml

 		<column name="city"/>
 		<column name="state"/>
 		<column name="zip"/>
+		<column name="country"/>
+		<column name="geolocation"/>
 		<column name="building"/>
 		<column name="floor"/>
 		<column name="room"/>

opennms-dao/src/test/resources/create.sql

         city            varchar(64),
         state           varchar(64),
         zip             varchar(64),
+        country         varchar(64),
         building        varchar(64),
         floor           varchar(64),
         room            varchar(64),

opennms-install/src/test/resources/etc/create.sql

         city            varchar(64),
         state           varchar(64),
         zip             varchar(64),
+        country         varchar(64),
         building        varchar(64),
         floor           varchar(64),
         room            varchar(64),

opennms-model/src/main/java/org/opennms/netmgt/model/OnmsAssetRecord.java

 
     @Deprecated
     public void setAddress1(final String address1) {
-        m_geolocation.setAddress1(address1);
+        if (m_geolocation != null)
+            m_geolocation.setAddress1(address1);
     }
 
     /**
 
     @Deprecated
     public void setAddress2(final String address2) {
-        m_geolocation.setAddress2(address2);
+        if (m_geolocation != null)
+            m_geolocation.setAddress2(address2);
     }
 
     /**
 
     @Deprecated
     public void setCity(final String city) {
-        m_geolocation.setCity(city);
+        if (m_geolocation != null)
+            m_geolocation.setCity(city);
     }
 
     /**
 
     @Deprecated
     public void setState(final String state) {
-        m_geolocation.setState(state);
+        if (m_geolocation != null)
+            m_geolocation.setState(state);
     }
 
     /**
 
     @Deprecated
     public void setZip(final String zip) {
-        m_geolocation.setZip(zip);
+        if (m_geolocation != null)
+            m_geolocation.setZip(zip);
+    }
+
+    /**
+     * PROXY METHOD: do not delete until {@link OnmsGeolocation} is truly a separate table, or projection mapping will fail.
+     */
+    @Transient
+    @Deprecated
+    @XmlElement
+    public String getCountry() {
+        return m_geolocation == null ? null : m_geolocation.getCountry();
+    }
+
+    @Deprecated
+    public void setCountry(final String country) {
+        if (m_geolocation != null)
+            m_geolocation.setCountry(country);
     }
 
     /**
 
     @Deprecated
     public void setCoordinates(final String coordinates) {
-        m_geolocation.setCoordinates(coordinates);
+        if (m_geolocation != null)
+            m_geolocation.setCoordinates(coordinates);
     }
 
     /**
     @Override
     public String toString() {
         return new ToStringCreator(this)
-                .append("category", getCategory())
-                .append("manufacturer", getManufacturer())
-                .append("vendor", getVendor())
-                .append("modelnumber", getModelNumber())
-                .append("serialnumber", getSerialNumber())
-                .append("description", getDescription())
-                .append("circuitid", getCircuitId())
-                .append("assetnumber", getAssetNumber())
-                .append("operatingsystem", getOperatingSystem())
-                .append("rack", getRack())
-                .append("slot", getSlot())
-                .append("port", getPort())
-                .append("region", getRegion())
-                .append("division", getDivision())
-                .append("department", getDepartment())
-                .append("address1", m_geolocation == null ? null : m_geolocation.getAddress1())
-                .append("address2", m_geolocation == null ? null : m_geolocation.getAddress2())
-                .append("city", m_geolocation == null ? null : m_geolocation.getCity())
-                .append("state", m_geolocation == null ? null : m_geolocation.getState())
-                .append("zip", m_geolocation == null ? null : m_geolocation.getZip())
-                .append("geolocation", m_geolocation == null ? null : m_geolocation.getCoordinates())
-                .append("building", getBuilding())
-                .append("floor", getFloor())
-                .append("room", getRoom())
-                .append("username", getUsername())
-                .append("password", getPassword())
-                .append("enable", getEnable())
-                .append("autoenable", getAutoenable())
-                .append("connection", getConnection())
-                .append("vendorphone", getVendorPhone())
-                .append("vendorfax", getVendorFax())
-                .append("vendorassetnumber", getVendorAssetNumber())
-                .append("userlastmodified", getLastModifiedBy())
-                .append("lastmodifieddate", getLastModifiedDate())
-                .append("dateinstalled", getDateInstalled())
-                .append("lease", getLease())
-                .append("leaseexpires", getLeaseExpires())
-                .append("supportphone", getSupportPhone())
-                .append("maintcontract", getMaintcontract())
-                .append("maintcontractexpires", getMaintContractExpiration())
-                .append("displaycategory", getDisplayCategory())
-                .append("notifycategory", getNotifyCategory())
-                .append("pollercategory", getPollerCategory())
-                .append("thresholdcategory", getThresholdCategory())
-                .append("comment", getComment())
-                .append("cpu", getCpu())
-                .append("ram", getRam())
-                .append("storagectrl", getStoragectrl())
-                .append("hdd1", getHdd1())
-                .append("hdd2", getHdd2())
-                .append("hdd3", getHdd3())
-                .append("hdd4", getHdd4())
-                .append("hdd5", getHdd5())
-                .append("hdd6", getHdd6())
-                .append("numpowersupplies", getNumpowersupplies())
-                .append("inputpower", getInputpower())
-                .append("additionalhardware", getAdditionalhardware())
-                .append("admin", getAdmin())
-                .append("snmpcommunity", getSnmpcommunity())
-                .append("rackunitheight", getRackunitheight())
-                .append("vmwareManagedObjectId", getVmwareManagedObjectId())
-                .append("vmwareManagedEntityType", getVmwareManagedEntityType())
-                .append("vmwareManagementServer", getVmwareManagementServer())
-                .append("vmwareTopologyInfo", getVmwareTopologyInfo())
-                .append("vmwareState", getVmwareState()).toString();
+        .append("category", getCategory())
+        .append("manufacturer", getManufacturer())
+        .append("vendor", getVendor())
+        .append("modelnumber", getModelNumber())
+        .append("serialnumber", getSerialNumber())
+        .append("description", getDescription())
+        .append("circuitid", getCircuitId())
+        .append("assetnumber", getAssetNumber())
+        .append("operatingsystem", getOperatingSystem())
+        .append("rack", getRack())
+        .append("slot", getSlot())
+        .append("port", getPort())
+        .append("region", getRegion())
+        .append("division", getDivision())
+        .append("department", getDepartment())
+        .append("address1", m_geolocation == null ? null : m_geolocation.getAddress1())
+        .append("address2", m_geolocation == null ? null : m_geolocation.getAddress2())
+        .append("city", m_geolocation == null ? null : m_geolocation.getCity())
+        .append("state", m_geolocation == null ? null : m_geolocation.getState())
+        .append("zip", m_geolocation == null ? null : m_geolocation.getZip())
+        .append("country", m_geolocation == null ? null : m_geolocation.getCountry())
+        .append("geolocation", m_geolocation == null ? null : m_geolocation.getCoordinates())
+        .append("building", getBuilding())
+        .append("floor", getFloor())
+        .append("room", getRoom())
+        .append("username", getUsername())
+        .append("password", getPassword())
+        .append("enable", getEnable())
+        .append("autoenable", getAutoenable())
+        .append("connection", getConnection())
+        .append("vendorphone", getVendorPhone())
+        .append("vendorfax", getVendorFax())
+        .append("vendorassetnumber", getVendorAssetNumber())
+        .append("userlastmodified", getLastModifiedBy())
+        .append("lastmodifieddate", getLastModifiedDate())
+        .append("dateinstalled", getDateInstalled())
+        .append("lease", getLease())
+        .append("leaseexpires", getLeaseExpires())
+        .append("supportphone", getSupportPhone())
+        .append("maintcontract", getMaintcontract())
+        .append("maintcontractexpires", getMaintContractExpiration())
+        .append("displaycategory", getDisplayCategory())
+        .append("notifycategory", getNotifyCategory())
+        .append("pollercategory", getPollerCategory())
+        .append("thresholdcategory", getThresholdCategory())
+        .append("comment", getComment())
+        .append("cpu", getCpu())
+        .append("ram", getRam())
+        .append("storagectrl", getStoragectrl())
+        .append("hdd1", getHdd1())
+        .append("hdd2", getHdd2())
+        .append("hdd3", getHdd3())
+        .append("hdd4", getHdd4())
+        .append("hdd5", getHdd5())
+        .append("hdd6", getHdd6())
+        .append("numpowersupplies", getNumpowersupplies())
+        .append("inputpower", getInputpower())
+        .append("additionalhardware", getAdditionalhardware())
+        .append("admin", getAdmin())
+        .append("snmpcommunity", getSnmpcommunity())
+        .append("rackunitheight", getRackunitheight())
+        .append("vmwareManagedObjectId", getVmwareManagedObjectId())
+        .append("vmwareManagedEntityType", getVmwareManagedEntityType())
+        .append("vmwareManagementServer", getVmwareManagementServer())
+        .append("vmwareTopologyInfo", getVmwareTopologyInfo())
+        .append("vmwareState", getVmwareState()).toString();
     }
 
     /**

opennms-model/src/main/java/org/opennms/netmgt/model/OnmsGeolocation.java

     private String m_city;
     private String m_state;
     private String m_zip;
+    private String m_country;
     private String m_coordinates;
 
     /**
     public void setZip(String zip) {
         m_zip = zip;
     }
-    
+
+    /**
+     *--# country              : The country where this asset resides.
+     *
+     * @return a {@link java.lang.String} object.
+     */
+    @Column(name="country", length=64)
+    public String getCountry() {
+        return m_country;
+    }
+
+    /**
+     * <p>setCountry</p>
+     *
+     * @param country a {@link java.lang.String} object.
+     */
+    public void setCountry(String country) {
+        m_country = country;
+    }
+
     @Column(name="geolocation", length=32)
     public String getCoordinates() {
         return m_coordinates;
         if (sb.length() > 0 && this.getCity() != null) sb.append(", ").append(this.getCity());
         if (sb.length() > 0 && this.getState() != null) sb.append(", ").append(this.getState());
         if (sb.length() > 0 && this.getZip() != null) sb.append(" ").append(this.getZip());
+        if (sb.length() > 0 && this.getCountry() != null) sb.append(", ").append(this.getCountry());
 
         return sb.toString();
     }

opennms-reporting/src/test/opennms-home/etc/database-schema.xml

 		<column name="city"/>
 		<column name="state"/>
 		<column name="zip"/>
+		<column name="country"/>
+		<column name="geolocation"/>
 		<column name="building"/>
 		<column name="floor"/>
 		<column name="room"/>

opennms-services/src/test/resources/etc/database-schema.xml

 		<column name="city"/>
 		<column name="state"/>
 		<column name="zip"/>
+		<column name="country"/>
+		<column name="geolocation"/>
 		<column name="building"/>
 		<column name="floor"/>
 		<column name="room"/>

opennms-webapp/src/main/java/org/opennms/gwt/web/ui/asset/client/AssetPageConstants.java

     @Key("zipHelp")
     String zipHelp();
 
+    @DefaultStringValue("Country")
+    @Key("country")
+    String country();
+
+    @DefaultStringValue("Country")
+    @Key("countryHelp")
+    String countryHelp();
+
     /* VMware asset fields */
     @DefaultStringValue("VMware")
     @Key("vmwareHeader")

opennms-webapp/src/main/java/org/opennms/gwt/web/ui/asset/client/AssetPageConstants_de.properties

 city = Stadt
 state = Staat
 zip = Postleitzahl
+country = Land
 coordinates = Koordinaten
 building = Gebäude
 floor = Stockwerk

opennms-webapp/src/main/java/org/opennms/gwt/web/ui/asset/client/view/AssetNodePage.ui.xml

 						name="{con.city}" value="" helpText="{con.cityHelp}" maxLength="64" />
 					<onms_fs:FieldSetSuggestBox ui:field="sZip"
 						name="{con.zip}" value="" helpText="{con.zipHelp}" maxLength="64" />
+					<onms_fs:FieldSetSuggestBox ui:field="sCountry"
+						name="{con.country}" value="" helpText="{con.countryHelp}" maxLength="64" />
 					<onms_fs:FieldSetSuggestBox ui:field="sCoordinates"
 						name="{con.coordinates}" value="" helpText="{con.coordinatesHelp}"
 						maxLength="32" />

opennms-webapp/src/main/java/org/opennms/gwt/web/ui/asset/client/view/AssetNodePageImpl.java

     @UiField
     FieldSetSuggestBox sZip;
     @UiField
+    FieldSetSuggestBox sCountry;
+    @UiField
     FieldSetSuggestBox sCoordinates;
     @UiField
     FieldSetSuggestBox sBuilding;
         fieldSetList.add(sCity);
         fieldSetList.add(sState);
         fieldSetList.add(sZip);
+        fieldSetList.add(sCountry);
         fieldSetList.add(sCoordinates);
         fieldSetList.add(sBuilding);
         fieldSetList.add(sFloor);
         m_asset.setCity(sCity.getValue());
         m_asset.setState(sState.getValue());
         m_asset.setZip(sZip.getValue());
+        m_asset.setCountry(sCountry.getValue());
         m_asset.setCoordinates(sCoordinates.getValue());
         m_asset.setBuilding(sBuilding.getValue());
         m_asset.setFloor(sFloor.getValue());
         sCity.setValue(asset.getCity());
         sState.setValue(asset.getState());
         sZip.setValue(asset.getZip());
+        sCountry.setValue(asset.getCountry());
         sCoordinates.setValue(asset.getCoordinates());
         sBuilding.setValue(asset.getBuilding());
         sFloor.setValue(asset.getFloor());
         sCity.setSuggestions(assetSugg.getCity());
         sState.setSuggestions(assetSugg.getState());
         sZip.setSuggestions(assetSugg.getZip());
+        sCountry.setSuggestions(assetSugg.getCountry());
         sCoordinates.setSuggestions(assetSugg.getCoordinates());
         sBuilding.setSuggestions(assetSugg.getBuilding());
         sFloor.setSuggestions(assetSugg.getFloor());

opennms-webapp/src/main/java/org/opennms/gwt/web/ui/asset/server/AssetServiceImpl.java

             suggestion.addCategory(asset.getCategory());
             suggestion.addCircuitId(asset.getCircuitId());
             suggestion.addCity(asset.getGeolocation().getCity());
+            suggestion.addCoordinates(asset.getGeolocation().getCoordinates());
+            suggestion.addCountry(asset.getGeolocation().getCountry());
             suggestion.addCpu(asset.getCpu());
             suggestion.addDepartment(asset.getDepartment());
             suggestion.addDescription(asset.getDescription());
             suggestion.addVendorFax(asset.getVendorFax());
             suggestion.addVendorPhone(asset.getVendorPhone());
             suggestion.addZip(asset.getGeolocation().getZip());
-            suggestion.addCoordinates(asset.getGeolocation().getCoordinates());
 
             // VMware monitoring assets
             suggestion.addVmwareManagedObjectId(asset.getVmwareManagedObjectId());

opennms-webapp/src/main/java/org/opennms/gwt/web/ui/asset/shared/AssetCommand.java

 
     private String m_coordinates;
 
+    private String m_country;
+
     private String m_cpu;
 
     private String m_dateInstalled;
         return m_coordinates;
     }
 
+    public String getCountry() {
+        return m_country;
+    }
+
     public String getCpu() {
         return m_cpu;
     }
         m_coordinates = coordinates;
     }
 
+    public void setCountry(String country) {
+        m_country = country;
+    }
+
     public void setCpu(String cpu) {
         m_cpu = cpu;
     }
                 + ", m_connectionOptions=" + m_connectionOptions + ", m_cpu=" + m_cpu + ", m_dateInstalled="
                 + m_dateInstalled + ", m_department=" + m_department + ", m_description=" + m_description
                 + ", m_displayCategory=" + m_displayCategory + ", m_division=" + m_division + ", m_enable=" + m_enable
-                + ", m_floor=" + m_floor + ", m_coordinates=" + m_coordinates + ", m_hdd1=" + m_hdd1
-                + ", m_hdd2=" + m_hdd2 + ", m_hdd3=" + m_hdd3
+                + ", m_floor=" + m_floor + ", m_coordinates=" + m_coordinates + ", m_country=" + m_country
+                + ", m_hdd1=" + m_hdd1 + ", m_hdd2=" + m_hdd2 + ", m_hdd3=" + m_hdd3
                 + ", m_hdd4=" + m_hdd4 + ", m_hdd5=" + m_hdd5 + ", m_hdd6=" + m_hdd6 + ", m_id=" + m_id
                 + ", m_inputpower=" + m_inputpower + ", m_lastModifiedBy=" + m_lastModifiedBy + ", m_lastModifiedDate="
                 + m_lastModifiedDate + ", m_lease=" + m_lease + ", m_leaseExpires=" + m_leaseExpires

opennms-webapp/src/main/java/org/opennms/gwt/web/ui/asset/shared/AssetSuggCommand.java

 
     private Set<String> m_city;
 
+    private Set<String> m_country;
+
     private Set<String> m_cpu;
 
     private Set<String> m_department;
         m_circuitId = new TreeSet<String>();
         m_city = new TreeSet<String>();
         m_cpu = new TreeSet<String>();
+        m_country = new TreeSet<String>();
         m_department = new TreeSet<String>();
         m_description = new TreeSet<String>();
         m_displayCategory = new TreeSet<String>();
         }
     }
 
+    public void addCountry(String country) {
+        if ((country != null) && !"".equals(country)) {
+            m_country.add(country);
+        }
+    }
+
     public void addDepartment(String department) {
         if ((department != null) && !"".equals(department)) {
             m_department.add(department);
         return m_city;
     }
 
+    public Collection<String> getCountry() {
+        return m_country;
+    }
+
     public Collection<String> getCpu() {
         return m_cpu;
     }

opennms-webapp/src/main/java/org/opennms/web/asset/Asset.java

 
     protected String zip = "";
 
+    protected String country = "";
+
     protected String geolocation = "";
 
     protected String building = "";
     }
 
     /**
-     * <p>Getter for the field <code>coordinates</code>.</p>
+     * <p>Getter for the field <code>zip</code>.</p>
      *
      * @return a {@link java.lang.String} object.
      */
-    public String getGeolocation() {
-        return (this.geolocation);
+    public String getZip() {
+        return (this.zip);
+    }
+
+    /**
+     * <p>Setter for the field <code>country</code>.</p>
+     *
+     * @param country a {@link java.lang.String} object.
+     */
+    public void setCountry(String country) {
+        if (country != null) {
+            this.country = country;
+        } else {
+            this.country = "";
+        }
+    }
+
+    /**
+     * <p>Getter for the field <code>country</code>.</p>
+     *
+     * @return a {@link java.lang.String} object.
+     */
+    public String getCountry() {
+        return (this.country);
     }
 
     /**
     }
 
     /**
-     * <p>Getter for the field <code>zip</code>.</p>
+     * <p>Getter for the field <code>geolocation</code>.</p>
      *
      * @return a {@link java.lang.String} object.
      */
-    public String getZip() {
-        return (this.zip);
+    public String getGeolocation() {
+        return (this.geolocation);
     }
 
     /**
         builder.append(state);
         builder.append(", zip=");
         builder.append(zip);
+        builder.append(", country=");
+        builder.append(country);
+        builder.append(", geolocation=");
+        builder.append(geolocation);
         builder.append(", building=");
         builder.append(building);
         builder.append(", floor=");

opennms-webapp/src/main/java/org/opennms/web/asset/AssetModel.java

             Connection conn = Vault.getDbConnection();
             d.watch(conn);
 
-            PreparedStatement stmt = conn.prepareStatement("INSERT INTO ASSETS (nodeID,category,manufacturer,vendor,modelNumber,serialNumber,description,circuitId,assetNumber,operatingSystem,rack,slot,port,region,division,department,address1,address2,city,state,zip,building,floor,room,vendorPhone,vendorFax,userLastModified,lastModifiedDate,dateInstalled,lease,leaseExpires,supportPhone,maintContract,vendorAssetNumber,maintContractExpires,displayCategory,notifyCategory,pollerCategory,thresholdCategory,comment,username,password,enable,connection,autoenable,cpu,ram,storagectrl,hdd1,hdd2,hdd3,hdd4,hdd5,hdd6,numpowersupplies,inputpower,additionalhardware,admin,snmpcommunity,rackunitheight,geolocation) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
+            PreparedStatement stmt = conn.prepareStatement("INSERT INTO ASSETS (nodeID,category,manufacturer,vendor,modelNumber,serialNumber,description,circuitId,assetNumber,operatingSystem,rack,slot,port,region,division,department,address1,address2,city,state,zip,building,floor,room,vendorPhone,vendorFax,userLastModified,lastModifiedDate,dateInstalled,lease,leaseExpires,supportPhone,maintContract,vendorAssetNumber,maintContractExpires,displayCategory,notifyCategory,pollerCategory,thresholdCategory,comment,username,password,enable,connection,autoenable,cpu,ram,storagectrl,hdd1,hdd2,hdd3,hdd4,hdd5,hdd6,numpowersupplies,inputpower,additionalhardware,admin,snmpcommunity,rackunitheight,geolocation,country) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
             d.watch(stmt);
             stmt.setInt(1, asset.nodeId);
             stmt.setString(2, asset.category);
             stmt.setString(59, asset.snmpcommunity);
             stmt.setString(60, asset.rackunitheight);
             stmt.setString(61, asset.geolocation);
+            stmt.setString(62, asset.country);
 
             stmt.execute();
         } finally {
             Connection conn = Vault.getDbConnection();
             d.watch(conn);
 
-            PreparedStatement stmt = conn.prepareStatement("UPDATE ASSETS SET category=?,manufacturer=?,vendor=?,modelNumber=?,serialNumber=?,description=?,circuitId=?,assetNumber=?,operatingSystem=?,rack=?,slot=?,port=?,region=?,division=?,department=?,address1=?,address2=?,city=?,state=?,zip=?,building=?,floor=?,room=?,vendorPhone=?,vendorFax=?,userLastModified=?,lastModifiedDate=?,dateInstalled=?,lease=?,leaseExpires=?,supportPhone=?,maintContract=?,vendorAssetNumber=?,maintContractExpires=?,displayCategory=?,notifyCategory=?,pollerCategory=?,thresholdCategory=?,comment=?, username=?, password=?,enable=?,connection=?,autoenable=?,cpu=?,ram=?,storagectrl=?,hdd1=?,hdd2=?,hdd3=?,hdd4=?,hdd5=?,hdd6=?,numpowersupplies=?,inputpower=?,additionalhardware=?,admin=?,snmpcommunity=?,rackunitheight=?,geolocation=? WHERE nodeid=?");
+            PreparedStatement stmt = conn.prepareStatement("UPDATE ASSETS SET category=?,manufacturer=?,vendor=?,modelNumber=?,serialNumber=?,description=?,circuitId=?,assetNumber=?,operatingSystem=?,rack=?,slot=?,port=?,region=?,division=?,department=?,address1=?,address2=?,city=?,state=?,zip=?,building=?,floor=?,room=?,vendorPhone=?,vendorFax=?,userLastModified=?,lastModifiedDate=?,dateInstalled=?,lease=?,leaseExpires=?,supportPhone=?,maintContract=?,vendorAssetNumber=?,maintContractExpires=?,displayCategory=?,notifyCategory=?,pollerCategory=?,thresholdCategory=?,comment=?, username=?, password=?,enable=?,connection=?,autoenable=?,cpu=?,ram=?,storagectrl=?,hdd1=?,hdd2=?,hdd3=?,hdd4=?,hdd5=?,hdd6=?,numpowersupplies=?,inputpower=?,additionalhardware=?,admin=?,snmpcommunity=?,rackunitheight=?,geolocation=?,country=? WHERE nodeid=?");
             d.watch(stmt);
             stmt.setString(1, asset.category);
             stmt.setString(2, asset.manufacturer);
             stmt.setString(58, asset.snmpcommunity);
             stmt.setString(59, asset.rackunitheight);
             stmt.setString(60, asset.geolocation);
-            stmt.setInt(61, asset.nodeId);
+            stmt.setString(61, asset.country);
+            stmt.setInt(62, asset.nodeId);
 
             stmt.execute();
         } finally {
             asset.setSnmpcommunity(rs.getString("snmpcommunity"));
             asset.setRackunitheight(rs.getString("rackunitheight"));
             asset.setGeolocation(rs.getString("geolocation"));
+            asset.setCountry(rs.getString("country"));
 
             // Convert from java.sql.Timestamp to java.util.Date, since it looks more pretty or something
             asset.lastModifiedDate = new Date(rs.getTimestamp("lastModifiedDate").getTime());
         new String[] { "Admin", "admin" },
         new String[] { "SNMP community", "snmpcommunity" },
 	new String[] { "Rack unit height", "rackunitheight" },
-        new String[] { "GeoLocation coordinates", "geolocation" }
+        new String[] { "GeoLocation coordinates", "geolocation" },
+        new String[] { "Country", "country" }
     };
 }

opennms-webapp/src/main/java/org/opennms/web/asset/ExportAssetsServlet.java

                 "City",
                 "State",
                 "Zip",
+                "Country",
+                "Geolocation",
                 "Building",
                 "Floor",
                 "Room",
             entries.add(asset.getCity());
             entries.add(asset.getState());
             entries.add(asset.getZip());
+            entries.add(asset.getCountry());
+            entries.add(asset.getGeolocation());
             entries.add(asset.getBuilding());
             entries.add(asset.getFloor());
             entries.add(asset.getRoom());

opennms-webapp/src/main/java/org/opennms/web/asset/ModifyAssetServlet.java

         asset.setCity(getRequestParameter(request, "city"));
         asset.setState(getRequestParameter(request, "state"));
         asset.setZip(getRequestParameter(request, "zip"));
+        asset.setCountry(getRequestParameter(request, "country"));
+        asset.setGeolocation(getRequestParameter(request, "geolocation"));
         asset.setBuilding(getRequestParameter(request, "building"));
         asset.setFloor(getRequestParameter(request, "floor"));
         asset.setRoom(getRequestParameter(request, "room"));

opennms-webapp/src/test/opennms-home/etc/database-schema.xml

 		<column name="city"/>
 		<column name="state"/>
 		<column name="zip"/>
+		<column name="country"/>
+		<column name="geolocation"/>
 		<column name="building"/>
 		<column name="floor"/>
 		<column name="room"/>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.