是否可以在XWiki Syntax 2.x中添加子项然后返回包含项?
我想要的是:
1. item 1 which might continue for several lines
and which get lined up correctly base on the list
thing:
* sub1 of item 1
* sub2 of item 1
Continuing with item 1, but not inside sub2.
2. item 2 continues the list.
我有
1. Item 1
1*. sub1
1*. sub2
anything here is part of sub2. If I skip a line, I leave the outer list.
那么,这可能是wiki语法还是我必须使用HTML?
答案 0 :(得分:3)
是的,可以使用小组:
public class RetryWithDelay implements
Func1<Observable<? extends Throwable>, Observable<?>> {
private static final String TAG = "RetryWithDelay";
private static final int DEFAULT_RETRY_COUNT = 5;
private static final int DEFAULT_RETRY_DELAY = 1000 * 60;
private final int maxRetries;
private final int retryDelayMillis;
private int retryCount;
public RetryWithDelay() {
this.maxRetries = DEFAULT_RETRY_COUNT;
this.retryDelayMillis = DEFAULT_RETRY_DELAY;
this.retryCount = 0;
}
public RetryWithDelay(final int maxRetries, final int retryDelayMillis) {
this.maxRetries = maxRetries;
this.retryDelayMillis = retryDelayMillis;
this.retryCount = 0;
}
@Override
public Observable<?> call(Observable<? extends Throwable> attempts) {
return attempts.flatMap(new Func1<Throwable, Observable<?>>() {
@Override
public Observable<?> call(Throwable throwable) {
if (throwable instanceof HttpException) {
LOGD(TAG, "Caught http exception.");
}
if (throwable instanceof IOException) {
LOGD(TAG, "Network error");
}
if (++retryCount < maxRetries) {
// When this Observable calls onNext, the original
// Observable will be retried (i.e. re-subscribed).
return Observable.timer(retryDelayMillis, TimeUnit.MILLISECONDS);
}
// Max retries hit. Just pass the error along.
return Observable.error(throwable);
}
});
}
}
有关完整语法+其他示例,请参阅http://platform.xwiki.org/xwiki/bin/view/Main/XWikiSyntax?syntax=2.1§ion=Groups。