Editing / Replacing a View

There are several modifications you can do on base views and derived views. This page explains how to do them.

To rename a base view or a derived view, in the Server Explorer, right-click on the view and then, click Rename.

Modifying Base Views

There are several scenarios in which you need to modify a base view. Depending on what you want to change, you can simply edit the view or you also need to do a source refresh of the base view.

To edit a view, open the view and click Edit.

To do a source refresh, open the view, click Edit and click Source refresh (image0). This is necessary when the structure of the data of the underlying data source changes. In the case of structured data sources (like JDBC or multi-dimensional databases), you also need to do it if the data type of a column changed in the database.

Here are some examples of when you need to do a “source refresh”:

  • For JDBC base views, if the table or view in the underlying database has a new column or a column was removed. In the case of JDBC base views, when the table/view in the database has a new column, you still can query the base view. However, the query will not return the new column until you do the “source refresh”.

  • For DF base view, if the structure of the CSV file changes. That is, if it has one less column or one new column.

  • For multidimensional base view, if you want modify the base view to add/remove dimensions, a value or a measure.

  • For multidimensional base view, if you want to re-create the base view again but with different options. E.g. to select the option “Include empty rows”.

Edit the view instead of doing a source refresh if you just want to rename a field, or add a description to a base view or its fields.

Modifying Derived Views

When you edit a derived view, the options available depend on the type of derived view. For example, for JOIN views you can change the type of join to perform (LEFT OUTER, INNER JOIN…). However, there are situations in which editing the view is not enough. In that case, create a view with the same name as the view to be replaced. You have to re-create the view if you want to:

  • Change the operation used to create the view. For example, to convert a join view into a union view.

  • Change the data source of a base view. That is, if the data has to be obtained from a different data source.

Views Affected by Modifications

When a change in a view affects other views or operations of web services published from Virtual DataPort, the Tool displays the dialog “Views Affected by Modification” before applying your changes. This dialog helps you understand how the changes you want to do will impact other elements. For example, if you remove a field from a view and this field is used on the join condition of another view.

When you change the output schema of a view (i.e. the fields of the view change) and the cache is enabled for this view, the cached data will be marked as invalid.

When the output schema does not change, but the definition of the view changes (i.e. the Where condition changes, the Group by fields change, etc.) and the cache is enabled for this view, you can decide if you want to mark the cached data as invalid.

This dialog “Views Affected by Modification” displays different things depending on the changes you have done:

  • If you have added new fields, you can select to which views and operations of Web services you want to propagate the new fields to. For example, if you add a field A to the view V you can add this new field A to the views that “use” this view and to the operations of Web services that publish this view.

    Note

    New fields cannot be propagated to operations of Web services that were created using the dialog Publish from vql expression.

  • If you have deleted fields, the dialog lists the views and Web services that will be affected by this change. In this list, you can click on each view to see how it is related to the view you are editing.

After applying the changes, the views that are left in an inconsistent state are marked with the icon image3. You have to edit them in order to fix them.

When a change in a view affects a widget, the widget is automatically updated. However, you have to redeploy this widget and its auxiliary Web service in order to apply the changes.

Views and Web services affected by modifications of another view

Views and Web services affected by modifications of another view

In the scenario captured in Views and Web services affected by modifications of another view, we have deleted a field and added another one to the view incidents_sales. This change affects:

  • The views inc_grouped_by_pref_clients and pref_clients_inc_sales.

  • And the operation getINCIDENTS_SALESBySUMMA of the Web service incidents_sales.

About the added a new field (ttime_quarter), the new field can be propagated to the elements that rely on this view:

  • The view inc_grouped_by_pref_clients. Note that the view pref_clients_inc_sales is not in this list. That is because if the field is added to the view inc_grouped_by_pref_clients it has to be added to the pref_clients_inc_sales view as well because inc_grouped_by_pref_clients is a selection of the other view.

  • The operation getINCIDENTS_SALESBySUMMA of the Web service incidents_sales.