Skip to content

Commit 8c5ac4d

Browse files
author
alexrobin
committed
Added more SOS test links
1 parent 163d44b commit 8c5ac4d

4 files changed

Lines changed: 43 additions & 21 deletions

File tree

sensorhub-webui-core/src/main/java/org/sensorhub/ui/SOSAdminPanel.java

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.vast.ows.sos.SOSServiceCapabilities;
2424
import com.vaadin.data.Property;
2525
import com.vaadin.server.ExternalResource;
26+
import com.vaadin.shared.ui.label.ContentMode;
2627
import com.vaadin.ui.HorizontalLayout;
2728
import com.vaadin.ui.Label;
2829
import com.vaadin.ui.Link;
@@ -43,7 +44,8 @@
4344
public class SOSAdminPanel extends DefaultModulePanel<SOSService> implements IModuleAdminPanel<SOSService>
4445
{
4546
private static final long serialVersionUID = -5196033911134749125L;
46-
protected static final String PROP_ENDPOINT = "endPoint";
47+
private static final String PROP_ENDPOINT = "endPoint";
48+
private static final String LINK_TARGET = "osh-sos";
4749

4850

4951
@SuppressWarnings("serial")
@@ -53,12 +55,12 @@ public LinkItem(String label, String linkText, String href)
5355
{
5456
setSpacing(true);
5557
addComponent(new Label(label + ":"));
56-
addComponent(new Link(linkText, new ExternalResource(href), "osh-sos", 0, 0, null));
58+
addComponent(new Link(linkText, new ExternalResource(href), LINK_TARGET, 0, 0, null));
5759
}
5860

5961
public void addLinkItem(String linkText, String href)
6062
{
61-
addComponent(new Link(linkText, new ExternalResource(href), "osh-sos", 0, 0, null));
63+
addComponent(new Link(linkText, new ExternalResource(href), LINK_TARGET, 0, 0, null));
6264
}
6365
}
6466

@@ -92,7 +94,7 @@ public void build(final MyBeanItem<ModuleConfig> beanItem, final SOSService modu
9294
// link to capabilities
9395
baseUrl += "?service=SOS&version=2.0&request=";
9496
String href = baseUrl + "GetCapabilities";
95-
Link link = new Link("Service Capabilities", new ExternalResource(href), "osh-sos", 0, 0, null);
97+
Link link = new Link("Service Capabilities", new ExternalResource(href), LINK_TARGET, 0, 0, null);
9698
link.setWidthUndefined();
9799
addComponent(link);
98100

@@ -122,22 +124,33 @@ public void build(final MyBeanItem<ModuleConfig> beanItem, final SOSService modu
122124
//linkItem.addLinkItem("JSON", href);
123125
tabLayout.addComponent(linkItem);
124126

125-
// result template
126-
href = baseUrl + "GetResultTemplate&offering=" + offering.getIdentifier() +
127-
"&observedProperty=" + offering.getObservableProperties().iterator().next();
128-
linkItem = new LinkItem("Record Description", "XML", href);
129-
href += "&responseFormat=" + OWSUtils.JSON_MIME_TYPE;
130-
linkItem.addLinkItem("JSON", href);
131-
tabLayout.addComponent(linkItem);
132-
133-
// latest obs
134-
href = baseUrl + "GetResult&offering=" + offering.getIdentifier() +
135-
"&observedProperty=" + offering.getObservableProperties().iterator().next() +
136-
"&temporalFilter=phenomenonTime,now";
137-
linkItem = new LinkItem("Latest Measurements", "RAW", href);
138-
href += "&responseFormat=" + OWSUtils.JSON_MIME_TYPE;
139-
linkItem.addLinkItem("JSON", href);
140-
tabLayout.addComponent(linkItem);
127+
for (String obs: offering.getObservableProperties())
128+
{
129+
// spacer
130+
Label spacer = new Label();
131+
spacer.setStyleName(STYLE_SPACER);
132+
spacer.setHeight(10, Unit.PIXELS);
133+
tabLayout.addComponent(spacer);
134+
135+
// observable name
136+
String label = obs.substring(obs.lastIndexOf('/')+1);
137+
tabLayout.addComponent(new Label("<b>"+label+"</b>", ContentMode.HTML));
138+
139+
// result template
140+
href = baseUrl + "GetResultTemplate&offering=" + offering.getIdentifier() + "&observedProperty=" + obs;
141+
linkItem = new LinkItem("Record Description", "XML", href);
142+
href += "&responseFormat=" + OWSUtils.JSON_MIME_TYPE;
143+
linkItem.addLinkItem("JSON", href);
144+
tabLayout.addComponent(linkItem);
145+
146+
// latest obs
147+
href = baseUrl + "GetResult&offering=" + offering.getIdentifier() + "&observedProperty=" + obs +
148+
"&temporalFilter=phenomenonTime,now";
149+
linkItem = new LinkItem("Latest Measurements", "RAW", href);
150+
href += "&responseFormat=" + OWSUtils.JSON_MIME_TYPE;
151+
linkItem.addLinkItem("JSON", href);
152+
tabLayout.addComponent(linkItem);
153+
}
141154
}
142155
}
143156
}

sensorhub-webui-core/src/main/java/org/sensorhub/ui/api/UIConstants.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ public interface UIConstants
3131
public final static String STYLE_LINK = "link";
3232
public final static String STYLE_PRESSED = "v-pressed";
3333
public final static String STYLE_BORDERLESS = "borderless";
34-
public final static String STYLE_SPINNER = "spinner";
34+
public final static String STYLE_SPACER = "spacer";
35+
public final static String STYLE_SPINNER = "spinner";
3536
public final static String STYLE_SECTION_BUTTONS = "section-buttons";
3637

3738
// constants for icon resources

sensorhub-webui-core/widgetset/src/main/resources/VAADIN/themes/sensorhub/sensorhub.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ $v-layout-margin-right: 25px;
5050
clear: none;
5151
}
5252

53+
.v-slot-spacer {
54+
line-height: 0;
55+
}
56+
5357
.v-slot-section-buttons {
5458
float: right;
5559
margin-top: 20px;

sensorhub-webui-core/widgetset/src/main/resources/VAADIN/themes/sensorhub/styles.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12727,6 +12727,10 @@ div.v-layout.v-horizontal.v-widget {
1272712727
clear: none;
1272812728
}
1272912729

12730+
.sensorhub .v-slot-spacer {
12731+
line-height: 0;
12732+
}
12733+
1273012734
.sensorhub .v-slot-section-buttons {
1273112735
float: right;
1273212736
margin-top: 20px;

0 commit comments

Comments
 (0)