All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dw.cli.commands.AllPageGetter Maven / Gradle / Ivy

package dw.cli.commands;

import java.util.List;

import com.martiansoftware.jsap.JSAP;
import com.martiansoftware.jsap.JSAPException;

import dw.xmlrpc.DokuJClient;
import dw.xmlrpc.Page;
import dw.xmlrpc.exception.DokuException;

public class AllPageGetter extends ItemListToStringCommand {

	@Override
	protected void registerParameters(JSAP jsap) throws JSAPException {
		addLongFormatSwitch(jsap);
	}

	@Override
	protected List query(DokuJClient dokuClient) throws DokuException {
		return dokuClient.getAllPages();
	}

	@Override
	protected String itemToString(Page page) {
		if ( !_config.getBoolean("longFormat") ){
			return page.id();
		} else {
			return page.id()
					+ " " + page.perms()
					+ " " + page.size();
		}
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy