Skip to content

Commit 7c1189f

Browse files
authored
Add and populate core.Documents.ParentType column (#587)
1 parent 60efaa5 commit 7c1189f

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

panoramapublic/src/org/labkey/panoramapublic/PanoramaPublicModule.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ protected void init()
106106
{
107107
addController(PanoramaPublicController.NAME, PanoramaPublicController.class);
108108
PanoramaPublicSchema.register(this);
109-
AttachmentService.get().registerAttachmentType(CatalogImageAttachmentType.get());
110-
AttachmentService.get().registerAttachmentType(PanoramaPublicLogoResourceType.get());
109+
AttachmentService.get().registerAttachmentParentType(CatalogImageAttachmentType.get());
110+
AttachmentService.get().registerAttachmentParentType(PanoramaPublicLogoResourceType.get());
111111
}
112112

113113
@Override

panoramapublic/src/org/labkey/panoramapublic/bluesky/PanoramaPublicLogoAttachmentParent.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import org.jetbrains.annotations.NotNull;
44
import org.jetbrains.annotations.Nullable;
5-
import org.labkey.api.attachments.AttachmentType;
5+
import org.labkey.api.attachments.AttachmentParentType;
66
import org.labkey.api.data.Container;
77
import org.labkey.api.data.ContainerManager;
88
import org.labkey.panoramapublic.model.Journal;
@@ -29,7 +29,7 @@ public static PanoramaPublicLogoAttachmentParent get()
2929
}
3030

3131
@Override
32-
public @NotNull AttachmentType getAttachmentType()
32+
public @NotNull AttachmentParentType getAttachmentParentType()
3333
{
3434
return PanoramaPublicLogoResourceType.get();
3535
}
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package org.labkey.panoramapublic.bluesky;
22

33
import org.jetbrains.annotations.NotNull;
4-
import org.labkey.api.attachments.AttachmentType;
4+
import org.labkey.api.attachments.AttachmentParentType;
55
import org.labkey.api.data.CoreSchema;
66
import org.labkey.api.data.SQLFragment;
77

8-
public class PanoramaPublicLogoResourceType implements AttachmentType
8+
public class PanoramaPublicLogoResourceType implements AttachmentParentType
99
{
1010
private static final PanoramaPublicLogoResourceType INSTANCE = new PanoramaPublicLogoResourceType();
1111

@@ -21,17 +21,17 @@ private PanoramaPublicLogoResourceType()
2121
@Override
2222
public @NotNull String getUniqueName()
2323
{
24-
return getClass().getName();
24+
return "PanoramaPublicLogoResource";
2525
}
2626

2727
@Override
2828
public void addWhereSql(SQLFragment sql, String parentColumn, String documentNameColumn)
2929
{
3030
sql.append(parentColumn).append(" IN (SELECT EntityId FROM ")
31-
.append(CoreSchema.getInstance().getTableInfoContainers(), "c").append(")")
32-
.append(" AND (")
33-
.append(documentNameColumn).append(" LIKE ")
34-
.appendStringLiteral(PanoramaPublicLogoManager.LOGO_FILE_PREFIX + "%", CoreSchema.getInstance().getSqlDialect())
35-
.append(") ");
31+
.append(CoreSchema.getInstance().getTableInfoContainers(), "c").append(")")
32+
.append(" AND (")
33+
.append(documentNameColumn).append(" LIKE ")
34+
.appendStringLiteral(PanoramaPublicLogoManager.LOGO_FILE_PREFIX + "%", CoreSchema.getInstance().getSqlDialect())
35+
.append(") ");
3636
}
3737
}

panoramapublic/src/org/labkey/panoramapublic/catalog/CatalogImageAttachmentParent.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import org.jetbrains.annotations.NotNull;
44
import org.labkey.api.attachments.AttachmentParent;
5-
import org.labkey.api.attachments.AttachmentType;
5+
import org.labkey.api.attachments.AttachmentParentType;
66
import org.labkey.api.data.Container;
77
import org.labkey.api.view.ShortURLRecord;
88

@@ -29,7 +29,7 @@ public String getContainerId()
2929
}
3030

3131
@Override
32-
public @NotNull AttachmentType getAttachmentType()
32+
public @NotNull AttachmentParentType getAttachmentParentType()
3333
{
3434
return CatalogImageAttachmentType.get();
3535
}

panoramapublic/src/org/labkey/panoramapublic/catalog/CatalogImageAttachmentType.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package org.labkey.panoramapublic.catalog;
22

33
import org.jetbrains.annotations.NotNull;
4-
import org.labkey.api.attachments.AttachmentType;
4+
import org.labkey.api.attachments.AttachmentParentType;
55
import org.labkey.api.data.CoreSchema;
66
import org.labkey.api.data.SQLFragment;
77

8-
public class CatalogImageAttachmentType implements AttachmentType
8+
public class CatalogImageAttachmentType implements AttachmentParentType
99
{
1010
private static final CatalogImageAttachmentType INSTANCE = new CatalogImageAttachmentType();
1111

@@ -21,7 +21,7 @@ private CatalogImageAttachmentType()
2121
@Override
2222
public @NotNull String getUniqueName()
2323
{
24-
return getClass().getName();
24+
return "CatalogImage";
2525
}
2626

2727
@Override

0 commit comments

Comments
 (0)