Search in sources :

Example 1 with OSIORestConnector

use of org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestConnector in project linuxtools by eclipse.

the class OSIORestRepositoryConnectorUI method getQueryWizard.

@Override
public IWizard getQueryWizard(TaskRepository repository, IRepositoryQuery query) {
    RepositoryQueryWizard wizard = new RepositoryQueryWizard(repository);
    AbstractRepositoryConnector connector = getConnector();
    OSIORestConnector connectorREST = (OSIORestConnector) connector;
    TaskData taskData = new TaskData(new OSIORestTaskAttributeMapper(repository, connectorREST), repository.getConnectorKind(), "Query", // $NON-NLS-1$ //$NON-NLS-2$
    "Query");
    if (query == null) {
        wizard.addPage(new OSIORestQueryTypeWizardPage(repository, connector));
    } else {
        if (isCustomQuery(query)) {
            wizard.addPage(OSIORestUIUtil.createOSIORestSearchPage(true, true, taskData, connectorREST, repository, query));
        } else {
            wizard.addPage(OSIORestUIUtil.createOSIORestSearchPage(false, true, taskData, connectorREST, repository, query));
        }
    }
    return wizard;
}
Also used : RepositoryQueryWizard(org.eclipse.mylyn.tasks.ui.wizards.RepositoryQueryWizard) AbstractRepositoryConnector(org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector) OSIORestQueryTypeWizardPage(org.eclipse.linuxtools.internal.mylyn.osio.rest.ui.provisional.OSIORestQueryTypeWizardPage) OSIORestConnector(org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestConnector) OSIORestTaskAttributeMapper(org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestTaskAttributeMapper) TaskData(org.eclipse.mylyn.tasks.core.data.TaskData)

Example 2 with OSIORestConnector

use of org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestConnector in project linuxtools by eclipse.

the class TestOSIORestClient method setUp.

@SuppressWarnings("deprecation")
@Before
public void setUp() {
    connector = new OSIORestConnector();
    repository = new TaskRepository(connector.getConnectorKind(), "http://openshift.io/api");
    repository.setProperty(IOSIORestConstants.REPOSITORY_AUTH_ID, "user");
    repository.setProperty(IOSIORestConstants.REPOSITORY_AUTH_TOKEN, "xxxxxxTokenxxxxxx");
    requestProvider = new OSIOTestRestRequestProvider();
    requestProvider.addGetRequest("/user", new Identity("user", "user", new Date(2017, 01, 01), new Date(2017, 01, 01), "User", "//image/user", "user", Boolean.TRUE, "user@user.org", "userCo", "", "//users/user", "TestUser"));
}
Also used : OSIOTestRestRequestProvider(org.eclipse.linuxtools.mylyn.osio.rest.test.support.OSIOTestRestRequestProvider) TaskRepository(org.eclipse.mylyn.tasks.core.TaskRepository) OSIORestConnector(org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestConnector) Identity(org.eclipse.linuxtools.internal.mylyn.osio.rest.core.response.data.Identity) Date(java.sql.Date) Before(org.junit.Before)

Example 3 with OSIORestConnector

use of org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestConnector in project linuxtools by eclipse.

the class OSIORestSearchQueryPage method doRefreshControls.

@Override
protected void doRefreshControls() {
    try {
        OSIORestConnector connectorREST = (OSIORestConnector) getConnector();
        connectorREST.getRepositoryConfiguration(getTaskRepository()).updateSpaceOptions(getTargetTaskData());
        for (Entry<String, AbstractAttributeEditor> entry : editorMap.entrySet()) {
            entry.getValue().refresh();
        }
    } catch (CoreException e) {
        StatusHandler.log(new Status(IStatus.ERROR, OSIORestUIPlugin.PLUGIN_ID, "OSIORestSearchQueryPage could not refresh!", // $NON-NLS-1$
        e));
    }
}
Also used : Status(org.eclipse.core.runtime.Status) IStatus(org.eclipse.core.runtime.IStatus) AbstractAttributeEditor(org.eclipse.mylyn.tasks.ui.editors.AbstractAttributeEditor) CoreException(org.eclipse.core.runtime.CoreException) OSIORestConnector(org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestConnector)

Aggregations

OSIORestConnector (org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestConnector)3 Date (java.sql.Date)1 CoreException (org.eclipse.core.runtime.CoreException)1 IStatus (org.eclipse.core.runtime.IStatus)1 Status (org.eclipse.core.runtime.Status)1 OSIORestTaskAttributeMapper (org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestTaskAttributeMapper)1 Identity (org.eclipse.linuxtools.internal.mylyn.osio.rest.core.response.data.Identity)1 OSIORestQueryTypeWizardPage (org.eclipse.linuxtools.internal.mylyn.osio.rest.ui.provisional.OSIORestQueryTypeWizardPage)1 OSIOTestRestRequestProvider (org.eclipse.linuxtools.mylyn.osio.rest.test.support.OSIOTestRestRequestProvider)1 AbstractRepositoryConnector (org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector)1 TaskRepository (org.eclipse.mylyn.tasks.core.TaskRepository)1 TaskData (org.eclipse.mylyn.tasks.core.data.TaskData)1 AbstractAttributeEditor (org.eclipse.mylyn.tasks.ui.editors.AbstractAttributeEditor)1 RepositoryQueryWizard (org.eclipse.mylyn.tasks.ui.wizards.RepositoryQueryWizard)1 Before (org.junit.Before)1