Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature : Optimizing image and file banks #574

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 2 additions & 18 deletions blog/blog-war/src/main/webapp/blog/jsp/postManager.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -147,20 +147,13 @@
browseInfo="<%=title%>" objectId="<%=post.getId()%>"
activateWysiwygBackupManager="true"/>

<% if ("CreatePost".equals(action)) {
%>
<% if ("CreatePost".equals(action)) { %>
$("#Title").click(function() {
if ($('#Title').attr('value') === "${blog_postUntitled}") {
$("#Title").attr('value','');
}
});
<%
}
%>

if ($.trim($(".wysiwyg-fileStorage").text()).length==0) {
$(".wysiwyg-fileStorage").css("display", "none") ;
}
<% } %>
});
</script>
</head>
Expand Down Expand Up @@ -200,15 +193,6 @@
<div class="field" id="contentArea">
<label for="editor" class="txtlibform"><fmt:message key="blog.content"/></label>
<div class="champs">

<div class="container-wysiwyg wysiwyg-fileStorage">

<viewTags:displayToolBarWysiwyg
editorName="editor"
componentId="<%=instanceId%>"
objectId="<%=post.getId()%>" />
</div>

<textarea rows="5" cols="10" name="editor" id="editor"><c:out value="<%=content%>" escapeXml="true"/></textarea>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,18 +273,18 @@
<parameter>
<name>viewInWysiwyg</name>
<label>
<message lang="fr">Images réutilisables</message>
<message lang="en">Reusable images</message>
<message lang="de">Wiederverwendbare Bilder</message>
<message lang="fr">Banque d'images</message>
<message lang="en">Image store</message>
<message lang="de">Bildbank</message>
</label>
<order>10</order>
<mandatory>true</mandatory>
<value>no</value>
<type>checkbox</type>
<updatable>always</updatable>
<help>
<message lang="fr">Permet d'utiliser les images de cette application depuis l'éditeur Wysiwyg et les applications Vote et Enquête</message>
<message lang="en">Images will be available from Wysiwyg editor and Vote and Survey applications</message>
<message lang="fr">Permet d'utiliser les images de cette application depuis l'éditeur WYSIWYG et les applications Vote et Enquête</message>
<message lang="en">Images will be available from WYSIWYG editor and Vote and Survey applications</message>
<message lang="de">Bilder werden von WYSIWYG-Editor, Abstimmung und Umfrage Komponent verfügbar sein</message>
</help>
<warning>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,6 @@

<div class="field" id="contentArea">
<div class="champs">
<div class="container-wysiwyg wysiwyg-fileStorage">

<viewTags:displayToolBarWysiwyg
editorName="Content"
componentId="<%=componentId%>"
objectId="${parution}" />
</div>

