cancel
Showing results for 
Search instead for 
Did you mean: 

Facelets???

manuelgentile
Champ in-the-making
Champ in-the-making
Is it possible to integrate into the Alfresco Web Client a set of pages made with Facelets!?!?!?
It's a special content editor??

Thanks
33 REPLIES 33

manuelgentile
Champ in-the-making
Champ in-the-making
browse.xhtml

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
   xmlns:f="http://java.sun.com/jsf/core"
   xmlns:h="http://java.sun.com/jsf/html"
   xmlns:t="http://myfaces.apache.org/tomahawk"
   xmlns:sloop="http://www.pa.itd.cnr.it/sloop"
   xmlns:ui="http://java.sun.com/jsf/facelets"
   xmlns:jsp="http://java.sun.com/JSP/Page"
   xmlns:a="http://www.alfresco.org/alfresco"
   xmlns:r="http://www.alfresco.org/repo">
<body>
<ui:composition template="../parts/template.xhtml">
   <ui:param name="form_id" value="browse"/>
   <ui:define name="script">
      <script type="text/javascript">
         //<![CDATA[
         function applySizeSpaces(e)
         {
            return applySize(e, 'spaces-apply');
         }
         function applySizeContent(e)
         {
            return applySize(e, 'content-apply');
         }
         function applySize(e, field)
         {
            var keycode;
            if (window.event) keycode = window.event.keyCode;
            else if (e) keycode = e.which;
            if (keycode == 13)
            {
               document.forms['browse']['browse:act'].value='browse:' + field;
               document.forms['browse'].submit();
               return false;
            }
            return true;
         }
         //]]>
      </script>
   <ui:define name="content">
      <table cellspacing="0" cellpadding="0" width="100%">
         <ui:include src="../parts/breadcrumb.xhtml"/>
         <tr>
            <td
               style="background-image:url(#{facesContext.externalContext.request.contextPath}/images/parts/statuspanel_4.gif)"
               width="4"></td>
            <td bgcolor="#EEEEEE">
            <table cellspacing="4" cellpadding="0" width="100%">
               <tr>
                  <a:panel id="browse-actions"
                     rendered="#{NavigationBean.searchContext == null}">
                     <td width="32"><h:graphicImage id="space-logo"
                        url="/images/icons/#{NavigationBean.nodeProperties.icon}.gif"
                        width="32" height="32" /></td>
                     <td>
                     <div class="mainTitle"><h:outputText
                        value="#{NavigationBean.nodeProperties.name}" id="msg2" /> 
                     <a:actionLink image="/images/icons/opennetwork.gif"
                        value="#{msg.network_folder} #{NavigationBean.nodeProperties.cifsPathLabel}"
                        showLink="false"
                        href="#{NavigationBean.nodeProperties.cifsPath}"
                        rendered="#{NavigationBean.nodeProperties.cifsPath != null}"
                        target="new" id="cifs" />  <a:actionLink id="actRSS"
                        value="#{msg.rss_feed_link}" showLink="false"
                        image="/images/icons/rss.gif"
                        href="#{NavigationBean.RSSFeedURL}"
                        rendered="#{NavigationBean.RSSFeed == true}" /></div>
                     <div class="mainSubText"><h:outputText
                        value="#{msg.view_description}" id="msg3" /></div>
                     <div class="mainSubText"><h:outputText
                        value="#{NavigationBean.nodeProperties.description}" id="msg4" /></div>
                     </td>
                     <td style="padding-right:4px" align="right"><h:graphicImage
                        id="img-rule" url="/images/icons/rule.gif" width="16"
                        height="16" title="#{msg.rules_count}" /> <h:outputText
                        value="(#{NavigationBean.ruleCount})" id="rulemsg1"
                        style="vertical-align:20%" /></td>
                     <td class="separator" width="1"></td>
                     <td style="padding-left:4px" align="right"><r:permissionEvaluator
                        value="#{NavigationBean.currentNode}" allow="CreateChildren"
                        id="eval2">
                        <a:actionLink value="#{msg.add_content}"
                           image="/images/icons/add.gif" padding="2" action="addContent"
                           actionListener="#{AddContentDialog.start}"
                           style="white-space:nowrap" id="link3" />
                     </r:permissionEvaluator></td>
                     <td style="padding-left:4px" width="52"><a:menu
                        id="createMenu" itemSpacing="4" label="#{msg.create_options}"
                        image="/images/icons/menu.gif" menuStyleClass="moreActionsMenu"
                        style="white-space:nowrap">
                        <r:actions id="acts_create" value="browse_create_menu"
                           context="#{NavigationBean.currentNode}" />
                     </a:menu></td>
                     <td style="padding-left:4px" width="80"><a:menu
                        id="actionsMenu" itemSpacing="4" label="#{msg.more_actions}"
                        image="/images/icons/menu.gif" menuStyleClass="moreActionsMenu"
                        style="white-space:nowrap">
                        <r:actions id="acts_browse" value="browse_actions_menu"
                           context="#{NavigationBean.currentNode}" />
                     </a:menu></td>
                  </a:panel>

                  <a:panel id="search-actions"
                     rendered="#{NavigationBean.searchContext != null}">
                     <td width="32"><h:graphicImage
                        value="/images/icons/search_results_large.gif"
                        width="32" height="32">
                     </h:graphicImage></td>
                     <td>
                     <div class="mainTitle"><h:outputText
                        value="#{msg.search_results}" id="msg11" /></div>
                     <div class="mainSubText"><h:outputFormat
                        value="#{msg.search_detail}" id="msg12">
                        <f:param value="#{NavigationBean.searchContext.text}"
                           id="param2" />
                     </h:outputFormat></div>
                     <div class="mainSubText"><h:outputText
                        value="#{msg.search_description}" id="msg13" /></div>
                     </td>
                     <td style="padding-right:4px" align="right"><a:actionLink
                        value="#{msg.close_search}" image="/images/icons/action.gif"
                        style="white-space:nowrap"
                        actionListener="#{BrowseBean.closeSearch}" id="link21" /></td>
                     <td style="padding-right:4px" width="80"><a:actionLink
                        value="#{msg.new_search}" image="/images/icons/search_icon.gif"
                        style="white-space:nowrap" action="advSearch" id="link20" /></td>
                     <td style="padding-left:4px" width="90"><a:menu
                        id="searchMenu" itemSpacing="4" label="#{msg.more_actions}"
                        image="/images/icons/menu.gif" menuStyleClass="moreActionsMenu"
                        style="white-space:nowrap">
                        <a:booleanEvaluator value="#{NavigationBean.isGuest == false}"
                           id="eval0">
                           <a:actionLink value="#{msg.save_new_search}"
                              image="/images/icons/save_search.gif" padding="4"
                              action="#{AdvancedSearchBean.saveNewSearch}" id="link20_1" />
                           <a:booleanEvaluator
                              value="#{AdvancedSearchBean.allowEdit == true}" id="eval0_1">
                              <a:actionLink value="#{msg.save_edit_search}"
                                 image="/images/icons/edit_search.gif" padding="4"
                                 action="#{AdvancedSearchBean.saveEditSearch}" id="link20_2" />
                           </a:booleanEvaluator>
                        </a:booleanEvaluator>
                     </a:menu></td>
                  </a:panel>

                  <td class="separator" width="1"></td>
                  <td width="118" valign="middle"><a:modeList id="viewMode"
                     itemSpacing="4" iconColumnWidth="20"
                     selectedStyleClass="statusListHighlight"
                     disabledStyleClass="statusListDisabled"
                     selectedImage="/images/icons/Details.gif"
                     value="#{BrowseBean.browseViewMode}"
                     actionListener="#{BrowseBean.viewModeChanged}" menu="true"
                     menuImage="/images/icons/menu.gif" styleClass="moreActionsMenu">
                     <a:listItem value="details" label="#{msg.details_view}" />
                     <a:listItem value="icons" label="#{msg.view_icon}" />
                     <a:listItem value="list" label="#{msg.view_browse}" />
                     <a:listItem value="dashboard" label="#{msg.custom_view}"
                        disabled="#{!NavigationBean.currentNodeHasTemplate}" />
                  </a:modeList></td>
               </tr>
            </table>

            </td>
            <td
               style="background-image:url(#{facesContext.externalContext.request.contextPath}/images/parts/statuspanel_6.gif)"
               width="4"></td>
         </tr>

         <tr>
            <td><h:graphicImage
               value="/images/parts/statuspanel_7.gif"
               width="4" height="9"></h:graphicImage></td>
            <td
               style="background-image:url(#{facesContext.externalContext.request.contextPath}/images/parts/statuspanel_8.gif)"></td>
            <td><h:graphicImage
               value="/images/parts/statuspanel_9.gif"
               width="4" height="9"></h:graphicImage></td>
         </tr>

         <tr valign="top">
            <td
               style="background-image:url(#{facesContext.externalContext.request.contextPath}/images/parts/whitepanel_4.gif)"
               width="4"></td>
            <td style="padding:4px"><h:panelGroup id="spaces-panel-facets">
               <f:facet name="title">
                  <a:panel id="page-controls1" style="font-size:9px">
                     <h:outputText value="#{msg.items_per_page}" id="items-txt1" />
                     <h:inputText id="spaces-pages"
                        value="#{BrowseBean.pageSizeSpacesStr}"
                        style="width:24px;margin-left:4px" maxlength="3"
                        onkeyup="return applySizeSpaces(event);" />
                     <div style="display:none"><a:actionLink id="spaces-apply"
                        value="" actionListener="#{BrowseBean.updateSpacesPageSize}" /></div>
                  </a:panel>
               </f:facet>
            </h:panelGroup> <a:panel id="spaces-panel" border="white" bgcolor="white"
               titleBorder="blue" titleBgcolor="#D3E6FE" styleClass="mainSubTitle"
               label="#{msg.browse_spaces}" progressive="true"
               facetsId="spaces-panel-facets">

               <a:richList id="spacesList"
                  viewMode="#{BrowseBean.browseViewMode}"
                  pageSize="#{BrowseBean.pageSizeSpaces}" styleClass="recordSet"
                  headerStyleClass="recordSetHeader" rowStyleClass="recordSetRow"
                  altRowStyleClass="recordSetRowAlt" width="100%"
                  value="#{BrowseBean.nodes}" var="r">

                  <f:facet name="empty">
                     <h:outputFormat id="no-space-items" value="#{msg.no_space_items}"
                        escape="false"
                        rendered="#{NavigationBean.searchContext == null}">
                        <f:param value="#{msg.create_space}" />
                     </h:outputFormat>
                  </f:facet>

                  <a:column id="col1" primary="true" width="200"
                     style="padding:2px;text-align:left"
                     rendered="#{BrowseBean.browseViewMode == 'details'}">
                     <f:facet name="header">
                        <a:sortLink id="col1-sort" label="#{msg.name}" value="name"
                           mode="case-insensitive" styleClass="header" />
                     </f:facet>
                     <f:facet name="small-icon">
                        <a:actionLink id="col1-act1" value="#{r.name}"
                           image="/images/icons/#{r.smallIcon}.gif"
                           actionListener="#{BrowseBean.clickSpace}" showLink="false">
                           <f:param name="id" value="#{r.id}" />
                        </a:actionLink>
                     </f:facet>
                     <a:actionLink id="col1-act2" value="#{r.name}"
                        actionListener="#{BrowseBean.clickSpace}">
                        <f:param name="id" value="#{r.id}" />
                     </a:actionLink>
                  </a:column>

                  <a:column id="col2" primary="true"
                     style="padding:2px;text-align:left;vertical-align:top;"
                     rendered="#{BrowseBean.browseViewMode == 'icons'}">
                     <f:facet name="large-icon">
                        <a:actionLink id="col2-act1" value="#{r.name}"
                           image="/images/icons/#{r.icon}.gif"
                           actionListener="#{BrowseBean.clickSpace}" showLink="false">
                           <f:param name="id" value="#{r.id}" />
                        </a:actionLink>
                     </f:facet>
                     <a:actionLink id="col2-act2" value="#{r.name}"
                        actionListener="#{BrowseBean.clickSpace}" styleClass="header">
                        <f:param name="id" value="#{r.id}" />
                     </a:actionLink>
                  </a:column>
                  <a:column id="col3" primary="true"
                     style="padding:2px;text-align:left"
                     rendered="#{BrowseBean.browseViewMode == 'list'}">
                     <f:facet name="large-icon">
                        <a:actionLink id="col3-act1" value="#{r.name}"
                           image="/images/icons/#{r.icon}.gif"
                           actionListener="#{BrowseBean.clickSpace}" showLink="false">
                           <f:param name="id" value="#{r.id}" />
                        </a:actionLink>
                     </f:facet>
                     <r:nodeInfo id="col3-act2-nodeinfo" value="#{r.id}">
                        <a:actionLink id="col3-act2" value="#{r.name}"
                           actionListener="#{BrowseBean.clickSpace}" styleClass="title">
                           <f:param name="id" value="#{r.id}" />
                        </a:actionLink>
                     </r:nodeInfo>
                  </a:column>

                  <a:column id="col4" style="text-align:left">
                     <f:facet name="header">
                        <a:sortLink id="col4-sort" label="#{msg.description}"
                           value="description" styleClass="header" />
                     </f:facet>
                     <h:outputText id="col4-txt" value="#{r.description}" />
                  </a:column>

                  <a:column id="col5" style="text-align:left"
                     rendered="#{(NavigationBean.searchContext!=null) and (BrowseBean.browseViewMode == 'details')}">
                     <f:facet name="header">
                        <a:sortLink id="col5-sort" label="#{msg.path}"
                           value="displayPath" styleClass="header" />
                     </f:facet>
                     <r:nodePath id="col5-path" value="#{r.path}"
                        actionListener="#{BrowseBean.clickSpacePath}" />
                  </a:column>

                  <a:column id="col6" style="text-align:left"
                     rendered="#{BrowseBean.browseViewMode == 'details'}">
                     <f:facet name="header">
                        <a:sortLink id="col6-sort" label="#{msg.created}"
                           value="created" styleClass="header" />
                     </f:facet>
                     <h:outputText id="col6-txt" value="#{r.created}">
                        <a:convertXMLDate type="both" pattern="#{msg.date_time_pattern}" />
                     </h:outputText>
                  </a:column>

                  <a:column id="col7" style="text-align:left"
                     rendered="#{(BrowseBean.browseViewMode == 'details') || (BrowseBean.browseViewMode == 'icons')}">
                     <f:facet name="header">
                        <a:sortLink id="col7-sort" label="#{msg.modified}"
                           value="modified" styleClass="header" />
                     </f:facet>
                     <h:outputText id="col7-txt" value="#{r.modified}">
                        <a:convertXMLDate type="both" pattern="#{msg.date_time_pattern}" />
                     </h:outputText>
                  </a:column>

                  <a:column id="col8" style="text-align:left"
                     rendered="#{BrowseBean.browseViewMode == 'list'}">
                     <r:nodeDescendants id="col8-kids" value="#{r.nodeRef}"
                        styleClass="header"
                        actionListener="#{BrowseBean.clickDescendantSpace}" />
                  </a:column>


                  <a:column id="col9" actions="true" style="text-align:left">
                     <f:facet name="header">
                        <h:outputText id="col9-txt" value="#{msg.actions}" />
                     </f:facet>


                     <r:actions id="col9-acts1" value="space_browse" context="#{r}"
                        showLink="false" styleClass="inlineAction" />
                     <a:menu id="spaces-more-menu" itemSpacing="4"
                        image="/images/icons/more.gif" tooltip="#{msg.more_actions}"
                        menuStyleClass="moreActionsMenu">
                        <r:actions id="col9-acts2" value="space_browse_menu"
                           context="#{r}" />
                     </a:menu>
                  </a:column>

                  <a:dataPager id="pager1" styleClass="pager" />
               </a:richList>

            </a:panel></td>
            <td
               style="background-image:url(#{facesContext.externalContext.request.contextPath}/images/parts/whitepanel_6.gif)"
               width="4"></td>
         </tr>


         <tr valign="top">
            <td
               style="background-image:url(#{facesContext.externalContext.request.contextPath}/images/parts/whitepanel_4.gif)"
               width="4"></td>
            <td style="padding:4px"><h:panelGroup id="content-panel-facets">
               <f:facet name="title">
                  <a:panel id="page-controls2" style="font-size:9px">
                     <h:outputText value="#{msg.items_per_page}" id="items-txt2" />
                     <h:inputText id="content-pages"
                        value="#{BrowseBean.pageSizeContentStr}"
                        style="width:24px;margin-left:4px" maxlength="3"
                        onkeyup="return applySizeContent(event);" />
                     <div style="display:none"><a:actionLink id="content-apply"
                        value="" actionListener="#{BrowseBean.updateContentPageSize}" /></div>
                  </a:panel>
               </f:facet>
            </h:panelGroup> <a:panel id="content-panel" border="white" bgcolor="white"
               titleBorder="blue" titleBgcolor="#D3E6FE" styleClass="mainSubTitle"
               label="#{msg.browse_content}" progressive="true"
               facetsId="content-panel-facets">


               <a:richList id="contentRichList"
                  viewMode="#{BrowseBean.browseViewMode}"
                  pageSize="#{BrowseBean.pageSizeContent}" styleClass="recordSet"
                  headerStyleClass="recordSetHeader" rowStyleClass="recordSetRow"
                  altRowStyleClass="recordSetRowAlt" width="100%"
                  value="#{BrowseBean.items}" var="r">


                  <f:facet name="empty">
                     <h:outputFormat id="no-content-items"
                        value="#{msg.no_content_items}" escape="false"
                        rendered="#{NavigationBean.searchContext == null}">
                        <f:param value="#{msg.add_content}" />
                        <f:param value="#{msg.create_content}" />
                     </h:outputFormat>
                  </f:facet>

                  <a:column id="col10" primary="true" width="200"
                     style="padding:2px;text-align:left"
                     rendered="#{BrowseBean.browseViewMode == 'details'}">
                     <f:facet name="header">
                        <a:sortLink id="col10-sort" label="#{msg.name}" value="name"
                           mode="case-insensitive" styleClass="header" />
                     </f:facet>
                     <f:facet name="small-icon">
                        <a:actionLink id="col10-act1" value="#{r.name}" href="#{r.url}"
                           target="new" image="#{r.fileType16}" showLink="false"
                           styleClass="inlineAction" />
                     </f:facet>
                     <a:actionLink id="col10-act2" value="#{r.name}" href="#{r.url}"
                        target="new" />
                     <r:lockIcon id="col10-lock" value="#{r.nodeRef}"
                        align="absmiddle" />
                  </a:column>


                  <a:column id="col11" primary="true"
                     style="padding:2px;text-align:left;vertical-align:top;"
                     rendered="#{BrowseBean.browseViewMode == 'icons'}">
                     <f:facet name="large-icon">
                        <a:actionLink id="col11-act1" value="#{r.name}" href="#{r.url}"
                           target="new" image="#{r.fileType32}" showLink="false"
                           styleClass="inlineAction" />
                     </f:facet>
                     <a:actionLink id="col11-act2" value="#{r.name}" href="#{r.url}"
                        target="new" styleClass="header" />
                     <r:lockIcon id="col11-lock" value="#{r.nodeRef}"
                        align="absmiddle" />
                  </a:column>


                  <a:column id="col12" primary="true"
                     style="padding:2px;text-align:left"
                     rendered="#{BrowseBean.browseViewMode == 'list'}">
                     <f:facet name="large-icon">
                        <a:actionLink id="col12-act1" value="#{r.name}" href="#{r.url}"
                           target="new" image="#{r.fileType32}" showLink="false"
                           styleClass="inlineAction" />
                     </f:facet>
                     <a:actionLink id="col12-act2" value="#{r.name}" href="#{r.url}"
                        target="new" styleClass="title" />
                     <r:lockIcon id="col12-lock" value="#{r.nodeRef}"
                        align="absmiddle" />
                  </a:column>

                  <a:column id="col13" style="text-align:left">
                     <f:facet name="header">
                        <a:sortLink id="col13-sort" label="#{msg.description}"
                           value="description" styleClass="header" />
                     </f:facet>
                     <h:outputText id="col13-txt" value="#{r.description}" />
                  </a:column>


                  <a:column id="col14" style="text-align:left"
                     rendered="#{(NavigationBean.searchContext != null) and (BrowseBean.browseViewMode == 'details')}">
                     <f:facet name="header">
                        <a:sortLink id="col14-sort" label="#{msg.path}"
                           value="displayPath" styleClass="header" />
                     </f:facet>
                     <r:nodePath id="col14-path" value="#{r.path}"
                        actionListener="#{BrowseBean.clickSpacePath}" />
                  </a:column>


                  <a:column id="col15" style="text-align:left"
                     rendered="#{(BrowseBean.browseViewMode == 'details') || (BrowseBean.browseViewMode == 'icons')}">
                     <f:facet name="header">
                        <a:sortLink id="col15-sort" label="#{msg.size}" value="size"
                           styleClass="header" />
                     </f:facet>
                     <h:outputText id="col15-txt" value="#{r.size}">
                        <a:convertSize />
                     </h:outputText>
                  </a:column>


                  <a:column id="col16" style="text-align:left"
                     rendered="#{BrowseBean.browseViewMode == 'details'}">
                     <f:facet name="header">
                        <a:sortLink id="col16-sort" label="#{msg.created}"
                           value="created" styleClass="header" />
                     </f:facet>
                     <h:outputText id="col16-txt" value="#{r.created}">
                        <a:convertXMLDate type="both" pattern="#{msg.date_time_pattern}" />
                     </h:outputText>
                  </a:column>

                  <a:column id="col17" style="text-align:left"
                     rendered="#{(BrowseBean.browseViewMode == 'details') || (BrowseBean.browseViewMode == 'icons')}">
                     <f:facet name="header">
                        <a:sortLink id="col17-sort" label="#{msg.modified}"
                           value="modified" styleClass="header" />
                     </f:facet>
                     <h:outputText id="col17-txt" value="#{r.modified}">
                        <a:convertXMLDate type="both" pattern="#{msg.date_time_pattern}" />
                     </h:outputText>
                  </a:column>

                  <a:column id="col18" actions="true" style="text-align:left">
                     <f:facet name="header">
                        <h:outputText id="col18-txt" value="#{msg.actions}" />
                     </f:facet>
                     
                     <a:actionLink image="/images/icons/opennetwork.gif"
                        value="Edit"
                        showLink="true"
                        action="edit_doc_http"
                        actionListener="#{CheckinCheckoutBean.editFile}"
                        id="ccaca" />

                     <r:actions id="col18-acts1" value="document_browse"
                        context="#{r}" showLink="false" styleClass="inlineAction" />

                     <a:menu id="content-more-menu" itemSpacing="4"
                        image="/images/icons/more.gif" tooltip="#{msg.more_actions}"
                        menuStyleClass="moreActionsMenu">
                        <r:actions id="col18-acts2" value="document_browse_menu"
                           context="#{r}" />
                     </a:menu>
                  </a:column>

                  <a:dataPager id="pager2" styleClass="pager" />
               </a:richList>

            </a:panel></td>
            <td
               style="background-image:url(#{facesContext.externalContext.request.contextPath}/images/parts/whitepanel_6.gif)"
               width="4"></td>
         </tr>

         <tr valign="top">
            <td
               style="background-image:url(#{facesContext.externalContext.request.contextPath}/images/parts/whitepanel_4.gif)"
               width="4"></td>
            <td><h:messages globalOnly="true" styleClass="errorMessage"
               layout="table" /></td>
            <td
               style="background-image:url(#{facesContext.externalContext.request.contextPath}/images/parts/whitepanel_6.gif)"
               width="4"></td>
         </tr>

         <tr>
            <td><h:graphicImage value="/images/parts/whitepanel_7.gif"
               width="4" height="4"></h:graphicImage></td>
            <td width="100%" align="center"
               style="background-image:url(#{facesContext.externalContext.request.contextPath}/images/parts/whitepanel_8.gif)"></td>
            <td><h:graphicImage value="/images/parts/whitepanel_9.gif"
               width="4" height="4"></h:graphicImage></td>
         </tr>

      </table>


   </ui:define>
</ui:composition>
</body>
</html>

manuelgentile
Champ in-the-making
Champ in-the-making
template.xhtml

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
   xmlns:f="http://java.sun.com/jsf/core"
   xmlns:h="http://java.sun.com/jsf/html"
   xmlns:t="http://myfaces.apache.org/tomahawk"
   xmlns:sloop="http://www.pa.itd.cnr.it/sloop"
   xmlns:ui="http://java.sun.com/jsf/facelets"
   xmlns:jsp="http://java.sun.com/JSP/Page"
   xmlns:a="http://www.alfresco.org/alfresco"
   xmlns:r="http://www.alfresco.org/repo">
<head>
<title><ui:insert name="title">FreeLOms</ui:insert></title>
<link rel="stylesheet"
   href="#{facesContext.externalContext.request.contextPath}/css/main.css"
   type="text/css" />
<link rel="stylesheet"
   href="#{facesContext.externalContext.request.contextPath}/css/sloop.css"
   type="text/css" />
<script type="text/javascript"
   src="#{facesContext.externalContext.request.contextPath}/scripts/menu.js"/>
<script type="text/javascript"
   src="#{facesContext.externalContext.request.contextPath}/scripts/webdav.js"/>
<ui:insert name="script"/>
</head>
<body>
<f:view>
   <f:loadBundle basename="alfresco.messages.webclient" var="msg" />
   <h:form acceptCharset="UTF-8" id="#{form_id}">
      <div id="titlebar">
         <ui:insert name="titlebar">
            <ui:include src="titlebar.xhtml" />
         </ui:insert>
      </div>
      <div id="center">
         <div id="shelf">
            <ui:insert name="shelf">
               <ui:include src="shelf.xhtml" />
            </ui:insert>
         </div>
         <div id="content">
            <ui:insert name="content" />
         </div>
      </div>
   </h:form>
