-
Notifications
You must be signed in to change notification settings - Fork 21
FAQ
No, you can just wrap your objects with DrupalEntityContainer or AbstractDrupalArrayEntity to get full api functionality without inheriting AbstractDrupalEntity.
DrupalArrayEntity
- container, implementing collection interface. Can manage drupal and non-drupal entities, providing them with all DrupalEntity
methods like post, push, pull, delete.
DrupalEntityContainer
- wrapper object, able to contain drupal or non-drupal entities providing them with all DrupalEntity methods like post, push, pull, delete.
Note: in case of raw content item types deserialization issues may occur.
You shouldn’t store instances of this class (or subclasses) as serializable fields: objects, containing subclasses of this entity container won’t be able to deserialize them correctly.
Implement ILoginManager
interface and pass to DrupalClient
constructor.
You can use drupal client instance to cancel all pending requests
DrupalClient drupalClient = ...
drupalClient.cancelAll();
Or cancel requests by tag/listener
DrupalClient drupalClient = ...
drupalClient.cancelAllRequestsForListener(OnResponseListener, tag);
Also it is possible to cancel requests related to specific entity
drupalEntity.cancellAllRequests().
DrupalClient drupalClient = ...
drupalClient.setProgressListener(new DrupalClient.RequestProgressListener() {
@Override
public void onRequestStarted(DrupalClient theClient, int activeRequests) {
if (activeRequests > 0) {
// show progress
}
}
@Override
public void onRequestFinished(DrupalClient theClient, int activeRequests) {
if (activeRequests == 0) {
// hide progress
}
}
});
You have to specify request format you need while creating DrupalClient
or in AbstractBaseDrupalEntity
class:
@override
protected RequestConfig getRequestConfig(RequestMethod method,Object resultClass)
{
RequestConfig config = super.getRequestConfig(method,resultClass);
config.setRequestFormat(RequestFormat.XML);
return config;
}
and implement IResponseItem
and IPostableItem
interfaces by your class drupal class or container to customize object serialization and deserialization.
Yes, you can just create BaseRequest objects and deal with them, using our api as simple networking library:
RequestConfig config = new RequestConfig(respTypeSpec);
BaseRequest request = new BaseRequest(RequestMethod.GET,
"some/relative/url",config);
myClient.performRequest(request,myTag,myListener,synchronous);