Author: rfelden
Date: Wed May 23 18:18:06 2007
New Revision: 41
URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D41&repname=3D=
jahia_upgrade
Log:
updated integrity project
Modified:
trunk/integrity/src/main/java/org/jahia/integrity/controller/Controller=
.java
trunk/integrity/src/main/java/org/jahia/integrity/view/MainPanel.form
trunk/integrity/src/main/java/org/jahia/integrity/view/MainPanel.java
Modified: trunk/integrity/src/main/java/org/jahia/integrity/controller/Cont=
roller.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/integrity/src/m=
ain/java/org/jahia/integrity/controller/Controller.java&rev=3D41&repname=3D=
jahia_upgrade
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/integrity/src/main/java/org/jahia/integrity/controller/Controller=
.java (original)
+++ trunk/integrity/src/main/java/org/jahia/integrity/controller/Controller=
.java Wed May 23 18:18:06 2007
@@ -12,6 +12,7 @@
=
import java.io.IOException;
import java.io.File;
+import java.io.PrintStream;
import java.util.*;
=
/**
@@ -258,10 +259,19 @@
}
=
gui.disableHourglass();
- String[] authors =3D lastReport.second.keySet().toArray(ne=
w String[0]) ;
- Arrays.sort(authors);
+ String[] authorsTemp =3D lastReport.second.keySet().toArra=
y(new String[0]) ;
+ Arrays.sort(authorsTemp);
//authors.addAll(lastReport.first.keySet()) ;
=
+ String[] authors ;
+ if (authorsTemp.length > 0) {
+ authors =3D new String[authorsTemp.length +1] ;
+ authors[0] =3D "<all>" ;
+ System.arraycopy(authorsTemp, 0, authors, 1, authorsTe=
mp.length);
+ } else {
+ authors =3D authorsTemp ;
+ }
+
// benchmarking
time =3D System.currentTimeMillis() - time ;
gui.displayBench(time + "ms");
@@ -277,15 +287,40 @@
* @param author the author of the commits
*/
public void retrieveCommits(String author) {
- if (lastReport !=3D null) {
- Pair<ArrayList<Pair<Commit, Commit>>, ArrayList<Commit>> commi=
tsRetrieved =3D new Pair<ArrayList<Pair<Commit, Commit>>, ArrayList<Commit>=
>(
- lastReport.first.get(author) ,
- lastReport.second.get(author)
- ) ;
+ if (lastReport !=3D null && author !=3D null && !author.equals("")=
) {
+ Pair<ArrayList<Pair<Commit, Commit>>, ArrayList<Commit>> commi=
tsRetrieved ;
+ if (!author.equals("<all>")) {
+ commitsRetrieved =3D new Pair<ArrayList<Pair<Commit, Commi=
t>>, ArrayList<Commit>>(
+ lastReport.first.get(author) ,
+ lastReport.second.get(author)
+ ) ;
+ } else {
+ ArrayList<Pair<Commit, Commit>> goodCommits =3D new ArrayL=
ist<Pair<Commit, Commit>>() ;
+ ArrayList<Commit> badCommits =3D new ArrayList<Commit>() ;
+ for (ArrayList<Pair<Commit, Commit>> good : lastReport.fir=
st.values()) {
+ goodCommits.addAll(good) ;
+ }
+ for (ArrayList<Commit> bad : lastReport.second.values()) {
+ badCommits.addAll(bad) ;
+ }
+ commitsRetrieved =3D new Pair<ArrayList<Pair<Commit, Commi=
t>>, ArrayList<Commit>>(
+ goodCommits, badCommits) ;
+ }
gui.onCommitsRetrieved(commitsRetrieved);
}
}
=
+ public void saveLogToFile(File file, String content) {
+ try {
+ file.createNewFile() ;
+ PrintStream ps =3D new PrintStream(file) ;
+ ps.println(content) ;
+ ps.close() ;
+ } catch (IOException e) {
+ gui.display(e.toString());
+ }
+ }
+
/**
* Safe exit method.
*/
Modified: trunk/integrity/src/main/java/org/jahia/integrity/view/MainPanel.=
form
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/integrity/src/m=
ain/java/org/jahia/integrity/view/MainPanel.form&rev=3D41&repname=3Djahia_u=
pgrade
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/integrity/src/main/java/org/jahia/integrity/view/MainPanel.form (=
original)
+++ trunk/integrity/src/main/java/org/jahia/integrity/view/MainPanel.form W=
ed May 23 18:18:06 2007
@@ -109,7 +109,7 @@
<gridbag top=3D"2" left=3D"5" bottom=3D"2" right=3D"5" weigh=
tx=3D"1.0" weighty=3D"0.0"/>
</constraints>
<properties>
- <text value=3D""/>
+ <text value=3D"http://svn.jahia.org/svn/jahia"/>
</properties>
</component>
<component id=3D"ac7e6" class=3D"javax.swing.JTextField" binding=
=3D"branch">
@@ -120,7 +120,7 @@
<gridbag top=3D"2" left=3D"5" bottom=3D"2" right=3D"5" weigh=
tx=3D"1.0" weighty=3D"0.0"/>
</constraints>
<properties>
- <text value=3D""/>
+ <text value=3D"branches/JAHIA-5-0-SP-BRANCH"/>
</properties>
</component>
<component id=3D"7de6d" class=3D"javax.swing.JLabel">
@@ -183,7 +183,7 @@
<gridbag top=3D"0" left=3D"0" bottom=3D"0" right=3D"10" weig=
htx=3D"0.0" weighty=3D"0.0"/>
</constraints>
<properties>
- <text value=3D"Save log"/>
+ <text value=3D"Save missing log"/>
</properties>
</component>
<component id=3D"93c70" class=3D"javax.swing.JButton" binding=3D=
"clearLogButton" default-binding=3D"true">
@@ -192,7 +192,7 @@
<gridbag top=3D"0" left=3D"10" bottom=3D"0" right=3D"0" weig=
htx=3D"0.0" weighty=3D"0.0"/>
</constraints>
<properties>
- <text value=3D"Clear log"/>
+ <text value=3D"Clear logs"/>
</properties>
</component>
</children>
Modified: trunk/integrity/src/main/java/org/jahia/integrity/view/MainPanel.=
java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/integrity/src/m=
ain/java/org/jahia/integrity/view/MainPanel.java&rev=3D41&repname=3Djahia_u=
pgrade
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/integrity/src/main/java/org/jahia/integrity/view/MainPanel.java (=
original)
+++ trunk/integrity/src/main/java/org/jahia/integrity/view/MainPanel.java W=
ed May 23 18:18:06 2007
@@ -4,6 +4,7 @@
import org.jahia.integrity.model.Query;
import org.jahia.integrity.model.Commit;
import org.jahia.tools.Pair;
+import org.jahia.tools.GUITools;
=
import javax.swing.*;
import java.awt.event.ActionListener;
@@ -13,6 +14,7 @@
import java.awt.*;
import java.sql.Date;
import java.util.ArrayList;
+import java.io.File;
=
/**
* @author Romain
@@ -52,7 +54,11 @@
});
saveLog.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
- display("save log not implemented yet");
+ File saveFile =3D GUITools.selectSaveLocation(tabbedPane1,=
"Select save location", "/", false) ;
+ if (saveFile !=3D null) {
+ controller.saveLogToFile(saveFile, badCommitsDisplay.g=
etText());
+ }
+
}
});
clearLogButton.addActionListener(new ActionListener() {
@@ -68,8 +74,14 @@
}
}
});
- server.setText(controller.getLastUsedServer());
- branch.setText(controller.getLastUsedBranch());
+ String newServer =3D controller.getLastUsedServer() ;
+ String newBranch =3D controller.getLastUsedBranch() ;
+ if (!newServer.equals("")) {
+ server.setText(controller.getLastUsedServer());
+ }
+ if (!newBranch.equals("")) {
+ branch.setText(controller.getLastUsedBranch());
+ }
String nowDate =3D new Date(System.currentTimeMillis()).toString();
String curMonth =3D nowDate.substring(0, 8) + "01";
start.setText(curMonth);
_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list