Package javax.portlet

Examples of javax.portlet.PortletSession


     * @param displayName         If we're editing an existing RA, its name
     * @param adapterAbstractName If we're editing an existing RA, its AbstractName
     * @return resource adapter parameter data object
     */
    public ResourceAdapterParams getRARConfiguration(PortletRequest request, String rarPath, String displayName, String adapterAbstractName) {
        PortletSession session = request.getPortletSession(true);
        if (rarPath != null && !rarPath.equals("")) {
            ResourceAdapterParams results = (ResourceAdapterParams) session.getAttribute(
                    CONFIG_SESSION_KEY + "-" + rarPath, PortletSession.APPLICATION_SCOPE);
            if (results == null) {
                results = loadConfigPropertiesByPath(request, rarPath);
                session.setAttribute(CONFIG_SESSION_KEY + "-" + rarPath, results, PortletSession.APPLICATION_SCOPE);
                session.setAttribute(CONFIG_SESSION_KEY + "-" + results.displayName, results,
                        PortletSession.APPLICATION_SCOPE);
            }
            return results;
        } else if (displayName != null && !displayName.equals(
                "") && adapterAbstractName != null && !adapterAbstractName.equals("")) {
            ResourceAdapterParams results = (ResourceAdapterParams) session.getAttribute(
                    CONFIG_SESSION_KEY + "-" + displayName, PortletSession.APPLICATION_SCOPE);
            if (results == null) {
                results = loadConfigPropertiesByAbstractName(request, adapterAbstractName);
                session.setAttribute(CONFIG_SESSION_KEY + "-" + displayName, results, PortletSession.APPLICATION_SCOPE);
            }
            return results;
        } else {
            throw new IllegalArgumentException();
        }
View Full Code Here


                }
            }
            if (found != null) {
                data.jars = new String[]{found.getRepositoryURI()};
                WriteableRepository repo = PortletManager.getCurrentServer(actionRequest).getWritableRepositories()[0];
                final PortletSession session = actionRequest.getPortletSession();
                ProgressInfo progressInfo = new ProgressInfo();
                progressInfo.setMainMessage("Downloading " + found.getName());
                session.setAttribute(ProgressInfo.PROGRESS_INFO_KEY, progressInfo, PortletSession.APPLICATION_SCOPE);
                // Start the download monitoring
                new Thread(new Downloader(found, progressInfo, repo)).start();
                actionResponse.setRenderParameter(MODE_KEY, DOWNLOAD_STATUS_MODE);
            } else {
                actionResponse.setRenderParameter(MODE_KEY, DOWNLOAD_MODE);
View Full Code Here

        request.setAttribute("groupId", groupId);
        request.setAttribute("artifactId", artifactId);
        request.setAttribute("version", version);
        request.setAttribute("format", format);
       
        PortletSession assemblysession = request.getPortletSession(true);
        assemblysession.setAttribute("plugins", plugins);

        request.setAttribute("allInstallable", true);
        request.setAttribute("mode", ASSEMBLY_VIEW_MODE + "-after");
    }
View Full Code Here

    private void renderTestLoginForm(RenderRequest request, RenderResponse response) throws IOException, PortletException {
        testLoginView.include(request, response);
    }

    private void renderTestResults(RenderRequest request, RenderResponse response) throws IOException, PortletException {
        PortletSession session = request.getPortletSession();
        String status = (String) session.getAttribute("TestLoginError");
        if (status == null) {
            Set principals = (Set) session.getAttribute("TestLoginPrincipals");
            status = "Login succeeded with " + (principals == null ? 0 : principals.size()) + " principals";
            request.setAttribute("principals", principals);
        }
        request.setAttribute("LoginResults", status);
        testResultsView.include(request, response);
View Full Code Here

    private void renderTestLoginForm(RenderRequest request, RenderResponse response) throws IOException, PortletException {
        testLoginView.include(request, response);
    }

    private void renderTestResults(RenderRequest request, RenderResponse response) throws IOException, PortletException {
        PortletSession session = request.getPortletSession();
        String status = (String) session.getAttribute("TestLoginError");
        if (status == null) {
            Set principals = (Set) session.getAttribute("TestLoginPrincipals");
            status = "Login succeeded with " + (principals == null ? 0 : principals.size()) + " principals";
            request.setAttribute("principals", principals);
        }
        request.setAttribute("LoginResults", status);
        testResultsView.include(request, response);
View Full Code Here

        usageView = null;
        super.destroy();
    }

    public DriverDownloader.DriverInfo[] getDriverInfo(PortletRequest request) {
        PortletSession session = request.getPortletSession(true);
        DriverDownloader.DriverInfo[] results = (DriverDownloader.DriverInfo[]) session.getAttribute(DRIVER_SESSION_KEY,
                PortletSession.APPLICATION_SCOPE);
        if (results == null) {
            DriverDownloader downloader = new DriverDownloader();
            try {
                results = downloader.loadDriverInfo(new URL(DRIVER_INFO_URL));
                session.setAttribute(DRIVER_SESSION_KEY, results, PortletSession.APPLICATION_SCOPE);
            } catch (MalformedURLException e) {
                log.error("Unable to download driver data", e);
                results = new DriverDownloader.DriverInfo[0];
            }
        }
View Full Code Here

     * @param displayName         If we're editing an existing RA, its name
     * @param adapterAbstractName If we're editing an existing RA, its AbstractName
     * @return resource adapter parameter data object
     */
    public ResourceAdapterParams getRARConfiguration(PortletRequest request, String rarPath, String displayName, String adapterAbstractName) {
        PortletSession session = request.getPortletSession(true);
        if (rarPath != null && !rarPath.equals("")) {
            ResourceAdapterParams results = (ResourceAdapterParams) session.getAttribute(
                    CONFIG_SESSION_KEY + "-" + rarPath, PortletSession.APPLICATION_SCOPE);
            if (results == null) {
                results = loadConfigPropertiesByPath(request, rarPath);
                session.setAttribute(CONFIG_SESSION_KEY + "-" + rarPath, results, PortletSession.APPLICATION_SCOPE);
                session.setAttribute(CONFIG_SESSION_KEY + "-" + results.displayName, results,
                        PortletSession.APPLICATION_SCOPE);
            }
            return results;
        } else if (displayName != null && !displayName.equals(
                "") && adapterAbstractName != null && !adapterAbstractName.equals("")) {
            ResourceAdapterParams results = (ResourceAdapterParams) session.getAttribute(
                    CONFIG_SESSION_KEY + "-" + displayName, PortletSession.APPLICATION_SCOPE);
            if (results == null) {
                results = loadConfigPropertiesByAbstractName(request, adapterAbstractName);
                session.setAttribute(CONFIG_SESSION_KEY + "-" + displayName, results, PortletSession.APPLICATION_SCOPE);
            }
            return results;
        } else {
            throw new IllegalArgumentException();
        }
View Full Code Here

                }
            }
            if (found != null) {
                data.jars = new String[]{found.getRepositoryURI()};
                WriteableRepository repo = PortletManager.getCurrentServer(actionRequest).getWritableRepositories()[0];
                final PortletSession session = actionRequest.getPortletSession();
                ProgressInfo progressInfo = new ProgressInfo();
                progressInfo.setMainMessage("Downloading " + found.getName());
                session.setAttribute(ProgressInfo.PROGRESS_INFO_KEY, progressInfo, PortletSession.APPLICATION_SCOPE);
                // Start the download monitoring
                new Thread(new Downloader(found, progressInfo, repo)).start();
                actionResponse.setRenderParameter(MODE_KEY, DOWNLOAD_STATUS_MODE);
            } else {
                actionResponse.setRenderParameter(MODE_KEY, DOWNLOAD_MODE);
View Full Code Here

    }

    public void renderView(RenderRequest request, RenderResponse response, MultiPageModel model) throws PortletException, IOException {
        KeystoreManager manager = PortletManager.getCurrentServer(request).getKeystoreManager();
        KeystoreInstance[] keystores = manager.getKeystores();
        PortletSession session = request.getPortletSession(true);
        KeystoreData[] datas = new KeystoreData[keystores.length];
        Map keys = new HashMap();
        for (int i = 0; i < datas.length; i++) {
            AbstractName aName = PortletManager.getNameFor(request, keystores[i]);
            String name = (String) aName.getName().get(NameFactory.J2EE_NAME);
            KeystoreData data = (KeystoreData) session.getAttribute(KEYSTORE_DATA_PREFIX+name);
            if(data == null) {
                data = new KeystoreData();
                data.setInstance(keystores[i]);
                session.setAttribute(KEYSTORE_DATA_PREFIX+name, data);
            }
            datas[i] = data;
            if(!data.getInstance().isKeystoreLocked()) {
                try {
                    String[] all = data.getInstance().getUnlockedKeys(null);
View Full Code Here

         // So we do nothing
      }
      else if (create)
      {
         // For sure we need a session we will obtain a valid one
         PortletSession portletSession = preq.getPortletSession();
         session = new DispatchedHttpSession(this, portletSession, scope);
      }
      else
      {
         // Here we can try an existing session but it may return null
         PortletSession portletSession = preq.getPortletSession(false);

         //
         if (portletSession != null)
         {
            session = new DispatchedHttpSession(this, portletSession, scope);
View Full Code Here

TOP

Related Classes of javax.portlet.PortletSession

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.