Skip to content

Commit

Permalink
fix: string array can not be saved to alfresco, instead use string list
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Rudolph committed Nov 7, 2024
1 parent a234729 commit 606f552
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ private static HashMap<String, Serializable> profileToMap(UserProfileEdit profil
newUserInfo.put(CCConstants.PROP_USER_LASTNAME, profile.getLastName());
newUserInfo.put(CCConstants.PROP_USER_EMAIL, profile.getEmail());
newUserInfo.put(CCConstants.CM_PROP_PERSON_ABOUT, profile.getAbout());
newUserInfo.put(CCConstants.CM_PROP_PERSON_SKILLS, profile.getSkills());
newUserInfo.put(CCConstants.CM_PROP_PERSON_SKILLS, new ArrayList(Arrays.asList(profile.getSkills())));
newUserInfo.put(CCConstants.CM_PROP_PERSON_VCARD, profile.getVCard());
if(AuthorityServiceFactory.getLocalService().isGlobalAdmin()) {
newUserInfo.put(CCConstants.CM_PROP_PERSON_EDU_SCHOOL_PRIMARY_AFFILIATION, profile.getPrimaryAffiliation());
Expand Down Expand Up @@ -573,7 +573,11 @@ public String getPrimaryAffiliation() {
}

public String[] getSkills() {
return (String[])this.userInfo.get(CCConstants.CM_PROP_PERSON_SKILLS);
List<String> skills = (List<String>)this.userInfo.get(CCConstants.CM_PROP_PERSON_SKILLS);
if(skills != null){
return skills.toArray(new String[0]);
}
return null;
}
public String getHomeFolder() {
if(this.homeFolderId == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ public String getAbout() {
public void setAbout(String about) {
this.about = about;
}
@JsonProperty

@JsonProperty
@Schema(description = "",nullable = true)
public String[] getSkills() {
return skills;
}
Expand Down
6 changes: 6 additions & 0 deletions Backend/services/rest/api/src/main/resources/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -6067,8 +6067,10 @@
},
"skills": {
"items": {
"nullable": true,
"type": "string"
},
"nullable": true,
"type": "array"
},
"type": {
Expand Down Expand Up @@ -6121,8 +6123,10 @@
},
"skills": {
"items": {
"nullable": true,
"type": "string"
},
"nullable": true,
"type": "array"
},
"type": {
Expand Down Expand Up @@ -6170,8 +6174,10 @@
},
"skills": {
"items": {
"nullable": true,
"type": "string"
},
"nullable": true,
"type": "array"
},
"type": {
Expand Down

0 comments on commit 606f552

Please sign in to comment.