<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "../../Reference_Guide.ent">
%BOOK_ENTITIES;
]>
<section id="sect-Reference_Guide-Default_Portal_Configuration">
	<title>Default Portal Configuration</title>

		<para>
			&PRODUCT; default homepage URL is <emphasis>http://{hostname}:{port}/portal/</emphasis>.
         There may be multiple independent portals deployed in parallel at any given time, each of which has its root
         context (i.e.: <emphasis>http://{hostname}:{port}/sample-portal/</emphasis>).
         Each portal is internally composed of one or more 'portals'. It is required to have at least
         one such portal - the default one is called 'classic'. When accessing the default homepage URL of &PRODUCT;, you
         are automatically redirected to the 'classic' portal.

         The default portal performs another important task. When starting up &PRODUCT; for the first time, its
         JCR database will be empty (that's where portals keep their runtime-configurable settings).
         It is the default portal used to detect this, and to trigger automatic data initialization.
		</para>
	<para xml:id="sect-Reference_Guide-Default_Portal_Configuration-Configuration">
      <citetitle><emphasis role="bold">Configuration</emphasis></citetitle>
    </para>
		<para>
			The following example configuration can be found at: &#34;<filename>portal.war:/WEB-INF/conf/portal/portal-configuration.xml</filename>&#34;.
		</para>
		
<programlisting language="xml">&#60;component&#62;
    &#60;key&#62;org.exoplatform.portal.config.UserPortalConfigService&#60;/key&#62;
    &#60;type&#62;org.exoplatform.portal.config.UserPortalConfigService&#60;/type&#62;
    &#60;component-plugins&#62;           
     &#60;component-plugin&#62;
       &#60;name&#62;new.portal.config.user.listener&#60;/name&#62;
       &#60;set-method&#62;initListener&#60;/set-method&#62;
       &#60;type&#62;org.exoplatform.portal.config.NewPortalConfigListener&#60;/type&#62;
       &#60;description&#62;this listener init the portal configuration&#60;/description&#62;
       &#60;init-params&#62;
         &#60;value-param&#62;
           &#60;name&#62;default.portal&#60;/name&#62;
           &#60;description&#62;The default portal for checking db is empty or not&#60;/description&#62;
           &#60;value&#62;classic&#60;/value&#62;
         &#60;/value-param&#62; 
         ...
       &#60;/init-params&#62;
     &#60;/component-plugin&#62;
    &#60;/component-plugins&#62; 
  &#60;/component&#62;</programlisting>
		<para>
			In this example, the <emphasis role="bold">classic</emphasis> portal has been set as the default.
		</para>
      <note>
         <para>
         Components, component-plugins, and init-params are explained in the Foundations chapter. For now, just note how the
         <emphasis>NewPortalConfigListener</emphasis> component-plugin is used to add configuration to
         <emphasis>UserPortalConfigService</emphasis>, which is designed in this way to allow other components
         to add configuration to it.
         </para>
      </note>
    <para xml:id="sect-Reference_Guide-Default_Portal_Configuration-Tips-Delete_Portals_Definition">
      <citetitle><emphasis role="bold">Delete Portals Definition by Configuration</emphasis></citetitle>
    </para>
        <para>
            In some cases, some portal definitions are defined but not used any more. If you want to delete them, you can add some configurations to
            <filename>portal.war/WEB-INF/conf/portal/portal-configuration.xml</filename>.
        </para>
        <para>
            To delete a portal definition or a portal template definition, you need to define a component plug-in as the example below:
        </para>
        <programlisting language="xml"><![CDATA[<external-component-plugins>
    <target-component>org.exoplatform.portal.config.UserPortalConfigService</target-component>
	<component-plugin>
	  <name>new.portal.config.user.listener</name>
	  <set-method>deleteListenerElements</set-method>
	  <type>org.exoplatform.portal.config.NewPortalConfigListener</type>
	  <description>this listener delete some predefined portal and templates configuration</description>
	  <init-params>
		<object-param>
		  <name>site.templates.location</name>
		  <description>description</description>
		  <object type="org.exoplatform.portal.config.SiteConfigTemplates">
			<field name="portalTemplates">
			  <collection type="java.util.HashSet">
				<value>
				  <string>basic</string>
				</value>
				<value>
				  <string>classic</string>
				</value>
			  </collection>
			</field>
		  </object>
		</object-param>
		<object-param>
		  <name>portal.configuration</name>
		  <description>description</description>
		  <object type="org.exoplatform.portal.config.NewPortalConfig">
			<field  name="predefinedOwner">
			  <collection type="java.util.HashSet">
				<value><string>classic</string></value>
			  </collection>
			</field>
			<field name="ownerType"><string>portal</string></field>
		  </object>
		</object-param>
	  </init-params>
	</component-plugin>
</external-component-plugins>]]></programlisting>
        <para xml:id="sect-Reference_Guide-Default_Portal_Configuration-Tips-Show_Info_bar_portlet">
      <citetitle><emphasis role="bold">Set the info bar shown by default for portlet</emphasis></citetitle>
        </para>
            <para>You can set the info bar shown by default for portlets of a portal by adding a property for the <emphasis>portal-config</emphasis> configuration in the <filename>portal.xml</filename> file.</para>
<programlisting language="xml"><![CDATA[<properties>
    <entry key="showPortletInfo">1</entry>
</properties>]]></programlisting>
            <para>There are two values for "showPortletInfo": 0 and 1. If the value is 1, the info bar of portlets is shown by default. If the value is 0, it is not.</para>
    <para>
	<prompt>
		<emphasis role="bold">See also</emphasis>
	</prompt>
    </para>
    <itemizedlist>
           <listitem>
               <para><link linkend="sect-Reference_Guide-Portal_Default_Permission_Configuration">Portal Default Permission Configuration</link></para>
           </listitem>
           <listitem>
               <para><link linkend="sect-Reference_Guide-Portal_Navigation_Configuration">Portal Navigation Configuration</link></para>
           </listitem>
		    <listitem>
               <para><link linkend="sect-Reference_Guide-Internationalization_Configuration">Internationalization Configuration</link></para>
           </listitem>
		   <listitem>
               <para><link linkend="sect-Reference_Guide-Javascript_Configuration">JavaScript Configuration</link></para>
           </listitem>
       </itemizedlist>
</section>