Skip to content

Commit

Permalink
Merge pull request #87 from kartverket/version1.2_dev
Browse files Browse the repository at this point in the history
Version1.2 dev
  • Loading branch information
Jarle Pedersen authored Oct 28, 2018
2 parents 58307fa + 8d82a0f commit dedc91e
Show file tree
Hide file tree
Showing 1,502 changed files with 112,019 additions and 214,831 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</td>
<td width="60%">
<asp:Label ID="Label2" runat="server" CssClass="HeaderText"
Text="Geosynkronisering Administrator"></asp:Label>
Text="Geosynkronisering Administrator 1.2"></asp:Label>
</td>
<td width="20%">
&nbsp;</td>
Expand Down Expand Up @@ -162,14 +162,9 @@
<asp:BoundField DataField="TargetNamespacePrefix" HeaderText="TargetNamespacePrefix"
SortExpression="TargetNamespacePrefix" />
<asp:BoundField DataField="Version" HeaderText="Version" SortExpression="Version" />
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True"
ShowInsertButton="True" ButtonType="Image"
CancelImageUrl="~/Images/Edit_UndoHS.png" CancelText="Avbryt"
DeleteImageUrl="~/Images/delete_12x12.png" DeleteText="Slett"
EditImageUrl="~/Images/EditTableHS.png" EditText="Rediger"
InsertText="Lagre" NewImageUrl="~/Images/AddTableHS.png" NewText="Ny"
SelectText="Velg" UpdateImageUrl="~/Images/saveHS.png" UpdateText="Lagre"
InsertImageUrl="~/Images/saveHS.png" />
<asp:BoundField DataField="Tolerance" HeaderText="Tolerance" />
<asp:BoundField DataField="Decimals" HeaderText="Decimals" />
<asp:CommandField ButtonType="Image" CancelImageUrl="~/Images/Edit_UndoHS.png" CancelText="Avbryt" DeleteImageUrl="~/Images/delete_12x12.png" DeleteText="Slett" EditImageUrl="~/Images/EditTableHS.png" EditText="Rediger" InsertImageUrl="~/Images/saveHS.png" InsertText="Lagre" NewImageUrl="~/Images/AddTableHS.png" NewText="Ny" SelectText="Velg" ShowDeleteButton="True" ShowEditButton="True" ShowInsertButton="True" UpdateImageUrl="~/Images/saveHS.png" UpdateText="Lagre" />
</Fields>
<InsertRowStyle CssClass="GridView" />
<PagerSettings Mode="NextPreviousFirstLast" Position="Bottom" Visible="true" />
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public XElement GetFeatureCollectionFromWFS(string nsPrefixTargetNamespace, stri
catch (System.Exception exp)
{
//20130821-Leg:Added logging of wfsGetFeatureDocument
logger.ErrorException("GetFeatureCollectionFromWFS: wfsGetFeatureDocument:" + wfsGetFeatureDocument.ToString() + "\r\n" + "GetFeatureCollectionFromWFS function failed:", exp);
logger.Error(exp, "GetFeatureCollectionFromWFS: wfsGetFeatureDocument:" + wfsGetFeatureDocument.ToString() + "\r\n" + "GetFeatureCollectionFromWFS function failed:");
throw new System.Exception("GetFeatureCollectionFromWFS function failed", exp);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public override string GetLastIndex(int datasetId)
}
catch (System.Exception exp)
{
Logger.ErrorException("GetLastIndex Exception:", exp);
Logger.Error(exp, "GetLastIndex Exception:");
throw new System.Exception("GetLastIndex function failed", exp);
}

Expand Down Expand Up @@ -80,7 +80,7 @@ public override void MakeChangeLog(int startChangeId, int count, string dbConnec
}
catch (System.Exception exp)
{
Logger.ErrorException("MakeChangeLog function failed:", exp);
Logger.Error(exp, "MakeChangeLog function failed:");
throw new System.Exception("MakeChangeLog function failed", exp);
}
Logger.Info("MakeChangeLog END");
Expand Down Expand Up @@ -144,7 +144,7 @@ private void FillOptimizedChangeLog(ref Npgsql.NpgsqlCommand command, ref List<O
}
catch (System.Exception exp)
{
Logger.ErrorException("FillOptimizedChangeLog function failed:", exp);
Logger.Error(exp,"FillOptimizedChangeLog function failed:");
throw new System.Exception("FillOptimizedChangeLog function failed", exp);
}
Logger.Info("FillOptimizedChangeLog END");
Expand Down Expand Up @@ -173,7 +173,7 @@ private void PrepareChangeLogQuery(Npgsql.NpgsqlConnection conn, ref Npgsql.Npgs
}
catch (System.Exception exp)
{
Logger.ErrorException("PrepareChangeLogQuery function failed:", exp);
Logger.Error(exp, "PrepareChangeLogQuery function failed:");
throw new System.Exception("PrepareChangeLogQuery function failed", exp);
}
Logger.Info("PrepareChangeLogQuery END");
Expand All @@ -198,7 +198,7 @@ private Int64 GetMaxChangeLogId(Npgsql.NpgsqlConnection conn, int datasetid)
}
catch (System.Exception exp)
{
Logger.ErrorException("GetMaxChangeLogId function failed:", exp);
Logger.Error(exp, "GetMaxChangeLogId function failed:");
throw new System.Exception("GetMaxChangeLogId function failed", exp);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public abstract class SpatialDbChangelog : IChangelogProvider
private string zipFile;
private string streamFileLocation;
private string tmpzipFile;
private string _version;

public void Intitalize(int datasetId)
{
Expand All @@ -45,10 +46,23 @@ public void Intitalize(int datasetId)
zipFile = destFileName + ".zip";
streamFileLocation = AppDomain.CurrentDomain.BaseDirectory + "\\Changelogfiles\\" + zipFile;
tmpzipFile = Path.Combine(Path.GetTempPath(), zipFile);
_version = DatasetsData.Version(datasetId);
}

public abstract string GetLastIndex(int datasetId);

public string GetDatasetVersion(int datasetId)
{
_version = DatasetsData.Version(datasetId);
return _version;
}

public virtual void HandleReport(GetLastIndexRequest request)
{

Logger.Error("FEIL OPPSTÅTT HOS ABONNENT");
}

public OrderChangelog GenerateInitialChangelog(int datasetId)
{
string downloadUriBase = ServerConfigData.DownloadUriBase().TrimEnd('/');
Expand Down Expand Up @@ -122,7 +136,7 @@ orderby d.DateCreated descending
}
catch (Exception ex)
{
Logger.ErrorException(string.Format("Failed to create or upload file {0}", zipFile), ex);
Logger.Error(ex, string.Format("Failed to create or upload file {0}", zipFile));
throw ex;
}

Expand All @@ -134,7 +148,7 @@ orderby d.DateCreated descending
}
catch (Exception ex)
{
Logger.ErrorException(string.Format("Failed to create or upload file {0}", zipFile), ex);
Logger.Error(ex, string.Format("Failed to create or upload file {0}", zipFile));
throw ex;
}

