Created
April 12, 2023 07:48
-
-
Save ambrinchaudhary/68010607de588819485f017f14d6a6c0 to your computer and use it in GitHub Desktop.
POC - Use of Frontend DataSet in D&M
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
compileOnly project(":apps:frontend-data-set:frontend-data-set-api") | |
compileOnly project(":apps:frontend-data-set:frontend-data-set-taglib") |
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
package com.liferay.document.library.web.internal.frontend.data.set.view; | |
import com.liferay.frontend.data.set.view.FDSView; | |
import com.liferay.frontend.data.set.view.table.BaseTableFDSView; | |
import com.liferay.frontend.data.set.view.table.FDSTableSchema; | |
import com.liferay.frontend.data.set.view.table.FDSTableSchemaBuilder; | |
import com.liferay.frontend.data.set.view.table.FDSTableSchemaBuilderFactory; | |
import java.util.Locale; | |
import org.osgi.service.component.annotations.Component; | |
import org.osgi.service.component.annotations.Reference; | |
/** | |
* @author Ambrin Chaudhary | |
*/ | |
@Component( | |
property = "frontend.data.set.name=DLFDSHeadlessId", | |
service = FDSView.class | |
) | |
public class DLTableFDSView extends BaseTableFDSView { | |
@Override | |
public FDSTableSchema getFDSTableSchema(Locale locale) { | |
FDSTableSchemaBuilder fdsTableSchemaBuilder = | |
_fdsTableSchemaBuilderFactory.create(); | |
return fdsTableSchemaBuilder.add( | |
"name", "name", | |
fdsTableSchemaField -> fdsTableSchemaField.setContentRenderer( | |
"actionLink") | |
).add( | |
"typeLabel", "type" | |
).build(); | |
} | |
@Reference | |
private FDSTableSchemaBuilderFactory _fdsTableSchemaBuilderFactory; | |
} |
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
<%@ | |
taglib uri="http://liferay.com/tld/frontend-data-set" prefix="frontend-data-set" %> |
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
<div class="frontend-data-set-headless"> | |
<frontend-data-set:headless-display | |
apiURL="/o/headless-delivery/v1.0/sites/20119/document-folders" | |
formName="fm" | |
id="DLFDSHeadlessId" | |
style="fluid" | |
/> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment