@@ -130,7 +130,7 @@ public class TableCache {
130130 //trend_mappings
131131 x = new TableTemplate ("trend_mappings" , "Trend Mappings" );
132132 x .keyColumn = "id" ;
133- x .otherColumns = "\" server_id\" ,\" name\" ,\" persistent_identifier\" ,\" retain_data\" " ;
133+ x .otherColumns = "\" server_id\" ,\" name\" ,\" persistent_identifier\" ,\" retain_data\" , \" field_access \" " ;
134134 x .query =
135135 "SELECT\n " +
136136 " \" x\" .\" id\" ,\n " +
@@ -139,6 +139,7 @@ public class TableCache {
139139 " \" x\" .\" name\" ,\n " +
140140 " \" x\" .\" persistent_identifier\" ,\n " +
141141 " \" x\" .\" retain_data\" ,\n " +
142+ " \" x\" .\" field_access\" ,\n " +
142143 " COALESCE(\" y\" .\" sample_count\" , 0) AS \" sample_count\" ,\n " +
143144 " COALESCE(DATE_TRUNC('seconds', \" y\" .\" first_sample\" AT TIME ZONE '" +timezone +"')::TEXT, 'N/A') AS \" first_sample\" ,\n " +
144145 " COALESCE(DATE_TRUNC('seconds', \" y\" .\" last_sample\" AT TIME ZONE '" +timezone +"')::TEXT, 'N/A') AS \" last_sample\" \n " +
@@ -158,14 +159,16 @@ public class TableCache {
158159 ") \" z\" \n " +
159160 "ON \" x\" .\" server_id\" = \" z\" .\" id\" \n " +
160161 "ORDER BY \" x\" .\" server_id\" ;" ;
161- x .header = "[\" Trend ID\" ,\" Server ID\" ,\" Server Name\" ,\" Name\" ,\" Persistent Identifier\" ,\" Retain Data (Days)\" ,\" Sample Count\" ,\" First Sample\" ,\" Last Sample\" ]," +
162- "[\" <READONLY>N/A\" ,\" ^\\ \\ d+$\" ,\" <READONLY>N/A\" ,\" ^.+$\" ,\" ^.+$\" ,\" ^\\ \\ d+$\" ,\" <READONLY>0\" ,\" <READONLY>N/A\" ,\" <READONLY>N/A\" ]" ;
162+ x .header = "[\" Trend ID\" ,\" Server ID\" ,\" Server Name\" ,\" Name\" ,\" Persistent Identifier\" ,\" Retain Data (Days)\" ,\" Field Access \" , \" Sample Count\" ,\" First Sample\" ,\" Last Sample\" ]," +
163+ "[\" <READONLY>N/A\" ,\" ^\\ \\ d+$\" ,\" <READONLY>N/A\" ,\" ^.+$\" ,\" ^.+$\" ,\" ^\\ \\ d+$\" ,\" ^true$|^false$ \" , \" <READONLY>0\" ,\" <READONLY>N/A\" ,\" <READONLY>N/A\" ]" ;
163164 x .conversion = new BiFunction <Integer ,String ,String >(){
164165 @ Override public String apply (Integer i , String s ){
165166 if (i ==0 ){
166167 return s .equalsIgnoreCase ("N/A" )?"DEFAULT" :String .valueOf (Integer .parseInt (s ));
167168 }else if (i ==1 || i ==4 ){
168169 return String .valueOf (Integer .parseInt (s ));
170+ }else if (i ==5 ){
171+ return s .equals ("1" ) || s .equalsIgnoreCase ("true" ) ? "TRUE" :"FALSE" ;
169172 }else {
170173 return Utility .escapePostgreSQL (s );
171174 }
0 commit comments