</f:view>
</body>
</html>

manuelgentile
Champ in-the-making
Champ in-the-making
shelf.xhtml

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
   xmlns:f="http://java.sun.com/jsf/core"
   xmlns:h="http://java.sun.com/jsf/html"
   xmlns:t="http://myfaces.apache.org/tomahawk"
   xmlns:sloop="http://www.pa.itd.cnr.it/sloop"
   xmlns:ui="http://java.sun.com/jsf/facelets"
   xmlns:jsp="http://java.sun.com/JSP/Page"
   xmlns:a="http://www.alfresco.org/alfresco"
   xmlns:r="http://www.alfresco.org/repo">
<head>
<link rel="stylesheet"
   href="#{facesContext.externalContext.request.contextPath}/css/main.css"
   type="text/css" />
</head>
<body>
<ui:composition>
   <a:panel id="shelfPanel" expanded="#{NavigationBean.shelfExpanded}">

      <table cellspacing="0" cellpadding="0" width="100%" bgcolor="#ffffff" class="shelf">
         <tr>
            <td><h:graphicImage value="/images/parts/headbar_begin.gif"
               width="4" height="33"></h:graphicImage></td>
            <td align="center" width="100%"
               style="background-image: url(#{facesContext.externalContext.request.contextPath}/images/parts/headbar_bg.gif)">
            <div class="headbarTitle"><h:outputText id="shelfText"
               value="#{msg.shelf}" /></div>
            </td>
            <td><h:graphicImage value="/images/parts/headbar_end.gif"
               width="4" height="33" /></td>
         </tr>
         <tr>
            <td style="background-image: url(#{facesContext.externalContext.request.contextPath}/images/parts/whitepanel_4.gif)"   width="4"></td>
            <td valign="top" width="100%">
            <r:shelf id="shelf" groupPanel="ballongrey" groupBgcolor="#eeeeee"
               selectedGroupPanel="bluetoolbar" selectedGroupBgcolor="#e9f0f4"
               innerGroupPanel="white" innerGroupBgcolor="#ffffff"
               groupExpandedActionListener="#{NavigationBean.shelfGroupToggled}">
               <r:shelfGroup label="#{msg.clipboard}" id="shelf-group-1"
                  expanded="#{NavigationBean.shelfItemExpanded[0]}">
                  <r:clipboardShelfItem id="clipboard-shelf"
                     collections="#{ClipboardBean.items}"
                     pasteActionListener="#{ClipboardBean.pasteItem}" />
               </r:shelfGroup>
               <r:shelfGroup label="#{msg.recent_spaces}"
                  id="shelf-group-2"
                  expanded="#{NavigationBean.shelfItemExpanded[1]}">
                  <r:recentSpacesShelfItem id="recent-shelf"
                     value="#{RecentSpacesBean.recentSpaces}"
                     navigateActionListener="#{RecentSpacesBean.navigate}" />
               </r:shelfGroup>

               <r:shelfGroup label="#{msg.shortcuts}" id="shelf-group-3"
                  expanded="#{NavigationBean.shelfItemExpanded[2]}">
                  <r:shortcutsShelfItem id="shortcut-shelf"
                     value="#{UserShortcutsBean.shortcuts}"
                     clickActionListener="#{UserShortcutsBean.click}"
                     removeActionListener="#{UserShortcutsBean.removeShortcut}" />
               </r:shelfGroup>
              
              
               <r:shelfGroup label="Drop Zone" id="shelf-group-4"
                  expanded="#{NavigationBean.shelfItemExpanded[3]}">

               </r:shelfGroup>

               <r:shelfGroup label="Actions in Progress" id="shelf-group-5"
                  expanded="#{NavigationBean.shelfItemExpanded[4]}">

               </r:shelfGroup>
            </r:shelf></td>
            <td
               style="background-image: url(#{facesContext.externalContext.request.contextPath}/images/parts/whitepanel_6.gif)"
               width="4"></td>
         </tr>
         <tr>
            <td><h:graphicImage value="/images/parts/whitepanel_7.gif"
               width="4" height="4"></h:graphicImage></td>
            <td width="100%" align="center" style="background-image: url(#{facesContext.externalContext.request.contextPath}/images/parts/whitepanel_8.gif)"></td>
            <td><h:graphicImage value="/images/parts/whitepanel_9.gif"
               width="4" height="4"></h:graphicImage></td>
         </tr>
      </table>

   </a:panel>


</ui:composition>
</body>
</html>

manuelgentile
Champ in-the-making
Champ in-the-making
titlebar.xhtml


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
   xmlns:f="http://java.sun.com/jsf/core"
   xmlns:h="http://java.sun.com/jsf/html"
   xmlns:t="http://myfaces.apache.org/tomahawk"
   xmlns:sloop="http://www.pa.itd.cnr.it/sloop"
   xmlns:ui="http://java.sun.com/jsf/facelets"
   xmlns:jsp="http://java.sun.com/JSP/Page"
   xmlns:a="http://www.alfresco.org/alfresco"
   xmlns:r="http://www.alfresco.org/repo">
<head>
<link rel="stylesheet"
   href="#{facesContext.externalContext.request.contextPath}/css/main.css"
   type="text/css" />
</head>
<body>
<ui:composition>
   <table cellspacing="0" cellpadding="2" width="100%">
      <tr>
         <td width="100%">
         <table cellspacing="0" cellpadding="0" width="100%">
            <tr>
               <td style="padding-right:4px;"><a:actionLink
                  image="/images/logo/AlfrescoLogo32.png" value="Alfresco"
                  tooltip="Alfresco" showLink="false" action="about" /></td>
               <td><h:graphicImage value="/images/parts/titlebar_begin.gif"
                  width="10" height="30" /></td>
               <td width="100%"
                  style="background-image:url(#{facesContext.externalContext.request.contextPath}/images/parts/titlebar_bg.gif)">
               <a:modeList itemSpacing="3" iconColumnWidth="0" horizontal="true"
                  itemStyleClass="topToolbar" itemLinkStyleClass="topToolbarLink"
                  selectedStyleClass="topToolbar"
                  selectedLinkStyleClass="topToolbarLink"
                  value="#{NavigationBean.toolbarLocation}"
                  actionListener="#{NavigationBean.toolbarLocationChanged}">
                  <a:listItem value="companyhome" label="#{msg.company_home}"
                     rendered="#{NavigationBean.companyHomeVisible}" />
                  <a:listItem value="userhome" label="#{msg.my_home}" />
                  <a:listItem value="guesthome" label="#{msg.guest_home}"
                     rendered="#{(NavigationBean.isGuest==false) and (NavigationBean.guestHomeVisible)}" />
                  <a:listItem value="myalfresco" label="#{msg.my_alfresco}" />
               </a:modeList></td>
               <td><h:graphicImage value="/images/parts/titlebar_end.gif"
                  width="8" height="30" /></td>
            </tr>
         </table>
         </td>
         <td>
         <table cellspacing="2" cellpadding="0" width="100%">
            <tr>
               <td><a:booleanEvaluator
                  value="#{NavigationBean.currentUser.admin==true}" id="evalA">
                  <a:actionLink value="#{msg.admin_console}"
                     image="/images/icons/admin_console.gif" showLink="false"
                     action="dialog:adminConsole" id="link11_1" />
               </a:booleanEvaluator></td>
               <td width="8"> </td>
               <td><a:actionLink value="#{msg.user_console}"
                  image="/images/icons/user_console.gif" showLink="false"
                  action="dialog:userConsole"
                  actionListener="#{UsersBean.setupUserAction}" id="link11_2">
                  <f:param name="id" value="#{NavigationBean.currentUser.person.id}" />
               </a:actionLink></td>
               <td width="8"> </td>
               <td><a:actionLink value="#{msg.toggle_shelf}"
                  image="/images/icons/shelf.gif" showLink="false"
                  actionListener="#{NavigationBean.toggleShelf}" /></td>
               <td width="8"> </td>
               <td><a:actionLink value="#{msg.help}"
                  image="/images/icons/Help_icon.gif" showLink="false"
                  href="#{NavigationBean.helpUrl}" target="help" /></td>
               <td width="8"> </td>
               <td><a href="http://www.alfresco.com/services/support/issues/"
                  target="new"><h:outputText value="#{msg.raise_issue}" /></a><nobr></nobr>
               </td>
               <td width="8"> </td>
               <td><a:actionLink id="logout" image="/images/icons/logout.gif"
                  value="#{msg.logout} (#{NavigationBean.currentUser.userName})"
                  rendered="#{NavigationBean.isGuest == false}"
                  action="#{LoginBean.logout}" immediate="true" /> <a:actionLink
                  id="login" image="/images/icons/login.gif"
                  value="#{msg.login} (#{NavigationBean.currentUser.userName})"
                  rendered="#{NavigationBean.isGuest == true}"
                  action="#{LoginBean.logout}" /> <nobr></nobr></td>
            </tr>
         </table>
         </td>
         <td>
         <table cellspacing="0" cellpadding="0" width="100%">
            <tr>
               <td><h:graphicImage value="/images/parts/searchbar_begin.gif"
                  width="6" height="30" /></td>
               <td width="100%"
                  style="background-image:url(#{facesContext.externalContext.request.contextPath}/images/parts/searchbar_bg.gif)">
               <r:simpleSearch id="search" actionListener="#{BrowseBean.search}" /></td>
               <td><h:graphicImage value="/images/parts/searchbar_end.gif"
                  width="6" height="30" /></td>
            </tr>
         </table>
         </td>
      </tr>
   </table>
</ui:composition>
</body>
</html>

manuelgentile
Champ in-the-making
Champ in-the-making
breadcrumb.xhtml

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
   xmlns:f="http://java.sun.com/jsf/core"
   xmlns:h="http://java.sun.com/jsf/html"
   xmlns:t="http://myfaces.apache.org/tomahawk"
   xmlns:sloop="http://www.pa.itd.cnr.it/sloop"
   xmlns:ui="http://java.sun.com/jsf/facelets"
   xmlns:jsp="http://java.sun.com/JSP/Page"
   xmlns:a="http://www.alfresco.org/alfresco"
   xmlns:r="http://www.alfresco.org/repo">
<body>
<ui:composition>
   <tr>
      <td><h:graphicImage value="/images/parts/headbar_1.gif" width="4"
         height="7" /></td>
      <td width="100%"
         style="background-image: url(#{facesContext.externalContext.request.contextPath}/images/parts/headbar_2.gif)"></td>
      <td><h:graphicImage value="/images/parts/headbar_3.gif" width="4"
         height="7" /></td>
   </tr>
   <tr>
      <td style="background-image: url(#{facesContext.externalContext.request.contextPath}/images/parts/headbar_4.gif)"></td>
      <td bgcolor="#8EB6E6">
      <div style="padding-left:8px" class="headbarTitle"><a:breadcrumb
         value="#{NavigationBean.location}" styleClass="headbarLink" /></div>
      </td>
      <td style="background-image: url(#{facesContext.externalContext.request.contextPath}/images/parts/headbar_6.gif)"></td>
   </tr>

   <tr>
      <td><h:graphicImage value="/images/parts/headbar_7.gif" width="4"
         height="10" /></td>
      <td width="100%"
         style="background-image: url(#{facesContext.externalContext.request.contextPath}/images/parts/headbar_8.gif)"></td>
      <td><h:graphicImage value="/images/parts/headbar_9.gif" width="4"
         height="10" /></td>
   </tr>
</ui:composition>
</body>
</html>

manuelgentile
Champ in-the-making
Champ in-the-making
alfresco.taglib.xml
and
repo.taglib.xml

are not complete!

I love facelet templating and the relative view code reusing!!!!!

Let me knowe about that…..

gavinc
Champ in-the-making
Champ in-the-making
Thanks very much for posting these, I will definitely take another look before we start the 2.0 redesign.

Yes, the code re-use is one of the main attractions of facelets for me, for us I think it could reduce the complexity and duplication of our app significantly.

manuelgentile
Champ in-the-making
Champ in-the-making
If I remember rightly some of the action listener methods did not work correctly and I had a few issues using our rich list component if there was more than one item to display in a list.

I'm happy to share with Alfresco community some important results…..
To work with alfresco components in facelets we need to define some ComponentHandlers that makes method binding that you have defined in the Tag classes.

As example

package cnr.itd.freeloms.web.ui.common;

import java.io.IOException;
import javax.el.ELException;
import javax.faces.FacesException;
import javax.faces.component.UIComponent;
import javax.faces.el.MethodBinding;
import org.alfresco.web.ui.common.component.UIPanel;
import cnr.itd.freeloms.web.ui.AlfrescoBaseComponentHandler;
import com.sun.facelets.FaceletContext;
import com.sun.facelets.tag.TagAttribute;
import com.sun.facelets.tag.jsf.ComponentConfig;

