Skip to content

Commit

Permalink
feat: Edit an image - MEED-2043 - Meeds-io/MIPs#53 (#2698)
Browse files Browse the repository at this point in the history
This change allow to edit a new uploaded or attached image (add crop drawer and alternative text)
  • Loading branch information
SaraBoutej authored Aug 11, 2023
1 parent 4817307 commit 3ebf0cd
Show file tree
Hide file tree
Showing 23 changed files with 504 additions and 113 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* This file is part of the Meeds project (https://meeds.io/).
*
* Copyright (C) 2023 Meeds Association [email protected]
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

package org.exoplatform.social.attachment.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class FileAttachmentObject implements Cloneable {

private String id;

private String uploadId;

private String altText;

@Override
public FileAttachmentObject clone() { // NOSONAR
return new FileAttachmentObject(id, uploadId, altText);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@
@AllArgsConstructor
public class FileAttachmentResourceList implements Cloneable {

private List<String> uploadIds;
private List<FileAttachmentObject> uploadedFiles;

private List<String> fileIds;
private List<FileAttachmentObject> attachedFiles;

private long userIdentityId;
private long userIdentityId;

private String objectType;
private String objectType;

private String objectId;
private String objectId;

private String parentObjectId;
private String parentObjectId;

@Override
public FileAttachmentResourceList clone() { // NOSONAR
return new FileAttachmentResourceList(uploadIds, fileIds, userIdentityId, objectType, objectId, parentObjectId);
return new FileAttachmentResourceList(uploadedFiles, attachedFiles, userIdentityId, objectType, objectId, parentObjectId);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ public class ObjectAttachmentDetail implements Cloneable {

private String updater;

private String altText;

@Override
public ObjectAttachmentDetail clone() { // NOSONAR
return new ObjectAttachmentDetail(id, name, mimetype, size, updated, updater);
return new ObjectAttachmentDetail(id, name, mimetype, size, updated, updater, altText);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* This file is part of the Meeds project (https://meeds.io/).
*
* Copyright (C) 2023 Meeds Association [email protected]
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

package org.exoplatform.social.attachment.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.exoplatform.upload.UploadResource;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class UploadedAttachmentDetail implements Cloneable {

private String id;

private UploadResource uploadedResource;

private String altText;

@Override
public UploadedAttachmentDetail clone() { // NOSONAR
return new UploadedAttachmentDetail(id, uploadedResource, altText);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,14 @@ MetadataItem createMetadataItem(MetadataObject metadataObject,
MetadataKey metadataKey,
Map<String, String> properties) throws ObjectAlreadyExistsException;

/**
* @param metadataItem {@link MetadataItem}
* @param userIdentityId {@link Identity} technical identifier designating the
* user making the operation
* @return Deleted {@link MetadataItem}
*/
MetadataItem updateMetadataItem(MetadataItem metadataItem, long userIdentityId);

/**
* @param itemId {@link MetadataItem} technical identifier
* @param userIdentityId {@link Identity} technical identifier
Expand Down
Loading

0 comments on commit 3ebf0cd

Please sign in to comment.