To create a link to a page in REM from within your plugin:

1

Add a rem-ext xmlns attribute to you UiBinder file.

For example:

<ui:UiBinder xmlns:rem-ext="urn:import:com.opencloud.rem.ext.client.ui">

2

Add a REMLink widget to your UiBinder template wherever you want the link to appear.

For example:

<rem-ext:REMLink ui:field="manageRAEntitiesLink">manage RA entities</rem-ext:REMLink>

3

Add an import for REM and REMLink to your corresponding panel implementation; and add a @UiField entry for your link.

import com.opencloud.rem.ext.client.ui.REMLink;
import com.opencloud.rem.ext.client.REM;
@UiField REMLink manageRAEntitiesLink;

4

Add an import for HistoryManager to your panel implementation; add it as a constructor arg; and assign it to a field.

import com.opencloud.rem.client.place.HistoryManager;
    @Inject
    public YourPanelImpl(/* existing constuctor args */, HistoryManager historyManager) {
        this.historyManager = historyManager;
        // existing constructor logic
    }
    private HistoryManager historyManager;

5

Add code to your presenter implementation when refresh is called to update the links in the view.

For example:

    public void refresh() {
        prepare();
        if(viewPopulated) return;

        final HistoryToken currentToken = historyManager.currentToken();
        view.updateLinks(currentToken.getConnectionId(), currentToken.getInstanceId());

        // existing logic

        viewPopulated = true;
    }

6

Add code to your panel implementation to update the link.

For example:

    @Override
    public void updateLinks(String connectionId, String instanceId) {
        manageRAEntitiesLink.setHref(REM.getHostPageBaseURL()
            + "#v=EMS&c=" + connectionId
            + "&i=" + URL.encodeQueryString(instanceId)
            + "&p=Management&b=resources&rv=LIST");
    }

When running your plugin in dev-mode, the link will show as a title tooltip; and clicking will display an error popup. When deployed in REM, it will target the link to REM itself.

Previous page Next page