Search in sources :

Example 6 with FinderPath

use of org.jboss.hal.core.finder.FinderPath in project console by hal.

the class StandaloneServerColumn method onServerResult.

@Override
public void onServerResult(ServerResultEvent event) {
    // noinspection Duplicates
    if (isVisible()) {
        ItemMonitor.stopProgress(event.getServer().getId());
        FinderPath path = refreshPath != null ? refreshPath : finder.getContext().getPath();
        refreshPath = null;
        finder.refresh(path);
    }
}
Also used : FinderPath(org.jboss.hal.core.finder.FinderPath)

Example 7 with FinderPath

use of org.jboss.hal.core.finder.FinderPath in project console by hal.

the class TourSetup method standaloneSteps.

private void standaloneSteps(Tour tour, PlaceRequest homepage, PlaceRequest deployments, PlaceRequest runtime) {
    // place requests for standalone mode
    PlaceRequest configuration = places.finderPlace(NameTokens.CONFIGURATION, new FinderPath().append(Ids.CONFIGURATION, Ids.asId(Names.SUBSYSTEMS))).build();
    String serverId = Ids.hostServer(Server.STANDALONE.getHost(), environment.getName());
    PlaceRequest monitor = places.finderPlace(NameTokens.RUNTIME, new FinderPath().append(Ids.STANDALONE_SERVER_COLUMN, serverId)).build();
    // steps for standalone mode
    tour.addStep(homepage, Ids.HOMEPAGE_DEPLOYMENTS_MODULE, Names.HOMEPAGE, resources.messages().tourStandaloneHomeDeployments(), Placement.RIGHT);
    tour.addStep(homepage, Ids.HOMEPAGE_CONFIGURATION_MODULE, Names.HOMEPAGE, resources.messages().tourStandaloneHomeConfiguration(), Placement.LEFT);
    tour.addStep(homepage, Ids.HOMEPAGE_RUNTIME_MODULE, Names.HOMEPAGE, resources.messages().tourStandaloneHomeRuntime(), Placement.RIGHT);
    tour.addStep(deployments, Ids.DEPLOYMENT, Names.DEPLOYMENT, resources.messages().tourStandaloneDeployment(), Placement.RIGHT);
    tour.addStep(deployments, Ids.DEPLOYMENT_ADD_ACTIONS, Names.DEPLOYMENT, resources.messages().tourStandaloneDeploymentAddActions(), Placement.BOTTOM);
    tour.addStep(configuration, Ids.CONFIGURATION_SUBSYSTEM, Names.CONFIGURATION, resources.messages().tourStandaloneConfigurationSubsystem(), Placement.RIGHT);
    tour.addStep(runtime, Ids.STANDALONE_SERVER_COLUMN, Names.RUNTIME, resources.messages().tourStandaloneRuntimeServer(), Placement.RIGHT);
    tour.addStep(monitor, Ids.RUNTIME_SUBSYSTEM, Names.RUNTIME, resources.messages().tourStandaloneRuntimeSubsystem(), Placement.RIGHT);
}
Also used : PlaceRequest(com.gwtplatform.mvp.shared.proxy.PlaceRequest) FinderPath(org.jboss.hal.core.finder.FinderPath)

Example 8 with FinderPath

use of org.jboss.hal.core.finder.FinderPath in project console by hal.

the class TourSetup method commonSteps.

private void commonSteps(Tour tour) {
    // steps for access control apply to both standalone and domain mode
    if (accessControl.isSuperUserOrAdministrator() && !accessControl.isSingleSignOn()) {
        PlaceRequest browseBy = new PlaceRequest.Builder().nameToken(NameTokens.ACCESS_CONTROL).build();
        PlaceRequest users = places.finderPlace(NameTokens.ACCESS_CONTROL, new FinderPath().append(Ids.ACCESS_CONTROL_BROWSE_BY, Ids.ACCESS_CONTROL_BROWSE_BY_USERS)).build();
        PlaceRequest roles = places.finderPlace(NameTokens.ACCESS_CONTROL, new FinderPath().append(Ids.ACCESS_CONTROL_BROWSE_BY, Ids.ACCESS_CONTROL_BROWSE_BY_ROLES)).build();
        tour.addStep(browseBy, Ids.ACCESS_CONTROL_BROWSE_BY, Names.ACCESS_CONTROL, resources.messages().tourAccessControl(), Placement.RIGHT);
        tour.addStep(users, Ids.USER, Names.ACCESS_CONTROL, resources.messages().tourAccessControlUsers(), Placement.RIGHT);
        tour.addStep(roles, Ids.ROLE, Names.ACCESS_CONTROL, resources.messages().tourAccessControlRoles(), Placement.RIGHT);
    }
}
Also used : PlaceRequest(com.gwtplatform.mvp.shared.proxy.PlaceRequest) FinderPath(org.jboss.hal.core.finder.FinderPath)

Example 9 with FinderPath

use of org.jboss.hal.core.finder.FinderPath in project console by hal.

the class TourSetup method domainSteps.

private void domainSteps(Tour tour, PlaceRequest homepage, PlaceRequest deployments, PlaceRequest runtime, String profile, String serverGroup) {
    // place requests for domain mode
    PlaceRequest deploymentsContentRepository = places.finderPlace(NameTokens.DEPLOYMENTS, new FinderPath().append(Ids.DEPLOYMENT_BROWSE_BY, Ids.asId(resources.constants().contentRepository()))).build();
    PlaceRequest profiles = places.finderPlace(NameTokens.CONFIGURATION, new FinderPath().append(Ids.CONFIGURATION, Ids.asId(Names.PROFILES))).build();
    PlaceRequest serverGroups = places.finderPlace(NameTokens.RUNTIME, new FinderPath().append(Ids.DOMAIN_BROWSE_BY, Ids.asId(Names.SERVER_GROUPS))).build();
    // steps for domain mode
    tour.addStep(homepage, Ids.HOMEPAGE_DEPLOYMENTS_MODULE, Names.HOMEPAGE, resources.messages().tourDomainHomeDeployments(), Placement.RIGHT);
    tour.addStep(homepage, Ids.HOMEPAGE_CONFIGURATION_MODULE, Names.HOMEPAGE, resources.messages().tourDomainHomeConfiguration(), Placement.LEFT);
    tour.addStep(homepage, Ids.HOMEPAGE_RUNTIME_MODULE, Names.HOMEPAGE, resources.messages().tourDomainHomeRuntime(), Placement.RIGHT);
    tour.addStep(deployments, Ids.DEPLOYMENT_BROWSE_BY, Names.DEPLOYMENT, resources.messages().tourDomainDeploymentsBrowseBy(), Placement.RIGHT);
    tour.addStep(deploymentsContentRepository, Ids.CONTENT_ADD_ACTIONS, Names.DEPLOYMENT, resources.messages().tourDomainDeploymentsAddActions(), Placement.BOTTOM);
    tour.addStep(profiles, Ids.PROFILE, Names.CONFIGURATION, resources.messages().tourDomainConfiguration(), Placement.RIGHT);
    if (profile != null) {
        PlaceRequest profileSubsystems = places.finderPlace(NameTokens.CONFIGURATION, new FinderPath().append(Ids.CONFIGURATION, Ids.asId(Names.PROFILES)).append(Ids.PROFILE, profile)).build();
        tour.addStep(profileSubsystems, Ids.CONFIGURATION_SUBSYSTEM, Names.CONFIGURATION, resources.messages().tourDomainConfigurationSubsystem(), Placement.RIGHT);
    }
    tour.addStep(runtime, Ids.DOMAIN_BROWSE_BY, Names.RUNTIME, resources.messages().tourDomainRuntimeBrowseBy(), Placement.RIGHT);
    tour.addStep(serverGroups, Ids.SERVER_GROUP, Names.RUNTIME, resources.messages().tourDomainRuntimeServerGroup(), Placement.RIGHT);
    tour.addStep(serverGroups, Ids.SERVER_GROUP_ADD, Names.RUNTIME, resources.messages().tourDomainRuntimeServerGroupsAdd(), Placement.BOTTOM);
    if (serverGroup != null) {
        PlaceRequest firstServerGroup = places.finderPlace(NameTokens.RUNTIME, new FinderPath().append(Ids.DOMAIN_BROWSE_BY, Ids.asId(Names.SERVER_GROUPS)).append(Ids.SERVER_GROUP, Ids.serverGroup(serverGroup))).build();
        tour.addStep(firstServerGroup, Ids.SERVER, Names.RUNTIME, resources.messages().tourDomainRuntimeServer(), Placement.RIGHT);
        tour.addStep(firstServerGroup, Ids.SERVER_ADD, Names.RUNTIME, resources.messages().tourDomainRuntimeServerAdd(), Placement.BOTTOM);
    }
}
Also used : PlaceRequest(com.gwtplatform.mvp.shared.proxy.PlaceRequest) FinderPath(org.jboss.hal.core.finder.FinderPath)

Example 10 with FinderPath

use of org.jboss.hal.core.finder.FinderPath in project console by hal.

the class InterfacePreview method update.

@Override
public void update(final NamedNode item) {
    Operation operation = new Operation.Builder(new ResourceAddress().add(SOCKET_BINDING_GROUP, "*"), QUERY).param(SELECT, new ModelNode().add(NAME)).param(WHERE, new ModelNode().set(DEFAULT_INTERFACE, item.getName())).build();
    dispatcher.execute(operation, result -> {
        List<String> socketBindingGroups = result.asList().stream().filter(modelNode -> !modelNode.isFailure()).map(modelNode -> failSafeGet(modelNode, RESULT + "/" + NAME)).filter(ModelNode::isDefined).map(ModelNode::asString).sorted().collect(toList());
        if (!socketBindingGroups.isEmpty()) {
            SafeHtmlBuilder html = new SafeHtmlBuilder();
            for (Iterator<String> iterator = socketBindingGroups.iterator(); iterator.hasNext(); ) {
                String sbg = iterator.next();
                PlaceRequest sbgPlaceRequest = places.finderPlace(NameTokens.CONFIGURATION, new FinderPath().append(Ids.CONFIGURATION, Ids.asId(Names.SOCKET_BINDINGS)).append(Ids.SOCKET_BINDING_GROUP, sbg)).build();
                String token = places.historyToken(sbgPlaceRequest);
                html.appendHtmlConstant("<a href=\"").appendHtmlConstant(token).appendHtmlConstant("\">").appendEscaped(sbg).appendHtmlConstant("</a>");
                if (iterator.hasNext()) {
                    html.appendEscaped(", ");
                }
            }
            links.innerHTML = html.toSafeHtml().asString();
        } else {
            links.textContent = Names.NOT_AVAILABLE;
        }
    });
}
Also used : ModelNode(org.jboss.hal.dmr.ModelNode) PreviewContent(org.jboss.hal.core.finder.PreviewContent) Iterator(java.util.Iterator) Operation(org.jboss.hal.dmr.Operation) Ids(org.jboss.hal.resources.Ids) FinderPath(org.jboss.hal.core.finder.FinderPath) PlaceRequest(com.gwtplatform.mvp.shared.proxy.PlaceRequest) ResourceAddress(org.jboss.hal.dmr.ResourceAddress) ModelNodeHelper.failSafeGet(org.jboss.hal.dmr.ModelNodeHelper.failSafeGet) List(java.util.List) Dispatcher(org.jboss.hal.dmr.dispatch.Dispatcher) Collectors.toList(java.util.stream.Collectors.toList) NameTokens(org.jboss.hal.meta.token.NameTokens) ModelDescriptionConstants(org.jboss.hal.dmr.ModelDescriptionConstants) HTMLElement(elemental2.dom.HTMLElement) PreviewAttributes(org.jboss.hal.core.finder.PreviewAttributes) SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder) NamedNode(org.jboss.hal.dmr.NamedNode) Places(org.jboss.hal.core.mvp.Places) Names(org.jboss.hal.resources.Names) Elements.span(org.jboss.gwt.elemento.core.Elements.span) PlaceRequest(com.gwtplatform.mvp.shared.proxy.PlaceRequest) ResourceAddress(org.jboss.hal.dmr.ResourceAddress) FinderPath(org.jboss.hal.core.finder.FinderPath) Operation(org.jboss.hal.dmr.Operation) ModelNode(org.jboss.hal.dmr.ModelNode) SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder)

Aggregations

FinderPath (org.jboss.hal.core.finder.FinderPath)13 PlaceRequest (com.gwtplatform.mvp.shared.proxy.PlaceRequest)10 HTMLElement (elemental2.dom.HTMLElement)4 Places (org.jboss.hal.core.mvp.Places)4 NameTokens (org.jboss.hal.meta.token.NameTokens)4 Ids (org.jboss.hal.resources.Ids)4 Names (org.jboss.hal.resources.Names)4 Arrays.asList (java.util.Arrays.asList)3 Iterator (java.util.Iterator)3 List (java.util.List)3 Elements (org.jboss.gwt.elemento.core.Elements)3 EventType.click (org.jboss.gwt.elemento.core.EventType.click)3 Environment (org.jboss.hal.config.Environment)3 Strings (com.google.common.base.Strings)2 SafeHtmlUtils (com.google.gwt.safehtml.shared.SafeHtmlUtils)2 HandlerRegistration (com.google.web.bindery.event.shared.HandlerRegistration)2 Element (elemental2.dom.Element)2 HTMLLIElement (elemental2.dom.HTMLLIElement)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2