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

plugin-template.src.BreadcrumbFE.tpl Maven / Gradle / Ivy

The newest version!
package ${project-package};

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.chon.cms.core.model.types.RootContentNode;
import org.chon.cms.model.content.IContentNode;
import org.chon.web.api.Request;
import org.chon.web.api.Response;

public class BreadcrumbFE {

	private IContentNode node;

	public BreadcrumbFE(Request req, Response resp, IContentNode node) {
		this.node = node;
	}
	
	public List getList() {
		List rv = new ArrayList();
		if(node instanceof RootContentNode) {
			return rv;
		}
		IContentNode n = node.getParent();
		while(n != null) {
			rv.add(n);
			if(n instanceof RootContentNode) 
				break;
			n = n.getParent();
		}
		Collections.reverse(rv);
		return rv;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy