Skip to content

Commit

Permalink
Merge pull request #162 from khoa-nd/master
Browse files Browse the repository at this point in the history
Merged
  • Loading branch information
khoa-nd committed Feb 5, 2015
2 parents 1c7d9bb + 1fa418d commit 595655b
Show file tree
Hide file tree
Showing 48 changed files with 9,996 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public ViewResolver viewResolver() {

public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/bootcamp/**").addResourceLocations("/bootcamp/");
registry.addResourceHandler("/talentsearch/**").addResourceLocations("/rs/");

registry.addResourceHandler("/**").addResourceLocations(environment.getProperty("webapp.resource.location"))
.resourceChain(true)
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/com/techlooper/controller/UserController.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,17 @@ public void saveAll(@RequestBody List<UserImportData> users, HttpServletResponse
}
}

@ResponseBody
@RequestMapping(value = "/api/users/import", method = RequestMethod.POST)
public void importUser(@RequestBody List<UserImportData> users, HttpServletResponse httpServletResponse) {
if (!users.isEmpty()) {
httpServletResponse.setStatus(userService.importUserAll(users) > 0 ?
HttpServletResponse.SC_NO_CONTENT : HttpServletResponse.SC_NOT_ACCEPTABLE);
} else {
httpServletResponse.setStatus(HttpServletResponse.SC_NOT_ACCEPTABLE);
}
}

@ResponseBody
@RequestMapping(value = "/user/save", method = RequestMethod.POST)
public List<FieldError> save(@RequestBody @Valid UserInfo userInfo, BindingResult result, HttpServletResponse httpServletResponse) {
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/techlooper/service/UserService.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ public interface UserService {
int addCrawledUserAll(List<UserImportData> users);

UserImportEntity findUserImportByEmail(String email);

int importUserAll(List<UserImportData> users);
}
27 changes: 27 additions & 0 deletions src/main/java/com/techlooper/service/impl/UserServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,33 @@ public int addCrawledUserAll(List<UserImportData> users) {
return Lists.newArrayList(userImportRepository.save(shouldBeSavedUsers)).size();
}

public int importUserAll(List<UserImportData> users) {
List<UserImportEntity> shouldBeSavedUsers = new ArrayList<>();

for (UserImportData user : users) {
try {
if (StringUtils.isEmpty(user.getEmail())) {
user.setEmail(user.getUsername() + "@missing.com");
}
UserImportEntity userImportEntity = userImportRepository.findOne(user.getEmail());
if (userImportEntity == null) {
userImportEntity = dozerMapper.map(user, UserImportEntity.class);
userImportEntity.withProfile(user.getCrawlerSource(), user);
userImportEntity.setCrawled(true);
shouldBeSavedUsers.add(userImportEntity);
}
} catch (Exception ex) {
LOGGER.error("User Import Fail : " + user.getUsername(), ex);
}
}

if (shouldBeSavedUsers.size() > 0) {
return Lists.newArrayList(userImportRepository.save(shouldBeSavedUsers)).size();
}

return 0;
}

public UserImportEntity findUserImportByEmail(String email) {
UserImportEntity userImportEntity = userImportRepository.findOne(email);

Expand Down
264 changes: 264 additions & 0 deletions src/main/webapp/assets/css/bubble.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,264 @@
.bubble-chart-container {
min-height: 380;
}

#box {
position: relative;
}
#box .circle {
cursor: pointer;
text-align: center;
width: 1000px;
height: 1000px;
position: absolute;
}
#box .active {
width: 340px;
height: 340px;
cursor: pointer;
z-index: 0 !important;
}
#box .circle span {
width: 125px;
font-size: 18px;
position: relative;
color: #efefef;
text-transform: capitalize;
}
#box .circle strong {
display: block;
clear: both;
font-weight: 400;
}
#box #pmTech span {
top: -68%;
}
#box .circle .circle-content {
background: red;
border-radius: 50%;
width: 150px;
height: 150px;
}
#box .circle .redColor {
background: red;
}
#box .circle .blueColor {
background: #106da4;
}
#box .circle .yellowColor {
background: #d7c500;
}
#box .circle .pinkColor {
background: #cc21a0;
}
#box .circle .greenColor {
background: #11a06c;
}
#box .circle .orangeColor {
background: #d26e03;
}
#box .circle .lightSalmonColor {
background: lightsalmon;
}
#box .circle .indigoColor {
background: indigo;
}
#box .circle .oliveColor {
background: olive;
}
#box .circle .saddleBrownColor {
background: saddlebrown;
}
#box .textSize1 {
width: 50px;
height: 50px;
}
#box .textSize1 .circle-content {
width: 50px;
height: 50px;
}
#box .textSize1 span {
font-size: 10px;
line-height: 5px;
top: 30px !important;
width: 50px;
}
#box .textSize1 strong {
font-size: 12px;
}
#box .textSize2 {
width: 75px;
height: 75px;
}
#box .textSize2 .circle-content {
width: 75px;
height: 75px;
}
#box .textSize2 span {
font-size: 15px;
line-height: 16px;
top: 30px !important;
width: 75px;
}
#box .textSize2 strong {
font-size: 20px;
}
#box .textSize3 {
width: 100px;
height: 100px;
}
#box .textSize3 .circle-content {
width: 100px;
height: 100px;
}
#box .textSize3 span {
font-size: 18px;
line-height: 22px;
top: 45px !important;
width: 100px;
}
#box .textSize3 strong {
font-size: 25px;
}
#box .textSize4 {
width: 125px;
height: 125px;
}
#box .textSize4 .circle-content {
width: 125px;
height: 125px;
}
#box .textSize4 span {
top: 50px !important;
width: 125px;
}
#box .textSize5 {
width: 175px;
height: 175px;
}
#box .textSize5 .circle-content {
width: 175px;
height: 175px;
}
#box .textSize5 span {
top: 60px !important;
width: 175px;
}
#box .textSize6 {
width: 200px;
height: 200px;
}
#box .textSize6 .circle-content {
width: 200px;
height: 200px;
}
#box .intro {
display: none;
width: 250px;
color: #727272;
position: absolute;
bottom: 100px;
left: 35px;
line-height: 15px;
}
#box .circle-content p {
font-size: 12px;
display: none;
position: absolute;
text-align: center;
color: #efefef;
left: 0;
right: 0;
width: 0;
}
#box .circle-content i {
display: none;
}
#box .active span {
font-size: 35px;
line-height: 40px;
top: 120px !important;
text-align: center;
width: 320px;
}
#box .active strong {
font-size: 45px;
}
#box .active i {
font-size: 12px;
display: block;
clear: both;
}
#box .active p {
display: block;
top: 270px;
}

.bubble-chart-error {
display: none;
width: 300px;
color: red;
margin: auto;
}

.small {
z-index: 5 !important;
}

.ball-highlight {
border: 5px solid rgba(255, 255, 255, 0.9);
opacity: 1;
border-top: 5px solid rgba(0, 0, 0, 0);
border-left: 5px solid rgba(0, 0, 0, 0);
border-right: 5px solid rgba(0, 0, 0, 0);
border-radius: 50%;
width: 100px;
height: 100px;
margin: 0 auto;
-moz-animation: spin 3s infinite linear;
-webkit-animation: spin 3s infinite linear;
display: none;
position: absolute;
left: 0;
top: 0;
}

@-moz-keyframes spin {
0% {
-moz-transform: rotate(0deg);
}

100% {
-moz-transform: rotate(360deg);
}
}

@-moz-keyframes spinoff {
0% {
-moz-transform: rotate(0deg);
}

100% {
-moz-transform: rotate(-360deg);
}
}

@-webkit-keyframes spin {
0% {
-webkit-transform: rotate(0deg);
}

100% {
-webkit-transform: rotate(360deg);
}
}

@-webkit-keyframes spinoff {
0% {
-webkit-transform: rotate(0deg);
}

100% {
-webkit-transform: rotate(-360deg);
}
}
Loading

0 comments on commit 595655b

Please sign in to comment.