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

Commit

Permalink
changing edit profile to suggest skill and interest tags, modified se…
Browse files Browse the repository at this point in the history
…rialutils to change spaces to hyphens, url mapper to replace %20 to ' '
  • Loading branch information
Jared Williams committed Jan 3, 2011
1 parent 3c0fef6 commit 23ef910
Show file tree
Hide file tree
Showing 7 changed files with 294 additions and 88 deletions.
Expand Up @@ -47,8 +47,8 @@ public void doGet(HttpServletRequest request, HttpServletResponse response) thro
reindexAll(self);
out.println("Reindexed all ldap values");
}
else if (command.equals("resetPermissions")){
resetPermissions(self);
else if (command.equals("rewritePeople")){
rewritePeople(self);
out.println("Reset all permissions");

}
Expand Down Expand Up @@ -76,15 +76,15 @@ else if(command.equals("resetFrontPage")) {
}
}

public void resetPermissions(Request self) throws NamingException, SolrServerException, IOException {
public void rewritePeople(Request self) throws NamingException, SolrServerException, IOException {
Solr solr = new Solr().connect();
SolrSession session = new SolrSession(Person.getAdmin(),solr);
Collection<Person> people = session.loadPeople();
ArrayList<Person> toAdd = new ArrayList<Person>();
for(Person ldapPerson: people) {

ldapPerson.setPermissions(ldapPerson.getPermissions());
ldapPerson.setCredentials(null);
// ldapPerson.setPermissions(ldapPerson.getPermissions());
// ldapPerson.setCredentials(null);
toAdd.add(ldapPerson);

}
Expand Down
Expand Up @@ -20,7 +20,7 @@ public static void main(String[] args) {
public static TreeSet<String> loadStringSet(String str, String delim) {
if(str==null || str.isEmpty())
return new TreeSet<String>();
return new TreeSet<String>(Arrays.asList(str.split(delim)));
return new TreeSet<String>(Arrays.asList(str.replaceAll("-"," ").split(delim)));
}

public static TreeSet<Person> loadBookmarks(String str,Person person, SolrSession session) {
Expand Down Expand Up @@ -49,7 +49,7 @@ public static String writeStringSet(TreeSet<String> set, String delim) {

String str = "";
for(String s : set)
str += s+delim;
str += s.replaceAll(" ", "-")+delim;

return str.substring(0,str.length()-delim.length());
}
Expand Down
Expand Up @@ -61,7 +61,7 @@ public String getCommand(String url) {
}

public Vector<String> getArgs(HttpServletRequest request) {
return getArgs(request.getRequestURI());
return getArgs(request.getRequestURI().replaceAll("%20", " "));
}

public Vector<String> getArgs(String url) {
Expand Down
55 changes: 54 additions & 1 deletion src/main/webapp/css/application.css
Expand Up @@ -205,7 +205,6 @@ body {
margin:0px;
border-bottom:1px solid #ccc;
border-top:1px solid #ccc;

}
.quickresult_box {
margin-top:0px;
Expand Down Expand Up @@ -250,6 +249,16 @@ body {
float: right;
}

.edit_left {
width: 50%;
float: left;
}

.edit_right {
width: 50%;
float: right;
}

#main_left div {
margin-left: 20px;
margin-top: 20px;
Expand Down Expand Up @@ -553,6 +562,10 @@ body {
margin-bottom:1px;
}

#edit_form_field input {
width: 142px;
}

#edit_container {
width:500px;
padding:6px;
Expand Down Expand Up @@ -631,4 +644,44 @@ a.sublink:hover
.about {
margin-left:-70px;
white-space: pre-wrap;
}

.suggestions {
width:220px;
position:absolute;
border-left:solid 1px;
border-right:solid 1px;
background:#fff;
color:#777;
line-height:14px;
font-size:10pt;
overflow:hidden;
visibility:hidden;
}

#skills_suggestions {

}

#interests_suggestions {
margin-left:243px;
}

.suggestions ul, .suggestions li {
list-style-type:none;
margin:0px;
border-bottom:1px solid;
border-top:1px solid;
}
.suggestions_box {
margin-top:0px;
padding:4px;
font-size:12px;
}
.suggestions_box:hover {
background:#FFFFCC;
}

#selected_suggestion {
background:#FFFFCC;
}

0 comments on commit 23ef910

Please sign in to comment.