1 23 24 package org.infoglue.deliver.controllers.kernel.impl.simple; 25 26 import java.awt.Color ; 27 import java.text.NumberFormat ; 28 import java.util.Collection ; 29 import java.util.Enumeration ; 30 import java.util.List ; 31 import java.util.Locale ; 32 import java.util.Map ; 33 import java.util.Vector ; 34 35 import javax.servlet.http.HttpServletRequest ; 36 37 import org.exolab.castor.jdo.Database; 38 import org.infoglue.cms.applications.common.VisualFormatter; 39 import org.infoglue.cms.entities.content.ContentVO; 40 import org.infoglue.cms.entities.content.ContentVersionVO; 41 import org.infoglue.cms.entities.management.ContentTypeDefinitionVO; 42 import org.infoglue.cms.entities.management.LanguageVO; 43 import org.infoglue.cms.entities.structure.SiteNodeVO; 44 import org.infoglue.cms.exception.SystemException; 45 import org.infoglue.cms.security.InfoGluePrincipal; 46 import org.infoglue.cms.util.DesEncryptionHelper; 47 import org.infoglue.deliver.applications.databeans.DatabaseWrapper; 48 import org.infoglue.deliver.applications.databeans.DeliveryContext; 49 import org.infoglue.deliver.applications.databeans.WebPage; 50 import org.infoglue.deliver.util.BrowserBean; 51 import org.infoglue.deliver.util.MathHelper; 52 import org.infoglue.deliver.util.ObjectConverter; 53 import org.infoglue.deliver.util.charts.ChartHelper; 54 import org.infoglue.deliver.util.graphics.ColorHelper; 55 import org.infoglue.deliver.util.graphics.FontHelper; 56 import org.infoglue.deliver.util.rss.RssHelper; 57 import org.infoglue.deliver.util.webservices.WebServiceHelper; 58 59 60 63 public interface TemplateController 64 { 65 67 70 public abstract Database getDatabase() throws SystemException; 71 72 public abstract DatabaseWrapper getDatabaseWrapper(); 73 74 77 78 public abstract void commitDatabase() throws SystemException; 79 80 84 public abstract void addToContext(String name, Object object); 85 86 89 public abstract void setStandardRequestParameters(Integer siteNodeId, Integer languageId, Integer contentId); 90 91 94 public abstract void setHttpRequest(HttpServletRequest request); 95 96 99 public abstract void setBrowserBean(BrowserBean browserBean); 100 101 104 public abstract String getTemplateAttributeName(); 105 106 109 public abstract Integer getSiteNodeId(); 110 111 114 public abstract Integer getLanguageId(); 115 116 119 public abstract Integer getContentId(); 120 121 124 public abstract ComponentLogic getComponentLogic(); 125 126 129 public abstract void setComponentLogic(ComponentLogic componentLogic); 130 131 134 public abstract VisualFormatter getVisualFormatter(); 135 136 139 public abstract ColorHelper getColorHelper(); 140 141 144 public abstract FontHelper getFontHelper(); 145 146 149 public abstract MathHelper getMathHelper(); 150 151 154 public abstract ChartHelper getChartHelper(); 155 156 159 public abstract WebServiceHelper getWebServiceHelper(); 160 161 164 public abstract NumberFormat getNumberFormatHelper() throws SystemException; 165 166 169 public DesEncryptionHelper getDesEncryptionHelper(); 170 171 174 public RssHelper getRssHelper(); 175 176 179 public abstract ObjectConverter getObjectConverter(); 180 181 184 public abstract ContentVO getContent(); 185 186 189 public abstract ContentVO getContent(Integer contentId); 190 191 public abstract InfoGluePrincipal getPrincipal(); 192 193 198 199 public abstract InfoGluePrincipal getPrincipal(String userName); 200 201 206 public abstract String getPrincipalPropertyValue(String propertyName); 207 208 213 public abstract Map getPrincipalPropertyHashValues(String propertyName); 214 215 220 public abstract String getPrincipalPropertyValue( 221 InfoGluePrincipal infoGluePrincipal, String propertyName); 222 223 228 public abstract Map getPrincipalPropertyHashValues( 229 InfoGluePrincipal infoGluePrincipal, String propertyName); 230 231 236 public abstract String getPrincipalPropertyValue( 237 InfoGluePrincipal infoGluePrincipal, String propertyName, 238 boolean escapeSpecialCharacters); 239 240 245 public abstract String getPrincipalPropertyValue(String propertyName, 246 boolean escapeSpecialCharacters); 247 248 253 public abstract Map getPrincipalPropertyHashValues( 254 InfoGluePrincipal infoGluePrincipal, String propertyName, 255 boolean escapeSpecialCharacters); 256 257 262 public abstract Map getPrincipalPropertyHashValues(String propertyName, 263 boolean escapeSpecialCharacters); 264 265 268 public abstract HttpServletRequest getHttpServletRequest(); 269 270 271 274 public abstract Enumeration getRequestParamenterNames(); 275 276 279 public abstract String getRequestParameter(String parameterName); 280 281 284 public abstract String [] getRequestParameterValues(String parameterName); 285 286 289 public abstract BrowserBean getBrowserBean(); 290 291 294 public abstract void setDeliveryControllers( 295 NodeDeliveryController nodeDeliveryController, 296 ContentDeliveryController contentDeliveryController, 297 IntegrationDeliveryController integrationDeliveryController); 298 299 303 public abstract String getContentAttribute(String contentBindningName, String attributeName, boolean clean); 304 305 309 public abstract String getContentAttribute(String attributeName, 310 boolean clean); 311 312 327 public abstract String getContentAttribute(Integer contentId, 328 String attributeName, boolean clean); 329 330 334 335 public abstract String getContentAttribute(Integer contentId, 336 Integer langaugeId, String attributeName, boolean clean); 337 338 342 343 public String getContentAttributeWithReturningId(Integer contentId, 344 Integer languageId, String attributeName, boolean clean, List contentVersionId); 345 346 350 public abstract String getContentAttribute(String attributeName); 351 352 357 public abstract String getContentAttribute(String contentBindningName, 358 String attributeName); 359 360 365 public abstract String getContentAttribute(Integer contentId, 366 String attributeName); 367 368 373 public abstract String getContentAttribute(Integer contentId, 374 Integer languageId, String attributeName); 375 376 377 382 public abstract String getParsedContentAttribute(String attributeName); 383 384 389 public abstract String getParsedContentAttribute( 390 String contentBindningName, String attributeName); 391 392 396 public abstract String getParsedContentAttribute(Integer contentId, 397 String attributeName); 398 399 403 public abstract String getParsedContentAttribute(String attributeName, 404 boolean clean); 405 406 410 public abstract String getParsedContentAttribute( 411 String contentBindningName, String attributeName, boolean clean); 412 413 417 public abstract String getParsedContentAttribute( 418 Integer contentId, String attributeName, boolean clean); 419 420 424 public abstract String getParsedContentAttribute( 425 Integer contentId, Integer languageId, String attributeName, boolean clean); 426 427 430 public abstract Collection getAssetKeys(String contentBindningName); 431 432 435 public abstract Collection getAssetKeys(Integer contentId); 436 437 441 public abstract String getAssetThumbnailUrl(Integer contentId, int width, 442 int height); 443 444 448 public abstract String getAssetThumbnailUrl(Integer contentId, 449 String assetKey, int width, int height); 450 451 456 public abstract String getAssetThumbnailUrl(String contentBindningName, 457 int width, int height); 458 459 464 public abstract String getAssetThumbnailUrl(String contentBindningName, 465 String assetKey, int width, int height); 466 467 472 public abstract String getAssetUrl(String contentBindningName); 473 474 public abstract String getEncodedUrl(String s, String enc); 475 476 479 public abstract String getAssetUrl(Integer contentId); 480 481 484 public abstract String getAssetUrl(Integer contentId, String assetKey); 485 486 491 public abstract String getAssetUrl(String contentBindningName, int index); 492 493 498 public abstract String getAssetUrl(String contentBindningName, 499 String assetKey); 500 501 506 public abstract String getInlineAssetUrl(String assetKey); 507 508 513 public abstract String getInlineAssetUrl(Integer contentId, String assetKey); 514 515 public abstract Integer getAssetFileSize(Integer contentId); 520 521 public abstract Integer getAssetFileSize(Integer contentId, String assetKey); 522 523 public abstract Integer getAssetFileSize(String contentBindningName, 524 int index); 525 526 public abstract Integer getAssetFileSize(String contentBindningName, 527 String assetKey); 528 529 534 public abstract List getRelatedContentsByQualifyer(String qualifyerXML); 535 536 541 public abstract List getRelatedContents(String attributeName); 542 543 548 public abstract List getRelatedContents(String bindingName, 549 String attributeName); 550 551 556 public abstract List getRelatedContents(Integer contentId, 557 String attributeName); 558 559 564 public abstract List getRelatedPages(String attributeName); 565 566 571 public abstract List getRelatedPages(String bindingName, 572 String attributeName); 573 574 579 public abstract List getRelatedPages(Integer contentId, String attributeName); 580 581 585 public abstract String getArchiveBaseUrl(String contentBindningName, 586 String assetKey); 587 588 592 public abstract String getArchiveBaseUrl(Integer contentId, String assetKey); 593 594 public abstract Vector getArchiveEntries(Integer contentId, String assetKey); 595 596 600 public abstract String getArchiveBaseUrl(String contentBindningName, 601 int index, String assetKey); 602 603 612 public abstract String getContentAttributeAsPDFUrl( 613 String contentBindningName, String attributeName); 614 615 618 619 public abstract List getContentAttributes(String schemaValue); 620 621 633 public abstract String getContentAttributeAsImageUrl( 634 String contentBindningName, String attributeName, int canvasWidth, 635 int canvasHeight); 636 637 public abstract String getContentAttributeAsImageUrl( 638 String contentBindningName, String attributeName, int canvasWidth, 639 int canvasHeight, int textStartPosX, int textStartPosY, 640 int textWidth, int textHeight, String fontName, int fontStyle, 641 int fontSize, String foregroundColor, String backgroundColor); 642 643 public abstract String getContentAttributeAsImageUrl( 644 String contentBindningName, String attributeName, int canvasWidth, 645 int canvasHeight, int textStartPosX, int textStartPosY, 646 int textWidth, int textHeight, String fontName, int fontStyle, 647 int fontSize, String foregroundColor, String backgroundColor, 648 String backgroundImageUrl); 649 650 public abstract String getContentAttributeAsImageUrl(Integer contentId, 651 String attributeName, int canvasWidth, int canvasHeight, 652 int textStartPosX, int textStartPosY, int textWidth, 653 int textHeight, String fontName, int fontStyle, int fontSize, 654 String foregroundColor, String backgroundColor); 655 656 public abstract String getContentAttributeAsImageUrl( 657 String contentBindningName, String attributeName, int canvasWidth, 658 int canvasHeight, int textStartPosX, int textStartPosY, 659 int textWidth, int textHeight, String fontName, int fontStyle, 660 int fontSize, Color foregroundColor, Color backgroundColor); 661 662 public abstract String getContentAttributeAsImageUrl( 663 String contentBindningName, String attributeName, int canvasWidth, 664 int canvasHeight, int textStartPosX, int textStartPosY, 665 int textWidth, int textHeight, String fontName, int fontStyle, 666 int fontSize, Color foregroundColor, Color backgroundColor, 667 String backgroundImageUrl); 668 669 public abstract String getContentAttributeAsImageUrl(Integer contentId, 670 String attributeName, int canvasWidth, int canvasHeight, 671 int textStartPosX, int textStartPosY, int textWidth, 672 int textHeight, String fontName, int fontStyle, int fontSize, 673 Color foregroundColor, Color backgroundColor); 674 675 public abstract String getContentAttributeAsImageUrl(Integer contentId, 676 String attributeName, int canvasWidth, int canvasHeight, 677 int textStartPosX, int textStartPosY, int textWidth, 678 int textHeight, String fontName, int fontStyle, int fontSize, 679 Color foregroundColor, Color backgroundColor, 680 String backgroundImageUrl); 681 682 689 public abstract String getStringAsImageUrl(String text, int canvasWidth, 690 int canvasHeight, int textStartPosX, int textStartPosY, 691 int textWidth, int textHeight, String fontName, int fontStyle, 692 int fontSize, String foregroundColor, String backgroundColor); 693 694 public abstract String getStringAsImageUrl(String text, int canvasWidth, 695 int canvasHeight, int textStartPosX, int textStartPosY, 696 int textWidth, int textHeight, String fontName, int fontStyle, 697 int fontSize, Color foregroundColor, Color backgroundColor); 698 699 702 public abstract String getDigitalAssetBaseUrl() throws Exception ; 703 704 707 708 public Integer getDigitalAssetId(Integer contentId, String assetKey) throws Exception ; 709 710 713 714 public Integer getDigitalAssetId(Integer contentId, Integer languageId, String assetKey) throws Exception ; 715 716 719 720 public Integer getParentRepositoryId(Integer repositoryId); 721 722 725 726 public Integer getParentRepositoryId(); 727 728 731 732 public SiteNodeVO getRepositoryRootSiteNode() throws Exception ; 733 734 737 738 public SiteNodeVO getRepositoryRootSiteNode(Integer repositoryId) throws Exception ; 739 740 743 public abstract String getRepositoryBaseUrl() throws Exception ; 744 745 750 public abstract String getPageUrl(String structureBindningName); 751 752 755 public abstract String getPageUrl(WebPage webpage, Integer contentId); 756 757 762 public abstract String getPageBaseUrl(String structureBindningName); 763 764 770 771 public String getPageAsDigitalAssetUrl(Integer siteNodeId, Integer languageId, Integer contentId, String fileSuffix); 772 773 776 public abstract Integer getSiteNodeId(String structureBindningName); 777 778 781 public abstract SiteNodeVO getSiteNode(Integer siteNodeId); 782 783 786 public abstract SiteNodeVO getSiteNode(); 787 788 791 public abstract Integer getContentId(String contentBindningName); 792 793 796 797 public Integer getMetaInformationContentId(); 798 799 802 803 public Integer getMetaInformationContentId(Integer siteNodeId); 804 805 808 public abstract Collection getChildContents(Integer contentId, 809 boolean includeFolders); 810 811 814 public abstract Integer getContentId(Integer siteNodeId, 815 String contentBindningName); 816 817 823 public abstract String getPageUrl(String structureBindningName, 824 Integer contentId); 825 826 832 public abstract String getPageUrlOnPosition(String structureBindningName, 833 int position); 834 835 842 public abstract String getPageUrl(String structureBindningName, 843 int position, Integer contentId); 844 845 849 public abstract String getCurrentPageUrl(); 850 851 855 856 public String getOriginalFullURL(); 857 858 861 public abstract String getPageUrl(Integer siteNodeId, Integer languageId, 862 Integer contentId); 863 864 868 public abstract String getCurrentPagePath(); 869 870 873 public abstract SiteNodeVO getParentSiteNode(Integer siteNodeId); 874 875 879 public abstract String getPageUrlAfterLanguageChange(String languageCode); 880 881 885 public abstract String getPageTitle(); 886 887 893 public abstract String getPageNavTitle(String structureBindningName); 894 895 899 public abstract String getPageNavTitle(Integer siteNodeId); 900 901 906 public abstract String getPageNavTitle(String structureBindningName, 907 int index); 908 909 913 public abstract boolean getIsPageCacheDisabled(); 914 915 918 public abstract String getPageContentType(); 919 920 924 public abstract boolean getIsPageProtected(); 925 926 930 public abstract boolean getIsEditOnSightDisabled(); 931 932 935 public boolean getIsInPageComponentMode(); 936 937 940 public abstract List getAvailableLanguages(); 941 942 947 public abstract List getNodeAvailableLanguages(); 948 949 954 public abstract List getNodeAvailableLanguages(Integer siteNodeId); 955 956 960 public List getPageLanguages(); 961 962 966 public List getPageLanguages(Integer siteNodeId); 967 968 972 public abstract List getChildPages(); 973 974 978 public abstract List getChildPages(String structureBindingName); 979 980 984 public abstract List getChildPages(Integer siteNodeId, boolean escapeHTML, boolean hideUnauthorizedPages); 985 986 990 public abstract List getChildPages(Integer siteNodeId); 991 992 993 public abstract List getBoundPages(String structureBindningName); 994 995 998 public abstract List getBoundPages(Integer siteNodeId, String structureBindningName); 999 1000 1005 public abstract List getLocalizedBoundPages(String structureBindningName); 1006 1007 1011 public abstract ContentVO getBoundContent(String structureBindningName); 1012 1013 1017 public abstract List getBoundContents(String structureBindningName); 1018 1019 1025 public abstract List getBoundFolderContents(String structureBindningName, 1026 boolean searchRecursive, String sortAttribute, String sortOrder); 1027 1028 1034 public abstract List getBoundFolderContents(Integer siteNodeId, 1035 String structureBindningName, boolean searchRecursive, 1036 String sortAttribute, String sortOrder); 1037 1038 1044 public abstract List getChildContents(Integer contentId, 1045 boolean searchRecursive, String sortAttribute, String sortOrder); 1046 1047 1053 1054 public List getChildContents(Integer contentId, boolean searchRecursive, String sortAttribute, String sortOrder, boolean includeFolders); 1055 1056 1059 1060 public ContentVersionVO getContentVersion(Integer contentId); 1061 1062 1065 1066 public ContentVersionVO getContentVersion(Integer contentId, Integer languageId, boolean useLanguageFallback); 1067 1068 1074 public abstract List getContentVersionsByCategory(Integer categoryId, String attributeName); 1075 1076 1079 1080 public List getMatchingContents(String contentTypeDefinitionNamesString, String categoryConditionString, boolean useLanguageFallback); 1081 1082 1086 1087 public Integer getOperatingMode(); 1088 1089 1092 1093 public abstract ContentTypeDefinitionVO getContentTypeDefinitionVO(Integer contentId); 1094 1095 1098 1099 public abstract ContentTypeDefinitionVO getContentTypeDefinitionVO(String name); 1100 1101 1104 1105 public Collection getContentTypeDefinitionAssetKeys(String schemaValue); 1106 1107 1113 public abstract WebPage getBoundPage(String structureBindningName, 1114 int position); 1115 1116 1119 public abstract String renderString(String template); 1120 1121 1124 public abstract String renderString(String template, boolean useSubContext); 1125 1126 1131 public abstract String include(String contentBindningName, 1132 String attributeName); 1133 1134 public abstract String include(String contentBindningName, 1135 String attributeName, boolean cacheInclude); 1136 1137 1142 public abstract String include(String contentBindningName, 1143 String attributeName, boolean cacheInclude, String cName, 1144 Object cObject); 1145 1146 1150 public abstract String getUrlContent(String url); 1151 1152 1156 public abstract String getUrlContent(String url, boolean includeRequest); 1157 1158 1162 public abstract String getUrlContent(String url, String encoding); 1163 1164 1168 public abstract String getUrlContent(String url, boolean includeRequest, 1169 String encoding); 1170 1171 public abstract Object getObjectWithName(String classname); 1172 1173 1177 public abstract String replace(String originalString, 1178 String expressionToReplace, String newString); 1179 1180 1185 public abstract String replace(String originalString, String substring, 1186 String stringToReplace, String newString); 1187 1188 1191 public boolean getIsCurrentSiteNode(Integer siteNodeId); 1192 1193 1198 public abstract boolean getIsParentToCurrent(Integer siteNodeId); 1199 1200 1203 public abstract boolean getHasLocalizedVersion(Integer contentId); 1204 1205 1208 public abstract boolean getHasUserPageAccess(Integer siteNodeId); 1209 1210 1213 public abstract boolean getHasUserPageAccess(Integer siteNodeId, String interceptionPointName); 1214 1215 1218 public abstract boolean getHasUserPageWriteAccess(Integer siteNodeId); 1219 1220 1224 public abstract List getFormAttributes(String contentBindningName, 1225 String attributeName); 1226 1227 1231 public abstract List getFormAttributes(Integer contentId, 1232 String attributeName); 1233 1234 1237 public LanguageVO getLanguage(Integer languageId); 1238 1239 1242 public LanguageVO getLanguage(String languageCode); 1243 1244 1247 public abstract Locale getLanguageCode(Integer languageId) throws SystemException; 1248 1249 1252 public abstract Locale getLocale() throws SystemException; 1253 1254 1263 1264 public void setCookie(String cookieName, String value, String domain, String path, Integer maxAge); 1265 1266 1271 1272 public String getCookie(String cookieName); 1273 1274 1275 public DeliveryContext getDeliveryContext(); 1276 1277 public void setDeliveryContext(DeliveryContext deliveryContext); 1278 1279 1283 public abstract TemplateController getTemplateController( 1284 Integer siteNodeId, Integer languageId, Integer contentId, InfoGluePrincipal infoGluePrincipal, DeliveryContext deliveryContext) 1285 throws SystemException, Exception ; 1286 1287 public abstract TemplateController getTemplateController( 1288 Integer siteNodeId, Integer languageId, Integer contentId, 1289 HttpServletRequest request, InfoGluePrincipal infoGluePrincipal, DeliveryContext deliveryContext) throws SystemException, Exception ; 1290 1291 public abstract String decoratePage(String page); 1292 1293 1296 1297 public String getEditOnSightTag(Integer contentId, Integer languageId, String attributeName, String html, boolean showInPublishedMode); 1298 1299 1306 public String getAssignPropertyBindingTag(String propertyName, boolean createNew, String html, boolean showInPublishedMode); 1307 1308 1309 public boolean getThreatFoldersAsContents(); 1310 1311 public void setThreatFoldersAsContents(boolean threatFoldersAsContents); 1312 1313 1324 public String getRenderedTextUrl( Integer contentId, String text, Map renderAttributes ); 1325 1326 1335 public String getRenderedTextUrl( String text, Map renderAttributes ); 1336 1337 1344 public boolean getIsDecorated(); 1345 1346} | Popular Tags |