01: package org.theospi.portfolio.list.impl;
02:
03: import org.sakaiproject.component.cover.ServerConfigurationService;
04:
05: /**
06: * Created by IntelliJ IDEA.
07: * User: John Ellis
08: * Date: Feb 10, 2006
09: * Time: 3:15:45 PM
10: * To change this template use File | Settings | File Templates.
11: */
12: public abstract class WorksiteBaseGenerator extends BaseListGenerator {
13: public void init() {
14: super .init();
15: }
16:
17: protected abstract String getSiteId(Object entity);
18:
19: protected abstract String getPageId(Object entity);
20:
21: public String getCustomLink(Object entry) {
22: // http://nightly2.sakaiproject.org:8084/portal/site/804a576b-6d03-474f-008c-74bd96a80676
23: // http://iter-odd.rsmart.com:8081/portal/site/f66ba891-fdb8-44bf-0063-04b663b88c23/page/77a3d5ad-7a1a-4aa8-80ba-0fa2504a3b36
24: String siteId = getSiteId(entry);
25: String pageId = getPageId(entry);
26:
27: String link = "/site/" + siteId;
28: if (pageId != null) {
29: link = link + "/page/" + pageId;
30: }
31: return ServerConfigurationService.getPortalUrl() + link;
32: }
33:
34: }
|