/**
*
* @author manuel gentile
*
*/
public class PanelComponentHandler extends AlfrescoBaseComponentHandler {
   
   public PanelComponentHandler(ComponentConfig arg0) {
      super(arg0);
   }

   @Override
   protected void setAttributes(FaceletContext arg0, Object arg1) {
      super.setAttributes(arg0, arg1);
      TagAttribute expandedActionListener =this.getAttribute("expandedActionListener");
      if (expandedActionListener != null)
         {
         if (!expandedActionListener.isLiteral())
           {
            MethodBinding vb = arg0.getFacesContext().getApplication().createMethodBinding(expandedActionListener.getValue(), ACTION_CLASS_ARGS);
               ((UIPanel)arg1).setExpandedActionListener(vb);
            }
            else
            {
               throw new FacesException("Expanded Action listener method binding incorrectly specified: " + expandedActionListener);
            }
         }
   }
   
   

   
   @Override
   protected void applyNextHandler(FaceletContext arg0, UIComponent arg1) throws IOException, FacesException, ELException {
      System.out.println("");
      System.out.println("—————–");
      System.out.println("ZZ");
      if (((UIPanel)arg1).isExpanded())
      {
         System.out.println(">ZZ");
         super.applyNextHandler(arg0, arg1);
      }
   }
   
   
}

package cnr.itd.freeloms.web.ui;

import com.sun.facelets.tag.jsf.ComponentConfig;
import com.sun.facelets.tag.jsf.ComponentHandler;

public abstract class AlfrescoBaseComponentHandler extends ComponentHandler {
   protected final static Class ACTION_CLASS_ARGS[] = { javax.faces.event.ActionEvent.class };

   public AlfrescoBaseComponentHandler(ComponentConfig arg0) {
      super(arg0);
      
   }
}

of course we need to modify alfresco.taglib.xml in this way

<tag>
      <tag-name>panel</tag-name>
      <component>
         <component-type>org.alfresco.faces.Panel</component-type>
         <handler-class>cnr.itd.freeloms.web.ui.common.PanelComponentHandler</handler-class>
      </component>
   </tag>

I'm just developed a large parte of ComponentHandlers ….


Gavin let me known about that…

🙂

manuelgentile
Champ in-the-making
Champ in-the-making
package cnr.itd.freeloms.web.ui.repo.shelf;

import javax.faces.FacesException;
import javax.faces.el.MethodBinding;
import org.alfresco.web.ui.repo.component.shelf.UIClipboardShelfItem;
import cnr.itd.freeloms.web.ui.AlfrescoBaseComponentHandler;
import com.sun.facelets.FaceletContext;
import com.sun.facelets.tag.TagAttribute;
import com.sun.facelets.tag.jsf.ComponentConfig;

/**
*
* @author manuel gentile
*
*/
public class ClipboardShelfItemComponentHandler extends AlfrescoBaseComponentHandler {
   
   public ClipboardShelfItemComponentHandler(ComponentConfig arg0) {
      super(arg0);
   }

   @Override
   protected void setAttributes(FaceletContext arg0, Object arg1) {
      super.setAttributes(arg0, arg1);
      TagAttribute pasteActionListener =this.getAttribute("pasteActionListener");
      if (pasteActionListener != null)
         {
         if (!pasteActionListener.isLiteral())
           {
            MethodBinding vb = arg0.getFacesContext().getApplication().createMethodBinding(pasteActionListener.getValue(), ACTION_CLASS_ARGS);
               ((UIClipboardShelfItem)arg1).setPasteActionListener(vb);
            }
            else
            {
               throw new FacesException("Paste Action listener method binding incorrectly specified: " + pasteActionListener);
            }
         }
   }

   
}

package cnr.itd.freeloms.web.ui.repo.shelf;

