Skip to content

Commit

Permalink
Many UI improvements
Browse files Browse the repository at this point in the history
Upgrade to XWiki 4.5.3
  • Loading branch information
tmortagne committed Apr 7, 2013
1 parent 805015e commit 4aa6f19
Show file tree
Hide file tree
Showing 42 changed files with 2,830 additions and 2,851 deletions.
20 changes: 10 additions & 10 deletions budget-transactionreader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,21 @@
<name>Budget - Transaction reader</name>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
</dependency>
<dependency>
<groupId>org.xwiki.commons</groupId>
<artifactId>xwiki-commons-component-api</artifactId>
<version>${xwiki.commons.version}</version>
<version>${commons.version}</version>
</dependency>
<dependency>
<groupId>org.xwiki.commons</groupId>
<artifactId>xwiki-commons-script</artifactId>
<version>${xwiki.commons.version}</version>
<version>${commons.version}</version>
</dependency>

<dependency>
<groupId>com.xpn.xwiki.platform</groupId>
<artifactId>xwiki-core</artifactId>
<version>${xwiki.platform.version}</version>
<groupId>org.xwiki.platform</groupId>
<artifactId>xwiki-platform-oldcore</artifactId>
<version>${platform.version}</version>
</dependency>

<!-- PDF parsing -->
Expand All @@ -65,9 +61,13 @@
<dependency>
<groupId>org.xwiki.commons</groupId>
<artifactId>xwiki-commons-test</artifactId>
<version>${xwiki.commons.version}</version>
<version>${commons.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</dependency>
</dependencies>
<repositories>
<repository>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@
import org.mortagne.budget.transaction.Transaction;
import org.mortagne.budget.transaction.io.TransactionReader;
import org.mortagne.budget.transaction.io.TransactionReaderConfiguration;
import org.xwiki.component.logging.AbstractLogEnabled;

import com.itextpdf.text.pdf.PdfReader;
import com.itextpdf.text.pdf.parser.PdfReaderContentParser;

public class LCLPDFTransactionReader extends AbstractLogEnabled implements TransactionReader
public class LCLPDFTransactionReader implements TransactionReader
{
private InputStream transationStream;

Expand Down Expand Up @@ -101,7 +100,7 @@ public int compare(DefaultTransaction t1, DefaultTransaction t2)
// total
currentTotal += transaction.getValue();
transaction.setTotal(currentTotal);

// date
if (!transaction.getRealDate().equals(currentDate)) {
currentDate = transaction.getDate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ public LCLPDFTransactionReaderFactory()
public TransactionReader createTransactionReader(InputStream transationStream,
TransactionReaderConfiguration configuration)
{
LCLPDFTransactionReader reader = new LCLPDFTransactionReader(transationStream, configuration);

reader.enableLogging(getLogger());

return reader;
return new LCLPDFTransactionReader(transationStream, configuration);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ public TransactionReader createTransactionReader(InputStream transationStream,
configuration.setDateFormat(DateFormat.getDateInstance(DateFormat.SHORT, Locale.FRANCE));
configuration.setCharset("ISO-8859-1");

LCLQIFTransactionReader reader = new LCLQIFTransactionReader(transationStream, configuration);
reader.enableLogging(getLogger());

return reader;
return new LCLQIFTransactionReader(transationStream, configuration);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@
import org.mortagne.budget.transaction.Transaction;
import org.mortagne.budget.transaction.io.TransactionReader;
import org.mortagne.budget.transaction.io.TransactionReaderConfiguration;
import org.xwiki.component.logging.AbstractLogEnabled;

public class QIFTransactionReader extends AbstractLogEnabled implements TransactionReader
public class QIFTransactionReader implements TransactionReader
{
private InputStream transationStream;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ public QIFTransactionReaderFactory()
public TransactionReader createTransactionReader(InputStream transationStream,
TransactionReaderConfiguration configuration)
{
QIFTransactionReader reader = new QIFTransactionReader(transationStream, configuration);

reader.enableLogging(getLogger());

return reader;
return new QIFTransactionReader(transationStream, configuration);
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package org.mortagne.budget.transaction.io;

import org.xwiki.component.logging.AbstractLogEnabled;

public abstract class AbstractTransactionReaderFactory extends AbstractLogEnabled implements TransactionReaderFactory
public abstract class AbstractTransactionReaderFactory implements TransactionReaderFactory
{
private String id;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@

import java.io.InputStream;

import org.xwiki.component.annotation.ComponentRole;
import org.xwiki.component.annotation.Role;

@ComponentRole
@Role
public interface TransactionReaderFactory
{
String getId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void setUp() throws Exception

TransactionReaderConfiguration configuration = new TransactionReaderConfiguration();

TransactionReaderFactory factory = getComponentManager().lookup(TransactionReaderFactory.class, "lcl.pdf");
TransactionReaderFactory factory = getComponentManager().getInstance(TransactionReaderFactory.class, "lcl.pdf");
this.reader =
factory.createTransactionReader(getClass().getResourceAsStream("/example.lcl.pdf"), configuration);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void setUp() throws Exception

TransactionReaderConfiguration configuration = new TransactionReaderConfiguration();

TransactionReaderFactory factory = getComponentManager().lookup(TransactionReaderFactory.class, "lcl.qif");
TransactionReaderFactory factory = getComponentManager().getInstance(TransactionReaderFactory.class, "lcl.qif");
this.reader =
factory.createTransactionReader(getClass().getResourceAsStream("/example.lcl.qif"), configuration);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
public class QIFTransactionReaderTest extends AbstractComponentTestCase
{
private static final DateFormat DATEFORMAT = new SimpleDateFormat("dd.MM.yy");

private TransactionReader reader;

@Before
Expand All @@ -48,7 +48,7 @@ public void setUp() throws Exception
configuration.setDateFormat(DateFormat.getDateInstance(DateFormat.SHORT, Locale.FRANCE));
configuration.setCharset("ISO-8859-1");

TransactionReaderFactory factory = getComponentManager().lookup(TransactionReaderFactory.class, "qif");
TransactionReaderFactory factory = getComponentManager().getInstance(TransactionReaderFactory.class, "qif");
this.reader = factory.createTransactionReader(getClass().getResourceAsStream("/example.qif"), configuration);
}

Expand All @@ -64,7 +64,7 @@ public void testParse() throws Exception
Assert.assertNull(transaction.getRealDate());
Assert.assertEquals("Carte", transaction.getType());
Assert.assertEquals(" CB SNCF 09/04/11 ", transaction.getDescription());

transaction = reader.next();

Assert.assertNotNull(transaction);
Expand Down
33 changes: 18 additions & 15 deletions budget-ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,22 @@
<name>Budget - UI</name>
<packaging>xar</packaging>
<build>
<extensions>
<extension>
<groupId>org.xwiki.platform.tools</groupId>
<artifactId>xwiki-xar-handlers</artifactId>
<version>${platform.tool.xar-handler.version}</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>org.xwiki.platform.tools</groupId>
<artifactId>xwiki-xar-plugin</artifactId>
<version>${platform.tool.xar-plugin.version}</version>
</plugin>
</plugins>
</build>
<extensions>
<!-- Needed to add support for the "xar" packaging -->
<extension>
<groupId>org.xwiki.commons</groupId>
<artifactId>xwiki-commons-tool-xar-handlers</artifactId>
<version>${commons.version}</version>
</extension>
</extensions>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.xwiki.commons</groupId>
<artifactId>xwiki-commons-tool-xar-plugin</artifactId>
<version>${commons.version}</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
94 changes: 0 additions & 94 deletions budget-ui/src/main/resources/Budget/Account.xml

This file was deleted.

Loading

0 comments on commit 4aa6f19

Please sign in to comment.