xlawrence    2005/06/13 15:04:16 CEST

  Modified files:
    core/src/webapp/jsp/jahia/htmleditors/xinha/plugins/JahiaLinker 
                                                                    dialog.html 
                                                                    
jahia-linker.js 
                                                                    utils.js 
    core/src/webapp/jsp/jahia/htmleditors/xinha/plugins/JahiaLinker/lang 
                                                                         en.js 
                                                                         fr.js 
    core/src/webapp/jsp/jahia/htmleditors/xinha utils.jsp 
                                                xinha_htmleditor.jsp 
  Log:
  Added ressource bundle + NPE check on title
  
  Revision  Changes    Path
  1.3       +6 -3      
jahia/core/src/webapp/jsp/jahia/htmleditors/xinha/plugins/JahiaLinker/dialog.html
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/webapp/jsp/jahia/htmleditors/xinha/plugins/JahiaLinker/dialog.html.diff?r1=1.2&r2=1.3&f=h
  1.2       +3 -3      
jahia/core/src/webapp/jsp/jahia/htmleditors/xinha/plugins/JahiaLinker/jahia-linker.js
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/webapp/jsp/jahia/htmleditors/xinha/plugins/JahiaLinker/jahia-linker.js.diff?r1=1.1&r2=1.2&f=h
  1.2       +28 -21    
jahia/core/src/webapp/jsp/jahia/htmleditors/xinha/plugins/JahiaLinker/lang/en.js
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/webapp/jsp/jahia/htmleditors/xinha/plugins/JahiaLinker/lang/en.js.diff?r1=1.1&r2=1.2&f=h
  1.2       +31 -26    
jahia/core/src/webapp/jsp/jahia/htmleditors/xinha/plugins/JahiaLinker/lang/fr.js
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/webapp/jsp/jahia/htmleditors/xinha/plugins/JahiaLinker/lang/fr.js.diff?r1=1.1&r2=1.2&f=h
  1.7       +38 -14    
jahia/core/src/webapp/jsp/jahia/htmleditors/xinha/plugins/JahiaLinker/utils.js
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/webapp/jsp/jahia/htmleditors/xinha/plugins/JahiaLinker/utils.js.diff?r1=1.6&r2=1.7&f=h
  1.5       +80 -106   
jahia/core/src/webapp/jsp/jahia/htmleditors/xinha/utils.jsp
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/webapp/jsp/jahia/htmleditors/xinha/utils.jsp.diff?r1=1.4&r2=1.5&f=h
  1.6       +16 -9     
jahia/core/src/webapp/jsp/jahia/htmleditors/xinha/xinha_htmleditor.jsp
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/webapp/jsp/jahia/htmleditors/xinha/xinha_htmleditor.jsp.diff?r1=1.5&r2=1.6&f=h
  
  
  
  Index: dialog.html
  ===================================================================
  RCS file: 
/home/cvs/repository/jahia/core/src/webapp/jsp/jahia/htmleditors/xinha/plugins/JahiaLinker/dialog.html,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- dialog.html       6 Jun 2005 15:01:40 -0000       1.2
  +++ dialog.html       13 Jun 2005 13:04:15 -0000      1.3
  @@ -122,9 +122,12 @@
       </td>
     </tr>
     <tr>
  -     <td>(*): Pages with less rights than the current 
field&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="active">Green</span>: Active 
pages<br/>
  -             <span class="waiting">Orange</span>: Waiting pages 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="staging">Red</span>: Staging 
pages
  -             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span 
class="markForDeleted">Bleue</span>: Mark For Delete pages
  +     <td>
  +         (*): <span id="i18n_legend_access">Pages with less rights than the 
current field</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  +             <span class="active">Green</span>: <span 
id="i18n_legend_active">Active pages</span><br/>
  +             <span class="waiting">Orange</span>: <span 
id="i18n_legend_waiting">Waiting 
pages</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  +             <span class="staging">Red</span>: <span 
id="i18n_legend_staging">Staging 
pages</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  +             <span class="markForDeleted">Bleue</span>: <span 
id="i18n_legend_mfdelete">Mark For Delete pages</span>
        </td>
     </tr>
     </form>
  
  
  
  Index: jahia-linker.js
  ===================================================================
  RCS file: 
