Skip to content

Commit

Permalink
Adoption for newer openCSV library.
Browse files Browse the repository at this point in the history
  • Loading branch information
rsjazz committed Feb 16, 2024
1 parent 37b1536 commit 0639df9
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?><launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.ibm.js.team.workitem.commandline/src/com/ibm/js/team/workitem/commandline/WorkitemCommandLine.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.ibm.js.team.workitem.commandline.WorkitemCommandLine"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-importworkitems /ignoreErrors repository=&quot;https://clm.example.com:9443/ccm&quot; user=ralph password=ralph projectArea=&quot;JKE Banking (Change Management)&quot; importFile=&quot;c:\aaTemp\Export\Test.csv&quot; delimiter=&quot;;&quot;"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.js.team.workitem.commandline"/>
</launchConfiguration>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.ibm.js.team.workitem.commandline/src/main/java/com/ibm/js/team/workitem/commandline/WorkitemCommandLine.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.ibm.js.team.workitem.commandline.WorkitemCommandLine"/>
<stringAttribute key="org.eclipse.jdt.launching.MODULE_NAME" value="com.ibm.js.team.workitem.commandline"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-importworkitems /ignoreErrors repository=&quot;https://elmratelimha11.fyre.ibm.com:9443/ccm&quot; user=ralph password=ralph projectArea=&quot;Safe&quot; importFile=&quot;c:\aaTemp\Export\Test.csv&quot; delimiter=&quot;;&quot;"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.js.team.workitem.commandline"/>
</launchConfiguration>
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ public class ExportCommand extends AbstractTeamRepositoryCommand {
private String fCSVLineEnding = IWorkItemCommandLineConstants.DEFAULT_CSV_LINE_ENDING;
// Delimiter to be used for columns
private char fCSVDefaultSeparator = IWorkItemCommandLineConstants.DEFAULT_CSV_SEPERATOR_CHAR;
private char fCSVDefaultQuoteChar = IWorkItemCommandLineConstants.DEFAULT_CSV_QUOTE_CHAR;
// Export headers as ID's?
private boolean fHeaderAsIDs = false;
// Ignore minor errors?
Expand All @@ -99,7 +98,7 @@ public class ExportCommand extends AbstractTeamRepositoryCommand {
// Suppress Attribute Not found Exception
private boolean fSuppressAttributeErrors = false;
private WorkItemExportHelper fWorkItemExportHelper;
private char fCSVDefaultQuote=IWorkItemCommandLineConstants.DEFAULT_CSV_QUOTE_CHAR;
private char fCSVDefaultQuoteChar=IWorkItemCommandLineConstants.DEFAULT_CSV_QUOTE_CHAR;

/**
* The constructor
Expand Down Expand Up @@ -461,7 +460,17 @@ private WorkItemExportHelper getWorkItemExportHelper() {
* @return
*/
private char getQuoteChar() {
return fCSVDefaultQuote;
return fCSVDefaultQuoteChar;
}

/**
* Set the default quote character
*
* @return
*/
@SuppressWarnings("unused")
private void setQuoteChar(char quoteChar) {
fCSVDefaultQuoteChar=quoteChar;
}

/**
Expand Down Expand Up @@ -568,4 +577,12 @@ private char getSeparator() {
return fCSVDefaultSeparator;
}

public char getfCSVEscapeChar() {
return fCSVEscapeChar;
}

public void setfCSVEscapeChar(char fCSVEscapeChar) {
this.fCSVEscapeChar = fCSVEscapeChar;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,16 @@ private char getQuoteChar() {
return fCSVDefaultQuoteChar;
}

/**
* Set the default quote character
*
* @return
*/
@SuppressWarnings("unused")
private void setQuoteChar(char quoteChar) {
fCSVDefaultQuoteChar=quoteChar;
}

/**
* If we want to override the query result set size limit.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import org.apache.commons.text.StringEscapeUtils;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;

import org.apache.logging.log4j.Logger;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ private boolean importItems(IProjectArea projectArea) throws TeamRepositoryExcep
* @throws TeamRepositoryException
* @throws WorkItemCommandLineException
*/
@SuppressWarnings("resource")
private boolean performImport(IProjectArea projectArea, boolean result) throws TeamRepositoryException,
WorkItemCommandLineException {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import com.ibm.team.process.common.IProjectArea;
import com.ibm.team.repository.common.TeamRepositoryException;
import com.ibm.team.workitem.client.IQueryClient;
import com.ibm.team.workitem.client.IWorkItemClient;
import com.ibm.team.workitem.client.WorkItemOperation;
import com.ibm.team.workitem.client.WorkItemWorkingCopy;
import com.ibm.team.workitem.common.expression.AttributeExpression;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import java.util.ArrayList;
import java.util.List;


import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import org.apache.commons.text.StringEscapeUtils;
import org.apache.logging.log4j.Logger;

import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.util.List;

import org.apache.logging.log4j.Logger;

import org.eclipse.core.runtime.IProgressMonitor;

import com.ibm.team.links.common.IReference;
Expand Down

0 comments on commit 0639df9

Please sign in to comment.