@@ -153,6 +153,7 @@ public String getDestination(String function, WebSiteSessionController scc,
153
153
}
154
154
} else if (function .startsWith ("searchResult" )) {
155
155
String id = request .getParameter ("Id" ); /* id de la publication */
156
+
156
157
String typeRequest = request .getParameter ("Type" );
157
158
158
159
if ("Publication" .equals (typeRequest ) || "Site" .equals (typeRequest )) {
@@ -209,8 +210,7 @@ public String getDestination(String function, WebSiteSessionController scc,
209
210
String nameSite = request .getParameter ("nameSite" );
210
211
String id = request .getParameter ("id" );
211
212
212
- destination =
213
- "http://" + getMachine (request ) + URLManager .getApplicationURL ()
213
+ destination = "http://" + getMachine (request ) + URLManager .getApplicationURL ()
214
214
+ "/wysiwyg/jsp/htmlEditor.jsp?" ;
215
215
destination += "SpaceId=" + scc .getSpaceId ();
216
216
@@ -222,9 +222,10 @@ public String getDestination(String function, WebSiteSessionController scc,
222
222
destination += "&ObjectId=" + id ;
223
223
destination += "&FileName=" + URLEncoder .encode (name , "UTF-8" );
224
224
destination += "&Path=" + URLEncoder .encode (path , "UTF-8" );
225
- destination +=
226
- "&ReturnUrl=" + URLEncoder .encode (URLManager .getApplicationURL () + URLManager .getURL (
227
- scc .getSpaceId (), scc .getComponentId ()) + "FromWysiwyg?path=" + path + "&name=" + name
225
+ destination += "&ReturnUrl=" + URLEncoder .encode (URLManager .getApplicationURL ()
226
+ + URLManager .getURL (
227
+ scc .getSpaceId (), scc .getComponentId ()) + "FromWysiwyg?path=" + path + "&name="
228
+ + name
228
229
+ "&nameSite=" + nameSite + "&profile=" + flag + "&id=" + id , "UTF-8" );
229
230
SilverTrace .info ("webSites" , "WebSitesRequestRouter.getDestination().ToWysiwyg" ,
230
231
"root.MSG_GEN_PARAM_VALUE" , "destination = " + destination );
@@ -302,12 +303,12 @@ public String getDestination(String function, WebSiteSessionController scc,
302
303
String listeIcones = request .getParameter ("ListeIcones" );
303
304
304
305
type = "design" ;
305
- complete =
306
- "&RecupParam=oui&Nom=" + nom + "&Description=" + description + "&Page=" + lapage
306
+ complete = "&RecupParam=oui&Nom=" + nom + "&Description=" + description + "&Page="
307
+ + lapage
307
308
+ "&ListeIcones=" + listeIcones ;
308
309
} else {
309
- destination =
310
- "/webSites/jsp/modifDesc.jsp?Id=" + id + "&path=" + currentPath + "&type=" + type ;
310
+ destination = "/webSites/jsp/modifDesc.jsp?Id=" + id + "&path=" + currentPath + "&type="
311
+ + type ;
311
312
}
312
313
313
314
destination = "/webSites/jsp/modifDesc.jsp?Id=" + id ;
@@ -346,8 +347,7 @@ public String getDestination(String function, WebSiteSessionController scc,
346
347
String childId = request .getParameter ("ChildId" );
347
348
String name = request .getParameter ("Name" );
348
349
String description = request .getParameter ("Description" );
349
- NodeDetail folder =
350
- new NodeDetail (childId , name , description , null , null , null , "0" , "X" );
350
+ NodeDetail folder = new NodeDetail (childId , name , description , null , null , null , "0" , "X" );
351
351
scc .updateFolderHeader (folder , "" );
352
352
action = "Search" ;
353
353
} else if (action .equals ("Delete" )) {
@@ -496,8 +496,8 @@ public String getDestination(String function, WebSiteSessionController scc,
496
496
String newTopicName = request .getParameter ("Name" );
497
497
String newTopicDescription = request .getParameter ("Description" );
498
498
499
- NodeDetail folder =
500
- new NodeDetail ( "X" , newTopicName , newTopicDescription , null , null , null , "0" , "X" );
499
+ NodeDetail folder = new NodeDetail ( "X" , newTopicName , newTopicDescription , null , null , null ,
500
+ "0" , "X" );
501
501
scc .addFolder (folder , "" );
502
502
503
503
destination = "/webSites/jsp/addTopic.jsp?Action=" + action + "&Id=" + fatherId ;
@@ -520,8 +520,8 @@ public String getDestination(String function, WebSiteSessionController scc,
520
520
request .setAttribute ("ListSites" , listeSites );
521
521
request .setAttribute ("CurrentFolder" , scc .getSessionTopic ());
522
522
523
- destination =
524
- "/webSites/jsp/classifyDeclassify.jsp?Action=" + action + "&TopicId=" + id + "&Path="
523
+ destination = "/webSites/jsp/classifyDeclassify.jsp?Action=" + action + "&TopicId=" + id
524
+ + "&Path="
525
525
+ linkedPathString ;
526
526
} else if (function .startsWith ("manage.jsp" )) {
527
527
String action = request .getParameter ("Action" );
@@ -557,9 +557,9 @@ public String getDestination(String function, WebSiteSessionController scc,
557
557
String id = scc .getNextId ();
558
558
559
559
/* Persist siteDetail inside database, type 1 = bookmark */
560
- SiteDetail descriptionSite =
561
- new SiteDetail (id , scc .getComponentId (), nomSite , description , nomPage , 1 , null ,
562
- null , 0 , popup );
560
+ SiteDetail descriptionSite
561
+ = new SiteDetail (id , scc .getComponentId (), nomSite , description , nomPage , 1 , null ,
562
+ null , 0 , popup );
563
563
descriptionSite .setPositions (positions );
564
564
565
565
String pubId = scc .createWebSite (descriptionSite );
@@ -668,8 +668,8 @@ public String getDestination(String function, WebSiteSessionController scc,
668
668
int type = ancien .getType ();
669
669
670
670
/* update description en BD */
671
- SiteDetail descriptionSite2 =
672
- new SiteDetail ( id , scc . getComponentId (), nomSite , description , nomPage , type , null ,
671
+ SiteDetail descriptionSite2 = new SiteDetail ( id , scc . getComponentId (), nomSite ,
672
+ description , nomPage , type , null ,
673
673
null , etat , popup );
674
674
675
675
scc .updateWebSite (descriptionSite2 );
@@ -762,9 +762,9 @@ public String getDestination(String function, WebSiteSessionController scc,
762
762
scc .createFolder (scc .getWebSitePathById (id ));
763
763
764
764
// Persist siteDetail inside database type 0 = site cree
765
- SiteDetail descriptionSite =
766
- new SiteDetail (id , scc .getComponentId (), nomSite , description , nomPage , 0 , null ,
767
- null , 0 , popup );
765
+ SiteDetail descriptionSite
766
+ = new SiteDetail (id , scc .getComponentId (), nomSite , description , nomPage , 0 , null ,
767
+ null , 0 , popup );
768
768
descriptionSite .setPositions (positions );
769
769
770
770
String pubId = scc .createWebSite (descriptionSite );
@@ -859,8 +859,8 @@ public String getDestination(String function, WebSiteSessionController scc,
859
859
860
860
boolean searchOk = ok ;
861
861
862
- SiteDetail descriptionSite2 =
863
- new SiteDetail ( id , scc . getComponentId (), nomSite , description , nomPage , type , null ,
862
+ SiteDetail descriptionSite2 = new SiteDetail ( id , scc . getComponentId (), nomSite ,
863
+ description , nomPage , type , null ,
864
864
null , Integer
865
865
.parseInt (etat ), popup );
866
866
@@ -1011,17 +1011,15 @@ public String getDestination(String function, WebSiteSessionController scc,
1011
1011
destination = "/webSites/jsp/design.jsp?Action=design&path=" + currentPath + "&Id=" + id ;
1012
1012
} else if (function .equals ("EffectiveUploadFile" )) {
1013
1013
List <FileItem > items = FileUploadUtil .parseRequest (request );
1014
-
1014
+ boolean status = true ;
1015
1015
String thePath = FileUploadUtil .getParameter (items , "path" );
1016
1016
scc .checkPath (thePath );
1017
1017
FileItem item = FileUploadUtil .getFile (items );
1018
1018
if (item != null ) {
1019
- String fileName = FileUploadUtil .getFileName (item );
1020
- File file = new File (thePath , fileName );
1021
- item .write (file );
1019
+ status = (scc .addFileIntoWebSite (thePath , item ) == 0 );
1022
1020
}
1023
1021
1024
- request .setAttribute ("UploadOk" , Boolean . TRUE );
1022
+ request .setAttribute ("UploadOk" , status );
1025
1023
1026
1024
destination = "/webSites/jsp/uploadFile.jsp?path=" + thePath ;
1027
1025
} else if (function .startsWith ("descUpload.jsp" )) {
@@ -1048,9 +1046,9 @@ public String getDestination(String function, WebSiteSessionController scc,
1048
1046
String id = scc .getNextId ();
1049
1047
1050
1048
// Persist uploaded website inside database, type=2
1051
- SiteDetail descriptionSite =
1052
- new SiteDetail (id , scc .getComponentId (), nomSite , description , nomPage , 2 , null ,
1053
- null , 0 , popup );
1049
+ SiteDetail descriptionSite
1050
+ = new SiteDetail (id , scc .getComponentId (), nomSite , description , nomPage , 2 , null ,
1051
+ null , 0 , popup );
1054
1052
1055
1053
descriptionSite .setPositions (positions );
1056
1054
int result = scc .createWebSiteFromZipFile (descriptionSite , fileItem );
@@ -1462,6 +1460,7 @@ private String parseCodeSupprHref(WebSiteSessionController scc, String code,
1462
1460
String apres ;
1463
1461
int index ;
1464
1462
String href = "<A href=\" " ; /* longueur de chaine = 9 */
1463
+
1465
1464
String finChemin ;
1466
1465
String fichier ;
1467
1466
String deb ;
@@ -1477,9 +1476,11 @@ private String parseCodeSupprHref(WebSiteSessionController scc, String code,
1477
1476
apres = theCode .substring (index + 9 );
1478
1477
1479
1478
if (apres .substring (0 , 7 ).equals ("http://" )) { /* lien externe */
1479
+
1480
1480
theReturn = avant
1481
1481
+ parseCodeSupprHref (scc , apres , settings , currentPath );
1482
1482
} else if (apres .substring (0 , 6 ).equals ("ftp://" )) { /* lien externe */
1483
+
1483
1484
theReturn = avant
1484
1485
+ parseCodeSupprHref (scc , apres , settings , currentPath );
1485
1486
} else if (apres .substring (0 , 3 ).equals ("rr:" )) { /* deja en relatif */
0 commit comments