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.policy.PolicyService.java

License:Open Source License

/**
 * Gets the list of policies currently applied to the specified object.
 * //from ww  w  .j  av a 2s.c  o  m
 * On success response received, {@link AppliedPoliciesReceivedEvent} event is fired
 * 
 * @param url url
 * @param filter filter
 */
public void getAppliedPolicies(String url, String filter) {
    EntryCollection policies = new EntryCollection();
    AppliedPoliciesReceivedEvent event = new AppliedPoliciesReceivedEvent(policies);
    ExceptionThrownEvent errorEvent = new ExceptionThrownEvent("Applied policies were not recieved.");
    EntryCollectionUnmarshaller unmarshaller = new EntryCollectionUnmarshaller(policies);
    String params = "";
    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.relationship.RelationshipService.java

License:Open Source License

/**
 * Gets all or a subset of relationships associated with an independent object.
 * /*w ww  . j ava 2 s .co m*/
 * On success response received, {@link RelationshipsReceivedEvent} event is fired
 * 
 * @param url url
 * @param includeSubRelationshipTypes include sub relationship types
 * @param relationshipDirection relationship direction
 * @param typeId type id
 * @param maxItems max items
 * @param skipCount skip count
 * @param filter filter
 * @param includeAllowableActions include allowable actions
 */
public void getObjectRelationships(String url, boolean includeSubRelationshipTypes,
        EnumRelationshipDirection relationshipDirection, String typeId, int maxItems, int skipCount,
        String filter, boolean includeAllowableActions) {
    EntryCollection relationships = new EntryCollection();
    RelationshipsReceivedEvent event = new RelationshipsReceivedEvent(relationships, relationshipDirection);
    ExceptionThrownEvent errorEvent = new ExceptionThrownEvent("Object's relationship was not recieved.");
    EntryCollectionUnmarshaller unmarshaller = new EntryCollectionUnmarshaller(relationships);

    String params = "";
    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_ALLOWABLE_ACTIONS + "=" + includeAllowableActions + "&";
    params += CmisArguments.INCLUDE_SUB_RELATIONSHIP_TYPES + "=" + includeSubRelationshipTypes;
    params += (skipCount < 0) ? "" : CmisArguments.SKIP_COUNT + "=" + skipCount;
    params += (relationshipDirection == null) ? ""
            : CmisArguments.RELATIONSHIP_DIRECTION + "=" + relationshipDirection.value();
    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.repository.RepositoryService.java

License:Open Source License

/**
 * Get a list of CMIS repositories available from this CMIS service endpoint.
 * /* w  w  w  .  j a v  a 2  s .  c o  m*/
 * On success response received, {@link RepositoriesReceivedEvent} event is fired
 * 
 * @param url url
 */
public void getRepositories(String url) {
    CmisRepositories cmisService = new CmisRepositories();
    RepositoriesReceivedEvent event = new RepositoriesReceivedEvent(url, cmisService);
    ExceptionThrownEvent errorEvent = new ExceptionThrownEvent("Service " + url + " is not available");
    RepositoriesUnmarshaller unmarshaller = new RepositoriesUnmarshaller(cmisService);
    AsyncRequestCallback callback = new AsyncRequestCallback(eventBus, unmarshaller, event, errorEvent);
    AsyncRequest.build(RequestBuilder.GET, url).send(callback);
}

From source file:org.gwtcmis.service.repository.RepositoryService.java

License:Open Source License

/**
 * Get information about the CMIS repository, the optional capabilities it supports and its 
 * Access Control information if applicable.
 * // w  ww  . j a  v a2 s  .c om
 * On success response received, {@link RepositoryInfoReceivedEvent} event is fired
 * 
 * @param url url
 */
public void getRepositoryInfo(String url) {
    CmisRepositoryInfo repositoryInfo = new CmisRepositoryInfo();
    RepositoryInfoReceivedEvent event = new RepositoryInfoReceivedEvent(repositoryInfo);
    ExceptionThrownEvent errorEvent = new ExceptionThrownEvent("Repository information was not received.");
    RepositoryInfoUnmarshaller unmarshaller = new RepositoryInfoUnmarshaller(repositoryInfo);
    AsyncRequestCallback callback = new AsyncRequestCallback(eventBus, unmarshaller, event, errorEvent);
    AsyncRequest.build(RequestBuilder.GET, url).send(callback);
}

From source file:org.gwtcmis.service.repository.RepositoryService.java

License:Open Source License

/**
 * Returns the list of Object-Types defined for the Repository that are children of the specified type.
 * //from  w ww . ja v  a  2 s  .c o m
 * On success response received, {@link TypeChildrenReceivedEvent} event is fired
 * 
 * @param url url
 * @param includePropertyDefinitions include property definitions
 * @param maxItems max items
 * @param skipCount skip count
 */
public void getTypeChildren(String url, boolean includePropertyDefinitions, int maxItems, int skipCount) {
    TypeCollection typeCollection = new TypeCollection();
    TypeChildrenReceivedEvent event = new TypeChildrenReceivedEvent(typeCollection);
    ExceptionThrownEvent errorEvent = new ExceptionThrownEvent("List of types was not received.");
    TypeChildrenUnmarshaller unmarshaller = new TypeChildrenUnmarshaller(typeCollection);

    String params = "";
    params += (maxItems < 0) ? "" : CmisArguments.MAX_ITEMS + "=" + maxItems + "&";
    params += (skipCount < 0) ? "" : CmisArguments.SKIP_COUNT + "=" + skipCount + "&";
    params += CmisArguments.INCLUDE_PROPERTY_DEFINITIONS + "=" + includePropertyDefinitions;
    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.repository.RepositoryService.java

License:Open Source License

/**
 * Get the set of descendant Object-Types defined for the Repository under the specified type.
 * /*  w ww  .  j  a va 2s  . com*/
 * On success response received, {@link TypeDescendantsRecievedEvent} event is fired
 * 
 * @param url url
 * @param typeId type id
 * @param depth depth
 * @param includePropertyDefinition include property definition
 */
public void getTypeDescendants(String url, String typeId, int depth, boolean includePropertyDefinition) {
    TypeCollection typeCollection = new TypeCollection();
    TypeDescendantsRecievedEvent event = new TypeDescendantsRecievedEvent(typeCollection);
    ExceptionThrownEvent errorEvent = new ExceptionThrownEvent("List of types was not received.");
    TypeDescendantsUnmarshaller unmarshaller = new TypeDescendantsUnmarshaller(typeCollection);
    String params = "";
    params += (depth < -1) ? "" : CmisArguments.DEPTH + "=" + depth + "&";
    params += CmisArguments.INCLUDE_PROPERTY_DEFINITIONS + "=" + includePropertyDefinition;
    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.repository.RepositoryService.java

License:Open Source License

/**
 * Gets the definition of the specified Object-Type.
 * /*from  w w w. j ava  2 s .co  m*/
 * On success response received, {@link TypeDefinitionReceivedEvent} event is fired
 * 
 * @param url url
 */
public void getTypeDefinition(String url) {
    TypeEntry type = new TypeEntry();
    TypeDefinitionReceivedEvent event = new TypeDefinitionReceivedEvent(type);
    ExceptionThrownEvent errorEvent = new ExceptionThrownEvent("Type definition was not received.");
    TypeDefinitionUnmarshaller unmarshaller = new TypeDefinitionUnmarshaller(type);
    AsyncRequestCallback callback = new AsyncRequestCallback(eventBus, unmarshaller, event, errorEvent);
    AsyncRequest.build(RequestBuilder.GET, url).send(callback);
}

From source file:org.gwtcmis.service.repository.RepositoryService.java

License:Open Source License

/**
 * Get base types of the repository.//from  w  w w .ja  va  2 s  .c o  m
 * 
 * On success response received, {@link BaseTypesReceivedEvent} event is fired
 * 
 * @param url url
 * @param includePropertyDefinition include property definition
 */
public void getBaseTypes(String url, boolean includePropertyDefinition) {
    TypeCollection typeCollection = new TypeCollection();
    BaseTypesReceivedEvent event = new BaseTypesReceivedEvent(typeCollection);
    ExceptionThrownEvent errorEvent = new ExceptionThrownEvent("List of base types was not received.");
    TypeChildrenUnmarshaller unmarshaller = new TypeChildrenUnmarshaller(typeCollection);
    String params = CmisArguments.INCLUDE_PROPERTY_DEFINITIONS + "=" + includePropertyDefinition;
    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.repository.RepositoryService.java

License:Open Source License

/**
 * Get types as a plain list.//from   w w w. j a va  2s . c o m
 * 
 * On success response received, {@link TypeListReceivedEvent} event is fired
 * 
 * @param url url
 * @param includePropertyDefinition include property definition
 */
public void getTypeList(String url, boolean includePropertyDefinition) {
    TypeList typeList = new TypeList();
    TypeListReceivedEvent event = new TypeListReceivedEvent(typeList);
    ExceptionThrownEvent errorEvent = new ExceptionThrownEvent("List of types was not received.");
    TypeListUnmarshaller unmarshaller = new TypeListUnmarshaller(typeList);
    String params = CmisArguments.INCLUDE_PROPERTY_DEFINITIONS + "=" + includePropertyDefinition + "&"
            + CmisArguments.DEPTH + "=" + -1;
    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.versioning.VersioningService.java

License:Open Source License

/**
 * Returns the list of all Document Objects in the specified Version Series, 
 * sorted by cmis:creationDate descending.
 * /*from  w ww . j  ava2s  . com*/
 * On success response received, {@link AllVersionsReceivedEvent} event is fired
 *  
 * @param url url
 * @param filter filter
 * @param includeAllowableActions include allowable actions
 */
public void getAllVersions(String url, String filter, boolean includeAllowableActions) {
    EntryCollection entryCollection = new EntryCollection();
    AllVersionsReceivedEvent event = new AllVersionsReceivedEvent(entryCollection);
    ExceptionThrownEvent errorEvent = new ExceptionThrownEvent("All versions were not received.");
    EntryCollectionUnmarshaller unmarshaller = new EntryCollectionUnmarshaller(entryCollection);

    String params = CmisArguments.INCLUDE_ALLOWABLE_ACTIONS + "=" + includeAllowableActions + "&";
    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);
}