001 /** 002 * Copyright (c) 2000-present Liferay, Inc. All rights reserved. 003 * 004 * This library is free software; you can redistribute it and/or modify it under 005 * the terms of the GNU Lesser General Public License as published by the Free 006 * Software Foundation; either version 2.1 of the License, or (at your option) 007 * any later version. 008 * 009 * This library is distributed in the hope that it will be useful, but WITHOUT 010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 012 * details. 013 */ 014 015 package com.liferay.portal.model; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.kernel.util.Accessor; 020 021 /** 022 * The extended model interface for the Layout service. Represents a row in the "Layout" database table, with each column mapped to a property of this class. 023 * 024 * @author Brian Wing Shun Chan 025 * @see LayoutModel 026 * @see com.liferay.portal.model.impl.LayoutImpl 027 * @see com.liferay.portal.model.impl.LayoutModelImpl 028 * @generated 029 */ 030 @ProviderType 031 public interface Layout extends LayoutModel, PersistedModel { 032 /* 033 * NOTE FOR DEVELOPERS: 034 * 035 * Never modify this interface directly. Add methods to {@link com.liferay.portal.model.impl.LayoutImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 036 */ 037 public static final Accessor<Layout, Long> LAYOUT_ID_ACCESSOR = new Accessor<Layout, Long>() { 038 @Override 039 public Long get(Layout layout) { 040 return layout.getLayoutId(); 041 } 042 043 @Override 044 public Class<Long> getAttributeClass() { 045 return Long.class; 046 } 047 048 @Override 049 public Class<Layout> getTypeClass() { 050 return Layout.class; 051 } 052 }; 053 054 /** 055 * Returns all layouts that are direct or indirect children of the current 056 * layout. 057 * 058 * @return the layouts that are direct or indirect children of the current 059 layout 060 * @throws SystemException if a system exception occurred 061 */ 062 public java.util.List<com.liferay.portal.model.Layout> getAllChildren(); 063 064 /** 065 * Returns the ID of the topmost parent layout (e.g. n-th parent layout) of 066 * the current layout. 067 * 068 * @return the ID of the topmost parent layout of the current layout 069 * @throws PortalException if a matching layout could not be found 070 * @throws SystemException if a system exception occurred 071 */ 072 public long getAncestorLayoutId() 073 throws com.liferay.portal.kernel.exception.PortalException; 074 075 /** 076 * Returns the plid of the topmost parent layout (e.g. n-th parent layout) 077 * of the current layout. 078 * 079 * @return the plid of the topmost parent layout of the current layout 080 * @throws PortalException if a matching layout could not be found 081 * @throws SystemException if a system exception occurred 082 */ 083 public long getAncestorPlid() 084 throws com.liferay.portal.kernel.exception.PortalException; 085 086 /** 087 * Returns all parent layouts of the current layout. The list is retrieved 088 * recursively with the direct parent layout listed first, and most distant 089 * parent listed last. 090 * 091 * @return the current layout's list of parent layouts 092 * @throws PortalException if a matching layout could not be found 093 * @throws SystemException if a system exception occurred 094 */ 095 public java.util.List<com.liferay.portal.model.Layout> getAncestors() 096 throws com.liferay.portal.kernel.exception.PortalException; 097 098 /** 099 * Returns all child layouts of the current layout, independent of user 100 * access permissions. 101 * 102 * @return the list of all child layouts 103 * @throws SystemException if a system exception occurred 104 */ 105 public java.util.List<com.liferay.portal.model.Layout> getChildren(); 106 107 /** 108 * Returns all child layouts of the current layout that the user has 109 * permission to access. 110 * 111 * @param permissionChecker the user-specific context to check permissions 112 * @return the list of all child layouts that the user has permission to 113 access 114 * @throws PortalException if a portal exception occurred 115 * @throws SystemException if a system exception occurred 116 */ 117 public java.util.List<com.liferay.portal.model.Layout> getChildren( 118 com.liferay.portal.security.permission.PermissionChecker permissionChecker) 119 throws com.liferay.portal.kernel.exception.PortalException; 120 121 /** 122 * Returns the color scheme that is configured for the current layout, or 123 * the color scheme of the layout set that contains the current layout if no 124 * color scheme is configured. 125 * 126 * @return the color scheme that is configured for the current layout, or 127 the color scheme of the layout set that contains the current 128 layout if no color scheme is configured 129 * @throws PortalException if a portal exception occurred 130 * @throws SystemException if a system exception occurred 131 */ 132 public com.liferay.portal.model.ColorScheme getColorScheme() 133 throws com.liferay.portal.kernel.exception.PortalException; 134 135 /** 136 * Returns the CSS text for the current layout, or for the layout set if no 137 * CSS text is configured in the current layout. 138 * 139 * <p> 140 * Layouts and layout sets can configure CSS that is applied in addition to 141 * the theme's CSS. 142 * </p> 143 * 144 * @return the CSS text for the current layout, or for the layout set if no 145 CSS text is configured in the current layout 146 * @throws PortalException if a portal exception occurred 147 * @throws SystemException if a system exception occurred 148 */ 149 public java.lang.String getCssText() 150 throws com.liferay.portal.kernel.exception.PortalException; 151 152 public java.lang.String getDefaultThemeSetting(java.lang.String key, 153 java.lang.String device, boolean inheritLookAndFeel); 154 155 /** 156 * Returns the layout's friendly URL for the given locale. 157 * 158 * @param locale the locale that the friendly URL should be retrieved for 159 * @return the layout's friendly URL for the given locale 160 */ 161 public java.lang.String getFriendlyURL(java.util.Locale locale); 162 163 /** 164 * Returns the friendly URLs for all configured locales. 165 * 166 * @return the friendly URLs for all configured locales 167 * @throws SystemException if a system exception occurred 168 */ 169 public java.util.Map<java.util.Locale, java.lang.String> getFriendlyURLMap(); 170 171 public java.lang.String getFriendlyURLsXML(); 172 173 /** 174 * Returns the current layout's group. 175 * 176 * <p> 177 * Group is Liferay's technical name for a site. 178 * </p> 179 * 180 * @return the current layout's group 181 * @throws PortalException if a group with the primary key could not be 182 found 183 * @throws SystemException if a system exception occurred 184 */ 185 public com.liferay.portal.model.Group getGroup() 186 throws com.liferay.portal.kernel.exception.PortalException; 187 188 /** 189 * Returns the current layout's HTML title for the given locale, or the 190 * current layout's name for the given locale if no HTML title is 191 * configured. 192 * 193 * @param locale the locale that the HTML title should be retrieved for 194 * @return the current layout's HTML title for the given locale, or the 195 current layout's name for the given locale if no HTML title is 196 configured 197 */ 198 public java.lang.String getHTMLTitle(java.util.Locale locale); 199 200 /** 201 * Returns the current layout's HTML title for the given locale language ID, 202 * or the current layout's name if no HTML title is configured. 203 * 204 * @param localeLanguageId the locale that the HTML title should be 205 retrieved for 206 * @return the current layout's HTML title for the given locale language ID, 207 or the current layout's name if no HTML title is configured 208 */ 209 public java.lang.String getHTMLTitle(java.lang.String localeLanguageId); 210 211 /** 212 * Returns <code>true</code> if the current layout has a configured icon. 213 * 214 * @return <code>true</code> if the current layout has a configured icon; 215 <code>false</code> otherwise 216 */ 217 public boolean getIconImage(); 218 219 /** 220 * Returns the current layout's {@link LayoutSet}. 221 * 222 * @return the current layout's layout set 223 * @throws PortalException if a portal exception occurred 224 * @throws SystemException if a system exception occurred 225 */ 226 public com.liferay.portal.model.LayoutSet getLayoutSet() 227 throws com.liferay.portal.kernel.exception.PortalException; 228 229 /** 230 * Returns the current layout's {@link LayoutType}. 231 * 232 * @return the current layout's layout type 233 */ 234 public com.liferay.portal.model.LayoutType getLayoutType(); 235 236 /** 237 * Returns the current layout's linked layout. 238 * 239 * @return the current layout's linked layout, or <code>null</code> if no 240 linked layout could be found 241 * @throws SystemException if a system exception occurred 242 */ 243 public com.liferay.portal.model.Layout getLinkedToLayout(); 244 245 /** 246 * Returns the current layout's parent plid. 247 * 248 * @return the current layout's parent plid, or <code>0</code> if the 249 current layout is the topmost parent layout 250 * @throws PortalException if a matching layout could not be found 251 * @throws SystemException if a system exception occurred 252 */ 253 public long getParentPlid() 254 throws com.liferay.portal.kernel.exception.PortalException; 255 256 public java.lang.String getRegularURL( 257 javax.servlet.http.HttpServletRequest request) 258 throws com.liferay.portal.kernel.exception.PortalException; 259 260 public java.lang.String getResetLayoutURL( 261 javax.servlet.http.HttpServletRequest request) 262 throws com.liferay.portal.kernel.exception.PortalException; 263 264 public java.lang.String getResetMaxStateURL( 265 javax.servlet.http.HttpServletRequest request) 266 throws com.liferay.portal.kernel.exception.PortalException; 267 268 public com.liferay.portal.model.Group getScopeGroup() 269 throws com.liferay.portal.kernel.exception.PortalException; 270 271 public java.lang.String getTarget(); 272 273 /** 274 * Returns the current layout's theme, or the layout set's theme if no 275 * layout theme is configured. 276 * 277 * @return the current layout's theme, or the layout set's theme if no 278 layout theme is configured 279 * @throws PortalException if a portal exception occurred 280 * @throws SystemException if a system exception occurred 281 */ 282 public com.liferay.portal.model.Theme getTheme() 283 throws com.liferay.portal.kernel.exception.PortalException; 284 285 public java.lang.String getThemeSetting(java.lang.String key, 286 java.lang.String device); 287 288 public java.lang.String getThemeSetting(java.lang.String key, 289 java.lang.String device, boolean inheritLookAndFeel); 290 291 public com.liferay.portal.kernel.util.UnicodeProperties getTypeSettingsProperties(); 292 293 public java.lang.String getTypeSettingsProperty(java.lang.String key); 294 295 public java.lang.String getTypeSettingsProperty(java.lang.String key, 296 java.lang.String defaultValue); 297 298 public com.liferay.portal.model.ColorScheme getWapColorScheme() 299 throws com.liferay.portal.kernel.exception.PortalException; 300 301 public com.liferay.portal.model.Theme getWapTheme() 302 throws com.liferay.portal.kernel.exception.PortalException; 303 304 /** 305 * Returns <code>true</code> if the given layout ID matches one of the 306 * current layout's hierarchical parents. 307 * 308 * @param layoutId the layout ID to search for in the current layout's 309 parent list 310 * @return <code>true</code> if the given layout ID matches one of the 311 current layout's hierarchical parents; <code>false</code> 312 otherwise 313 * @throws PortalException if any one of the current layout's acestors could 314 not be retrieved 315 * @throws SystemException if a system exception occurred 316 */ 317 public boolean hasAncestor(long layoutId) 318 throws com.liferay.portal.kernel.exception.PortalException; 319 320 /** 321 * Returns <code>true</code> if the current layout has child layouts. 322 * 323 * @return <code>true</code> if the current layout has child layouts, 324 <code>false</code> otherwise 325 * @throws SystemException if a system exception occurred 326 */ 327 public boolean hasChildren(); 328 329 public boolean hasScopeGroup() 330 throws com.liferay.portal.kernel.exception.PortalException; 331 332 public boolean includeLayoutContent( 333 javax.servlet.http.HttpServletRequest request, 334 javax.servlet.http.HttpServletResponse response) 335 throws java.lang.Exception; 336 337 public boolean isChildSelected(boolean selectable, 338 com.liferay.portal.model.Layout layout) 339 throws com.liferay.portal.kernel.exception.PortalException; 340 341 /** 342 * Returns <code>true</code> if the current layout can be used as a content 343 * display page. 344 * 345 * <p> 346 * A content display page must have an Asset Publisher portlet that is 347 * configured as the default Asset Publisher for the layout. 348 * </p> 349 * 350 * @return <code>true</code> if the current layout can be used as a content 351 display page; <code>false</code> otherwise 352 */ 353 public boolean isContentDisplayPage(); 354 355 /** 356 * Returns <code>true</code> if the current layout is the first layout in 357 * its parent's hierarchical list of children layouts. 358 * 359 * @return <code>true</code> if the current layout is the first layout in 360 its parent's hierarchical list of children layouts; 361 <code>false</code> otherwise 362 */ 363 public boolean isFirstChild(); 364 365 /** 366 * Returns <code>true</code> if the current layout is the topmost parent 367 * layout. 368 * 369 * @return <code>true</code> if the current layout is the topmost parent 370 layout; <code>false</code> otherwise 371 */ 372 public boolean isFirstParent(); 373 374 public boolean isIconImage(); 375 376 /** 377 * Returns <code>true</code> if the current layout utilizes its {@link 378 * LayoutSet}'s look and feel options (e.g. theme and color scheme). 379 * 380 * @return <code>true</code> if the current layout utilizes its layout set's 381 look and feel options; <code>false</code> otherwise 382 */ 383 public boolean isInheritLookAndFeel(); 384 385 public boolean isInheritWapLookAndFeel(); 386 387 /** 388 * Returns <code>true</code> if the current layout is built from a layout 389 * template and still maintains an active connection to it. 390 * 391 * @return <code>true</code> if the current layout is built from a layout 392 template and still maintains an active connection to it; 393 <code>false</code> otherwise 394 */ 395 public boolean isLayoutPrototypeLinkActive(); 396 397 /** 398 * Returns <code>true</code> if the current layout is part of the public 399 * {@link LayoutSet}. 400 * 401 * <p> 402 * Note, the returned value reflects the layout's default access options, 403 * not its access permissions. 404 * </p> 405 * 406 * @return <code>true</code> if the current layout is part of the public 407 layout set; <code>false</code> otherwise 408 */ 409 public boolean isPublicLayout(); 410 411 /** 412 * Returns <code>true</code> if the current layout is the root layout. 413 * 414 * @return <code>true</code> if the current layout is the root layout; 415 <code>false</code> otherwise 416 */ 417 public boolean isRootLayout(); 418 419 public boolean isSelected(boolean selectable, 420 com.liferay.portal.model.Layout layout, long ancestorPlid); 421 422 /** 423 * Returns <code>true</code> if the current layout can hold embedded 424 * portlets. 425 * 426 * @return <code>true</code> if the current layout can hold embedded 427 portlets; <code>false</code> otherwise 428 */ 429 public boolean isSupportsEmbeddedPortlets(); 430 431 public boolean isTypeArticle(); 432 433 public boolean isTypeControlPanel(); 434 435 public boolean isTypeEmbedded(); 436 437 public boolean isTypeLinkToLayout(); 438 439 public boolean isTypePanel(); 440 441 public boolean isTypePortlet(); 442 443 public boolean isTypeURL(); 444 445 public boolean matches(javax.servlet.http.HttpServletRequest request, 446 java.lang.String friendlyURL); 447 448 public void setLayoutSet(com.liferay.portal.model.LayoutSet layoutSet); 449 450 public void setTypeSettingsProperties( 451 com.liferay.portal.kernel.util.UnicodeProperties typeSettingsProperties); 452 }