Example usage for com.google.gwt.http.client RequestBuilder GET

List of usage examples for com.google.gwt.http.client RequestBuilder GET

Introduction

In this page you can find the example usage for com.google.gwt.http.client RequestBuilder GET.

Prototype

Method GET

To view the source code for com.google.gwt.http.client RequestBuilder GET.

Click Source Link

Document

Specifies that the HTTP GET method should be used.

Usage

From source file:org.gwtcmis.service.navigation.NavigationService.java

License:Open Source License

/**
 * To support paging and get next page with items.
 * /*from w ww  . j av  a  2  s.c o m*/
 * On success response received, NextPageReceivedEvent event is fired.
 * 
 * @param url url
 * @param filter filter
 * @param includeRelationships includeRelationships
 * @param renditionFilter renditionFilter
 * @param includeAllowableActions includeAllowableActions
 * @param includePathSegment includePathSegment
 */
public void getNextPage(String url, String filter, EnumIncludeRelationships includeRelationships,
        String renditionFilter, boolean includeAllowableActions, boolean includePathSegment) {
    EntryCollection entryCollection = new EntryCollection();
    NextPageReceivedEvent event = new NextPageReceivedEvent(entryCollection);
    ExceptionThrownEvent errorEvent = new ExceptionThrownEvent("Folder content was not received.");
    EntryCollectionUnmarshaller unmarshaller = new EntryCollectionUnmarshaller(entryCollection);

    String params = "";
    params += (filter == null || filter.length() <= 0) ? "" : CmisArguments.FILTER + "=" + filter + "&";
    params += CmisArguments.INCLUDE_RELATIONSHIPS + "=" + includeRelationships.value() + "&";
    params += (renditionFilter == null || renditionFilter.length() <= 0) ? ""
            : CmisArguments.RENDITION_FILTER + "=" + renditionFilter + "&";
    params += CmisArguments.INCLUDE_ALLOWABLE_ACTIONS + "=" + includeAllowableActions + "&";
    params += CmisArguments.INCLUDE_PATH_SEGMENT + "=" + includePathSegment + "&";
    url = url.contains("?") ? (url + "&" + params) : (url + "?" + params);
    AsyncRequestCallback callback = new AsyncRequestCallback(eventBus, unmarshaller, event, errorEvent);
    AsyncRequest.build(RequestBuilder.GET, url).send(callback);
}

From source file:org.gwtcmis.service.navigation.NavigationService.java

License:Open Source License

/**
 * Gets the set of descendant objects contained in the specified folder or any of its childfolders.
 * //from  w ww .  j av  a  2 s  .  c  o  m
 * On success response received, 
 * {@link org.gwtcmis.service.navigation.event.DescendantsReceivedEvent 
 * DescendantsReceivedEvent} event is fired
 * 
 * @param url url
 * @param depth depth
 * @param filter filter
 * @param includeRelationships includeRelationships
 * @param renditionFilter renditionFilter
 * @param includeAllowableActions includeAllowableActions
 * @param includePathSegment includePathSegment
 */
public void getDescendants(String url, int depth, String filter, EnumIncludeRelationships includeRelationships,
        String renditionFilter, boolean includeAllowableActions, boolean includePathSegment) {
    EntryCollection entryCollection = new EntryCollection();
    DescendantsReceivedEvent event = new DescendantsReceivedEvent(entryCollection);
    ExceptionThrownEvent errorEvent = new ExceptionThrownEvent("Folder descendants were not received.");
    EntryCollectionUnmarshaller unmarshaller = new EntryCollectionUnmarshaller(entryCollection);

    String params = "";
    params += (depth < -1) ? "" : CmisArguments.DEPTH + "=" + depth + "&";
    params += (filter == null || filter.length() <= 0) ? "" : CmisArguments.FILTER + "=" + filter + "&";
    params += CmisArguments.INCLUDE_RELATIONSHIPS + "=" + includeRelationships.value() + "&";
    params += (renditionFilter == null || renditionFilter.length() <= 0) ? ""
            : CmisArguments.RENDITION_FILTER + "=" + renditionFilter + "&";
    params += CmisArguments.INCLUDE_ALLOWABLE_ACTIONS + "=" + includeAllowableActions + "&";
    params += CmisArguments.INCLUDE_PATH_SEGMENT + "=" + includePathSegment;
    url = url.contains("?") ? (url + "&" + params) : (url + "?" + params);
    AsyncRequestCallback callback = new AsyncRequestCallback(eventBus, unmarshaller, event, errorEvent);
    AsyncRequest.build(RequestBuilder.GET, url).send(callback);
}

From source file:org.gwtcmis.service.navigation.NavigationService.java

License:Open Source License

/**
 * Gets the set of descendant folder objects contained in the specified folder.
 * // w  w w.  j  a va  2 s  .c  o  m
 * On success response received, 
 * {@link org.gwtcmis.service.navigation.event.FolderTreeReceivedEvent 
 * FolderTreeReceivedEvent} event is fired. 
 * 
 * @param url url
 * @param depth depth
 * @param filter filter
 * @param includeRelationships includeRelationships
 * @param renditionFilter renditionFilter
 * @param includeAllowableActions includeAllowableActions
 * @param includePathSegment includePathSegment
 */
public void getFolderTree(String url, int depth, String filter, EnumIncludeRelationships includeRelationships,
        String renditionFilter, boolean includeAllowableActions, boolean includePathSegment) {
    EntryCollection entryCollection = new EntryCollection();
    FolderTreeReceivedEvent event = new FolderTreeReceivedEvent(entryCollection);
    ExceptionThrownEvent errorEvent = new ExceptionThrownEvent("Folder content was not received.");
    EntryCollectionUnmarshaller unmarshaller = new EntryCollectionUnmarshaller(entryCollection);

    String params = "";
    params += (depth < -1) ? "" : CmisArguments.DEPTH + "=" + depth + "&";
    params += (filter == null || filter.length() <= 0) ? "" : CmisArguments.FILTER + "=" + filter + "&";
    params += CmisArguments.INCLUDE_RELATIONSHIPS + "=" + includeRelationships.value() + "&";
    params += (renditionFilter == null || renditionFilter.length() <= 0) ? ""
            : CmisArguments.RENDITION_FILTER + "=" + renditionFilter + "&";
    params += CmisArguments.INCLUDE_ALLOWABLE_ACTIONS + "=" + includeAllowableActions + "&";
    params += CmisArguments.INCLUDE_PATH_SEGMENT + "=" + includePathSegment;
    url = url.contains("?") ? (url + "&" + params) : (url + "?" + params);
    AsyncRequestCallback callback = new AsyncRequestCallback(eventBus, unmarshaller, event, errorEvent);
    AsyncRequest.build(RequestBuilder.GET, url).send(callback);
}

From source file:org.gwtcmis.service.navigation.NavigationService.java

License:Open Source License

/**
 * Gets the parent folder object for the specified folder object.
 * //from   www  . ja  v a2  s . co  m
 * On success response received, FolderParentReceivedEvent event is fired.
 * 
 * @param url url
 * @param filter filter
 */
public void getFolderParent(String url, String filter) {
    AtomEntry entry = new AtomEntry();
    FolderParentReceivedEvent event = new FolderParentReceivedEvent(entry);
    ExceptionThrownEvent errorEvent = new ExceptionThrownEvent("Folder parent was not received.");
    EntryUnmarshaller unmarshaller = new EntryUnmarshaller(entry);
    String params = (filter == null || filter.length() <= 0) ? "" : CmisArguments.FILTER + "=" + filter + "&";
    url = url.contains("?") ? (url + "&" + params) : (url + "?" + params);
    AsyncRequestCallback callback = new AsyncRequestCallback(eventBus, unmarshaller, event, errorEvent);
    AsyncRequest.build(RequestBuilder.GET, url).send(callback);
}

From source file:org.gwtcmis.service.navigation.NavigationService.java

License:Open Source License

/**
 * Gets the parent folder(s) for the specified non-folder, fileable object.
 * // w  w w .j a v  a 2 s.  c om
 * On success response received, 
 * {@link org.gwtcmis.service.navigation.event.ObjectParentsReceivedEvent 
 * ObjectParentsReceivedEvent} event is fired.
 * 
 * @param url url
 * @param filter filter
 * @param includeEnumIncludeRelationships includeEnumIncludeRelationships
 * @param renditionFilter renditionFilter
 * @param includeAllowableActions includeAllowableActions
 * @param includeRelativePathSegment includeRelativePathSegment
 */
public void getObjectParents(String url, String filter, EnumIncludeRelationships includeRelationships,
        String renditionFilter, boolean includeAllowableActions, boolean includeRelativePathSegment) {
    EntryCollection entryCollection = new EntryCollection();
    ObjectParentsReceivedEvent event = new ObjectParentsReceivedEvent(entryCollection);
    ExceptionThrownEvent errorEvent = new ExceptionThrownEvent("Object parents were not received.");
    EntryCollectionUnmarshaller unmarshaller = new EntryCollectionUnmarshaller(entryCollection);

    String params = "";
    params += CmisArguments.INCLUDE_RELATIONSHIPS + "=" + includeRelationships.value() + "&";
    params += (filter == null || filter.length() <= 0) ? "" : CmisArguments.FILTER + "=" + filter + "&";
    params += (renditionFilter == null || renditionFilter.length() <= 0) ? ""
            : CmisArguments.RENDITION_FILTER + "=" + renditionFilter + "&";
    params += CmisArguments.INCLUDE_ALLOWABLE_ACTIONS + "=" + includeAllowableActions + "&";
    params += CmisArguments.INCLUDE_RELATIVE_PATH_SEGMENT + "=" + includeRelativePathSegment;
    url = url.contains("?") ? (url + "&" + params) : (url + "?" + params);
    AsyncRequestCallback callback = new AsyncRequestCallback(eventBus, unmarshaller, event, errorEvent);
    AsyncRequest.build(RequestBuilder.GET, url).send(callback);
}

From source file:org.gwtcmis.service.navigation.NavigationService.java

License:Open Source License

/**
 * Gets the list of documents that are checked out that the user has access to.
 * /*  w ww.  jav a2  s.co m*/
 * On success response received, CheckedOutReceivedEvent event is fired.
 * 
 * @param url url
 * @param folderId folderId
 * @param maxItems maxItems
 * @param skipCount skipCount
 * @param filter filter
 * @param includeRelationships includeRelationships
 * @param renditionFilter renditionFilter
 * @param includeAllowableActions includeAllowableActions
 */
public void getCheckedOut(String url, String folderId, int maxItems, int skipCount, String filter,
        EnumIncludeRelationships includeRelationships, String renditionFilter,
        boolean includeAllowableActions) {
    EntryCollection entryCollection = new EntryCollection();
    CheckedOutReceivedEvent event = new CheckedOutReceivedEvent(entryCollection);
    ExceptionThrownEvent errorEvent = new ExceptionThrownEvent("Checked out documents are not found.");
    EntryCollectionUnmarshaller unmarshaller = new EntryCollectionUnmarshaller(entryCollection);

    String params = "";
    params += (folderId == null || folderId.length() < 0) ? "" : CmisArguments.FOLDER_ID + "=" + folderId + "&";
    params += (maxItems < 0) ? "" : CmisArguments.MAX_ITEMS + "=" + maxItems + "&";
    params += (skipCount < 0) ? "" : CmisArguments.SKIP_COUNT + "=" + skipCount + "&";
    params += (filter == null || filter.length() <= 0) ? "" : CmisArguments.FILTER + "=" + filter + "&";
    params += CmisArguments.INCLUDE_RELATIONSHIPS + "=" + includeRelationships.value() + "&";
    params += (renditionFilter == null || renditionFilter.length() <= 0) ? ""
            : CmisArguments.RENDITION_FILTER + "=" + renditionFilter + "&";
    params += (skipCount < 0) ? "" : CmisArguments.SKIP_COUNT + "=" + skipCount + "&";
    params += CmisArguments.INCLUDE_ALLOWABLE_ACTIONS + "=" + includeAllowableActions;
    url = url.contains("?") ? (url + "&" + params) : (url + "?" + params);
    AsyncRequestCallback callback = new AsyncRequestCallback(eventBus, unmarshaller, event, errorEvent);
    AsyncRequest.build(RequestBuilder.GET, url).send(callback);
}

From source file:org.gwtcmis.service.object.ObjectService.java

License:Open Source License

/**
 * Gets the specified information for the Object.
 * //from w  ww  .  j  a v  a 2  s .  co m
 * On success response received, 
 * {@link org.gwtcmis.service.object.event.AllowableActionsReceivedEvent 
 * AllowableActionsReceivedEvent} event is fired
 * 
 * @param url url
 */
public void getAllowableActions(String url) {
    AllowableActions allowableActions = new AllowableActions();
    AllowableActionsReceivedEvent event = new AllowableActionsReceivedEvent(allowableActions);
    ExceptionThrownEvent errorEvent = new ExceptionThrownEvent("Allowable actions were not received.");
    AllowableActionsUnmarshaller unmarshaller = new AllowableActionsUnmarshaller(allowableActions);
    AsyncRequestCallback callback = new AsyncRequestCallback(eventBus, unmarshaller, event, errorEvent);
    AsyncRequest.build(RequestBuilder.GET, url).send(callback);
}