/home/cvs/repository/jahia/core/src/webapp/jsp/jahia/htmleditors/xinha/plugins/JahiaLinker/jahia-linker.js,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- jahia-linker.js   26 May 2005 15:23:52 -0000      1.1
  +++ jahia-linker.js   13 Jun 2005 13:04:15 -0000      1.2
  @@ -39,9 +39,9 @@
   {
     name     : "JahiaLinker",
     version  : "1.0",
  -  developer: "Stephane Miousse",
  -  developer_url: "http://www.intellogix.com/";,
  -  c_owner      : "Intellogix",
  +  developer: "Stephane Miousse, Xavier Lawrence",
  +  developer_url: "http://www.intellogix.com/, http://www.jahia.org/";,
  +  c_owner      : "Intellogix, Jahia Solutions",
     license      : "htmlArea",
     sponsor      : "Intellogix",
     sponsor_url  : "http://www.intellogix.com";
  
  
  
  Index: utils.js
  ===================================================================
  RCS file: 
/home/cvs/repository/jahia/core/src/webapp/jsp/jahia/htmleditors/xinha/plugins/JahiaLinker/utils.js,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- utils.js  7 Jun 2005 16:46:23 -0000       1.6
  +++ utils.js  13 Jun 2005 13:04:15 -0000      1.7
  @@ -187,23 +187,47 @@
     
     if (groups || state != "active") {
       
  -     var message = "WARNING !!!\n\n";
  -     if (state == "markForDeleted") {
  -        message += "- You have selected a page which is marked for 
deletion.";
  -        message += "Once publication is made, this page will no longer be 
accessible (Result: 404 Error for all users).\n\n";
  +    var message;
  +    if (urlValue.indexOf("/lang/fr") > -1) {
  +    
  +        message = "ATTENTION !!!\n\n";
  +        if (state == "markForDeleted") {
  +            message += "- Vous avez s�lectionn�; une page qui va �tre 
supprim�e. ";
  +            message += "Une fois valid�e, la page ne sera plus accessible 
(R�sultat: Erreur 404 pour tous les utilisateurs).\n\n";
           
  -     } else if (state != "active") {
  -        message += "- You have selected a page which is in state '"+ state 
+"'.";
  -        message += "The content will not be accessible in 'Live' mode until 
publication is made (Result: 404 Error if the page has never been 
published).\n\n";
  -     }
  +        } else if (state != "active") {
  +            message += "- Vous avez s�lectionn� une page non publi�e. ";
  +            message += "Le contenu ne sera pas accessible en mode 'En ligne' 
avant validation (R�sultat: Erreur 404 si la page n'a jamais �t� valid�e).\n\n";
  +        }
        
  -     if (groups) {
  -        message += "- The page you have selected cannot be seen by groups 
'"+ groups +"', ";
  -        message += "which however have access to the field you are editing 
(Result: 403 Error for users belonging to '"+ groups +"').\n\n";
  -     }
  +        if (groups) {
  +            message += "- Vous avez s�lectionn� une page non accessible 
pour le(s) groupe(s) '"+ groups +"', ";
  +            message += "mais qui ont acc�s au champ que vous �ditez 
(R�sultat: Erreur 403 pour les utilisateurs appartenant au(x) groupe(s) '"+ 
groups +"').\n\n";
  +        }
        
  -     message += "Continue anyway ?";
  -     if (!confirm(message)) return;  
  +        message += "Continuer quand m�me ?";
  +        
  +    } else {
  +        
  +        message = "WARNING !!!\n\n";
  +        if (state == "markForDeleted") {
  +            message += "- You have selected a page which is marked for 
deletion.";
  +            message += "Once publication is made, this page will no longer 
be accessible (Result: 404 Error for all users).\n\n";
  +        
  +        } else if (state != "active") {
  +            message += "- You have selected a page which is in state '"+ 
state +"'.";
  +            message += "The content will not be accessible in 'Live' mode 
until publication is made (Result: 404 Error if the page has never been 
published).\n\n";
  +        }
  +     
  +        if (groups) {
  +            message += "- The page you have selected cannot be seen by 
groups '"+ groups +"', ";
  +            message += "which however have access to the field you are 
editing (Result: 403 Error for users belonging to '"+ groups +"').\n\n";
  +        }
  +     
  +        message += "Continue anyway ?";  
  +    }   
  +    
  +    if (!confirm(message)) return;  
     }
     
     href = document.insertLink.href;
  
  
  
  Index: en.js
  ===================================================================
  RCS file: 
/home/cvs/repository/jahia/core/src/webapp/jsp/jahia/htmleditors/xinha/plugins/JahiaLinker/lang/en.js,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- en.js     26 May 2005 15:23:52 -0000      1.1
  +++ en.js     13 Jun 2005 13:04:15 -0000      1.2
  @@ -1,25 +1,32 @@
   JahiaLinker.I18N = {
  -  "title"                                            : "Insert/Modify Link",
  -  "url_link"                                         : "URL Link",
  -  "url"                                                      : "URL", 
"target" : "Target",
  -  "normal_link"                      : "Ordinary Link",
  +  "title"                            : "Insert/Modify Link",
  +  "url_link"                         : "URL Link",
  +  "url"                              : "URL", 
  +  "target"              : "Target",
  +  "normal_link"              : "Ordinary Link",
     "internal_link"            : "Internal link",
  -  "same_window"                      : "Same Window",
  -  "new_window"                               : "New Window", "popup_window" 
: "Popup Window",
  -  "size"                                                     : "Size",
  -  "px"                                                               : 
"(px)",
  -  "name"                                                     : "Name",
  -  "menubar"                                  : "Menu Bar",
  -  "toolbar"                                  : "Toolbar",
  -  "locationbar"                      : "Location Bar",
  -  "statusbar"                                : "Status Bar",
  -  "scrollbar"                                : "Scrollbars",
  -  "resize"                                           : "Resizeable",
  -  "email_link"                               : "Email Link",
  -  "email_adr"                                : "Email Address",
  +  "same_window"              : "Same Window",
  +  "new_window"                       : "New Window", 
  +  "popup_window"        : "Popup Window",
  +  "size"                             : "Size",
  +  "px"                                       : "(px)",
  +  "name"                             : "Name",
  +  "menubar"                  : "Menu Bar",
  +  "toolbar"                  : "Toolbar",
  +  "locationbar"              : "Location Bar",
  +  "statusbar"                        : "Status Bar",
  +  "scrollbar"                        : "Scrollbars",
  +  "resize"                           : "Resizeable",
  +  "email_link"                       : "Email Link",
  +  "email_adr"                        : "Email Address",
     "email_subject"            : "Subject",
     "message_template"         : "Message Template",
  -  "ok"                                                               : "Ok",
  -  "clear"                                            : "Remove link",
  -  "cancel"                                           : "Cancel"
  -};
  +  "ok"                                       : "Ok",
  +  "cancel"                           : "Cancel",  
  +  "clear"                            : "Remove link",
  +  "legend_access"       : "Pages with less rights than the current field",
  +  "legend_waiting"      : "Waiting pages",                   
  +  "legend_staging"      : "Staging pages",
  +  "legend_active"       : "Active pages",
  +  "legend_mfdelete"     : "Mark For Delete pages"          
  +};
  \ No newline at end of file
  
  
  
  Index: fr.js
  ===================================================================
  RCS file: 
/home/cvs/repository/jahia/core/src/webapp/jsp/jahia/htmleditors/xinha/plugins/JahiaLinker/lang/fr.js,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- fr.js     26 May 2005 15:23:52 -0000      1.1
  +++ fr.js     13 Jun 2005 13:04:15 -0000      1.2
  @@ -1,27 +1,32 @@
   JahiaLinker.I18N = {
  -  "title"                                                    : 
"Ins&eacute;rer/Modifer un lien",
  -  "url_link"                                                 : "Lien URL",
  -  "url"                                                              : "URL",
  -  "target"                                                   : "Cible",
  -  "normal_link"                              : "Lien normal",
  -  "internal_link"                    : "Lien vers une ancre",
  -  "same_window"                              : "Dans la m&egrave;me 
fen&egrave;tre",
  -  "new_window"                                       : "Nouvelle 
fen&egrave;tre",
  -  "popup_window"                             : "Fen&egrave;tre popup",
  -  "size"                                                             : 
"Taile",
  -  "px"                                                                       
: "(px)",
  -  "name"                                                             : "Nom",
  -  "menubar"                                          : "Bare de menu",
  -  "toolbar"                                          : "Toolbar",
  -  "locationbar"                              : "Bare d'adresse",
  -  "statusbar"                                        : "Bare d'&eacute;tat",
  -  "scrollbar"                                        : "Bare de 
d&eacute;fillement",
  -  "resize"                                                   : 
"Redimmensionable",
  -  "email_link"                                       : "Lien courriel",
  -  "email_adr"                                        : "Courriel",
  -  "email_subject"                    : "Sujet",
  -  "message_template"                 : "Corps du message",
  -  "ok"                                                                       
: "Ok",
  -  "cancel"                                                   : "Annuler",
  -  "clear"                                                    : "Supprimer le 
lien"
  -};
  +  "title"               : "Ins&eacute;rer/Modifer un lien",
  +  "url_link"                         : "Lien URL",
  +  "url"                              : "URL",
  +  "target"                           : "Cible",
  +  "normal_link"              : "Lien normal",
  +  "internal_link"            : "Lien vers une ancre",
  +  "same_window"              : "Dans la m&ecirc;me fen&ecirc;tre",
  +  "new_window"                       : "Nouvelle fen&ecirc;tre",
  +  "popup_window"             : "Fen&ecirc;tre popup",
  +  "size"                             : "Taile",
  +  "px"                                       : "(px)",
  +  "name"                             : "Nom",
  +  "menubar"                  : "Barre de menu",
  +  "toolbar"                  : "Toolbar",
  +  "locationbar"              : "Barre d'adresse",
  +  "statusbar"                        : "Barre d'&eacute;tat",
  +  "scrollbar"                        : "Barre de d&eacute;fillement",
  +  "resize"                           : "Redimmensionable",
  +  "email_link"                       : "Lien courriel",
  +  "email_adr"                        : "Courriel",
  +  "email_subject"            : "Sujet",
  +  "message_template"         : "Corps du message",
  +  "ok"                                       : "Ok",
  +  "cancel"                           : "Annuler",
  +  "clear"                            : "Supprimer le lien",
  +  "legend_access"       : "Pages ayant moins de droits que le champ 
courant&nbsp;",
  +  "legend_waiting"      : "Pages approuv&eacute;es&nbsp;&nbsp;&nbsp;",       
            
  +  "legend_staging"      : "Pages &eacute;dit&eacute;es&nbsp;&nbsp;&nbsp;",
  +  "legend_active"       : "Pages publi&eacute;es",
  +  "legend_mfdelete"     : "Pages &agrave; supprimer"          
  +};
  \ No newline at end of file
  
  
  
  Index: utils.jsp
  ===================================================================
  RCS file: 
/home/cvs/repository/jahia/core/src/webapp/jsp/jahia/htmleditors/xinha/utils.jsp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- utils.jsp 7 Jun 2005 09:48:21 -0000       1.4
  +++ utils.jsp 13 Jun 2005 13:04:16 -0000      1.5
  @@ -10,7 +10,6 @@
   <%@ page import="org.jahia.services.htmleditors.*" %>
   <%@ page import="org.jahia.services.sitemap.*" %>
   <%@ page import="org.jahia.services.webdav.*" %>
  -<%@ page import="org.jahia.services.workflow.*" %>
   <%@ page import="org.jahia.services.version.*" %>
   <%@ page import="org.jahia.utils.*" %>
   <%@ page import="org.jahia.engines.shared.*" %>
  @@ -157,14 +156,15 @@
           String getcontentlength = curObj.getProperty("DAV:", 
"getcontentlength").toString();
           int size = Integer.parseInt(getcontentlength);
           if (size < 1024) {
  -            fileSize = Long.toString(size) + " octets";
  +            fileSize = new StringBuffer().append(size).append(" 
octets").toString();
               
           } else {
               final double fileSizeKo = size / 1024;
               DecimalFormat df = new DecimalFormat();
               df.setMaximumFractionDigits(2);
               df.setMinimumIntegerDigits(1);
  -            fileSize = df.format(fileSizeKo) + " ko";
  +            fileSize = new 
StringBuffer().append(df.format(fileSizeKo)).append(" ko").
  +                    toString();
           }
       }
       return fileSize;
  @@ -183,115 +183,89 @@
       return html.toString();
   }
   
  -public String getSitemapToJs(JahiaData jData, String jahiaPath, JahiaField 
theField, 
  -        HashMap engineMap) throws JahiaException {
  -    ParamBean jParams = jData.params();
  +public String getSitemapToJs(JahiaData jData, String jahiaPath, JahiaField 
theField,
  +        HashMap engineMap, String currentLanguageCode) throws JahiaException 
{
       StringBuffer buff = new StringBuffer();
  -    buff.append("[[0,0,\'root\','/'],");
  -    int pageInfosFlag;
  -    int defaultLevel = SiteMapViewHelper.DEFAULT_LEVEL;
  -    String languageCode = jParams.getLocale().toString();
  -    JahiaSiteMapService siteMapService = 
ServicesRegistry.getInstance().getJahiaSiteMapService();
  -    ContentPage theContentPage = 
ServicesRegistry.getInstance().getJahiaPageService().
  -            lookupContentPage(jParams.getSite().getHomePageID(), false);
  -    
  -    if (jData.gui().isNormalMode()) {
  -        pageInfosFlag = ContentPage.ACTIVE_PAGE_INFOS;
  -    } else {
  -        pageInfosFlag = ContentPage.ACTIVE_PAGE_INFOS | 
ContentPage.STAGING_PAGE_INFOS;
  -    }
  -    
  -    SiteMapViewHelper siteMapViewHelper = 
siteMapService.getTreeSiteMapViewHelper(
  -            jParams.getUser(), theContentPage, jParams.getSessionID(), 
pageInfosFlag,
  -            languageCode, defaultLevel);
  -    if (siteMapViewHelper == null) {
  -        return "";
  -    }
  -    TreeSiteMapViewHelper treeJahiaSiteMap = 
(TreeSiteMapViewHelper)siteMapViewHelper;
  -    
  -    ArrayList shouldDrawLineSegment = new ArrayList();
  -    for (int level = 0; level < treeJahiaSiteMap.getMaxLevel(); level++) {
  -        shouldDrawLineSegment.add(level, new Boolean(true));
  -    }
  -    
  -    boolean reachablePage = false;
  -    
  -    for (int i = 0; i < treeJahiaSiteMap.size(); i++) {
  -        ContentPage contentPage = treeJahiaSiteMap.getContentPage(i);
  -        if (contentPage == null) {
  -            continue;
  -        }
  -        reachablePage = contentPage.isReachable(jParams.getOperationMode(),
  -                
jParams.getEntryLoadRequest().getFirstLocale(true).toString(), 
jParams.getUser());
  -        String templateName = 
contentPage.getPageTemplate(jData.params()).getSourcePath();
  -        templateName = templateName.substring(templateName.lastIndexOf("/") 
+ 1);
  -        if (reachablePage && !templateName.equals("listeContacts.jsp") &&
  -                !templateName.equals("email.jsp") &&
  -                !templateName.equals("listeBoxCommun.jsp") &&
  -                !templateName.equals("listPopup.jsp") &&
  -                !templateName.equals("popup.jsp")) {
  -            final String pageTitle2 = treeJahiaSiteMap.getPageTitle(i,
  -                    jParams.getLocale().toString());
  -            final JahiaPage thePage = contentPage.getPage(jParams);
  -            
  -            if (thePage != null) {
  -                final int pageId = thePage.getID();
  +    try {
  +        ParamBean jParams = jData.params();
  +        buff.append("[[0,0,\'root\','/'],");
  +        int pageInfosFlag;
  +        int defaultLevel = SiteMapViewHelper.DEFAULT_LEVEL;
  +        JahiaSiteMapService siteMapService = 
ServicesRegistry.getInstance().getJahiaSiteMapService();
  +        ContentPage theContentPage = 
ServicesRegistry.getInstance().getJahiaPageService().
  +                lookupContentPage(jParams.getSite().getHomePageID(), false);
  +        
  +        if (jData.gui().isNormalMode()) {
  +            pageInfosFlag = ContentPage.ACTIVE_PAGE_INFOS;
  +        } else {
  +            pageInfosFlag = ContentPage.ACTIVE_PAGE_INFOS | 
ContentPage.STAGING_PAGE_INFOS;
  +        }
  +        
  +        SiteMapViewHelper siteMapViewHelper = 
siteMapService.getTreeSiteMapViewHelper(
  +                jParams.getUser(), theContentPage, jParams.getSessionID(), 
pageInfosFlag,
  +                currentLanguageCode, defaultLevel);
  +        if (siteMapViewHelper == null) {
  +            return "";
  +        }
  +        TreeSiteMapViewHelper treeJahiaSiteMap = 
(TreeSiteMapViewHelper)siteMapViewHelper;
  +        
  +        ArrayList shouldDrawLineSegment = new ArrayList();
  +        for (int level = 0; level < treeJahiaSiteMap.getMaxLevel(); level++) 
{
  +            shouldDrawLineSegment.add(level, new Boolean(true));
  +        }
  +                
  +        for (int i = 0; i < treeJahiaSiteMap.size(); i++) {
  +            ContentPage contentPage = treeJahiaSiteMap.getContentPage(i);
  +            if (contentPage == null) {
  +                continue;
  +            }
  +            String templateName = 
contentPage.getPageTemplate(jData.params()).getSourcePath();
  +            templateName = 
templateName.substring(templateName.lastIndexOf("/") + 1);
  +            if (! templateName.equals("listeContacts.jsp") &&
  +                    !templateName.equals("email.jsp") &&
  +                    !templateName.equals("listeBoxCommun.jsp") &&
  +                    !templateName.equals("listPopup.jsp") &&
  +                    !templateName.equals("popup.jsp")) {
  +                
  +                String pageTitle = treeJahiaSiteMap.getPageTitle(i,
  +                        currentLanguageCode);
                   
  -                StringBuffer pageUrl = new StringBuffer();
  -                
pageUrl.append(jahiaPath).append("/site/").append(jParams.getSiteKey())
  -                .append("/lang/").append(jParams.getLocale().toString())
  -                .append("/pid/").append(pageId);
  +                final JahiaPage thePage = contentPage.getPage(jParams);
                   
  -                buff.append("[").append((treeJahiaSiteMap.getPageLevel(i) + 
1))
  -                .append(",").append((i + 1)).append(",\'")
  -                .append(pageTitle2.replaceAll("'", "\\\\'"))
  -                .append("\','").append(pageUrl.toString().replaceAll("'", 
"\\\\'"))
  -                .append("\',\'").append(getPageState(pageId, jParams))
  -                .append("\',\'")
  -                
.append(BigText_Field.getInstance().getFieldGroupsNotHavingAccessOnPageAsString(
  -                        pageId, theField, jParams, engineMap)).append("'],");
  +                if (thePage != null) {
  +                    final int pageId = thePage.getID();
  +                    
  +                    if (pageTitle.equals("N/A")) {
  +                        if ("fr".equals(currentLanguageCode)) {
  +                            pageTitle = new StringBuffer().append("Pas de 
titre [pid = ").
  +                                    append(pageId).append("]").toString();
  +                        } else {
  +                            pageTitle = new StringBuffer().append("No title 
[pid = ").
  +                                    append(pageId).append("]").toString();
  +                        }
  +                    }                    
  +                
  +                    StringBuffer pageUrl = new StringBuffer();
  +                    
pageUrl.append(jahiaPath).append("/lang/").append(currentLanguageCode)
  +                    .append("/pid/").append(pageId);
  +                    
  +                    
buff.append("[").append((treeJahiaSiteMap.getPageLevel(i) + 1))
  +                    .append(",").append((i + 1)).append(",\'")
  +                    .append(pageTitle.replaceAll("'", "\\\\'"))
  +                    
.append("\','").append(pageUrl.toString().replaceAll("'", "\\\\'"))
  +                    .append("\',\'")
  +                    .append(BigText_Field.getInstance().getPageState(pageId, 
currentLanguageCode))
  +                    .append("\',\'")
  +                    
.append(BigText_Field.getInstance().getFieldGroupsNotHavingAccessOnPageAsString(
  +                            pageId, theField, jParams, 
engineMap)).append("'],");
  +                }
               }
           }
  +        buff = buff.deleteCharAt(buff.length()-1);
  +        buff.append("]");
  +    } catch (Exception e) {
  +        e.printStackTrace();
       }
  -    buff = buff.deleteCharAt(buff.length()-1);
  -    buff.append("]");
       return buff.toString();
   }
  -
  -/**
  - * Returns a String representing the state of a page. The String returned is
  - * the name of a CSS class which will be used by the editor to format the 
page
  - * title according to the CSS class. Thus, you should not modify the return
  - * values of this method, without changing the CSS class names of the 
JahiaLinker
  - * plugin (jahia-linker.css).
  - *
  - * @param pageId The pageId to get the state of
  - * @param jParams ParamBean instance of the current request
  - *
  - * @return A String representing the state of the page and a CSS class name
  - * @throws JahiaException If Something goes wrong
  - */
  -private String getPageState(int pageId, ParamBean jParams)
  -throws JahiaException {
  -    ContentPage page = ContentPage.getPage(pageId);
  -    if (page == null) { return "staging"; }
  -    
  -    Map languagesStates = 
WorkflowService.getInstance().getLanguagesStates(page);
  -    int state = 
((Integer)languagesStates.get(jParams.getLocale().toString()))
  -    .intValue();
  -    
  -    if (page.isMarkedForDelete()) { return "markForDeleted"; }
  -    
  -    switch (state) {
  -        case EntryLoadRequest.ACTIVE_WORKFLOW_STATE:
  -            return "active";
  -            
  -        case EntryLoadRequest.WAITING_WORKFLOW_STATE:
  -            return "waiting";
  -            
  -        default:
  -            return "staging";
  -    }
  -}
  -
   %>
  \ No newline at end of file
  
  
  
  Index: xinha_htmleditor.jsp
  ===================================================================
  RCS file: 
/home/cvs/repository/jahia/core/src/webapp/jsp/jahia/htmleditors/xinha/xinha_htmleditor.jsp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- xinha_htmleditor.jsp      7 Jun 2005 09:58:05 -0000       1.5
  +++ xinha_htmleditor.jsp      13 Jun 2005 13:04:16 -0000      1.6
  @@ -103,25 +103,32 @@
       jahiaPath.append(request.getServletPath());
   }
   
  -String currentLanguageCode = jParams.getLocale().toString();
  +StringBuffer buffer = new StringBuffer(100);
  +String currentLanguageCode = jParams.getLocale().toString().substring(0, 2);
   String urlPage = pageTemplate.getSourcePath();
  -urlPage = request.getContextPath() + 
urlPage.substring(0,urlPage.lastIndexOf("/"));
  -String xinhaUrl = request.getContextPath() + "/jsp/jahia/htmleditors/xinha/";
  +urlPage = 
buffer.append(request.getContextPath()).append(urlPage.substring(0, 
urlPage.lastIndexOf("/"))).toString(); 
  +buffer.delete(0, buffer.length());
  +String xinhaUrl = 
buffer.append(request.getContextPath()).append("/jsp/jahia/htmleditors/xinha/").toString();
  +buffer.delete(0, buffer.length());
   String realPath = request.getRequestURL().toString();
   realPath = realPath.substring(0, realPath.indexOf("/", 8));
  -String confFilePath = realPath + xinhaUrl + "xinha.conf";
  -URL url = new URL(realPath + urlPage + "/Global/xinha.conf");
  +String confFilePath = 
buffer.append(realPath).append(xinhaUrl).append("xinha.conf").toString();
  +buffer.delete(0, buffer.length());
  +URL url = new 
URL(buffer.append(realPath).append(urlPage).append("/Global/xinha.conf").toString());
  +buffer.delete(0, buffer.length());
   try {
       url.openStream();
  -    confFilePath = realPath + urlPage + "/Global/xinha.conf";
  -} catch (IOException io) {
  -}
  +    confFilePath = 
buffer.append(realPath).append(urlPage).append("/Global/xinha.conf").toString();
  +    buffer.delete(0, buffer.length());
  +} catch (IOException io) {}
  +
   pageContext.setAttribute("confFilePath", confFilePath);
   
   String pageContent = "null";
   String files = "null";
   try {
  -    pageContent = getSitemapToJs(jData, jahiaPath.toString(), theField, 
engineMap);
  +    pageContent = getSitemapToJs(jData, jahiaPath.toString(), theField, 
engineMap, 
  +            currentLanguageCode);
       if (pageContent != null && !pageContent.equals("")) {
           pageContent = pageContent.trim();
           if (!pageContent.startsWith("["))
  

Reply via email to