Beruflich Dokumente
Kultur Dokumente
1. Difference between a website and a portal? Website is collection web pages, typically it contains information about particular company. A portal is a powerful web site that gives users a single point of access (or gateway) to applications and information in a unified interface. For eg, Yahoo.com(home page) is great example of a portal. 2. What are the features of portal? Portal has got many features. To name a few: Personalization, Authentication(single sign-on) and content aggregation. 3. What are components of weblogic portal? Look and feel components, header & footer(Shell), Menus, layouts, books & pages, portlets. 4. What is the difference between streaming portal and file-based portal? Portals come in two flavors: file-based and streaming. A file-based portal(.portal) also called a light portal obtains all of its resources from the users file system. Streaming portals, on the other hand, derive their resources from one or more databases. 5. What is backing file? Backing file is java class used to pre-processing before portal object is rendered. The following portal controls support backing files: * Desktops * Books * Pages * Portlets * JspContent controls. 6. How to create streaming portal/desktop? Streaming desktop can be created using portal admin tool. 7. What are the components of look-and-feel? Look & feel determines the appearance portal applications, it can be modified by developers programmatically or administrators using portal admin tool in staging and production environment. The following are components of look and feel:
Look & Feel file(.laf) Skins Skeletons Themes Chromosomes and Genes Shells Layouts
Skins are collections of images, cascading style sheets (CSS), and JavaScript files that allow changes to be made to the look and feel of a portal without modifying the portal components directly. Skins basically provide the overall colors, graphics, and styles used by all components in a desktop interface.
Skeletons provide the physical boundaries of the portal components and provides references to the images, CSS, and JavaScript functions from the skin needed to render the portal. A portal web project can have multiple skeletons. When you select a Look & Feel for a desktop, a specific skin and skeleton is used. Each type of portal component, from a desktop to a portlet's title bar, has an associated JSP file, called a skeleton file that renders it. 9. Difference between Genes and chromosomes? Genes are implemented as simple text strings that are inserted into CSS styles or JavaScript files as variables. You define genes in an XML .chromosome file. In a .chromosomefile, you could define a gene called "bodyColor" and assign it a value of "red," like this:
JSP and HTML Portlets JSR 168 portlets Java Page Flow Portlets Java Server Faces (JSF) Portlets Struts Portlets Remote Portlets Browser (URL) Portlets 12. How is IPC (inter-portlet communication) happening? Watch this page soon for an answer... 13. What are portlet modes?
Portlet Modes allow you to affect the end users ability to edit the portlet or display Help for the portlet. You add icon buttons to a portlets title bar to indicate the availability of a mode. The following pre-defined modes exist for WebLogic Portal: * Edit Lets you specify a custom file that lets users modify the portlet's content when they click the Edit button. * Help Lets you specify a custom file that shows users help content for the portlet when they click the Help button. You can also create your own custom portlet modes using WebLogic Portal. 14. Types of portlet states? Portlet states determine the end users ability to affect the rendering of a portlet. WebLogic Portal supports following portlet states:
Normal the typical rendered appearance of the portlet. Minimize Collapses the portlet, leaving only the title bar, when the user clicks the Minimize button. Maximize Makes the portlet take up the entire desktop area (not including the desktop header and footer) when the user clicks the Maximize button. Float Displays the portlet in a popup window when the user clicks the Float button. Delete Removes the portlet from the desktop when the user clicks the Delete button.When you use the Portlet Wizard to create a portlet, state and mode settings are available on the Portlet Details dialog. These settings can also be edited in the portlets Properties view.
5. How did you handle security in WSRP? 6. What are the performance issues you had in WSRP?
at 5/26/2011 10:03:00 AM 0 comments Labels: Interviews, Questions, Weblogic Portal
<% ArrayList breadcrumbTitles = new ArrayList(); ArrayList breadcrumbURLs = new ArrayList(); boolean isHidden = false; BookPresentationContext book = BookPresentationContext.getBookPresentationContext(request); PagePresentationContext pageCtx = PagePresentationContext.getPagePresentationContext(request); if (!(book.getDefaultPage().equals(pageCtx.getDefinitionLabel()))) { breadcrumbTitles.add(book.getTitle()); breadcrumbURLs.add(PageURL.createPageURL(request,response,book.getDefaultPage()).toString()); } PagePresentationContext parentPage = book.getParentPagePresentationContext(); while (parentPage != null) { breadcrumbTitles.add(parentPage.getTitle()); if (parentPage instanceof BookPresentationContext) { BookPresentationContext parentBook = (BookPresentationContext)parentPage; breadcrumbURLs.add(PageURL.createPageURL(request,
<% //DO NOT SHOW BREADCRUMBS IN MAIN HOME PAGE and also in hidden page if (pageCtx.isHidden()) { } else { %> <ul class="breadcrumbs"> <% for (int i = breadcrumbTitles.size() - 1; i >= 0; i--) { if (((String)breadcrumbTitles.get(i)).equalsIgnoreCase("My Main Book")) { breadcrumbTitles.set(i, "My Home"); } %> <li class="first"><a href="<%=breadcrumbURLs.get(i) %>" ><%=breadcrumbTitles.get(i)%></a></li> <img src="<render:getSkinPath imageName="/arrow_right.gif" />" /> <% } %> <% } %> </ul>
Another approach is using WSRP - Web Services for Remote portlets. These portlets provide both presentation and business logic which is slightly different than standard web service which provides only business logic no presentation so every client had to implement on their own. To understand better, compare with HTTP where user interacts with remote servers by using browser and doing operation like form submitting. He gets his response as HTML in the browser. WSRP is a similar protocol between server and client. In WSRP terminology, the server is called a producer. It hosts services, typically portlets, that clients, or consumers, communicate with. Consumers uses WSRP which defines a common, well defined interface that defines how a portal(consumer) should interact with producer. WSRP is built upon existing Web services standards like SOAP, WSDL, and UDD. WSRP can aggregate portlets from more than one producers into single page and can apply consumer specific look-and-feel to that page. 5. Struts portlets: Lets say you have existing struts application up and running some where obviously outside portal and you would like to host in the portal. Weblogic portal provides struts portlets by which you can integrate with existing struts applications.
Weblogic offers three ways to do this: 1. Using Weblogic workshop by creating propagation session. 2. Customized Ant scripts 3. Import/export utility. When you use weblogic workshop, it involves a lot of manual tasks. Those manual tasks are error prone. I thought ant scripts are more effective as you have a lot of control and it is automated process. I never tried the third option. This blog will cover how to do propagation using ant scripts. Pre-requests: Both source & destination admin server should be running and should have same weblogic portal version. Ant environment variable needs to be set up. How to set up Ant: 1. Create environment variabale ANT_HOME in your local machine with value ${BEA_HOME}\modules\org.apache.ant_1.6.5. Eg: if you installed in C drive, value would be C:\bea\modules\org.apache.ant_1.6.5 2. Create another variable called ANT_OPTS with value of -Xmx500M Steps for propagation: 1. Create a folder called propagation from you planned to run scripts 2. Copy propagation.xml file from below into propagation folder.
propagation.xml:
<?xml version="1.0" ?> <!-- ==================================================================== --> <!-- Propagation Ant Script --> <!-- Author : Ananth Kannan --> <!-- Date : 05/30/2008 -->
<!-- Title: propagation.xml --> <!---> <!-- Usage Notes: --> <!---> <!-- The normal sequence of using this script is to invoke the targets in --> <!-- the following order: --> <!---> <!-- ant pingSrc --> <!-- ant pingDest --> <!-- ant downloadSrc --> <!-- ant validateSrc --> <!-- ant downloadDest --> <!-- ant validateDest --> <!-- ant combine --> <!-- ant commit --> <!-- ant uploadCombined --> <!---> <!-- ======================================================================= --> <project name="Portal Propagation Ant Tasks" basedir="." default="usage"> <property environment="env"/> <!-- Environment Settings --> <!-- Runtime: this variable must point to your install directory. --> <property name="deploy.dir" value="C:\bea\wlserver_10.0"/> <!-- Runtime: this variable must indicate where the files will be read/written. --> <property name="working.dir" value="C:\propagation"/> <!-- Source: --> <!-Setup the variables that identify your source environment (staging, for example) --> <!-These variables are explained below, or consult the Propagation Ant Task documentation. --> <property name="source.servlet.url" value="http://{src_admin_server}:7001/EAR_NamePropagation/inventorymanagement"/> <property name="source.admin.username" value="weblogic"/> <property name="source.admin.password" value="weblogic"/> <property name="source.allow.http" value="true"/> <!-- Destination: --> <!-Setup the variables that identify your destination environment (production, for example) --> <!-These variables are explained below, or consult the Propagation Ant Task documentation. --> <property name="dest.servlet.url" value="http://{dest_admin_server}:7001/EAR_NamePropagation/inventorymanagement"/> <property name="dest.admin.username" value="weblogic"/> <property name="dest.admin.password" value="weblogic"/> <property name="dest.allow.http" value="true"/> <path id="onlineTask.classpath"> <pathelement location="${deploy.dir}/platform/lib/p13n/p13n_common.jar"/> <pathelement location="${deploy.dir}/portal/lib/propagation/propagation.jar"/> <pathelement location="${deploy.dir}/portal/lib/propagation/propagation_ant.jar"/> <pathelement location="${deploy.dir}/portal/lib/propagation/content_prop.jar"/> <pathelement location="${deploy.dir}/portal/lib/propagation/netuix_prop.jar"/> </path> <path id="offlineTask.classpath"> <pathelement location="${deploy.dir}/platform/lib/p13n/p13n_common.jar"/> <pathelement location="${deploy.dir}/platform/lib/wlp/wsrp-common.jar"/>
<pathelement location="${deploy.dir}/portal/lib/propagation/propagation.jar"/> <pathelement location="${deploy.dir}/portal/lib/propagation/propagation_ant.jar"/> <pathelement location="${deploy.dir}/portal/lib/propagation/content_prop.jar"/> <pathelement location="${deploy.dir}/portal/lib/propagation/netuix_prop.jar"/> <pathelement location="${deploy.dir}/server/lib/api.jar"/> <pathelement location="${deploy.dir}/../modules/com.bea.core.xml.beaxmlbeans_2.2.0.0.jar"/> <pathelement location="${deploy.dir}/../modules/com.bea.core.weblogic.stax_1.0.1.0.jar"/> <pathelement location="${deploy.dir}/../modules/com.bea.core.utils_1.0.1.0.jar"/> </path> <!-SERVLET.URL: The online Propagation ant tasks require that the Propagation servlet be deployed in the application. By default, Portal applications will include the Propagation application library module which deploys the Propagation web application. Look for the following in the application's META-INF/weblogic-application.xml <library-ref> <library-name>wlp-propagation-app-lib</library-name> </library-ref> <library-context-root-override> <context-root>propagation</context-root> <override-value>portalAppPropagation</override-value> </library-context-root-override> In this example, the Propagation application module has been included, and the Propagation web application which is normally at context root "propagation" has been overridden to listen to context path "portalAppPropagation". Therefore, the servletURL in this case would be: http://hostname:port/portalAppPropagation/inventorymanagement The Propagation servlet is deployed by default to map to "inventorymanagement". --> <!-- ==================================================================== --> <!-- Targets --> <!-- ==================================================================== -->
<target name="usage" description="list of commands"> <echo message="Usage Instructions:" /> <echo message="Choose from this list of standard ant targets, or modify the build file to create your own." /> <echo message="1. pingSrc and pingDest - pings the server and application to make sure it is alive" /> <echo message="2. checkMutexSrc and checkMutexDest - determines if another user is working with the application" /> <echo message="3. lockSrc and lockDest - prevents admin changes on the src and dest system." /> <echo message="4. downloadSrc and downloadDest - creates src.zip and dest.zip files respectively" /> <echo message="5. validateSrc and validateDest - makes sure the src.zip and dest.zip files are good" /> <echo message="6. listScopes - lists the scopes in src.zip, for potential scoping of the differencing step" /> <echo message="6a. listPolicies - lists the policies in src.zip, for potential polices for the differencing step" /> <echo message="7. search - finds nodes with a specific string in their name, to help verify the wanted node was exported" /> <echo message="8. diff - differences src.zip and dest.zip and writes the results to diff_cm.xml" /> <echo message="9. combine - combines src.zip and dest.zip into a new inventory, combined.zip" /> <echo message="10. validateCombined - makes sure combined.zip is a good file" /> <echo message="11. extractCombined - extracts the working artifacts out of combined.zip for viewing" /> <echo message="12. insertCombined - inserts updated working artifacts into combined.zip" /> <echo message="13. checkManualElections - Test for the presence of manual elections. Used as condition to
determine if continue to upload/commit or quit." /> <echo message="14. uploadCombined - uploads combined.zip to the destination server" /> <echo message="15. commit or commitOpt - commits uploaded inventory on dest, either pessimistically or optimistically" /> <echo message="16. unlockSrc and unlockDest - allows admin changes on the src and dest system again." /> <echo message="17. electionsAdd and electionsSubtract - allows for algebraic operations on two changemanifest files." /> </target>
<!-- ONLINEPING TASK --> <taskdef name="onlinePing" classname="com.bea.propagation.ant.taskdefs.OnlinePingTask"> <classpath refid="onlineTask.classpath"/> </taskdef> <target name="pingSrc" description="ping the server"> <echo message="****** Start: pingSrc ******" /> <onlinePing servletURL="${source.servlet.url}" username="${source.admin.username}" password="${source.admin.password}" allowHttp="${source.allow.http}" /> <echo message="****** Finish: pingSrc ******" /> </target> <target name="pingDest" description="ping the server"> <echo message="****** Start: pingDest ******" /> <onlinePing servletURL="${dest.servlet.url}" username="${dest.admin.username}" password="${dest.admin.password}" allowHttp="${dest.allow.http}" /> <echo message="****** Finish: pingDest ******" /> </target> <!-- alternate method of pinging using Condition Ant construct --> <target name="pingDestC1" description="ping the server"> <echo message="****** Start: pingDestC1 ******" /> <condition property="ping_success"> <onlinePing servletURL="${dest.servlet.url}" username="${dest.admin.username}" password="${dest.admin.password}" allowHttp="${dest.allow.http}" /> </condition> <antcall target="ping_success" /> <echo message="****** Finish: pingDestC1 ******" /> </target> <target name="ping_success" if="ping_success"><echo message="The server is available." /></target>
</taskdef> <target name="checkMutexSrc" description="checks to see if the mutex is available"> <echo message="****** Start: checkMutexSrc ******" /> <onlineMutex servletURL="${source.servlet.url}" username="${source.admin.username}" password="${source.admin.password}" allowHttp="${source.allow.http}" failOnError="false" retryTimes="3" /> <echo message="****** Finish: checkMutexSrc ******" /> </target> <target name="checkMutexDest" description="checks to see if the mutex is available"> <echo message="****** Start: checkMutexDest ******" /> <onlineMutex servletURL="${dest.servlet.url}" username="${dest.admin.username}" password="${dest.admin.password}" allowHttp="${dest.allow.http}" failOnError="false" retryTimes="10" /> <echo message="****** Finish: checkMutexDest ******" /> </target> <!-- alternate method of checking the mutex using Condition Ant construct --> <target name="checkMutexDestC1" description="checks to see if the mutex is available"> <echo message="****** Start: checkMutexDestC1 ******" /> <condition property="mutex_success"> <onlineMutex servletURL="${dest.servlet.url}" username="${dest.admin.username}" password="${dest.admin.password}" allowHttp="${dest.allow.http}" failOnError="false" retryTimes="10" /> </condition> <antcall target="mutex_success" /> <echo message="****** Finish: checkMutexDestC1 ******" /> </target> <target name="mutex_success" if="mutex_success"><echo message="The mutex is available." /></target>
<!-- onlineMaintenanceMode TASK --> <taskdef name="onlineMaintenanceMode" classname="com.bea.propagation.ant.taskdefs.OnlineMaintenanceModeTask"> <classpath refid="onlineTask.classpath"/> </taskdef> <target name="lockSrc" description="put the server into maintenance mode"> <echo message="****** Start: lockSrc ******" /> <onlineMaintenanceMode servletURL="${source.servlet.url}" username="${source.admin.username}"
password="${source.admin.password}" allowHttp="${source.allow.http}" enable="true" /> <echo message="****** Finish: lockSrc ******" /> </target> <target name="lockDest" description="put the server into maintenance mode"> <echo message="****** Start: lockDest ******" /> <onlineMaintenanceMode servletURL="${dest.servlet.url}" username="${dest.admin.username}" password="${dest.admin.password}" allowHttp="${dest.allow.http}" enable="true" /> <echo message="****** Finish: lockDest ******" /> </target> <!-- alternate method of locking using Condition Ant construct --> <target name="lockDestC1" description="put the server into maintenance mode"> <condition property="lock_success"> <onlineMaintenanceMode servletURL="${dest.servlet.url}" username="${dest.admin.username}" password="${dest.admin.password}" allowHttp="${dest.allow.http}" enable="true" /> </condition> <antcall target="lock_success" /> </target> <target name="lock_success" if="lock_success"><echo message="Maintenance mode has been toggled." /></target>
<!-- ONLINEDOWNLOAD TASK --> <taskdef name="onlineDownload" classname="com.bea.propagation.ant.taskdefs.OnlineDownloadTask"> <classpath refid="onlineTask.classpath"/> </taskdef> <target name="downloadSrc"> <echo message="****** Start: downloadSrc ******" /> <delete file="${working.dir}/src.zip" quiet="true" /> <delete file="${working.dir}/downloadSrc.log" quiet="true" /> <onlineDownload servletURL="${source.servlet.url}" username="${source.admin.username}" password="${source.admin.password}" allowHttp="${source.allow.http}" failOnError="true" outputInventoryFile="${working.dir}/src.zip" logFile="${working.dir}/downloadSrc.log" > <modifier name="cm_exportPolicy" value="lastPublished" /> <modifier name="allowMaintenanceModeDisabled" value="true"/> <modifier name="allowSecurityOutOfSync" value="true"/> </onlineDownload>
<echo message="****** Finish: downloadSrc ******" /> <echo message="****** Please check :: src.zip is downloaded into ******${working.dir}" /> </target> <target name="downloadSrcRemote"> <echo message="****** Start: downloadSrcRemote ******" /> <delete file="${working.dir}/src.zip" quiet="true" /> <delete file="${working.dir}/downloadSrcRemote.log" quiet="true" /> <onlineDownload servletURL="${source.servlet.url}" username="${source.admin.username}" password="${source.admin.password}" allowHttp="${source.allow.http}" failOnError="true" outputToServerFileSystem="true" outputInventoryFile="D:\TEMP\prop_test\src.zip" logFile="${working.dir}/downloadSrcRemote.log" > <modifier name="allowMaintenanceModeDisabled" value="true"/> </onlineDownload> <echo message="****** Finish: downloadSrcRemote ******" /> </target> <target name="downloadDest"> <echo message="****** Start: downloadDest ******" /> <delete file="${working.dir}/dest.zip" quiet="true" /> <delete file="${working.dir}/downloadDest.log" quiet="true" /> <onlineDownload servletURL="${dest.servlet.url}" username="${dest.admin.username}" password="${dest.admin.password}" allowHttp="${dest.allow.http}" outputInventoryFile="${working.dir}/dest.zip" logFile="${working.dir}/downloadDest.log" > <modifier name="allowMaintenanceModeDisabled" value="true"/> <modifier name="allowSecurityOutOfSync" value="true"/> </onlineDownload> <echo message="****** Finish: downloadDest ******" /> </target>
<!-- OFFLINEVALIDATE TASK --> <taskdef name="offlineValidate" classname="com.bea.propagation.ant.taskdefs.OfflineValidateTask"> <classpath refid="offlineTask.classpath"/> </taskdef> <target name="validateSrc" description="valid inventory, with logging"> <echo message="****** Start: validateSrc ******" /> <delete file="${working.dir}/validateSrc_log.txt" quiet="true" /> <delete file="${working.dir}/validateSrc_verboselog.txt" quiet="true" /> <offlineValidate sourceFile="${working.dir}/src.zip" logFile="${working.dir}/validateSrc_log.txt" verboseLogFile="${working.dir}/validateSrc_verboselog.txt" />
<echo message="****** Finish: validateSrc ******" /> </target> <target name="validateDest" description="validates to see if an inventory file is a valid inventory"> <echo message="****** Start: validateDest ******" /> <delete file="${working.dir}/validateDest_log.txt" quiet="true" /> <delete file="${working.dir}/validateDest_verboselog.txt" quiet="true" /> <offlineValidate sourceFile="${working.dir}/dest.zip" logFile="${working.dir}/validateDest_log.txt" verboseLogFile="${working.dir}/validateDest_verboselog.txt" /> <echo message="****** Finish: validateDest ******" /> </target> <!-- alternate method of validating using Condition Ant construct --> <target name="validateDestC1" description="validates to see if an inventory file is a valid inventory"> <echo message="****** Start: validateC1 ******" /> <condition property="validate_success"> <offlineValidate sourceFile="${working.dir}/dest.zip" /> </condition> <antcall target="validate_success" /> <echo message="****** Finish: validateC1 ******" /> </target> <target name="validate_success" if="validate_success"><echo message="The validation succeeded." /></target>
<!-- OFFLINELISTSCOPES TASK --> <taskdef name="offlineListScopes" classname="com.bea.propagation.ant.taskdefs.OfflineListScopesTask"> <classpath refid="offlineTask.classpath"/> </taskdef> <target name="listScopes" description="lists the scopes found in the source inventory"> <echo message="****** Start: listScopes ******" /> <delete file="${working.dir}/listScopes_scopes.properties" quiet="true" /> <delete file="${working.dir}/listScopes_log.txt" quiet="true" /> <delete file="${working.dir}/listScopes_verboselog.txt" quiet="true" /> <mkdir dir="${working.dir}/scopes"/> <offlineListScopes sourceFile="${working.dir}/src.zip" scopeFile="${working.dir}/scopes/listScopes_scopes.properties" logFile="${working.dir}/scopes/listScopes_log.txt" verboseLogFile="${working.dir}/scopes/listScopes_verboselog.txt" /> <echo message="****** Finish: listScopes ****** under ${working.dir}/scopes" /> </target> <!-- OFFLINELISTPOLICIES TASK --> <taskdef name="offlineListPolicies" classname="com.bea.propagation.ant.taskdefs.OfflineListPoliciesTask"> <classpath refid="offlineTask.classpath"/>
</taskdef> <target name="listPolicies" description="lists the scopes found in the source inventory"> <echo message="****** Start: listPolicies ******" /> <delete file="${working.dir}/listPolicies_policies.properties" quiet="true" /> <delete file="${working.dir}/listPolicies_log.txt" quiet="true" /> <delete file="${working.dir}/listPolicies_verboselog.txt" quiet="true" /> <mkdir dir="${working.dir}/policies"/> <offlineListPolicies sourceFile="${working.dir}/src.zip" policyFile="${working.dir}/policies/listPolicies_policies.properties" globalAddFlag="true" globalUpdateFlag="false" globalDeleteFlag="true" logFile="${working.dir}/policies/listPolicies_log.txt" verboseLogFile="${working.dir}/policies/listPolicies_verboselog.txt" /> <echo message="****** Finish: listPolicies ****** under ${working.dir}/policies" /> </target> <!-- OFFLINESEARCH TASK --> <taskdef name="offlineSearch" classname="com.bea.propagation.ant.taskdefs.OfflineSearchTask"> <classpath refid="offlineTask.classpath"/> </taskdef> <target name="search" description="finds the nodes that contain the search string in the name"> <echo message="****** Start: search ******" /> <delete file="${working.dir}/search.txt" quiet="true" /> <delete file="${working.dir}/search_log.txt" quiet="true" /> <delete file="${working.dir}/search_verboselog.txt" quiet="true" /> <offlineSearch searchString="Global" sourceFile="${working.dir}/src.zip" listFile="${working.dir}/search.txt" logFile="${working.dir}/search_log.txt" verboseLogFile="${working.dir}/search_verboselog.txt" /> <echo message="****** Finish: search ******" /> </target> <!-- alternate method of searching using Condition Ant construct --> <target name="searchC1" description="finds the nodes that contain the search string in the name"> <echo message="****** Start: searchC1 ******" /> <condition property="search_success"> <offlineSearch searchString="Global" sourceFile="${working.dir}/src.zip" /> </condition> <antcall target="search_success" /> <echo message="****** Finish: searchC1 ******" /> </target> <target name="search_success" if="search_success"><echo message="The search succeeded." /></target>
<!-- OFFLINEDIFF TASK --> <taskdef name="offlineDiff" classname="com.bea.propagation.ant.taskdefs.OfflineDiffTask"> <classpath refid="offlineTask.classpath"/> </taskdef> <target name="diff" description="compare two inventories with logging"> <echo message="****** Start: diff ******" /> <delete file="${working.dir}/diff_cm.xml" quiet="true" /> <delete file="${working.dir}/diff_log.txt" quiet="true" /> <delete file="${working.dir}/diff_verboselog.txt" quiet="true" /> <offlineDiff sourceFile="${working.dir}/src.zip" destFile="${working.dir}/dest.zip" changeManifestFile="${working.dir}/diff_cm.xml" logFile="${working.dir}/diff_log.txt" verboseLogFile="${working.dir}/diff_verboselog.txt" /> <echo message="****** Finish: diff ******" /> </target> <!-- alternate method of diffing using Condition Ant construct --> <target name="diffC1" description="compare two inventories"> <echo message="****** Start: diffC1 ******" /> <delete file="${working.dir}/diffC1_cm.xml" quiet="true" /> <condition property="diff_success"> <offlineDiff sourceFile="${working.dir}/src.zip" destFile="${working.dir}/dest.zip" changeManifestFile="${working.dir}/diffC1_cm.xml" /> </condition> <antcall target="diff_success" /> <echo message="****** Finish: diffC1 ******" /> </target> <target name="diff_success" if="diff_success"><echo message="The two inventories are different." /></target>
<!-- OFFLINECOMBINE TASK --> <taskdef name="offlineCombine" classname="com.bea.propagation.ant.taskdefs.OfflineCombineTask"> <classpath refid="offlineTask.classpath"/> </taskdef> <target name="combine" description="Combine two inventories with logging"> <echo message="****** Start: combine ******" /> <delete file="${working.dir}/combined.zip" quiet="true" /> <delete file="${working.dir}/combine_cm.xml" quiet="true" /> <delete file="${working.dir}/combine_log.txt" quiet="true" /> <delete file="${working.dir}/combine_verboselog.txt" quiet="true" /> <offlineCombine sourceFile="${working.dir}/src.zip" destFile="${working.dir}/dest.zip" combinedInventoryFile="${working.dir}/combined.zip"
changeManifestFile="${working.dir}/combine_cm.xml" logFile="${working.dir}/combine_log.txt" verboseLogFile="${working.dir}/combine_verboselog.txt" /> <echo message="****** Finish: combine ******" /> </target> <target name="combineWithPolicy" description="Combine two inventories using policy file"> <echo message="****** Start: combine ******" /> <delete file="${working.dir}/combined.zip" quiet="true" /> <delete file="${working.dir}/combine_cm.xml" quiet="true" /> <delete file="${working.dir}/combine_log.txt" quiet="true" /> <delete file="${working.dir}/combine_verboselog.txt" quiet="true" /> <offlineCombine sourceFile="${working.dir}/src.zip" destFile="${working.dir}/dest.zip" combinedInventoryFile="${working.dir}/combined.zip" policiesFile = "${working.dir}/policy.properties" changeManifestFile="${working.dir}/combine_cm.xml" logFile="${working.dir}/combine_log.txt" verboseLogFile="${working.dir}/combine_verboselog.txt" /> <echo message="****** Finish: combine ******" /> </target> <target name="combineWithScope" description="Combine two inventories using scope file"> <echo message="****** Start: combine ******" /> <delete file="${working.dir}/combined.zip" quiet="true" /> <delete file="${working.dir}/combine_cm.xml" quiet="true" /> <delete file="${working.dir}/combine_log.txt" quiet="true" /> <delete file="${working.dir}/combine_verboselog.txt" quiet="true" /> <offlineCombine sourceFile="${working.dir}/src.zip" destFile="${working.dir}/dest.zip" combinedInventoryFile="${working.dir}/combined.zip" scopeFile = "${working.dir}/singlescope.properties" changeManifestFile="${working.dir}/combine_cm.xml" logFile="${working.dir}/combine_log.txt" verboseLogFile="${working.dir}/combine_verboselog.txt" /> <echo message="****** Finish: combine ******" /> </target> <!-- OFFLINEVALIDATE TASK --> <target name="validateCombined" description="valid inventory, with no logging"> <echo message="****** Start: validateCombined ******" /> <delete file="${working.dir}/validateCombined_log.txt" quiet="true" /> <delete file="${working.dir}/validateCombined_verboselog.txt" quiet="true" /> <offlineValidate sourceFile="${working.dir}/combined.zip" logFile="${working.dir}/validateCombined_log.txt" verboseLogFile="${working.dir}/validateCombined_verboselog.txt" /> <echo message="****** Finish: validateCombined ******" /> </target>
<!-- OFFLINEEXTRACT TASK --> <taskdef name="offlineExtract" classname="com.bea.propagation.ant.taskdefs.OfflineExtractTask"> <classpath refid="offlineTask.classpath"/> </taskdef> <target name="extractCombined" description="gather resources from the combined inventory"> <echo message="****** Start: extractCombined ******" /> <delete file="${working.dir}/extract/extractCombined_export.properties" quiet="true" /> <delete file="${working.dir}/extract/extractCombined_scope.properties" quiet="true" /> <delete file="${working.dir}/extract/extractCombined_policy.properties" quiet="true" /> <delete file="${working.dir}/extract/extractCombined_change.xml" quiet="true" /> <delete file="${working.dir}/extract/extractCombined_log.txt" quiet="true" /> <delete file="${working.dir}/extract/extractCombined_verboselog.txt" quiet="true" /> <mkdir dir="${working.dir}/extract"/> <offlineExtract sourceFile="${working.dir}/combined.zip" exportFile="${working.dir}/extract/extractCombined_export.properties" policyFile="${working.dir}/extract/extractCombined_policy.properties" changeManifestFile="${working.dir}/extract/extractCombined_change.xml" logFile="${working.dir}/extract/extractCombined_log.txt" verboseLogFile="${working.dir}/extract/extractCombined_verboselog.txt" /> <echo message="****** Finish: extractCombined ******" /> </target>
<!-- OFFLINEALGEBRA TASK --> <taskdef name="offlineAlgebra" classname="com.bea.propagation.ant.taskdefs.OfflineElectionAlgebraTask"> <classpath refid="offlineTask.classpath"/> </taskdef> <target name="electionsAdd" description="add the two election lists"> <echo message="****** Start: electionsAdd ******" /> <delete file="${working.dir}/addedElections.xml" quiet="true" /> <offlineAlgebra electionList1File="${working.dir}/elections1.xml" electionList2File="${working.dir}/elections2.xml" operation="add" outputFile="${working.dir}/addedElections.xml" /> <echo message="****** Finish: electionsAdd ******" /> </target> <target name="electionsSubtract" description="subtract the two election lists"> <echo message="****** Start: electionsSubtract ******" /> <delete file="${working.dir}/subtractedElections.xml" quiet="true" /> <offlineAlgebra electionList1File="${working.dir}/elections1.xml" electionList2File="${working.dir}/elections2.xml" operation="subtract" outputFile="${working.dir}/subtractedElections.xml" />
<!-- OFFLINEINSERT TASK --> <taskdef name="offlineInsert" classname="com.bea.propagation.ant.taskdefs.OfflineInsertTask"> <classpath refid="offlineTask.classpath"/> </taskdef> <target name="insertCombined" description="insert resources into the combined inventory"> <echo message="****** Start: insertCombined ******" /> <delete file="${working.dir}/newCombined.zip" quiet="true" /> <offlineInsert sourceFile="${working.dir}/combined.zip" policyFile="${working.dir}/extractCombined_policy.properties" changeManifestFile="${working.dir}/extractCombined_change.xml" outputFile="${working.dir}/newCombined.zip" /> <echo message="****** Finish: insertCombined ******" /> </target> <!-- OFFLINE Check for manual elections --> <taskdef name="offlineCheckForManualElections" classname="com.bea.propagation.ant.taskdefs.OfflineCheckManualElectionsTask"> <classpath refid="offlineTask.classpath"/> </taskdef> <target name="checkManualElections" description="check if there is manual elections in combined inventory or change manifest XML"> <echo message="****** Start: checkManualElections ******" /> <offlineCheckForManualElections changeManifestFile="${working.dir}/combine_cm.xml"/> <echo message="****** Finish: checkManualElections ******" /> </target> <target name="checkManualElectionsC1" description="check if there is manual elections in combined inventory or change manifest XML"> <echo message="****** Start: checkManualElectionsC1 ******" /> <condition property="hasManualElections"> <offlineCheckForManualElections sourceFile="${working.dir}/combined.zip"/> </condition> <antcall target="continuePropagation" /> <echo message="****** Finish: checkManualElectionsC1 ******" /> </target> <target name="continuePropagation" unless="hasManualElections"> <echo message="We could continue propagation" /> </target> <!-- ONLINEUPLOAD TASK --> <taskdef name="onlineUpload" classname="com.bea.propagation.ant.taskdefs.OnlineUploadTask"> <classpath refid="onlineTask.classpath"/> </taskdef> <target name="uploadCombined">
<echo message="****** Start: upload ******" /> <onlineUpload servletURL="${dest.servlet.url}" username="${dest.admin.username}" password="${dest.admin.password}" allowHttp="${dest.allow.http}" sourceFile="${working.dir}/combined.zip" /> <echo message="****** Finish: upload ******" /> </target> <target name="uploadRemote"> <echo message="****** Start: uploadRemote ******" /> <onlineUpload servletURL="${dest.servlet.url}" username="${dest.admin.username}" password="${dest.admin.password}" allowHttp="${dest.allow.http}" readFromServerFileSystem="true" sourceFile="D:\TEMP\prop_test\src.zip" /> <echo message="****** Finish: uploadRemote ******" /> </target> <target name="uploadSrc"> <echo message="****** Start: uploadSrc ******" /> <onlineUpload servletURL="${dest.servlet.url}" username="${dest.admin.username}" password="${dest.admin.password}" allowHttp="${dest.allow.http}" sourceFile="${working.dir}/src.zip" /> <echo message="****** Finish: uploadSrc ******" /> </target> <target name="uploadDest"> <echo message="****** Start: uploadDest ******" /> <onlineUpload servletURL="${dest.servlet.url}" username="${dest.admin.username}" password="${dest.admin.password}" allowHttp="${dest.allow.http}" sourceFile="${working.dir}/dest.zip" /> <echo message="****** Finish: uploadDest ******" /> </target> <!-- ONLINECOMMIT TASK --> <taskdef name="onlineCommit" classname="com.bea.propagation.ant.taskdefs.OnlineCommitTask"> <classpath refid="onlineTask.classpath"/> </taskdef> <target name="commit"> <echo message="****** Start: commit ******" /> <delete file="${working.dir}/commit.log" quiet="true" /> <onlineCommit servletURL="${dest.servlet.url}"
username="${dest.admin.username}" password="${dest.admin.password}" allowHttp="${dest.allow.http}" logFile="${working.dir}/commit.log" > <modifier name="differenceStrategy" value="pessimistic" /> <modifier name="cm_checkinComment" value="My sample checkin comment." /> <modifier name="allowMaintenanceModeDisabled" value="true"/> <modifier name="allowSecurityOutOfSync" value="true"/> </onlineCommit> <echo message="****** Finish: commit ******" /> </target> <target name="commitOpt"> <echo message="****** Start: commitOpt ******" /> <delete file="${working.dir}/commitOpt.log" quiet="true" /> <onlineCommit servletURL="${dest.servlet.url}" username="${dest.admin.username}" password="${dest.admin.password}" allowHttp="${dest.allow.http}" logFile="${working.dir}/commitOpt.log" > <modifier name="differenceStrategy" value="optimistic" /> <modifier name="cm_checkinComment" value="My sample checkin comment." /> <modifier name="allowMaintenanceModeDisabled" value="true"/> </onlineCommit> <echo message="****** Finish: commitOpt ******" /> </target> <!-- set scope file in commit task --> <target name="commitWithScope"> <echo message="****** Start: commitScope ******" /> <delete file="${working.dir}/commitScope.log" quiet="true" /> <onlineCommit servletURL="${dest.servlet.url}" username="${dest.admin.username}" password="${dest.admin.password}" allowHttp="${dest.allow.http}" scopeFile="${working.dir}/singlescope.properties" logFile="${working.dir}/commitScope.log" > <modifier name="differenceStrategy" value="pessimistic" /> <modifier name="cm_checkinComment" value="My sample checkin comment." /> <modifier name="allowMaintenanceModeDisabled" value="true"/> </onlineCommit> <echo message="****** Finish: commitOpt ******" /> </target> <!-- ONLINEMAINTENANCEMODE TASK --> <target name="unlockSrc" description="disable maintenance mode on the src server"> <echo message="****** Start: unlockSrc ******" /> <onlineMaintenanceMode servletURL="${source.servlet.url}" username="${source.admin.username}" password="${source.admin.password}" allowHttp="${source.allow.http}" enable="false"
/> <echo message="****** Finish: unlockSrc ******" /> </target> <target name="unlockDest" description="disable maintenance mode on the dest server"> <echo message="****** Start: unlockDest ******" /> <onlineMaintenanceMode servletURL="${dest.servlet.url}" username="${dest.admin.username}" password="${dest.admin.password}" allowHttp="${dest.allow.http}" enable="false" /> <echo message="****** Finish: unlockDest ******" /> </target>
<target name="startProp" description="Starts the propagation operation.." depends="pingSrc, pingDest, downloadSrc, validateSrc, downloadDest, validateDest, combine, uploadCombined, commit"> <echo message="****** Start: startProp ******" /> <echo message="****** Start: startProp ******" /> <echo message="****** Finish: startProp ******" /> </target> </project> 3. Create a folder called scopes under propagation. 4. In propagation.xml file. Make sure deploy.dir value is pointing to right BEA installation path on your local drive. For eg, C:\bea\wlserver_10.0" 5. Working.dir should point to propagation dir. 6. source.servlet.url is your source server. Where you copy the data from. For e.g, if you copy from INT box, then it should be http://source_server:7001/portlAppEARPropagation/inventorymanagement 7. Once you have all set up, run the following command from your propagation folder: ant f propagation.xml pingSrc If the above command fails, source server is not running. re-start it. 8. Same thing goes with destination as well. try this command: ant f propagation.xml pingDest 9. Type to generate scopes file by generating sourcezip first: ant -f propagation.xml downloadSrc then run this command: ant -f propagation.xml listScopes This should create a file listScopes.properties under propagation/scopes folder. To know more about scopes, please visit BEA documentation. 10. Once source and destination server running run the propagation command: ant f propagation.xml startProp It should propagate the data from source to destination. Important links:
What is the difference between streaming portal(desktop) and file based portal?
I have come across this question many times while working at client site from co-workers, clients and infrastructure folks - what is the difference between streaming portal and file based portal? Well, during portal development process we create .portal file in workshop. This is basically just a template in which more books, pages, portlets can be added. The .portal file is XML based and rendered as "single file mode". This file is mainly for development purpose and should not be used in the production though you can access it in production as well. You can not apply any entitlements or user customization as no data base involved in .portal template. The streaming portal(desktop) is created out of .portal template using weblogic portal admin tool. A single portal template can have any number of desktops. A desktop contains all the portlets, content, shells, layouts, and look and feel elements necessary to create individual user views of a portal. For eg, assume I have a requirement from three different clients to show some functionality of a portal. I don't want to create a three .portal template though I could, but I would like to have three different desktops with similar functionality but with different "look-and-feel". So I go to weblogic portal admin tool create a desktop called sample1 for client 1. sample 2 for client 2 with different look-and-feel. sample 3 for client 3 again with different look & f. Oh yes! Look and feel can be applied at run time ie while creating desktop itself. Also I can add/remove portlets if I want to for any desktop. I can also add/remove any book/page at run time as well. So what I have done is created 3 different desktops but with a different look-and-feel per client. When I create a desktop from a .portal template, the desktop is decoupled from the template, and modifications to the .portal file do not affect the desktop, and vice versa. For example, when you change a desktop's look and feel in the WebLogic Portal Administration Console, the change is made only to the desktop, not to the original.portal file. When you view a desktop with in a browser, the desktop is rendered in "streaming mode" from data base. P.S: If your portal application does not need any entitlements or personalizations and it is simple, static portal then file based portal is the best choice. File based portals give better peformance and propagation to other environments is also easy.
at 11/09/2009 09:15:00 AM 0 comments Labels: Weblogic Portal
<%-This is the JSP for the showing breadcrumbs in XYZ Eagle portal. It is part of the skeleton file page.jsp. Implementation based on WebLogic Portal 10.2. Author :: --%> Ananth Kannan
<% ArrayList breadcrumbTitles = new ArrayList(); ArrayList breadcrumbURLs = new ArrayList(); boolean isHidden = false; BookPresentationContext book = BookPresentationContext.getBookPresentationContext(request); PagePresentationContext pageCtx = PagePresentationContext.getPagePresentationContext(request); if (!(book.getDefaultPage().equals(pageCtx.getDefinitionLabel()))) { breadcrumbTitles.add(book.getTitle()); breadcrumbURLs.add(PageURL.createPageURL(request,response,book.getDefaultPage()).toString()); } PagePresentationContext parentPage = book.getParentPagePresentationContext(); while (parentPage != null) { breadcrumbTitles.add(parentPage.getTitle()); if (parentPage instanceof BookPresentationContext) { BookPresentationContext parentBook = (BookPresentationContext)parentPage; breadcrumbURLs.add(PageURL.createPageURL(request, response, parentBook.getDefaultPage()).toString()); } else { breadcrumbURLs.add(PageURL.createPageURL(request, response, parentPage.getDefinitionLabel()).toString()); } parentPage = parentPage.getParentPagePresentationContext(); } %>
<% //DO NOT SHOW BREADCRUMBS IN MAIN HOME PAGE and also in hidden page if (pageCtx.isHidden()) { } else { %> <ul class="breadcrumbs"> <% for (int i = breadcrumbTitles.size() - 1; i >= 0; i--) { if (((String)breadcrumbTitles.get(i)).equalsIgnoreCase("My Main Book")) {
breadcrumbTitles.set(i, "My Home"); } %> <li class="first"><a href="<%=breadcrumbURLs.get(i) %>" ><%=breadcrumbTitles.get(i)%></a></li> <img src="<render:getSkinPath imageName="/arrow_right.gif" />" /> <% } %> <% } %> </ul>
2. What is the difference between streaming portal and file-based portal? 3. What is backing file? 4. Backing file life cycle? 5. what is a control file and why we use it? 5. What are the different types of portlets? 6. what is page flow? 7. How to create streaming portal/desktop? 8. What are the components of look-and-feel? 9. Difference between skin and skeleton? 10.What is shell? 11.Difference between page and book? 12.Explain the order in portal creation(like books,pages and layout)? 13.Explain the inter-portlet communication and why we use it? 14.What are portlet modes and states? 15.Life cycle of the portlet? 16. What is UUP and give me detailed explanation about UUP. (Like how to write EJB or Java file to get the data from data base and how write .usr file and how to configure it in admin console) 17. Explain me about the content manage system. How to use the contents in JSP file?
18. How to create contents? 19. Explain me the steps to upgrade weblogic portal from 8.1 to 10.2/10.3? 20. Explain about WSRP portlets and security? 21. Have you involved in contents propogation ? what are the problems you faced in propogation? 22. Explain the problems faced in portal? how you solved? 23. Have you used AJAX in portal ? how you used? 24. How to improve the portal performance? 25. Steps to deploy the portal application to application server? A) cretae war file and ear file deploy it. 26. How to create the roles and assigning it to the portlet? 27. What are the problems you faced while creating the desktop? 28. JSR 168 life cycle. Explain detailed about JSR 168?