From source file:org.gwtcmis.service.object.ObjectService.java

License:Open Source License

/**
 * Gets the specified information for the Object.
 * /*  w ww .j  a v  a  2s .c  o  m*/
 * On success response received, 
 * {@link org.gwtcmis.service.object.event.ObjectReceivedEvent 
 * ObjectReceivedEvent} event is fired
 * 
 * @param url url
 * @param filter filter
 * @param includeEnumIncludeRelationships includeEnumIncludeRelationships
 * @param includePolicyIds includePolicyIds
 * @param renditionFilter renditionFilter
 * @param includeACL includeACL
 * @param includeAllowableActions includeAllowableActions
 */
public void getObject(String url, String filter, EnumIncludeRelationships includeRelationships,
        boolean includePolicyIds, String renditionFilter, boolean includeACL, boolean includeAllowableActions) {
    AtomEntry entry = new AtomEntry();
    ObjectReceivedEvent event = new ObjectReceivedEvent(entry);
    ExceptionThrownEvent errorEvent = new ExceptionThrownEvent("Object was not received.");
    EntryUnmarshaller unmarshaller = new EntryUnmarshaller(entry);

    String params = "";
    params += (filter == null || filter.length() <= 0) ? "" : CmisArguments.FILTER + "=" + filter + "&";
    params += CmisArguments.INCLUDE_RELATIONSHIPS + "=" + includeRelationships.value() + "&";
    params += (renditionFilter == null || renditionFilter.length() <= 0) ? ""
            : CmisArguments.RENDITION_FILTER + "=" + renditionFilter + "&";
    params += CmisArguments.INCLUDE_ACL + "=" + includeACL + "&";
    params += CmisArguments.INCLUDE_POLICY_IDS + "=" + includePolicyIds + "&";
    params += CmisArguments.INCLUDE_ALLOWABLE_ACTIONS + "=" + includeAllowableActions;
    url = (url.contains("?")) ? (url + "&" + params) : (url + "?" + params);
    AsyncRequestCallback callback = new AsyncRequestCallback(eventBus, unmarshaller, event, errorEvent);
    AsyncRequest.build(RequestBuilder.GET, url).send(callback);
}

From source file:org.gwtcmis.service.object.ObjectService.java

License:Open Source License

/**
 * Gets the list of properties for an Object.
 * //from  w w w . java 2 s . c om
 * On success response received, {@link PropertiesReceivedEvent} event is fired.
 * 
 * @param url url
 * @param filter filter
 */
public void getProperties(String url, String filter) {
    AtomEntry entry = new AtomEntry();
    PropertiesReceivedEvent event = new PropertiesReceivedEvent(entry);
    ExceptionThrownEvent errorEvent = new ExceptionThrownEvent("Object properties were not recieved.");
    EntryUnmarshaller unmarshaller = new EntryUnmarshaller(entry);
    String params = (filter == null || filter.length() < 0) ? "" : CmisArguments.FILTER + "=" + filter;
    url = (url.contains("?")) ? (url + "&" + params) : (url + "?" + params);
    AsyncRequestCallback callback = new AsyncRequestCallback(eventBus, unmarshaller, event, errorEvent);
    AsyncRequest.build(RequestBuilder.GET, url).send(callback);
}

From source file:org.gwtcmis.service.object.ObjectService.java

License:Open Source License

/**
 * Gets the content stream for the specified Document object, 
 * or gets a rendition stream for a specified rendition of a document or folder object.
 * /*from  w ww  . j a v  a 2 s .  c o  m*/
 * On success response received, {@link ContentStreamReceivedEvent}  event is fired.
 * 
 * @param url url
 * @param streamId streamId
 */
public void getContentStream(String url, String streamId) {
    CmisContentStreamType contentStream = new CmisContentStreamType();
    ContentStreamReceivedEvent event = new ContentStreamReceivedEvent(contentStream);
    ExceptionThrownEvent errorEvent = new ExceptionThrownEvent("Content stream is not recieved.");
    ContentStreamUnmarshaller unmarshaller = new ContentStreamUnmarshaller(contentStream);
    AsyncRequestCallback callback = new AsyncRequestCallback(eventBus, unmarshaller, event, errorEvent);
    AsyncRequest.build(RequestBuilder.GET, url + "?nocache=" + String.valueOf(Random.nextDouble()))
            .send(callback);
}