import javax.faces.FacesException;
import javax.faces.el.MethodBinding;
import org.alfresco.web.ui.repo.component.shelf.UIRecentSpacesShelfItem;
import cnr.itd.freeloms.web.ui.AlfrescoBaseComponentHandler;
import com.sun.facelets.FaceletContext;
import com.sun.facelets.tag.TagAttribute;
import com.sun.facelets.tag.jsf.ComponentConfig;

/**
*
* @author manuel gentile
*
*/
public class RecentSpacesShelfItemComponentHandler extends AlfrescoBaseComponentHandler {
   
   public RecentSpacesShelfItemComponentHandler(ComponentConfig arg0) {
      super(arg0);
   }

   @Override
   protected void setAttributes(FaceletContext arg0, Object arg1) {
      super.setAttributes(arg0, arg1);
      TagAttribute navigateActionListener =this.getAttribute("navigateActionListener");
      if (navigateActionListener != null)
         {
         if (!navigateActionListener.isLiteral())
           {
            MethodBinding vb = arg0.getFacesContext().getApplication().createMethodBinding(navigateActionListener.getValue(), ACTION_CLASS_ARGS);
               ((UIRecentSpacesShelfItem)arg1).setNavigateActionListener(vb);
            }
            else
            {
               throw new FacesException("Navigate Action listener method binding incorrectly specified:  " + navigateActionListener);
            }
         }
   }

   
}

package cnr.itd.freeloms.web.ui.repo.shelf;

import javax.faces.FacesException;
import javax.faces.el.MethodBinding;
import org.alfresco.web.ui.repo.component.shelf.UIShelf;
import cnr.itd.freeloms.web.ui.AlfrescoBaseComponentHandler;
import com.sun.facelets.FaceletContext;
import com.sun.facelets.tag.TagAttribute;
import com.sun.facelets.tag.jsf.ComponentConfig;

/**
*
* @author manuel gentile
*
*/
public class ShelfComponentHandler extends AlfrescoBaseComponentHandler {
   
   public ShelfComponentHandler(ComponentConfig arg0) {
      super(arg0);
   }

   @Override
   protected void setAttributes(FaceletContext arg0, Object arg1) {
      super.setAttributes(arg0, arg1);
      TagAttribute groupExpandedActionListener =this.getAttribute("groupExpandedActionListener");
      if (groupExpandedActionListener != null)
         {
         if (!groupExpandedActionListener.isLiteral())
           {
            MethodBinding vb = arg0.getFacesContext().getApplication().createMethodBinding(groupExpandedActionListener.getValue(), ACTION_CLASS_ARGS);
               ((UIShelf)arg1).setGroupExpandedActionListener(vb);
            }
            else
            {
               throw new FacesException("Expanded Action listener method binding incorrectly specified: " + groupExpandedActionListener);
            }
         }
   }
   
   
}



package cnr.itd.freeloms.web.ui.repo.shelf;

import javax.faces.FacesException;
import javax.faces.el.MethodBinding;
import org.alfresco.web.ui.repo.component.shelf.UIShortcutsShelfItem;
import cnr.itd.freeloms.web.ui.AlfrescoBaseComponentHandler;
import com.sun.facelets.FaceletContext;
import com.sun.facelets.tag.TagAttribute;
import com.sun.facelets.tag.jsf.ComponentConfig;

/**
*
* @author manuel gentile
*
*/
public class ShortcutsShelfItemComponentHandler extends AlfrescoBaseComponentHandler {
   
   public ShortcutsShelfItemComponentHandler(ComponentConfig arg0) {
      super(arg0);
   }

   @Override
   protected void setAttributes(FaceletContext arg0, Object arg1) {
      super.setAttributes(arg0, arg1);
      TagAttribute clickActionListener =this.getAttribute("clickActionListener");
      if (clickActionListener != null)
         {
         if (!clickActionListener.isLiteral())
           {
            MethodBinding vb = arg0.getFacesContext().getApplication().createMethodBinding(clickActionListener.getValue(), ACTION_CLASS_ARGS);
               ((UIShortcutsShelfItem)arg1).setClickActionListener(vb);
            }
            else
            {
               throw new FacesException("Click Action listener method binding incorrectly specified: " + clickActionListener);
            }
         }
      TagAttribute removeActionListener =this.getAttribute("removeActionListener");
      if (removeActionListener != null)
         {
         if (!removeActionListener.isLiteral())
           {
            MethodBinding vb = arg0.getFacesContext().getApplication().createMethodBinding(removeActionListener.getValue(), ACTION_CLASS_ARGS);
               ((UIShortcutsShelfItem)arg1).setRemoveActionListener(vb);
            }
            else
            {
               throw new FacesException("Remove Action listener method binding incorrectly specified " + removeActionListener);
            }
         }
   }

   
   
}

package cnr.itd.freeloms.web.ui.common;

import javax.faces.FacesException;
import javax.faces.el.MethodBinding;
import org.alfresco.web.ui.common.component.UIGenericPicker;
import cnr.itd.freeloms.web.ui.AlfrescoBaseComponentHandler;
import com.sun.facelets.FaceletContext;
import com.sun.facelets.tag.TagAttribute;
import com.sun.facelets.tag.jsf.ComponentConfig;

/**
*
* @author manuel gentile
*
*/
public class GenericPickerComponentHandler extends AlfrescoBaseComponentHandler {
   
   public GenericPickerComponentHandler(ComponentConfig arg0) {
      super(arg0);
   }

   @Override
   protected void setAttributes(FaceletContext arg0, Object arg1) {
      super.setAttributes(arg0, arg1);
      TagAttribute queryCallback =this.getAttribute("queryCallback");
      if (queryCallback != null)
         {
         if (!queryCallback.isLiteral())
           {
            MethodBinding vb = arg0.getFacesContext().getApplication().createMethodBinding(queryCallback.getValue(), ACTION_CLASS_ARGS);
               ((UIGenericPicker)arg1).setQueryCallback(vb);
            }
            else
            {
               throw new FacesException("Query Callback method binding incorrectly specified: " + queryCallback);
            }
         }
   }
   
   
}

gavinc
Champ in-the-making
Champ in-the-making
Hi,

Thanks for your continued efforts on this. I'm afraid I haven't had a chance to look at any of it yet as we are busy finializing the 1.4 release.

Hopefully soon though!