Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9175237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:52:51+00:00 2026-06-17T16:52:51+00:00

I would like to ask if there is any Java API call in liferay

  • 0

I would like to ask if there is any Java API call in liferay which returns the web contents, which were uploaded by a specific user.

For example, I have one user who has upload some content and I want to show in a portlet this content, how can I do this via java?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T16:52:52+00:00Added an answer on June 17, 2026 at 4:52 pm

    If you are specifically talking about web-content which is displayed inside Web-content Display portlet, then you can use the JournalArticleService and JournalArticleLocalService API to fetch the content depending upon the User.
    Prior to Liferay 6.0 Web-content was known as JournalArticle and hence the API name has not changed.

    So for example:

    You can use DynamicQuery API, as follows:

    long userId = 10987L; // ofcourse you need to find this
    
    DynamicQuery dynamicQuery = JournalArticleLocalServiceUtil.dynamicQuery();
    
    dynamicQuery.add(RestrictionsFactoryUtil.eq("userId", userId));
    
    int startOfList = 0;
    int endOfList = 1000;
    // if you want all the JournalArticle retrieved then use:
    // int endOfList = QueryUtil.ALL_POS;
    
    // this will retrieve the list of webcontents
    List<JournalArticle> articles = (List<JournalArticle>) JournalArticleLocalServiceUtil.dynamicQuery(dynamicQuery, startOfList, endOfList);
    

    The above code will retrieve all the JournalArticles so you would get all the versions of a single web-content since all these versions are stored in the same JournalArticle table. So for this you can add conditions to the dynamicQuery for the fields like version, id, resourcePrimKey, articleId, groupId, companyId etc.

    Or if you have more complex needs than you can create a custom-sql-finder in liferay to fetch the desired data from any combination of Liferay DB tables.


    If you are talking about contents as in Blogs, Wikis, Files, Webcontents etc then either use their respective *LocalServiceUtil or you can use AssetEntryLocalServiceUtil to fetch the assets for a particular User.

    So with AssetEntryLocalServiceUtil also you can use the DynamicQuery API as shown above. The code may not be same but will be along the same lines.


    You can know more about DynamicQuery API from this blog.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to ask if there's any Java package or library that have
Is there any Java API which would take a html document and a css
I would like to ask is there any way to achieve this functionality: I
I would like to ask if there is any tools for Google App Engine
Here's something I would like to ask about the JVM: Is there any free
I would like to ask if there is any possibility to access the cdrom
I would like ask if there's a way to download an android layout from
I would like to ask if there is a way to see a variable
I would like to ask if there is a more elegant way to write
I would like to ask you: Imagine that you have a site and there

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.