Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
a2cbb6f3
Commit
a2cbb6f3
authored
9 years ago
by
gakin
Browse files
Options
Downloads
Patches
Plain Diff
SSDM-1825 CORE: Warning on deleting samples with children - file missing from previous commit
SVN: 33984
parent
09a9f10e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewer.java
+64
-13
64 additions, 13 deletions
...nt/web/client/application/sample/GenericSampleViewer.java
with
64 additions
and
13 deletions
openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewer.java
+
64
−
13
View file @
a2cbb6f3
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
package
ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.sample
;
package
ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.sample
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.LinkedHashMap
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -56,6 +57,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDele
...
@@ -56,6 +57,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDele
import
ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider
;
import
ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider
;
import
ch.systemsx.cisd.openbis.generic.client.web.client.dto.GridRowModels
;
import
ch.systemsx.cisd.openbis.generic.client.web.client.dto.GridRowModels
;
import
ch.systemsx.cisd.openbis.generic.client.web.client.dto.ListSampleDisplayCriteria2
;
import
ch.systemsx.cisd.openbis.generic.client.web.client.dto.ListSampleDisplayCriteria2
;
import
ch.systemsx.cisd.openbis.generic.client.web.client.dto.SampleChildrenInfo
;
import
ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet
;
import
ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet
;
import
ch.systemsx.cisd.openbis.generic.shared.basic.GridRowModel
;
import
ch.systemsx.cisd.openbis.generic.shared.basic.GridRowModel
;
import
ch.systemsx.cisd.openbis.generic.shared.basic.IIdAndCodeHolder
;
import
ch.systemsx.cisd.openbis.generic.shared.basic.IIdAndCodeHolder
;
...
@@ -107,6 +109,8 @@ abstract public class GenericSampleViewer extends AbstractViewerWithVerticalSpli
...
@@ -107,6 +109,8 @@ abstract public class GenericSampleViewer extends AbstractViewerWithVerticalSpli
private
PropertyGrid
propertyGrid
;
private
PropertyGrid
propertyGrid
;
private
SectionsPanel
rightPanel
;
private
SectionsPanel
rightPanel
;
private
StringBuffer
additionalMessage
;
public
static
DatabaseModificationAwareComponent
create
(
public
static
DatabaseModificationAwareComponent
create
(
final
IViewContext
<
IGenericClientServiceAsync
>
creationViewContext
,
final
IViewContext
<
IGenericClientServiceAsync
>
creationViewContext
,
...
@@ -165,20 +169,67 @@ abstract public class GenericSampleViewer extends AbstractViewerWithVerticalSpli
...
@@ -165,20 +169,67 @@ abstract public class GenericSampleViewer extends AbstractViewerWithVerticalSpli
return
;
return
;
}
}
addToolBarButton
(
createDeleteButton
(
new
IDelegatedAction
()
addToolBarButton
(
createDeleteButton
(
new
IDelegatedAction
()
{
@Override
@SuppressWarnings
(
{
"unchecked"
,
"rawtypes"
})
public
void
execute
()
{
{
@Override
final
AsyncCallback
<
Void
>
callback
=
@SuppressWarnings
(
isTrashEnabled
()
?
createDeletionCallback
()
{
"unchecked"
,
"rawtypes"
})
:
createPermanentDeletionCallback
();
public
void
execute
()
additionalMessage
=
new
StringBuffer
();
{
final
AsyncCallback
<
Void
>
callback
=
//we need info for just 1 sample/
isTrashEnabled
()
?
createDeletionCallback
()
List
<
TechId
>
sampleIds
=
new
ArrayList
<
TechId
>(
Arrays
.
asList
(
TechId
.
create
(
getOriginalData
())));
:
createPermanentDeletionCallback
();
// new ArrayList<TechId>();
new
SampleListDeletionConfirmationDialog
(
getViewContext
()
// sampleIds.add(TechId.create(getOriginalData()));
.
getCommonViewContext
(),
getOriginalDataAsSingleton
(),
callback
,
getOriginalData
()).
show
();
viewContext
.
getCommonService
().
getSampleChildrenInfo
(
sampleIds
,
true
,
}
new
AbstractAsyncCallback
<
List
<
SampleChildrenInfo
>>(
viewContext
)
}));
{
@Override
protected
void
process
(
List
<
SampleChildrenInfo
>
info
)
{
final
int
MAX_INFO_SIZE
=
10
;
SampleChildrenInfo
sampleInfo
=
info
.
get
(
0
);
StringBuffer
sampleSb
=
new
StringBuffer
();
StringBuffer
dataSetSb
=
new
StringBuffer
();
for
(
String
child
:
sampleInfo
.
getDerivedSamples
())
{
sampleSb
.
append
(
child
+
"<br>"
);
}
for
(
String
ds
:
sampleInfo
.
getDataSets
())
{
dataSetSb
.
append
(
ds
+
"<br>"
);
}
if
(
sampleSb
.
length
()
>
0
||
dataSetSb
.
length
()
>
0
)
{
additionalMessage
.
append
(
"<br>Sample "
+
getOriginalData
().
getIdentifier
()
+
" has the following:"
);
}
if
(
sampleSb
.
length
()
>
0
)
{
additionalMessage
.
append
(
"<br><br>Derived Samples:<br>"
);
additionalMessage
.
append
(
sampleSb
);
if
(
sampleInfo
.
getChildCount
()
>
MAX_INFO_SIZE
)
additionalMessage
.
append
(
"<br> and "
+
(
sampleInfo
.
getChildCount
()-
MAX_INFO_SIZE
)
+
" more"
);
}
if
(
dataSetSb
.
length
()
>
0
)
{
additionalMessage
.
append
(
"<br>Data Sets:<br>"
);
additionalMessage
.
append
(
dataSetSb
);
if
(
sampleInfo
.
getDataSetCount
()
>
MAX_INFO_SIZE
)
additionalMessage
.
append
(
"<br> and "
+
(
sampleInfo
.
getDataSetCount
()-
MAX_INFO_SIZE
)
+
" more"
);
}
if
(
sampleSb
.
length
()
>
0
||
dataSetSb
.
length
()
>
0
)
{
additionalMessage
.
append
(
"<br>"
);
}
new
SampleListDeletionConfirmationDialog
(
getViewContext
()
.
getCommonViewContext
(),
getOriginalDataAsSingleton
(),
callback
,
getOriginalData
(),
additionalMessage
.
toString
()).
show
();
}
});
}
}));
addToolBarButton
(
createRevertDeletionButton
(
new
IDelegatedAction
()
addToolBarButton
(
createRevertDeletionButton
(
new
IDelegatedAction
()
{
{
@Override
@Override
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment