-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make it possible for users to view their data on Panorama Public (#387)
Add a "My Data" view for datasets submitted to Panorama Public.
- Loading branch information
Showing
12 changed files
with
482 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
panoramapublic/src/org/labkey/panoramapublic/query/MyDataTableInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package org.labkey.panoramapublic.query; | ||
|
||
import org.labkey.api.data.CompareType; | ||
import org.labkey.api.data.ContainerFilter; | ||
import org.labkey.api.data.SimpleFilter; | ||
import org.labkey.api.query.FieldKey; | ||
import org.labkey.api.security.User; | ||
import org.labkey.panoramapublic.PanoramaPublicSchema; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class MyDataTableInfo extends ExperimentAnnotationsTableInfo | ||
{ | ||
public static final String NAME = "MyPanoramaPublicData"; | ||
|
||
public MyDataTableInfo(PanoramaPublicSchema schema, ContainerFilter cf, User user) | ||
{ | ||
super(schema, cf); | ||
|
||
if (user != null) | ||
{ | ||
// Filter to rows where the given user is either the submitter or the lab head. | ||
SimpleFilter.OrClause or = new SimpleFilter.OrClause(); | ||
or.addClause(new CompareType.EqualsCompareClause(FieldKey.fromParts("submitter"), CompareType.EQUAL, user.getUserId())); | ||
or.addClause(new CompareType.EqualsCompareClause(FieldKey.fromParts("labhead"), CompareType.EQUAL, user.getUserId())); | ||
SimpleFilter filter = new SimpleFilter(); | ||
filter.addClause(or); | ||
addCondition(filter); | ||
} | ||
|
||
List<FieldKey> visibleColumns = new ArrayList<>(); | ||
visibleColumns.add(FieldKey.fromParts("Share")); | ||
visibleColumns.add(FieldKey.fromParts("Title")); | ||
visibleColumns.add(FieldKey.fromParts("Organism")); | ||
visibleColumns.add(FieldKey.fromParts("Instrument")); | ||
visibleColumns.add(FieldKey.fromParts("Runs")); | ||
visibleColumns.add(FieldKey.fromParts("Keywords")); | ||
visibleColumns.add(FieldKey.fromParts("Citation")); | ||
visibleColumns.add(FieldKey.fromParts("pxid")); | ||
visibleColumns.add(FieldKey.fromParts("Public")); | ||
visibleColumns.add(FieldKey.fromParts("CatalogEntry")); | ||
setDefaultVisibleColumns(visibleColumns); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.