[JBoss Seam] - Re: Search Engines and Seam
by trickyvail
Previously I stated that search engines were not caching pages, but it would be more accurate to state that they were caching blank pages (sorry for the imprecision).
It seems that robots.txt can only be used to define areas to not visit, so that won't work either.
Currently I'm thinking about the following approach:
<html>
| <head>
| <meta http-equiv="Refresh" content="0; URL=home.seam">
| <meta name="robots" content="noindex,follow">
| </head>
| </html>(Tell the search engine to follow the redirecting index.html page, but not to index it.)
Ideally though, I would like to have JBoss load my home.seam page by default, rather than load an index.html page with a redirect. Is this something that is possible and how do you configure JBoss to do this?
Thank you for everyone's help.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4054498#4054498
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4054498
18Â years, 11Â months
[JBoss Portal] - Re: probleme with
by eagleIT
DashboardManager.java :
| package fr.cpage.PersonnalizePortlet.backingbean;
|
| import java.io.Serializable;
| import java.util.ArrayList;
| import java.util.Collection;
| import java.util.Collections;
| import java.util.Iterator;
| import java.util.LinkedHashMap;
| import java.util.List;
| import java.util.Map;
|
| import javax.faces.context.FacesContext;
| import javax.faces.model.SelectItem;
|
| import org.jboss.portal.core.admin.ui.actions.WindowComparator;
| import org.jboss.portal.core.model.content.Content;
| import org.jboss.portal.core.model.content.ContentType;
| import org.jboss.portal.core.model.instance.Instance;
| import org.jboss.portal.core.model.instance.InstanceContainer;
| import org.jboss.portal.core.model.portal.DuplicatePortalObjectException;
| import org.jboss.portal.core.model.portal.Page;
| import org.jboss.portal.core.model.portal.Portal;
| import org.jboss.portal.core.model.portal.PortalObject;
| import org.jboss.portal.core.model.portal.PortalObjectContainer;
| import org.jboss.portal.core.model.portal.PortalObjectId;
| import org.jboss.portal.core.model.portal.Window;
| import org.jboss.portal.theme.LayoutService;
| import org.jboss.portal.theme.PortalLayout;
| import org.jboss.portal.theme.ThemeConstants;
| import org.jboss.seam.ScopeType;
| import org.jboss.seam.annotations.Create;
| import org.jboss.seam.annotations.In;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.Out;
| import org.jboss.seam.annotations.Scope;
|
| /**
| *
| */
|
| @Name("dashboardManager")
| @Scope(ScopeType.SESSION)
| public class DashboardManager implements Serializable {
|
| private static final PortalObjectId dashboardId = PortalObjectId.parse("/dashboard", PortalObjectId.CANONICAL_FORMAT);
|
|
| // liste des portlets disponible en SelectItem pour les afficher dans
| // MaPage.xhtml
| List<String> lstPortletDispo;
|
| List<Instance> lstPortletDispoObj;
|
| // Nom de la portlet sélectionnée
| String selectedPortletName;
|
| // liste des layouts disponible en SelectItem pour les afficher dans
| // MaPage.xhtml
| List<String> lstLayouts;
|
| List<PortalLayout> lstLayoutsObject;
|
| // liste des pages disponible en SelectItem pour les afficher dans
| // MaPage.xhtml
| List<String> lstPages;
|
| // PortalObjectContainer = conteneur de tous les portails déployés sur jboss
|
| public PortalObjectContainer portalObjectContainer;
|
|
| public LayoutService layoutService;
|
| public InstanceContainer instanceContainer;
|
| // portail de l'utilisateur connecté
| Portal userPortal;
|
| // nom de l'utilisateur connecté
| String userId;
|
| // portletInfo injecté grâce au service
| @In(create = true)
| PortletInfo portletInfo;
|
| // liste des windows dans une page
| List<PortalObject> lstWindows;
|
| // clé : nom de la région valeur : nom de la région + portlet dans cette
| // région
| Map<String, Region> mapRegions;
|
| // Nom de la région sélectionnée
| String selectedRegionName;
|
| // Nom de la page sélectionnée
| String selectedPageName;
|
| // Position de la portlet dans la région
| int orderPortlet;
|
| // object de la page sélectionnée
| PortalObject selectedPage;
|
| String windowName;
|
| int nbWindowName;
|
| String infosPortlet;
|
| // Constructeur
| @Create
| public void initialize() {
| // PortalObjectContainer = conteneur de tous les portails déployés sur jboss
| }
| initLstPortletDispo();
| initLstLayouts();
| initUser();
| initLstPages();
| initLstRegions();
| initLstWindows();
| }
|
| /**
| * Initialisation de la liste des portlets disponibles
| */
| public void initLstPortletDispo() {
| // chargement de la liste de Portlets Définitions
| this.lstPortletDispo = new ArrayList<String>();
| this.lstPortletDispoObj = new ArrayList<Instance>();
| // listes des portlets dans la collection colIntances
| Collection<Instance> colInstances = instanceContainer.getDefinitions();
|
| // Chargement de la liste des porlets dans notre liste (pas triée)
| for (Instance instance : colInstances) { // Ajout portlet par portlet dans
| // la liste de SelectItem
| this.lstPortletDispo.add(instance.getId());
| this.lstPortletDispoObj.add(instance);
|
| }
| // tri par ordre alphabétique
| Collections.sort(this.lstPortletDispo);
| }
|
| /**
| * Initialisation de la liste des layouts disponibles
| */
| public void initLstLayouts() {
| // chargement de la liste de Layouts
| this.lstLayouts = new ArrayList<String>();
| this.lstLayoutsObject = new ArrayList<PortalLayout>();
| this.portletInfo.getPortletContext().getAttribute("LayoutService");
| // liste des layouts dans la collection colLayouts
| Collection<PortalLayout> colLayouts = layoutService.getLayouts();
| // Chargement de la liste des layouts dans notre liste (pas triée)
| for (PortalLayout layout : colLayouts) { // Ajout layout par layout dans la
| // liste de SelectItem
| this.lstLayouts.add(layout.getLayoutInfo().getName());
| this.lstLayoutsObject.add(layout);
| }
| }
|
| /**
| * initialise le nom de utilisateur connecté
| */
| public void initUser() {
| // Get user name
| this.userId = FacesContext.getCurrentInstance().getExternalContext().getRemoteUser();
| }
|
| /**
| * Initialisation de la liste des pages disponibles
| *
| * @param object conteneur de tous les objets dans les potails
| */
| public void initLstPages() {
| // chargement de la liste des pages
| this.lstPages = new ArrayList<String>();
| userPortal = (Portal)portalObjectContainer.getObject(dashboardId).getChild(userId);
| // Collection des objects appartenant à utilisateur = pages contenues dans
| // le dashboard
| Collection<PortalObject> colPages = this.userPortal.getChildren();
| for (PortalObject page : colPages) { // Ajout page par page dans la liste
| // de SelectItem
| this.lstPages.add(page.getName());
| }
| }
|
| /**
| * Initialisation de la map des regions disponibles + les portlets dans cette
| * région
| */
| public void initLstRegions() {
| // initialisation de lstRegions
| this.selectedPage = this.userPortal.getChild(this.selectedPageName);
| this.mapRegions = new LinkedHashMap<String, Region>();
| // nom du layout de la page en cours
| String layoutName = this.selectedPage.getProperty("layout.id");
| // object layout de la page en cours
| PortalLayout layout = getLayout(layoutName);
| // On fait une liste de toutes les régions de ce layout
| Collection<String> colRegions = layout.getLayoutInfo().getRegionNames();
| // On les ajoute dans la liste d'items pour pourvoir les utiliser avec le
| // SelectManyMenu
| for (String region : colRegions) {
| // si la région est "navigation", on l'ajoute pas
| if (!"navigation".equals(region)) {
| this.mapRegions.put(region, new Region(region));
| }
| }
| }
|
| /**
| * Retourne l'objet PortalLayout dont l'identifiant est lay
| *
| * @param lay identifiant du layout
| * @return l'objet PortalLayout
| */
| private PortalLayout getLayout(String lay) {
| int index = this.lstLayouts.indexOf(lay);
| PortalLayout retLayout = this.lstLayoutsObject.get(index);
| return retLayout;
|
| }
|
| /**
| * Action changer de page, liés au boutton dans la jsp
| */
| public void actionSelectedPageChange() {
| // object PortalObject de la page en cours
| System.out.println("----------------DEBUG" + selectedPageName);
| initLstPages();
| initLstRegions();
| initLstWindows();
| }
|
| /**
| * Action pour ajouter une window dans une page donnée, avec une région donnée
| */
| public void actionAddWindow() {
| Page page = (Page) this.selectedPage;
| try {
|
| String instanceName = this.selectedPortletName;
| String nameWindow = this.selectedPortletName.replaceAll("Instance", "Window");
| nameWindow = nameWindow + (int) (100 * Math.random());
| Window window = page.createWindow(nameWindow, ContentType.PORTLET, instanceName);
| Content content = window.getContent();
|
| window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_REGION, this.selectedRegionName);
| window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER, "" + Integer.MAX_VALUE);
|
|
| reinitOrderWindows(window);
|
| //this.portletInfo.getPortletContext().setAttribute("PortalObjectContainer", portalObjectContainer);
| //this.portletInfo.getPortletContext().setAttribute("InstanceContainer", instanceContainer);
|
| } catch (DuplicatePortalObjectException unexpected) {
| unexpected.printStackTrace();
| }
|
| }
|
| private void reinitOrderWindows(Window window) {
| // Get the windows belonging to the selected region sorted by order
| List windows = new ArrayList();
| for (Iterator i = selectedPage.getChildren(PortalObject.WINDOW_MASK).iterator();i.hasNext();)
| {
| Window tmp = (Window)i.next();
| if (selectedRegionName.equals(tmp.getProperty(ThemeConstants.PORTAL_PROP_REGION)))
| {
| windows.add(tmp);
| }
| }
|
| // Add the created one
| windows.add(window);
|
| // Update the order states
| for (int i = 0;i < windows.size();i++)
| {
| Window tmp = (Window)windows.get(i);
| tmp.setDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER, "" + i);
| }
| }
|
| public void changeSelectedPortlet() {
| int index = this.lstPortletDispoObj.indexOf(this.selectedPortletName);
| Instance porlet = this.lstPortletDispoObj.get(index);
| String idAttribute = porlet.INSTANCE_ID_ATTRIBUTE;
| String id = porlet.getId();
| this.infosPortlet = "Id de l'attribut de la portlet : ";
| this.infosPortlet += idAttribute;
| this.infosPortlet += "\n id de la portlet : ";
| this.infosPortlet += id;
| }
|
| /**
| * initialisation de la liste des windows dans la page en cours
| */
| public void initLstWindows() {
| this.lstWindows = new ArrayList<PortalObject>();
| Collection<PortalObject> colWindows = this.selectedPage.getChildren(PortalObject.WINDOW_MASK);
| for (PortalObject window : colWindows) {
| this.lstWindows.add(window);
| String region = window.getProperty(ThemeConstants.PORTAL_PROP_REGION);
| Region reg = this.mapRegions.get(region);
| reg.addWindow(window.getName());
| }
| }
|
| /**
| * Retourne la valeur de lstPortletDispo.
| *
| * @return valeur de lstPortletDispo.
| */
| public List<String> getLstPortletDispo() {
| return this.lstPortletDispo;
| }
|
| /**
| * Définit la valeur de lstPortletDispo.
| *
| * @param lstPortletDispo valeur de lstPortletDispo à définir.
| */
| public void setLstPortletDispo(List<String> lstPortletDispo) {
| this.lstPortletDispo = lstPortletDispo;
| }
|
| /**
| * Retourne la valeur de lstLayouts.
| *
| * @return valeur de lstLayouts.
| */
| public List<String> getLstLayouts() {
| return this.lstLayouts;
| }
|
| /**
| * Définit la valeur de lstLayouts.
| *
| * @param lstLayouts valeur de lstLayouts à définir.
| */
| public void setLstLayouts(List<String> lstLayouts) {
| this.lstLayouts = lstLayouts;
| }
|
| /**
| * Retourne la valeur de lstPages.
| *
| * @return valeur de lstPages.
| */
| public List<String> getLstPages() {
| return this.lstPages;
| }
|
| /**
| * Définit la valeur de lstPages.
| *
| * @param lstPages valeur de lstPages à définir.
| */
| public void setLstPages(List<String> lstPages) {
| this.lstPages = lstPages;
| }
|
| /**
| * Retourne la valeur de lstRegions.
| *
| * @return valeur de lstRegions.
| */
| public List<String> getLstRegions() {
| List<String> lstRegion = new ArrayList<String>();
| lstRegion.addAll(this.mapRegions.keySet());
| return lstRegion;
| }
|
| public List<Region> getLstRegionObj() {
| List<Region> lstRegion = new ArrayList<Region>();
| lstRegion.addAll(this.mapRegions.values());
| return lstRegion;
| }
|
| /**
| * Retourne la valeur de userId.
| *
| * @return valeur de userId.
| */
| public String getUserId() {
| return this.userId;
| }
|
| /**
| * Définit la valeur de userId.
| *
| * @param userId valeur de userId à définir.
| */
| public void setUserId(String userId) {
| this.userId = userId;
| }
|
| /**
| * Retourne la valeur de selectedPageName.
| *
| * @return valeur de selectedPageName.
| */
| public String getSelectedPageName() {
| return this.selectedPageName;
| }
|
| /**
| * Définit la valeur de selectedPageName.
| *
| * @param selectedPageName valeur de selectedPageName à définir.
| */
| public void setSelectedPageName(String selectedPageName) {
| this.selectedPageName = selectedPageName;
| }
|
| /**
| * Retourne la valeur de selectedPortletName.
| *
| * @return valeur de selectedPortletName.
| */
| public String getSelectedPortletName() {
| return this.selectedPortletName;
| }
|
| /**
| * Définit la valeur de selectedPortletName.
| *
| * @param selectedPortletName valeur de selectedPortletName à définir.
| */
| public void setSelectedPortletName(String selectedPortletName) {
| this.selectedPortletName = selectedPortletName;
| }
|
| /**
| * Retourne la valeur de selectedRegionName.
| *
| * @return valeur de selectedRegionName.
| */
| public String getSelectedRegionName() {
| return this.selectedRegionName;
| }
|
| /**
| * Définit la valeur de selectedRegionName.
| *
| * @param selectedRegionName valeur de selectedRegionName à définir.
| */
| public void setSelectedRegionName(String selectedRegionName) {
| this.selectedRegionName = selectedRegionName;
| }
|
| /**
| * Retourne la valeur de orderPortlet.
| *
| * @return valeur de orderPortlet.
| */
| public int getOrderPortlet() {
| return this.orderPortlet;
| }
|
| /**
| * Définit la valeur de orderPortlet.
| *
| * @param orderPortlet valeur de orderPortlet à définir.
| */
| public void setOrderPortlet(int orderPortlet) {
| this.orderPortlet = orderPortlet;
| }
|
| /**
| * Retourne la valeur de infosPortlet.
| *
| * @return valeur de infosPortlet.
| */
| public String getInfosPortlet() {
| return this.infosPortlet;
| }
|
| /**
| * Définit la valeur de infosPortlet.
| *
| * @param infosPortlet valeur de infosPortlet à définir.
| */
| public void setInfosPortlet(String infosPortlet) {
| this.infosPortlet = infosPortlet;
| }
|
| /**
| * Retourne la valeur de portalObjectContainer.
| *
| * @return valeur de portalObjectContainer.
| */
| public PortalObjectContainer getPortalObjectContainer() {
| return this.portalObjectContainer;
| }
|
| /**
| * Définit la valeur de portalObjectContainer.
| *
| * @param portalObjectContainer valeur de portalObjectContainer à définir.
| */
| public void setPortalObjectContainer(PortalObjectContainer portalObjectContainer) {
| this.portalObjectContainer = portalObjectContainer;
| }
|
| /**
| * Retourne la valeur de instanceContainer.
| *
| * @return valeur de instanceContainer.
| */
| public InstanceContainer getInstanceContainer() {
| return this.instanceContainer;
| }
|
| /**
| * Définit la valeur de instanceContainer.
| *
| * @param instanceContainer valeur de instanceContainer à définir.
| */
| public void setInstanceContainer(InstanceContainer instanceContainer) {
| this.instanceContainer = instanceContainer;
| }
|
| /**
| * Retourne la valeur de layoutService.
| *
| * @return valeur de layoutService.
| */
| public LayoutService getLayoutService() {
| return this.layoutService;
| }
|
| /**
| * Définit la valeur de layoutService.
| *
| * @param layoutService valeur de layoutService à définir.
| */
| public void setLayoutService(LayoutService layoutService) {
| this.layoutService = layoutService;
| }
|
| }
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4054495#4054495
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4054495
18Â years, 11Â months