{"id":18645934,"url":"https://github.com/giosil/wportlet","last_synced_at":"2025-07-17T01:34:43.032Z","repository":{"id":116932715,"uuid":"222926805","full_name":"giosil/wportlet","owner":"giosil","description":"Simple framework to build portlets like a webapp.","archived":false,"fork":false,"pushed_at":"2025-04-04T12:41:22.000Z","size":3833,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-17T18:37:00.895Z","etag":null,"topics":["java","java-portlets","liferay-portlet","portlet","portlets"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/giosil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-20T11:55:15.000Z","updated_at":"2025-04-04T12:41:25.000Z","dependencies_parsed_at":"2024-06-28T17:50:13.843Z","dependency_job_id":"5f191756-593e-46d2-a577-86c29bfc30da","html_url":"https://github.com/giosil/wportlet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/giosil/wportlet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giosil%2Fwportlet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giosil%2Fwportlet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giosil%2Fwportlet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giosil%2Fwportlet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/giosil","download_url":"https://codeload.github.com/giosil/wportlet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giosil%2Fwportlet/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265558678,"owners_count":23787958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","java-portlets","liferay-portlet","portlet","portlets"],"created_at":"2024-11-07T06:17:45.156Z","updated_at":"2025-07-17T01:34:43.013Z","avatar_url":"https://github.com/giosil.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WPortlet\n\nSimple framework to build portlets like a webapp.\n\n## Example\n\n```java\nimport javax.portlet.*;\n\nimport org.dew.portlet.*;\n\npublic \nclass HelloAction implements IAction \n{\n  public\n  Object action(String sAction, Parameters parameters, ActionRequest request, ActionResponse response)\n    throws Exception\n  {\n    if(parameters.isBlank(\"name\")) {\n      throw new Exception(ResourcesMgr.getMessage(request, \"error.name\"));\n    }\n    \n    String sName = parameters.getString(\"name\");\n    \n    return sName;\n  }\n  \n  public\n  String view(String sAction, Parameters parameters, Object actionResult, RenderRequest request, RenderResponse response)\n    throws Exception\n  {\n    String sName = (String) actionResult;\n    \n    String sHello = ResourcesMgr.getMessage(request, \"hello\", sName);\n    \n    request.setAttribute(\"hello\", sHello);\n    \n    return \"hello.jsp\";\n  }\n  \n  public String exception(String sAction, Parameters parameters, Exception actionException, RenderRequest request, RenderResponse response)\n    throws Exception\n  {\n    return null;\n  }\n}\n```\n\n## Setting Up JNDI in Liferay 7.4\n\nIn liferay/tomcat/conf/Catalina/localhost/ROOT.xml\n\n```xml\n    \u003cResource name=\"jdbc/demodb\" auth=\"Container\"\n        factory=\"com.zaxxer.hikari.HikariJNDIFactory\"\n        type=\"javax.sql.DataSource\"\n        minimumIdle=\"10\"\n        maximumPoolSize=\"100\"\n        maxLifetime=\"1800000\"\n        connectionTimeout=\"300000\"\n        dataSourceClassName=\"org.postgresql.ds.PGSimpleDataSource\"\n        dataSource.serverName=\"demo-db\"\n        dataSource.portNumber=\"5432\"\n        dataSource.databaseName=\"demo\"\n        dataSource.user=\"demo\"\n        dataSource.password=\"demo\"\n        validationQuery=\"SELECT 1\"/\u003e\n```\n\nIn 7.4 Liferay introduced the \"Shielded Class Loader\" in an effort to shield the webapp class loader from the OSGi container.\nBefore invoking the lookup:\n\n```java\nThread thread = Thread.currentThread();\n\n// Get the thread's class loader. You'll reinstate it after using\n// the data source you look up using JNDI\nClassLoader origLoader = thread.getContextClassLoader();\n\n// get the shielded class loader\nClassLoader shieldedClassLoader = PortalClassLoaderUtil.getClassLoader();\n\n// get the webapp class loader from it\nClassLoader webappClassLoader = shieldedClassLoader.getClass().getClassLoader();\n\n// Set webapp class loader on the thread\nthread.setContextClassLoader(webappClassLoader);\n```\n\n## Build\n\n- `git clone https://github.com/giosil/wportlet.git`\n- `mvn clean install`\n\n## Contributors\n\n* [Giorgio Silvestris](https://github.com/giosil)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiosil%2Fwportlet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgiosil%2Fwportlet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiosil%2Fwportlet/lists"}