Search in sources :

Example 1 with NoProxy

use of org.bedework.calfacade.annotations.ical.NoProxy in project bw-calendar-engine by Bedework.

the class BwAlarm method getXicalProperties.

/**
 * Find x-properties storing the value of the named ical property
 *
 * @param val - name to match
 * @return list of matching properties - never null
 *  @throws CalFacadeException
 */
@NoProxy
@NoDump
public List<BwXproperty> getXicalProperties(final String val) throws CalFacadeException {
    List<BwXproperty> res = new ArrayList<>();
    List<BwXproperty> xs = getXproperties();
    if (xs == null) {
        return res;
    }
    for (BwXproperty x : xs) {
        if (x.getName().equals(BwXproperty.bedeworkIcalProp)) {
            List<Xpar> xpars = x.getParameters();
            Xpar xp = xpars.get(0);
            if (xp.getName().equals(val)) {
                res.add(x);
            }
        }
    }
    return res;
}
Also used : Xpar(org.bedework.calfacade.BwXproperty.Xpar) ArrayList(java.util.ArrayList) NoProxy(org.bedework.calfacade.annotations.ical.NoProxy) NoDump(org.bedework.calfacade.annotations.NoDump)

Example 2 with NoProxy

use of org.bedework.calfacade.annotations.ical.NoProxy in project bw-calendar-engine by Bedework.

the class BwEvent method updateStag.

/**
 * Set the stag for this event.
 * @param val
 */
@NoProxy
public void updateStag(final Timestamp val) {
    DateTime dt = new DateTime(val);
    // dt.setUtc(true);
    setStag(new LastModified(dt).getValue() + "-" + hex4FromNanos(val.getNanos()));
}
Also used : LastModified(net.fortuna.ical4j.model.property.LastModified) DateTime(net.fortuna.ical4j.model.DateTime) NoProxy(org.bedework.calfacade.annotations.ical.NoProxy)

Example 3 with NoProxy

use of org.bedework.calfacade.annotations.ical.NoProxy in project bw-calendar-engine by Bedework.

the class BwEvent method getXicalProperties.

/**
 * Find x-properties storing the value of the named ical property
 *
 * @param val - name to match
 * @return list of matching properties - never null
 *  @throws CalFacadeException
 */
@NoProxy
@NoDump
public List<BwXproperty> getXicalProperties(final String val) throws CalFacadeException {
    List<BwXproperty> res = new ArrayList<>();
    List<BwXproperty> xs = getXproperties();
    if (xs == null) {
        return res;
    }
    for (BwXproperty x : xs) {
        if (x.getName().equals(BwXproperty.bedeworkIcalProp)) {
            List<Xpar> xpars = x.getParameters();
            Xpar xp = xpars.get(0);
            if (xp.getName().equals(val)) {
                res.add(x);
            }
        }
    }
    return res;
}
Also used : Xpar(org.bedework.calfacade.BwXproperty.Xpar) ArrayList(java.util.ArrayList) NoProxy(org.bedework.calfacade.annotations.ical.NoProxy) NoDump(org.bedework.calfacade.annotations.NoDump)

Example 4 with NoProxy

use of org.bedework.calfacade.annotations.ical.NoProxy in project bw-calendar-engine by Bedework.

the class BwEvent method inDateTimeRange.

/**
 * Returns true if the event start and end dates lie within the specified
 * limits. Either or both of start and end may be null.
 *
 * @param start - UTC date/time or null
 * @param end - UTC date/time or null
 * @return true if event satisfies the limits
 */
@NoProxy
@NoWrap
public boolean inDateTimeRange(final String start, final String end) {
    if ((getEntityType() == IcalDefs.entityTypeTodo) && getNoStart()) {
        // XXX Wrong? - true if start - end covers today?
        return true;
    }
    String evStart = getDtstart().getDate();
    String evEnd = getDtend().getDate();
    int evstSt;
    if (end == null) {
        // < infinity
        evstSt = -1;
    } else {
        evstSt = evStart.compareTo(end);
    }
    if (evstSt >= 0) {
        return false;
    }
    int evendSt;
    if (start == null) {
        // > infinity
        evendSt = 1;
    } else {
        evendSt = evEnd.compareTo(start);
    }
    if ((evendSt > 0) || (evStart.equals(evEnd) && (evendSt >= 0))) {
        // Passed the tests.
        return true;
    }
    return false;
}
Also used : ToString(org.bedework.util.misc.ToString) NoProxy(org.bedework.calfacade.annotations.ical.NoProxy) NoWrap(org.bedework.calfacade.annotations.NoWrap)

Example 5 with NoProxy

use of org.bedework.calfacade.annotations.ical.NoProxy in project bw-calendar-engine by Bedework.

the class BwEvent method toString.

@Override
@NoProxy
public String toString() {
    final ToString ts = new ToString(this);
    toStringSegment(ts);
    return ts.toString();
}
Also used : ToString(org.bedework.util.misc.ToString) NoProxy(org.bedework.calfacade.annotations.ical.NoProxy) CloneForOverride(org.bedework.calfacade.annotations.CloneForOverride)

Aggregations

NoProxy (org.bedework.calfacade.annotations.ical.NoProxy)10 ToString (org.bedework.util.misc.ToString)6 DateTime (net.fortuna.ical4j.model.DateTime)3 NoDump (org.bedework.calfacade.annotations.NoDump)3 ArrayList (java.util.ArrayList)2 LastModified (net.fortuna.ical4j.model.property.LastModified)2 Xpar (org.bedework.calfacade.BwXproperty.Xpar)2 TreeSet (java.util.TreeSet)1 Period (net.fortuna.ical4j.model.Period)1 Created (net.fortuna.ical4j.model.property.Created)1 DtStamp (net.fortuna.ical4j.model.property.DtStamp)1 CloneForOverride (org.bedework.calfacade.annotations.CloneForOverride)1 NoWrap (org.bedework.calfacade.annotations.NoWrap)1