Package javax.portlet

Examples of javax.portlet.PortletSession


        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


    protected BaseImportExportHandler(String mode, String viewName) {
        super(mode, viewName);
    }

    protected PluginListType getRepoPluginList(PortletRequest request, PluginInstaller pluginInstaller, String repo) throws IOException, PortletException {
        PortletSession session = request.getPortletSession(true);
        PluginListType list = (PluginListType) session.getAttribute(CONFIG_LIST_SESSION_KEY);
        String listRepo = (String) session.getAttribute(CONFIG_LIST_REPO_SESSION_KEY);

        if (list == null || !repo.equals(listRepo)) {
            try {
                list = pluginInstaller.listPlugins(new URL(repo));
            } catch (FailedLoginException e) {
                throw new PortletException("Invalid login for repository '" + repo + "'", e);
            }
            session.setAttribute(CONFIG_LIST_SESSION_KEY, list);
            session.setAttribute(CONFIG_LIST_REPO_SESSION_KEY, repo);
        }
        return list;
    }
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

    }

    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

        rarPathMap.clear();
        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 || results.length ==0) {
            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, rarPathMap.get(displayName), 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()};
                try {
                    PluginInstallerGBean installer = KernelRegistry.getSingleKernel().getGBean(PluginInstallerGBean.class);
                    //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, installer)).start();
                    actionResponse.setRenderParameter(MODE_KEY, DOWNLOAD_STATUS_MODE);
                } catch (GBeanNotFoundException e) {
                    throw new PortletException(e);
View Full Code Here

  }
 
  public void render(RenderRequest request, RenderResponse response)
      throws PortletException, IOException {

    PortletSession session = request.getPortletSession();
    PortletMode mode = (PortletMode) session
        .getAttribute("CurrentPortletMode");

    if (mode == null) {
      mode = request.getPortletMode();
    }

    if (mode != request.getPortletMode()) {
      request.setAttribute("isPortletModeChanged", Boolean.TRUE);
    } else {
      request.setAttribute("isPortletModeChanged", Boolean.FALSE);
    }

    session.setAttribute("CurrentPortletMode", mode);
    super.render(request, response);
  }
View Full Code Here

        _portletRequest = portletRequest;
    }

    protected Object getAttribute(String key)
    {
        PortletSession portletSession = getSession();
        return (portletSession == null)
               ? null : portletSession.getAttribute(key.toString(), PortletSession.PORTLET_SCOPE);
    }
View Full Code Here

        _portletRequest.getPortletSession(true).setAttribute(key, value, PortletSession.PORTLET_SCOPE);
    }

    protected void removeAttribute(String key)
    {
        PortletSession portletSession = getSession();
        if (portletSession != null)
        {
            portletSession.removeAttribute(key, PortletSession.PORTLET_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.