Class ExhibitService
- java.lang.Object
-
- cz.zcu.students.cacha.bp_server.services.ExhibitService
-
@Service public class ExhibitService extends Object
Class represent service which is responsible for exhibits operations
-
-
Constructor Summary
Constructors Constructor Description ExhibitService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deleteExhibit(Exhibit exhibit)
Deletes given exhibit from db and its images from fsvoid
deleteExhibit(Long exhibitId, User user)
Deletes exhibit if is managed by given userList<ExhibitVM>
getAllExhibitsOfUsersInstitution(User user)
Gets all the exhibits of user's institutionExhibitVM
getExhibit(Long exhibitId, User user)
Gets an exhibit defined by its id if is managed by given userString
getExhibitQRCode(Long exhibitId, User user)
Gets base64 encoded QR code for given exhibitExhibitsLanguagesVM
getExhibitsApproveTranslations(User user)
Gets exhibits and allowed languages of user's institutionList<ExhibitVM>
getExhibitsOfInstitution(Long institutionId)
Gets all exhibits of given institutionExhibitsLanguagesVM
getExhibitsTranslate(Long institutionId)
Gets exhibits and allowed languages of an institution defined by its idvoid
saveExhibit(Exhibit exhibit, User user)
Saves new exhibit to user's institutionvoid
saveExhibit(Exhibit exhibit, Long institutionId)
Saves new exhibit to institution defined by its idvoid
updateExhibit(Long exhibitId, UpdateExhibitVM updateExhibitVM, User user)
Updates exhibit informationString
updateExhibitImage(Long exhibitId, ImageVM imageVM, User user)
Updates exhibit image and returns its new nameString
updateExhibitInfoLabel(Long exhibitId, ImageVM imageVM, User user)
Updates exhibit info label image and returns its new name
-
-
-
Method Detail
-
getExhibitsOfInstitution
public List<ExhibitVM> getExhibitsOfInstitution(Long institutionId)
Gets all exhibits of given institution- Parameters:
institutionId
- institution id- Returns:
- all exhibits of given institution
-
deleteExhibit
public void deleteExhibit(Long exhibitId, User user)
Deletes exhibit if is managed by given user- Parameters:
exhibitId
- exhibit iduser
- user
-
deleteExhibit
public void deleteExhibit(Exhibit exhibit)
Deletes given exhibit from db and its images from fs- Parameters:
exhibit
- exhibit
-
saveExhibit
public void saveExhibit(Exhibit exhibit, User user)
Saves new exhibit to user's institution- Parameters:
exhibit
- new exhibituser
- owner of an institution
-
saveExhibit
public void saveExhibit(Exhibit exhibit, Long institutionId)
Saves new exhibit to institution defined by its id- Parameters:
exhibit
- new exhibitinstitutionId
- id of institution managing exhibit
-
updateExhibitImage
public String updateExhibitImage(Long exhibitId, ImageVM imageVM, User user)
Updates exhibit image and returns its new name- Parameters:
exhibitId
- updated exhibit idimageVM
- encoded imageuser
- manager of given exhibit- Returns:
- new image name
-
updateExhibitInfoLabel
public String updateExhibitInfoLabel(Long exhibitId, ImageVM imageVM, User user)
Updates exhibit info label image and returns its new name- Parameters:
exhibitId
- updated exhibit idimageVM
- encoded info label imageuser
- manager of given exhibit- Returns:
- new info label name
-
updateExhibit
public void updateExhibit(Long exhibitId, UpdateExhibitVM updateExhibitVM, User user)
Updates exhibit information- Parameters:
exhibitId
- updated exhibit idupdateExhibitVM
- updated informationuser
- manager of given exhibit
-
getAllExhibitsOfUsersInstitution
public List<ExhibitVM> getAllExhibitsOfUsersInstitution(User user)
Gets all the exhibits of user's institution- Parameters:
user
- owner of an institution- Returns:
- all exhibits of user's institution
-
getExhibitsApproveTranslations
public ExhibitsLanguagesVM getExhibitsApproveTranslations(User user)
Gets exhibits and allowed languages of user's institution- Parameters:
user
- owner of institution- Returns:
- exhibits and allowed language
-
getExhibit
public ExhibitVM getExhibit(Long exhibitId, User user)
Gets an exhibit defined by its id if is managed by given user- Parameters:
exhibitId
- exhibit iduser
- manager of exhibit- Returns:
- exhibit
-
getExhibitQRCode
public String getExhibitQRCode(Long exhibitId, User user)
Gets base64 encoded QR code for given exhibit- Parameters:
exhibitId
- exhibit iduser
- institution manager- Returns:
- base64 encoded QR code
-
getExhibitsTranslate
public ExhibitsLanguagesVM getExhibitsTranslate(Long institutionId)
Gets exhibits and allowed languages of an institution defined by its id- Parameters:
institutionId
- institution id- Returns:
- exhibits and allowed language
-
-