New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sending the full container path to the UI #17950
Sending the full container path to the UI #17950
Conversation
final ContainerLoader containerLoader = new ContainerLoader(); | ||
|
||
final VelocityResourceKey velocityResourceKey = new VelocityResourceKey(fileAssetContainer, PageMode.EDIT_MODE); | ||
final InputStream inputStream = containerLoader.writeObject(velocityResourceKey); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import com.dotcms.datagen.SiteDataGen; | ||
import com.dotmarketing.beans.Host; | ||
import com.dotmarketing.business.APILocator; | ||
import com.dotmarketing.portlets.ContentletBaseTest; | ||
import com.dotmarketing.portlets.containers.model.Container; | ||
import com.dotmarketing.portlets.containers.model.FileAssetContainer; | ||
import com.dotmarketing.portlets.folders.model.Folder; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
import java.util.Optional; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue found: Avoid unused imports such as 'java.util.Optional'
import com.dotmarketing.portlets.containers.model.Container; | ||
import com.dotmarketing.portlets.containers.model.FileAssetContainer; | ||
import com.dotmarketing.portlets.folders.model.Folder; | ||
import com.dotmarketing.util.Constants; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import com.dotmarketing.portlets.containers.model.FileAssetContainer; | ||
import com.dotmarketing.portlets.folders.model.Folder; | ||
import com.dotmarketing.util.Constants; | ||
import com.dotmarketing.util.HostUtil; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -1,14 +1,49 @@ | |||
package com.dotmarketing.portlets.containers.business; | |||
|
|||
import com.dotcms.datagen.ContainerAsFileDataGen; | |||
import com.dotcms.datagen.FolderDataGen; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import com.dotcms.datagen.SiteDataGen; | ||
import com.dotmarketing.beans.Host; | ||
import com.dotmarketing.business.APILocator; | ||
import com.dotmarketing.portlets.ContentletBaseTest; | ||
import com.dotmarketing.portlets.containers.model.Container; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...MS/src/integration-test/java/com/dotcms/rendering/velocity/services/ContainerLoaderTest.java
Show resolved
Hide resolved
import com.dotmarketing.business.APILocator; | ||
import com.dotmarketing.exception.DotDataException; | ||
import com.dotmarketing.exception.DotSecurityException; | ||
import com.dotmarketing.portlets.containers.model.Container; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import java.io.InputStream; | ||
import java.nio.charset.StandardCharsets; | ||
|
||
import static org.junit.Assert.assertEquals; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Should: return a div with the File Comntainer's id | ||
*/ | ||
@Test | ||
public void aaa() throws DotDataException, DotSecurityException, IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please rename this test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final ContainerLoader containerLoader = new ContainerLoader(); | ||
|
||
final VelocityResourceKey velocityResourceKey = new VelocityResourceKey(fileAssetContainer, PageMode.EDIT_MODE); | ||
final InputStream inputStream = containerLoader.writeObject(velocityResourceKey); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this InputStream should be closed in a finally statement or in a try with resources
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Sending the full container path to the UI * codacy refactoring * renaming test method and close resource correctly
This reverts commit 655f786.
The Multi tree was saved with the default host container id and not with the container's id in the new site, so now it is send the container full path to the UI, then it is send back by the UI when a Multi tree is saved