use of org.pentaho.platform.api.repository.IContentItem in project pentaho-platform by pentaho.
the class HttpServletRequestHandler method handleUIRequest.
public void handleUIRequest(final IUIComponent component, final String contentType) throws IOException {
IContentItem contentItem = getOutputHandler().getOutputContentItem(IOutputHandler.RESPONSE, IOutputHandler.CONTENT, getInstanceId(), null);
OutputStream outputStream = contentItem.getOutputStream(this.getActionPath());
((BaseUIComponent) component).setUrlFactory(urlFactory);
component.handleRequest(outputStream, this, contentType, getParameterProviders());
}
use of org.pentaho.platform.api.repository.IContentItem in project pentaho-platform by pentaho.
the class ApacheVFSOutputHandlerTest method getOutputContentItemTest.
@Test
public void getOutputContentItemTest() {
setupMockObjectsDefaults(CONTENT_NAME, true, true);
IContentItem contentItem = apacheVFSOutputHandler.getFileOutputContentItem();
assertNotNull(contentItem);
}
use of org.pentaho.platform.api.repository.IContentItem in project pentaho-platform by pentaho.
the class ApacheVFSOutputHandlerTest method getOutputContentFileNotWritableTest.
@Test
public void getOutputContentFileNotWritableTest() {
setupMockObjectsDefaults(CONTENT_NAME, false, true);
IContentItem contentItem = apacheVFSOutputHandler.getFileOutputContentItem();
assertNull(contentItem);
verify(apacheVFSOutputHandler).logError("Cannot write to virtal file: 1:filecontent");
}
use of org.pentaho.platform.api.repository.IContentItem in project pentaho-platform by pentaho.
the class XActionUtilTest method testDeleteContentItem_repoNoFile.
@Test
public void testDeleteContentItem_repoNoFile() throws Exception {
doReturn(null).when(repository).getFile(anyString());
IContentItem item = mock(RepositoryFileContentItem.class);
doReturn(mock(OutputStream.class)).when(item).getOutputStream(anyObject());
XactionUtil.deleteContentItem(item, repository);
verify(repository, times(0)).deleteFile(anyString(), anyBoolean(), anyString());
}
use of org.pentaho.platform.api.repository.IContentItem in project pentaho-platform by pentaho.
the class XActionUtilTest method testDeleteContentItem_repo.
@Test
public void testDeleteContentItem_repo() throws Exception {
IContentItem item = mock(RepositoryFileContentItem.class);
doReturn(mock(OutputStream.class)).when(item).getOutputStream(anyObject());
XactionUtil.deleteContentItem(item, repository);
verify(repository, times(1)).deleteFile(anyString(), anyBoolean(), anyString());
}
Aggregations