Search in sources :

Example 1 with BwCollectionLastmod

use of org.bedework.calfacade.BwCollectionLastmod in project bw-calendar-engine by Bedework.

the class EntityBuilder method makeCollection.

BwCalendar makeCollection() throws CalFacadeException {
    final BwCalendar col = new BwCalendar();
    restoreSharedEntity(col);
    col.setName(getString(PropertyInfoIndex.NAME));
    col.setPath(getString(PropertyInfoIndex.HREF));
    col.setCreated(getString(PropertyInfoIndex.CREATED));
    col.setLastmod(new BwCollectionLastmod(col, getString(PropertyInfoIndex.LAST_MODIFIED)));
    col.setSummary(getString(PropertyInfoIndex.SUMMARY));
    col.setDescription(getString(PropertyInfoIndex.DESCRIPTION));
    col.setAffectsFreeBusy(getBool(PropertyInfoIndex.AFFECTS_FREE_BUSY));
    col.setAliasUri(getString(PropertyInfoIndex.ALIAS_URI));
    col.setCalType(getInt(PropertyInfoIndex.CALTYPE));
    col.setDisplay(getBool(PropertyInfoIndex.DISPLAY));
    col.setFilterExpr(getString(PropertyInfoIndex.FILTER_EXPR));
    col.setIgnoreTransparency(getBool(PropertyInfoIndex.IGNORE_TRANSP));
    col.setLastRefresh(getString(PropertyInfoIndex.LAST_REFRESH));
    col.setLastRefreshStatus(getString(PropertyInfoIndex.LAST_REFRESH_STATUS));
    col.setRefreshRate(getInt(PropertyInfoIndex.REFRESH_RATE));
    col.setRemoteId(getString(PropertyInfoIndex.REMOTE_ID));
    col.setRemotePw(getString(PropertyInfoIndex.REMOTE_PW));
    col.setUnremoveable(getBool(PropertyInfoIndex.UNREMOVEABLE));
    restoreProperties(col);
    restoreCategories(col);
    return col;
}
Also used : BwCollectionLastmod(org.bedework.calfacade.BwCollectionLastmod) BwCalendar(org.bedework.calfacade.BwCalendar)

Example 2 with BwCollectionLastmod

use of org.bedework.calfacade.BwCollectionLastmod in project bw-calendar-engine by Bedework.

the class CoreCalendars method testSynchCol.

@Override
public boolean testSynchCol(final BwCalendar col, final String token) throws CalFacadeException {
    if (token == null) {
        return true;
    }
    final String lastmod = token.substring(0, 16);
    final int seq = Integer.parseInt(token.substring(17), 16);
    final BwCollectionLastmod cl = col.getLastmod();
    final int cmp = cl.getTimestamp().compareTo(lastmod);
    if (cmp > 0) {
        return true;
    }
    if (cmp < 0) {
        return false;
    }
    return cl.getSequence() > seq;
}
Also used : BwCollectionLastmod(org.bedework.calfacade.BwCollectionLastmod)

Example 3 with BwCollectionLastmod

use of org.bedework.calfacade.BwCollectionLastmod in project bw-calendar-engine by Bedework.

the class CollectionLastmodRule method end.

public void end(String ns, String name) throws Exception {
    BwCollectionLastmod lm = (BwCollectionLastmod) pop();
    BwCalendar ent = (BwCalendar) top();
    ent.setLastmod(lm);
    lm.setDbEntity(ent);
}
Also used : BwCollectionLastmod(org.bedework.calfacade.BwCollectionLastmod) BwCalendar(org.bedework.calfacade.BwCalendar)

Aggregations

BwCollectionLastmod (org.bedework.calfacade.BwCollectionLastmod)3 BwCalendar (org.bedework.calfacade.BwCalendar)2