@YuSheng
You can rely on AssetReferenceSearch to get the assets used in the page to publish them.
Example snippet:
Node pageJcrContentNode = pageJcrContentResource.adaptTo(Node.class);Map<String,Asset> assetReferencesMap = new AssetReferenceSearch(pageJcrContentNode, "/content/dam", resourceResolv...