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

Read named by sheet #10

Closed
wants to merge 36 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
804948f
xlconnect/#37 - named regions by name and filter by sheet name
spoltier Mar 21, 2019
602868f
xlconnect/#37 - WIP reference coordinates by worksheet
spoltier Apr 4, 2019
d24e719
XLConnect #37 - better error message, simpler getNames
spoltier Sep 5, 2019
3e7b695
XLConnect #37 - write in specific sheet's named region
spoltier Sep 19, 2019
02027bc
XLConnect #37 - create, check existence, and append to named region
spoltier Sep 19, 2019
5e85f96
XLConnect #37 - simplified worksheet name null handling
spoltier Sep 26, 2019
3fa1835
XLConnect #37 - clear named region in specific worksheet
spoltier Sep 26, 2019
3fd469f
XLConnect #37 - set worksheet on name if present
spoltier Oct 2, 2019
c31c9b8
#37 fix scope v formula - sheet property
spoltier Sep 16, 2021
9941ef4
#37 fall back to globally scoped name
spoltier Sep 16, 2021
cd7fc7f
gh #37: copy names when cloning
spoltier Sep 16, 2021
dee51cb
#37 clean up cloning code
spoltier Sep 16, 2021
fa5808f
#37 strict matching of worksheet name
spoltier Sep 16, 2021
63192d0
Review: parameter name change to '...scope'
spoltier Sep 23, 2021
1874f8a
Review: add getDefinedNames
spoltier Sep 23, 2021
11b3bb0
Review: use "" for explicit global scope
spoltier Sep 23, 2021
d293147
Review: worksheet scope for ref coordinates
spoltier Sep 23, 2021
5b09391
Apply suggestions from code review
spoltier Sep 23, 2021
a08607f
Review: suggested refactorings
spoltier Sep 23, 2021
9b68c9f
Review: addImage with scope
spoltier Sep 23, 2021
e3dda7d
Apply suggestions from code review
spoltier Sep 23, 2021
b42f0b7
specify scope when failed name creation
spoltier Oct 7, 2021
88b4468
WIP - classes for attributes
spoltier Oct 14, 2021
aef9d73
WIP - classes for attributes
spoltier Oct 14, 2021
5c6ba9f
classes for attributes, first working draft
spoltier Oct 14, 2021
58e07e3
createName - handle null case in worksheet name display
spoltier Oct 21, 2021
a7bf4a4
Actual Worksheet scope even when null passed
spoltier Oct 28, 2021
a400a9a
WIP readWorksheetName
spoltier Oct 28, 2021
028f0ad
WIP readWorksheetName
spoltier Oct 28, 2021
53b077e
attribute values are arrays
spoltier Oct 28, 2021
3907e8f
clean up after rebase
spoltier Jan 23, 2024
0939923
existsName: exception as warning
spoltier Jan 23, 2024
4acd6c5
align wrapper method signatures to order in R package
spoltier Jan 30, 2024
9ea9aff
refactor parameter in Workbook order to match RWorkbookWrapper
spoltier Feb 7, 2024
729bfb7
adjust parameter order for createName
spoltier Feb 13, 2024
ae5c94f
bump major version for added API argument
spoltier Feb 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<groupId>com.miraisolutions</groupId>
<artifactId>XLConnect</artifactId>
<packaging>jar</packaging>
<version>2.0.1-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
<name>XLConnect</name>
<url>https://mirai-solutions.ch/</url>
<repositories>
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/miraisolutions/xlconnect/Attribute.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.miraisolutions.xlconnect;

public enum Attribute {
WORKSHEET_SCOPE {
@Override
public String toString() {
return "worksheetScope";
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.miraisolutions.xlconnect;

public class BooleanWithAttributes extends ResultWithAttributes implements WithJNI{

private final boolean value;

public BooleanWithAttributes(Attribute attributeName, String attributeValue, boolean value) {
super(attributeName, attributeValue);
this.value = value;
}

public BooleanWithAttributes(boolean value) {
super();
this.value = value;
}

public boolean getValue() {
return value;
}

@Override
public String jni() {
return "Z";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.miraisolutions.xlconnect;

import com.miraisolutions.xlconnect.data.DataFrame;

public class DataFrameWithAttributes extends ResultWithAttributes{

private final DataFrame value;

public DataFrameWithAttributes(Attribute attributeName, String attributeValue, DataFrame value) {
super(attributeName, attributeValue);
this.value = value;
}


public DataFrame getValue() {
return value;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.miraisolutions.xlconnect;

import com.miraisolutions.xlconnect.integration.r.RDataFrameWrapper;

import java.util.Map;

public class RDataFrameWithAttributes extends ResultWithAttributes{

private final RDataFrameWrapper value;

public RDataFrameWithAttributes(Map<String, String[]> attributes, RDataFrameWrapper value) {
super(attributes);
this.value = value;
}

public RDataFrameWrapper getValue() {
return value;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package com.miraisolutions.xlconnect;


import java.util.*;

/**
* Represent attributes to be set on an object in R as part of the result to be returned.
* Should be extended for each required type. Not using a generic typed value, because it looks like R can't retrieve it
* in a specific subtype (we get an Object instance).
*/
class ResultWithAttributes {

private final Map<String,String[]> attributes;

public ResultWithAttributes(Map<String,String[]> theAttributes) {
this.attributes = theAttributes;
}

public ResultWithAttributes() {
this(Collections.emptyMap());
}

public ResultWithAttributes(Attribute attributeName, String attributeValue) {
this(Collections.singletonMap(attributeName.toString(), new String[]{attributeValue}));
}

public Map<String, String[]> getAttributes() {
return Collections.unmodifiableMap(attributes);
}

public String[] getAttributeNames() {
return attributes.keySet().toArray(new String[0]);
}

/* public String[] getAttributeValues() {
return attributes.values().toArray(new String[0]);
}*/

public String[] getAttributeValue(String attributeName){
return attributes.get(attributeName);
}
}
8 changes: 8 additions & 0 deletions src/main/java/com/miraisolutions/xlconnect/WithJNI.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.miraisolutions.xlconnect;

public interface WithJNI {
/**
* @return the JNI to use for the getValue() method
*/
String jni();
}
Loading
Loading