<textarea rows="5" cols="10" name="editor" id="Content">${parutionContent}</textarea>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions kmelia/kmelia-war/src/main/webapp/kmelia/jsp/xmlForm.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
<head>
<title></title>
<view:looknfeel/>
<view:includePlugin name="wysiwyg"/>
<% formUpdate.displayScripts(out, context);%>
<script type="text/javascript">
function topicGoTo(id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,6 @@ $(document).ready(function() {
<div class="field" id="contentArea">
<label class="txtlibform" for="content"><fmt:message key="quickinfo.news.content" /> </label>
<div class="champs">
<div class="container-wysiwyg wysiwyg-fileStorage">
<viewTags:displayToolBarWysiwyg editorName="editorContent" componentId="${curQuickInfo.componentInstanceId}" objectId="${curQuickInfo.publicationId}" />
</div>
<textarea name="editorContent" id="editorContent" rows="50" cols="10"><%=codeHtml%></textarea>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,6 @@ fieldset#news-thumbnail legend {
background: url("../../../util/icons/images.png") no-repeat scroll 11px 0 rgba(0, 0, 0, 0);
}

.skinFieldset .champs .wysiwyg-fileStorage {
width: 98%;
background-color: #FFF;
}

#nameArea,
#descriptionArea,
#contentArea,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ QuizzPalmares = Le top
QuizzUserParticipations = Mes participations
QuizzAverage = Moyenne
QuizzOnglet1 = Quizz
QuizzDeleteThisQuizz = Etes-vous s\u00FBr de vouloir supprimer le quizz ?
QuizzDeleteThisQuizz = Etes-vous s\u00fbr de vouloir supprimer le quizz ?
QuizzNewQuizz = Cr\u00e9er un quizz
QuizzUpdate = Modifier un quizz
QuizzParticipate = Quizz auxquels vous avez particip\u00e9
Expand All @@ -44,10 +44,10 @@ QuizzCreditOver = Cr\u00e9dit utilis\u00e9
QuizzCreditAvailable = Cr\u00e9dit disponible
QuizzParticipate = Participer au quizz
QuizzNotice = Remarque :
QuizzSeeClue = Consulter l\u0027indice
QuizzSeeClue = Consulter l'indice
QuizzClue = Indice
QuizzPenalty = P\u00e9nalit\u00e9
QuizzCreation = Cr\u00e9ation d\u0027un quizz
QuizzCreation = Cr\u00e9ation d'un quizz
QuizzCreationDate = Date de cr\u00e9ation
QuizzCreationBeginDate = Ouvert du
QuizzCreationEndDate = au
Expand All @@ -72,29 +72,28 @@ TotalScoreLib = Score Total
EducationSuggestion = Suggestion p\u00e9dagogique
Finish = Terminer Quizz
Comment = Commentaires
Caracters = caract\u00E8res
Caracters = caract\u00e8res
MustContainsPositiveNumber = doit contenir un nombre positif
MustContainsInfNumber=doit contenir un nombre inf\u00e9rieur ou \u00e9gal \u00E0
MustContainsSupNumber=doit contenir un nombre sup\u00e9rieur ou \u00e9gal \u00E0
MustContainsStrictlyInfNumber=doit contenir un nombre inf\u00e9rieur \u00E0
MustContainsLessCar = est limit\u00e9 \u00E0
MustContainsInfNumber=doit contenir un nombre inf\u00e9rieur ou \u00e9gal \u00e0
MustContainsSupNumber=doit contenir un nombre sup\u00e9rieur ou \u00e9gal \u00e0
MustContainsStrictlyInfNumber=doit contenir un nombre inf\u00e9rieur \u00e0
MustContainsLessCar = est limit\u00e9 \u00e0
MustContainsAQuestion = Veuillez saisir une question ...
QuestionUp = D\u00e9placer vers le haut
QuestionDown = D\u00e9placer vers le bas
QuestionAdd = Ajouter une question
ConfirmCancel = Etes-vous s\u00FBr de vouloir annuler la cr\u00e9ation du quizz ?
ConfirmCancel = Etes-vous s\u00fbr de vouloir annuler la cr\u00e9ation du quizz ?
UserUnknown = Inconnu
QuestionUpdate = Modifier
quizz.link = Permalien
quizz.CopyQuizzLink = Pour copier le lien vers ce quizz : Clique droit puis \u0027Copier le raccourci\u0027
quizz.CopyQuizzLink = Pour copier le lien vers ce quizz : Clique droit puis 'Copier le raccourci'

quizz.galleries = Phototh\u00E8ques
quizz.imageGallery = Image associ\u00e9e

quizz.style = Type de r\u00e9ponse
quizz.open = Question ouverte
quizz.radio = Bouton radio
quizz.checkbox = Case \u00E0 cocher
quizz.checkbox = Case \u00e0 cocher
quizz.list = Liste d\u00e9roulante

quizz.header.fieldset.info = Informations principales
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,10 @@ QuestionDown = Nach unten verschieben
QuestionAdd = Eine Frage hinzuf\u00fcgen
ConfirmCancel = Sind Sie sicher, die Erstellung des Quiz abbrechen zu wollen?
UserUnknown = Unbekannt
QuestionUpdate = \u00C4ndern
QuestionUpdate = \u00c4ndern
Quizz.link = Permalink
Quizz.CopyQuizLink = Um den Link in dieses Quiz zu kopieren: Rechtsklick, dann "Verkn\u00fcpfung kopieren"

quizz.galleries = Fotosammlungen
quizz.imageGallery = Dazugeh\u00f6rendes Bild

quizz.style = Art der Antwort
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ QuestionUpdate = Edit
quizz.link = Permalink
quizz.CopyQuizzLink = To copy the link to this quiz, right click then click on 'Copy shortcut'

quizz.galleries = Galleries
quizz.imageGallery = Linked image

quizz.style = Type of answer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ QuizzPalmares = Le top
QuizzUserParticipations = Mes participations
QuizzAverage = Moyenne
QuizzOnglet1 = Quizz
QuizzDeleteThisQuizz = Etes-vous s\u00FBr de vouloir supprimer le quizz ?
QuizzDeleteThisQuizz = Etes-vous s\u00fbr de vouloir supprimer le quizz ?
QuizzNewQuizz = Cr\u00e9er un quizz
QuizzUpdate = Modifier un quizz
QuizzParticipate = Quizz auxquels vous avez particip\u00e9
Expand All @@ -44,10 +44,10 @@ QuizzCreditOver = Cr\u00e9dit utilis\u00e9
QuizzCreditAvailable = Cr\u00e9dit disponible
QuizzParticipate = Participer au quizz
QuizzNotice = Remarque :
QuizzSeeClue = Consulter l\u0027indice
QuizzSeeClue = Consulter l'indice
QuizzClue = Indice
QuizzPenalty = P\u00e9nalit\u00e9
QuizzCreation = Cr\u00e9ation d\u0027un quizz
QuizzCreation = Cr\u00e9ation d'un quizz
QuizzCreationDate = Date de cr\u00e9ation
QuizzCreationBeginDate = Ouvert du
QuizzCreationEndDate = au
Expand All @@ -72,29 +72,28 @@ TotalScoreLib = Score Total
EducationSuggestion = Suggestion p\u00e9dagogique
Finish = Terminer Quizz
Comment = Commentaires
Caracters=caract\u00E8res
Caracters=caract\u00e8res
MustContainsPositiveNumber = doit contenir un nombre positif
MustContainsInfNumber=doit contenir un nombre inf\u00e9rieur ou \u00e9gal \u00E0
MustContainsSupNumber=doit contenir un nombre sup\u00e9rieur ou \u00e9gal \u00E0
MustContainsStrictlyInfNumber=doit contenir un nombre inf\u00e9rieur \u00E0
MustContainsLessCar = est limit\u00e9 \u00E0
MustContainsInfNumber=doit contenir un nombre inf\u00e9rieur ou \u00e9gal \u00e0
MustContainsSupNumber=doit contenir un nombre sup\u00e9rieur ou \u00e9gal \u00e0
MustContainsStrictlyInfNumber=doit contenir un nombre inf\u00e9rieur \u00e0
MustContainsLessCar = est limit\u00e9 \u00e0
MustContainsAQuestion = Veuillez saisir une question ...
QuestionUp = D\u00e9placer vers le haut
QuestionDown = D\u00e9placer vers le bas
QuestionAdd = Ajouter une question
ConfirmCancel = Etes-vous s\u00FBr de vouloir annuler la cr\u00e9ation du quizz ?
ConfirmCancel = Etes-vous s\u00fbr de vouloir annuler la cr\u00e9ation du quizz ?
UserUnknown = Inconnu
QuestionUpdate = Modifier
quizz.link = Permalien
quizz.CopyQuizzLink = Pour copier le lien vers ce quizz : Clique droit puis \u0027Copier le raccourci\u0027
quizz.CopyQuizzLink = Pour copier le lien vers ce quizz : Clique droit puis 'Copier le raccourci'

quizz.galleries = Phototh\u00E8ques
quizz.imageGallery = Image associ\u00e9e

quizz.style = Type de r\u00e9ponse
quizz.open = Question ouverte
quizz.radio = Bouton radio
quizz.checkbox = Case \u00E0 cocher
quizz.checkbox = Case \u00e0 cocher
quizz.list = Liste d\u00e9roulante

quizz.header.fieldset.info = Informations principales
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.silverpeas.components.quizz.QuizzException;
import org.silverpeas.core.admin.component.model.ComponentInstLight;
import org.silverpeas.core.admin.service.OrganizationController;
import org.silverpeas.core.admin.service.OrganizationControllerProvider;
import org.silverpeas.core.clipboard.ClipboardException;
import org.silverpeas.core.clipboard.ClipboardSelection;
import org.silverpeas.core.exception.DecodingException;
Expand Down Expand Up @@ -57,7 +56,6 @@
import javax.servlet.http.HttpSession;
import java.io.File;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.Iterator;
Expand Down Expand Up @@ -533,21 +531,7 @@ public void updateQuestions(Collection<Question> questions, String quizzId)
}

public List<ComponentInstLight> getGalleries() {
List<ComponentInstLight> galleries = null;
OrganizationController orgaController =
OrganizationControllerProvider.getOrganisationController();
String[] compoIds = orgaController.getCompoId("gallery");
for (final String compoId : compoIds) {
if ("yes".equalsIgnoreCase(
orgaController.getComponentParameterValue("gallery" + compoId, "viewInWysiwyg"))) {
if (galleries == null) {
galleries = new ArrayList<>();
}
ComponentInstLight gallery = orgaController.getComponentInstLight("gallery" + compoId);
galleries.add(gallery);
}
}
return galleries;
return OrganizationController.get().getComponentsWithParameterValue("viewInWysiwyg", "yes");
}

public boolean isPdcUsed() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ if ((action.equals("CreateQuestion")) || (action.equals("SendQuestionForm"))) {
<%if (galleries != null) {%>
<span class="txtsublibform"> ou </span><input type="hidden" name="valueImageGallery<%= i %>" id="valueImageGallery<%= i %>"/>
<select class="galleries" name="galleries" onchange="choixGallery(this, '<%= i %>');this.selectedIndex=0;">
<option selected><%= surveyResource.getString("survey.galleries") %></option>
<option selected><%= surveyResource.getString("GML.thumbnail.galleries") %></option>
<%
for (ComponentInstLight gallery : galleries) { %>
<option value="<%= gallery.getId() %>"><%= gallery.getLabel() %></option>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ if ((action.equals("CreateQuestion")) || (action.equals("SendQuestionForm"))) {
<%if (galleries != null) {%>
<span class="txtsublibform"> ou </span><input type="hidden" name="valueImageGallery<%= i %>" id="valueImageGallery<%= i %>"/>
<select class="galleries" name="galleries" onchange="choixGallery(this, '<%= i %>');this.selectedIndex=0;">
<option selected><%= surveyResource.getString("survey.galleries") %></option>
<option selected><%= surveyResource.getString("GML.thumbnail.galleries") %></option>
<%
for (ComponentInstLight gallery : galleries) { %>
<option value="<%= gallery.getId() %>"><%= gallery.getLabel() %></option>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@
package org.silverpeas.components.silvercrawler;

import org.silverpeas.components.silvercrawler.model.SilverCrawlerRuntimeException;
import org.silverpeas.core.admin.component.model.ComponentInst;
import org.silverpeas.core.admin.component.model.ComponentInstLight;
import org.silverpeas.core.admin.service.OrganizationController;
import org.silverpeas.core.admin.service.OrganizationControllerProvider;
import org.silverpeas.core.index.indexing.model.RepositoryIndexer;
import org.silverpeas.core.scheduler.Scheduler;
import org.silverpeas.core.scheduler.SchedulerEvent;
Expand Down Expand Up @@ -64,26 +63,22 @@ public void initialize() {
public void doScheduledIndex() {
try {
// indexation des fichiers du composant
OrganizationController orga = OrganizationControllerProvider.getOrganisationController();
String[] instanceIds = orga.getCompoId("silverCrawler");
for (int i = 0; instanceIds != null && i < instanceIds.length; i++) {
ComponentInst instance = orga.getComponentInst("silverCrawler" + instanceIds[i]);
boolean periodicIndex = "yes".equals(instance.getParameterValue("periodicIndex"));
if (periodicIndex) {
RepositoryIndexer repositoryIndexer = new RepositoryIndexer(null, instance.getId());
OrganizationController orga = OrganizationController.get();
List<ComponentInstLight> instances = orga.getComponentsWithParameterValue("periodicIndex", "yes");
for (ComponentInstLight instance : instances) {
RepositoryIndexer repositoryIndexer = new RepositoryIndexer(null, instance.getId());

List<String> profiles = new ArrayList<>();
profiles.add("admin");
String[] adminIds = orga.getUsersIdsByRoleNames(instance.getId(), profiles);
List<String> profiles = new ArrayList<>();
profiles.add("admin");
String[] adminIds = orga.getUsersIdsByRoleNames(instance.getId(), profiles);

String adminId = "0";
if (adminIds != null && adminIds.length > 0) {
adminId = adminIds[0];
}

Path pathRepository = Paths.get(instance.getParameterValue("directory"));
repositoryIndexer.addPath(pathRepository, adminId);
String adminId = "0";
if (adminIds != null && adminIds.length > 0) {
adminId = adminIds[0];
}

Path pathRepository = Paths.get(instance.getParameterValue("directory"));
repositoryIndexer.addPath(pathRepository, adminId);
}
} catch (Exception e) {
throw new SilverCrawlerRuntimeException(e);
Expand Down