-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#27 collection/File template & icon to display
- Loading branch information
Hetal Patel
committed
Jan 19, 2018
1 parent
470f9a2
commit 4c841cb
Showing
5 changed files
with
200 additions
and
50 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
src/emc-metalnx-services/src/main/java/com/emc/metalnx/services/interfaces/IconService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.emc.metalnx.services.interfaces; | ||
|
||
public interface IconService { | ||
|
||
String getIconToDisplayFile(String mimeType); | ||
String getIconToDisplayCollection(); | ||
|
||
} |
45 changes: 45 additions & 0 deletions
45
src/emc-metalnx-services/src/main/java/com/emc/metalnx/services/irods/IconServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package com.emc.metalnx.services.irods; | ||
|
||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
import com.emc.metalnx.services.interfaces.IconService; | ||
|
||
@Service | ||
@Transactional | ||
public class IconServiceImpl implements IconService { | ||
|
||
@Override | ||
public String getIconToDisplayFile(String mimeType) { | ||
|
||
String icon = ""; | ||
|
||
switch (mimeType) { | ||
|
||
case "application/pdf": | ||
icon = "fa fa-file-pdf-o"; | ||
break; | ||
|
||
case "image/jpg": | ||
case "image/jpeg": | ||
case "image/png": | ||
case "image/gif": | ||
icon = "fa fa-file-image-o"; | ||
break; | ||
|
||
default: | ||
icon = "fa fa-file"; | ||
break; | ||
} | ||
|
||
return icon; | ||
|
||
} | ||
|
||
@Override | ||
public String getIconToDisplayCollection() { | ||
// TODO Auto-generated method stub | ||
return "fa fa-folder"; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters