Skip to content

Commit

Permalink
Merge pull request eclipse-hawkbit#84 from bsinno/doc-links-configurable
Browse files Browse the repository at this point in the history
Migrated hardcoded doc links to configurable setup.
  • Loading branch information
kaizimmerm committed Mar 12, 2016
2 parents 9f7ed2d + 3f763e7 commit 6f9d6f7
Show file tree
Hide file tree
Showing 12 changed files with 196 additions and 158 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,18 @@ spring.rabbitmq.port=5672
hawkbit.dmf.rabbitmq.deadLetterQueue=dmf_connector_deadletter
hawkbit.dmf.rabbitmq.deadLetterExchange=dmf.connector.deadletter
hawkbit.dmf.rabbitmq.receiverQueue=dmf_receiver

# UI demo account
hawkbit.server.ui.demo.password=admin
hawkbit.server.ui.demo.user=admin
hawkbit.server.ui.demo.tenant=DEFAULT

# UI help links
hawkbit.server.ui.links.documentation.root=https://github.com/eclipse/hawkbit
hawkbit.server.ui.links.documentation.deployment-view=https://github.com/eclipse/hawkbit
hawkbit.server.ui.links.documentation.distribution-view=https://github.com/eclipse/hawkbit
hawkbit.server.ui.links.documentation.rollout-view=https://github.com/eclipse/hawkbit
hawkbit.server.ui.links.documentation.security=https://github.com/eclipse/hawkbit
hawkbit.server.ui.links.documentation.system-configuration-view=https://github.com/eclipse/hawkbit
hawkbit.server.ui.links.documentation.targetfilter-view=https://github.com/eclipse/hawkbit
hawkbit.server.ui.links.documentation.upload-view=https://github.com/eclipse/hawkbit
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ hawkbit.threadpool.queuesize=20000
hawkbit.controller.pollingTime=00:05:00
hawkbit.controller.pollingOverdueTime=00:05:00

## Configuration for RabbitMQ integration
# Configuration for RabbitMQ integration
hawkbit.dmf.rabbitmq.deadLetterQueue=dmf_connector_deadletter
hawkbit.dmf.rabbitmq.deadLetterExchange=dmf.connector.deadletter
hawkbit.dmf.rabbitmq.receiverQueue=dmf_receiver
hawkbit.dmf.rabbitmq.receiverQueue=dmf_receiver
126 changes: 122 additions & 4 deletions hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/UiProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ public static class Demo {
/**
* Demo tenant.
*/
private String tenant = "DEFAULT";
private String tenant = "";
/**
* Demo user name.
*/
private String user = "admin";
private String user = "";

/**
* Demo user password.
*/
private String password = "admin";
private String password = "";

public String getTenant() {
return tenant;
Expand Down Expand Up @@ -82,10 +82,13 @@ public void setPassword(final String password) {
}

/**
* Links to potentially other systems (e.g. support, user management etc.).
* Links to potentially other systems (e.g. support, user management,
* documentation etc.).
*
*/
public static class Links {
private final Documentation documentation = new Documentation();

/**
* Link to product support.
*/
Expand All @@ -96,6 +99,121 @@ public static class Links {
*/
private String requestAccount = "";

public Documentation getDocumentation() {
return documentation;
}

/**
* Configuration of UI documentation links.
*
*/
public static class Documentation {
/**
* Link to root of documentation and user guides.
*/
private String root = "";

/**
* Link to documentation of deployment view.
*/
private String deploymentView = "";

/**
* Link to documentation of distribution view.
*/
private String distributionView = "";

/**
* Link to documentation of upload view.
*/
private String uploadView = "";

/**
* Link to documentation of system configuration view.
*/
private String systemConfigurationView = "";

/**
* Link to security related documentation.
*/
private String security = "";

/**
* Link to target filter view.
*/
private String targetfilterView = "";

/**
* Link to documentation of rollout view.
*/
private String rolloutView = "";

public String getDeploymentView() {
return deploymentView;
}

public void setDeploymentView(final String deploymentView) {
this.deploymentView = deploymentView;
}

public String getDistributionView() {
return distributionView;
}

public void setDistributionView(final String distributionView) {
this.distributionView = distributionView;
}

public String getUploadView() {
return uploadView;
}

public void setUploadView(final String uploadView) {
this.uploadView = uploadView;
}

public String getSystemConfigurationView() {
return systemConfigurationView;
}

public void setSystemConfigurationView(final String systemConfigurationView) {
this.systemConfigurationView = systemConfigurationView;
}

public String getSecurity() {
return security;
}

public void setSecurity(final String security) {
this.security = security;
}

public String getTargetfilterView() {
return targetfilterView;
}

public void setTargetfilterView(final String targetfilterView) {
this.targetfilterView = targetfilterView;
}

public String getRolloutView() {
return rolloutView;
}

public void setRolloutView(final String rolloutView) {
this.rolloutView = rolloutView;
}

public String getRoot() {
return root;
}

public void setRoot(final String root) {
this.root = root;
}

}

/**
* Link to user management.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@
* Approach to create necessary UI component which are decorated Aspect of fine
* tuning the component or extending the component is separated.
*
*
*
*
*
*/
public final class SPUIComponentProvider {
private static final Logger LOG = LoggerFactory.getLogger(SPUIComponentProvider.class);
Expand Down Expand Up @@ -411,4 +407,22 @@ public static Link getLink(final String id, final String name, final String reso
return link;

}

/**
* Generates help/documentation links from within management UI.
*
* @param uri
* to documentation site
*
* @return generated link
*/
public static Link getHelpLink(final String uri) {

final Link link = new Link("", new ExternalResource(uri));
link.setTargetName("_blank");
link.setIcon(FontAwesome.QUESTION_CIRCLE);
link.setDescription("Documentation");
return link;

}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
import org.eclipse.hawkbit.repository.SpPermissionChecker;
import org.eclipse.hawkbit.repository.TargetFilterQueryManagement;
import org.eclipse.hawkbit.repository.model.TargetFilterQuery;
import org.eclipse.hawkbit.ui.UiProperties;
import org.eclipse.hawkbit.ui.components.SPUIButton;
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
import org.eclipse.hawkbit.ui.documentation.DocumentationPageLink;
import org.eclipse.hawkbit.ui.filtermanagement.event.CustomFilterUIEvent;
import org.eclipse.hawkbit.ui.filtermanagement.state.FilterManagementUIState;
import org.eclipse.hawkbit.ui.utils.I18N;
Expand Down Expand Up @@ -86,6 +86,9 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
@Autowired
private UINotification notification;

@Autowired
private transient UiProperties uiProperties;

@Autowired
@Qualifier("uiExecutor")
private transient Executor executor;
Expand Down Expand Up @@ -212,7 +215,7 @@ private void createComponents() {
validationIcon = createStatusIcon();
saveButton = createSaveButton();

helpLink = DocumentationPageLink.TARGET_FILTER_VIEW.getLink();
helpLink = SPUIComponentProvider.getHelpLink(uiProperties.getLinks().getDocumentation().getTargetfilterView());

closeIcon = createSearchResetIcon();
}
Expand Down
Loading

0 comments on commit 6f9d6f7

Please sign in to comment.