Skip to content
This repository has been archived by the owner on Dec 6, 2022. It is now read-only.

Commit

Permalink
Successful working merge of help branch.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrim committed Nov 23, 2010
1 parent 22ae25e commit 5c5ca5e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 17 deletions.
2 changes: 1 addition & 1 deletion schema.xml
Expand Up @@ -437,7 +437,7 @@
<field name="linkedin" type="textgen" indexed="false" stored="true"/>
<field name="twitter" type="textgen" indexed="false" stored="true"/>
<field name="irc" type="textgen" indexed="true" stored="true"/>
<field name="picture" type="text" indexed="false" stored="true"/>
<field name="picture" type="text" indexed="true" stored="true"/>
<field name="email2" type="textgen" indexed="true" stored="true"/>
<field name="phone2" type="textgen" indexed="true" stored="true"/>
<field name="permissions" type="string" indexed="false" stored="true"/>
Expand Down
16 changes: 9 additions & 7 deletions src/main/java/gov/nysenate/opendirectory/models/Person.java
Expand Up @@ -14,6 +14,8 @@ public class Person {

public Person() {}


//VARIABLES NEED TO BE EXACT STRING MATCHES OF SOLR SCHEMA.XML
private TreeSet<String> credentials;
private HashMap<String,TreeSet<String>> permissions;

Expand All @@ -39,7 +41,7 @@ public Person() {}
private String twitter;
private String facebook;
private String linkedin;
private String IRC;
private String irc;

public String getFirstName() {
return firstName;
Expand Down Expand Up @@ -80,7 +82,7 @@ public TreeSet<String> getCredentials(){
public String getBio(){
return bio;
}
public String getPic(){
public String getPicture(){
return picture;
}
public String getLinkedin() {
Expand All @@ -104,8 +106,8 @@ public TreeSet<String> getInterests() {
public TreeSet<String> getSkills() {
return skills;
}
public String getIRC() {
return IRC;
public String getIrc() {
return irc;
}

public void setFirstName(String firstName) {
Expand Down Expand Up @@ -147,7 +149,7 @@ public void setCredentials (TreeSet<String> credentials){
public void setBio(String bio){
this.bio = bio;
}
public void setPic(String picture){
public void setPicture(String picture){
this.picture = picture;
}
public void setSkills(TreeSet<String> skills) {
Expand All @@ -171,8 +173,8 @@ public void setFacebook(String facebook) {
public void setLinkedin(String linkedin) {
this.linkedin = linkedin;
}
public void setIRC(String iRC) {
IRC = iRC;
public void setIrc(String IRC) {
this.irc = IRC;
}

public String toString() {
Expand Down
Expand Up @@ -62,6 +62,8 @@ public Person loadPerson(SolrDocument profile) {
String fieldname = (String)fields.item(c).getAttributes().item(1).getNodeValue();

if(fieldname.equals("user_credential") || fieldname.equals("skills") || fieldname.equals("interests")) {

//System.out.println(fieldname);
if(approved)
person.setCredentials(Credentials((String)profile.getFieldValue(fieldname)));
else
Expand Down
19 changes: 10 additions & 9 deletions src/main/java/gov/nysenate/opendirectory/solr/SolrSession.java
Expand Up @@ -101,15 +101,16 @@ private void addPerson(Person person) throws SolrServerException, IOException {
person.setPermissions(Person.getDefaultPermissions());
person.setCredentials(cred_default);

person.setBio("");
person.setEmail2("");
person.setPhone2("");
person.setTwitter("");
person.setFacebook("");
person.setLinkedin("");
person.setIRC("");
person.setBio(" ");
person.setEmail2(" ");
person.setPhone2(" ");
person.setTwitter(" ");
person.setFacebook(" ");
person.setLinkedin(" ");
person.setIrc(" ");
person.setSkills(null);
person.setInterests(null);
person.setPicture(" ");
}

String permissions = Permissions(person.getPermissions());
Expand Down Expand Up @@ -141,13 +142,13 @@ private void addPerson(Person person) throws SolrServerException, IOException {

//additional contact info
solr_person.addField("bio", person.getBio(), 1.0f);
solr_person.addField("picture", person.getPic(), 1.0f);
solr_person.addField("picture", person.getPicture(), 1.0f);
solr_person.addField("email2", person.getEmail2(), 1.0f);
solr_person.addField("phone2", person.getPhone2(), 1.0f);
solr_person.addField("twitter", person.getTwitter(), 1.0f);
solr_person.addField("facebook", person.getFacebook(), 1.0f);
solr_person.addField("linkedin", person.getLinkedin(), 1.0f);
solr_person.addField("irc", person.getIRC(), 1.0f);
solr_person.addField("irc", person.getIrc(), 1.0f);
solr_person.addField("skills", skills, 1.0f);
solr_person.addField("interests", interests,1.0f);

Expand Down

0 comments on commit 5c5ca5e

Please sign in to comment.