Search in sources :

Example 1 with DataAgentTarget

use of com.hack23.cia.model.internal.application.data.impl.DataAgentTarget in project cia by Hack23.

the class StartAgentClickListener method buttonClick.

@Override
public void buttonClick(final ClickEvent event) {
    final DataAgentWorkOrder dataAgentWorkOrder = new DataAgentWorkOrder();
    dataAgentWorkOrder.setTarget(dataAgentTarget);
    dataAgentWorkOrder.setOperation(dataAgentOperation);
    LOGGER.info(LOG_MSG_EXECUTE_WORKORDER, dataAgentWorkOrder);
    ApplicationMangerAccess.getApplicationManager().getAgentContainer().execute(dataAgentWorkOrder);
}
Also used : DataAgentWorkOrder(com.hack23.cia.model.internal.application.data.impl.DataAgentWorkOrder)

Example 2 with DataAgentTarget

use of com.hack23.cia.model.internal.application.data.impl.DataAgentTarget in project cia by Hack23.

the class AgentOperationsOverviewPageModContentFactoryImpl method createContent.

@Secured({ "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout content = createPanelContent();
    getMenuItemFactory().createMainPageMenuBar(menuBar);
    LabelFactory.createHeader2Label(content, ADMIN_AGENT_OPERATION);
    final VerticalLayout overviewLayout = new VerticalLayout();
    overviewLayout.setSizeFull();
    content.addComponent(overviewLayout);
    content.setExpandRatio(overviewLayout, ContentRatio.LARGE);
    final ResponsiveRow grid = createGridLayout(overviewLayout);
    for (final DataAgentTarget dataAgentTarget : DataAgentTarget.values()) {
        final Button importDataButton = new Button(MessageFormat.format(BUTTON_PATTERN, DataAgentOperation.IMPORT, dataAgentTarget), VaadinIcons.BULLSEYE);
        importDataButton.addClickListener(new StartAgentClickListener(dataAgentTarget, DataAgentOperation.IMPORT));
        importDataButton.setId(MessageFormat.format(BUTTON_ID_PATTERN, ViewAction.START_AGENT_BUTTON, DataAgentOperation.IMPORT, dataAgentTarget));
        createRowItem(grid, importDataButton, WILL_FETCH_DATA_FROM_SOURCE);
    }
    final String pageId = getPageId(parameters);
    getPageActionEventHelper().createPageEvent(ViewAction.VISIT_ADMIN_AGENT_OPERATION_VIEW, ApplicationEventGroup.ADMIN, NAME, null, pageId);
    return content;
}
Also used : Button(com.vaadin.ui.Button) ResponsiveRow(com.jarektoro.responsivelayout.ResponsiveRow) VerticalLayout(com.vaadin.ui.VerticalLayout) DataAgentTarget(com.hack23.cia.model.internal.application.data.impl.DataAgentTarget) StartAgentClickListener(com.hack23.cia.web.impl.ui.application.views.pageclicklistener.StartAgentClickListener) Secured(org.springframework.security.access.annotation.Secured)

Aggregations

DataAgentTarget (com.hack23.cia.model.internal.application.data.impl.DataAgentTarget)1 DataAgentWorkOrder (com.hack23.cia.model.internal.application.data.impl.DataAgentWorkOrder)1 StartAgentClickListener (com.hack23.cia.web.impl.ui.application.views.pageclicklistener.StartAgentClickListener)1 ResponsiveRow (com.jarektoro.responsivelayout.ResponsiveRow)1 Button (com.vaadin.ui.Button)1 VerticalLayout (com.vaadin.ui.VerticalLayout)1 Secured (org.springframework.security.access.annotation.Secured)1