Expand All @@ -145,10 +159,10 @@ orderby d.DateCreated descending
}
catch (Exception ex)
{
Logger.ErrorException(
Logger.Error(ex,
string.Format(
"Failed on SaveChanges, Kartverket.Geosynkronisering.ChangelogProviders.PostGISChangelog.OrderChangelog startIndex:{0} count:{1} changelogId:{2}",
LastChangeId, count, ldbo.ChangelogId), ex);
LastChangeId, count, ldbo.ChangelogId));
throw ex;
}
Logger.Info(
Expand Down Expand Up @@ -207,8 +221,8 @@ private OrderChangelog _OrderChangelog(int startIndex, int count, string todoFil
catch (Exception ex)
{
chlmng.SetStatus(_currentOrderChangeLog.changelogId, ChangelogStatusType.cancelled);
Logger.ErrorException(
string.Format("Failed to make Change Log {0}", destPath + destFileName + ".xml"), ex);
Logger.Error(ex,
string.Format("Failed to make Change Log {0}", destPath + destFileName + ".xml"));
throw ex;
}

Expand All @@ -225,7 +239,7 @@ private OrderChangelog _OrderChangelog(int startIndex, int count, string todoFil
catch (Exception ex)
{
chlmng.SetStatus(_currentOrderChangeLog.changelogId, ChangelogStatusType.cancelled);
Logger.ErrorException(string.Format("Failed to create or upload file {0}", zipFile), ex);
Logger.Error(ex, string.Format("Failed to create or upload file {0}", zipFile));
throw ex;
}

Expand All @@ -237,7 +251,7 @@ private OrderChangelog _OrderChangelog(int startIndex, int count, string todoFil
}
catch (Exception ex)
{
Logger.ErrorException(string.Format("Failed to create or upload file {0}", zipFile), ex);
Logger.Error(ex, string.Format("Failed to create or upload file {0}", zipFile));
throw ex;
}

Expand All @@ -254,7 +268,7 @@ private OrderChangelog _OrderChangelog(int startIndex, int count, string todoFil
public OrderChangelog OrderChangelog(int startIndex, int count, string todoFilter, int datasetId)
{
// If startIndex == 1: Check if initital changelog exists
if (startIndex == 1)
if (startIndex < 2)
{
using (geosyncEntities db = new geosyncEntities())
{
Expand All @@ -273,7 +287,7 @@ orderby d.DateCreated descending
}
}

// If initial changelog don't exists or startIndex != 1
// If initial changelog don't exists or startIndex > 1
return _OrderChangelog(startIndex, count, todoFilter, datasetId);
}

Expand Down Expand Up @@ -371,7 +385,7 @@ public void BuildChangeLogFile(int count, string wfsUrl, int startChangeId, stri
if (!CheckChangelogHasFeatures(changeLog))
{
Exception exp = new Exception("CheckChangelogHasFeatures found 0 features");
Logger.ErrorException("CheckChangelogHasFeatures found 0 features", exp);
Logger.Error(exp, "CheckChangelogHasFeatures found 0 features");
throw exp;
}

Expand All @@ -380,7 +394,7 @@ public void BuildChangeLogFile(int count, string wfsUrl, int startChangeId, stri
}
catch (Exception exp)
{
Logger.ErrorException("BuildChangeLogFile function failed:", exp);
Logger.Error(exp, "BuildChangeLogFile function failed:");
throw new Exception("BuildChangeLogFile function failed", exp);
}
Logger.Info("BuildChangeLogFile END");
Expand Down Expand Up @@ -618,6 +632,9 @@ private bool CheckChangelogHasFeatures(XElement changeLog)

return true;
}



}

public class OptimizedChangeLogElement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public override string GetLastIndex(int datasetId)

catch (System.Exception exp)
{
Logger.ErrorException("GetLastIndex Exception:", exp);
Logger.Error(exp, "GetLastIndex Exception:");
throw new System.Exception("GetLastIndex function failed", exp);
}

Expand Down Expand Up @@ -70,7 +70,7 @@ public override void MakeChangeLog(int startChangeId, int count, string dbConnec
}
catch (System.Exception exp)
{
Logger.ErrorException("SqlServerSpatialChangelog.MakeChangeLog function failed:", exp);
Logger.Error(exp, "SqlServerSpatialChangelog.MakeChangeLog function failed:");
throw new System.Exception("MakeChangeLog function failed", exp);
}
Logger.Info("SqlServerSpatialChangelog.MakeChangeLog END");
Expand Down Expand Up @@ -139,7 +139,7 @@ private void FillOptimizedChangeLog(ref SqlCommand command,
catch (Exception exp)
{

Logger.ErrorException("SqlServerSpatialChangelog.FillOptimizedChangeLog function failed:", exp);
Logger.Error(exp, "SqlServerSpatialChangelog.FillOptimizedChangeLog function failed:");
throw new System.Exception("FillOptimizedChangeLog function failed", exp);
}
Logger.Info("SqlServerSpatialChangelog.FillOptimizedChangeLog END");
Expand Down Expand Up @@ -168,7 +168,7 @@ private void PrepareChangeLogQuery(SqlConnection conn, ref SqlCommand command, i
}
catch (System.Exception exp)
{
Logger.ErrorException("SqlServerSpatialChangelog.PrepareChangeLogQuery function failed:", exp);
Logger.Error(exp, "SqlServerSpatialChangelog.PrepareChangeLogQuery function failed:");
throw new System.Exception("PrepareChangeLogQuery function failed", exp);
}
Logger.Info("SqlServerSpatialChangelog.PrepareChangeLogQuery END");
Expand All @@ -195,7 +195,7 @@ private Int64 GetMaxChangeLogId(SqlConnection conn, int datasetid)
}
catch (System.Exception exp)
{
Logger.ErrorException("GetMaxChangeLogId function failed:", exp);
Logger.Error(exp, "GetMaxChangeLogId function failed:");
throw new System.Exception("GetMaxChangeLogId function failed", exp);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,8 @@ private static DatasetType[] CreateDatasets()
lstTitles.Add(title);
featType.Title = lstTitles.ToArray();
featType.Items = new[] { "urn:ogc:def:crs:EPSG::" + DatasetsData.DefaultCrs(id) };
featType.ItemsElementName = new ItemsChoiceType1[1];
featType.ItemsElementName.SetValue(ItemsChoiceType1.DefaultCRS, 0);
featType.ItemsElementName = new ItemsChoiceType[1];
featType.ItemsElementName.SetValue(ItemsChoiceType.DefaultCRS, 0);
featType.OutputFormats = new OutputFormatListType();
List<string> formats = new List<string>();
formats.Add("text/xml; subtype=gml/3.2.1"); //DB?
Expand Down Expand Up @@ -625,9 +625,9 @@ private static Operation CreateOperation(string operationName, string parameterN
dcp.Item = new HTTP();

//GET
ItemsChoiceType ictGet = new ItemsChoiceType();
ictGet = ItemsChoiceType.Get;
List<ItemsChoiceType> listIct = new List<ItemsChoiceType>();
ItemsChoiceType1 ictGet = new ItemsChoiceType1();
ictGet = ItemsChoiceType1.Get;
List<ItemsChoiceType1> listIct = new List<ItemsChoiceType1>();
listIct.Add(ictGet);
List <RequestMethodType> reqMethods = new List<RequestMethodType>();
RequestMethodType reqMethod = new RequestMethodType();
Expand All @@ -636,9 +636,9 @@ private static Operation CreateOperation(string operationName, string parameterN


//POST
ItemsChoiceType ictPost = new ItemsChoiceType();
ictPost = new ItemsChoiceType();
ictPost = ItemsChoiceType.Post;
ItemsChoiceType1 ictPost = new ItemsChoiceType1();
ictPost = new ItemsChoiceType1();
ictPost = ItemsChoiceType1.Post;
listIct.Add(ictPost);
reqMethod = new RequestMethodType();
reqMethod.href = ServiceData.ServiceUrl(true);
Expand Down
Loading

0 comments on commit dedc91e

Please sign in to comment.