Package org.jasig.portal.layout.node

Examples of org.jasig.portal.layout.node.UserLayoutFolderDescription


        {
            return new ChannelDescription(node);
        }
        else if (type.equals(Constants.ELM_FOLDER))
        {
            return new UserLayoutFolderDescription(node);
        }
        else
        {
            throw new PortalException("Given XML Element is not a channel!");
        }
View Full Code Here


      Enumeration<String> columns = ulm.getChildIds(destinationId);
      if (columns.hasMoreElements()) {
        ulm.moveNode(sourceId, columns.nextElement(), null);
      } else {

        IUserLayoutFolderDescription newColumn = new UserLayoutFolderDescription();
        newColumn.setName("Column");
        newColumn.setId("tbd");
        newColumn
            .setFolderType(IUserLayoutFolderDescription.REGULAR_TYPE);
        newColumn.setHidden(false);
        newColumn.setUnremovable(false);
        newColumn.setImmutable(false);

        // add the column to our layout
        IUserLayoutNodeDescription col = ulm.addNode(newColumn,
            destinationId, null);
View Full Code Here

    if (newColumnCount > oldColumnCount) {
          List<String> newColumnIds = new ArrayList<String>();
      for (int i = columnList.size(); i < newColumnCount; i++) {

        // create new column element
        IUserLayoutFolderDescription newColumn = new UserLayoutFolderDescription();
        newColumn.setName("Column");
        newColumn.setId("tbd");
        newColumn
            .setFolderType(IUserLayoutFolderDescription.REGULAR_TYPE);
        newColumn.setHidden(false);
        newColumn.setUnremovable(false);
        newColumn.setImmutable(false);

        // add the column to our layout
        IUserLayoutNodeDescription node = ulm.addNode(newColumn, tabId,
            null);
        newColumnIds.add(node.getId());
View Full Code Here

                if (node != null)
                    break;
             }
        } else {

            IUserLayoutFolderDescription newColumn = new UserLayoutFolderDescription();
            newColumn.setName("Column");
            newColumn.setId("tbd");
            newColumn.setFolderType(IUserLayoutFolderDescription.REGULAR_TYPE);
            newColumn.setHidden(false);
            newColumn.setUnremovable(false);
            newColumn.setImmutable(false);

            // add the column to our layout
            IUserLayoutNodeDescription col = ulm.addNode(newColumn, tabId, null);

            // add the channel
View Full Code Here

       
    // construct a brand new tab
    String id = "tbd";
        String tabName = request.getParameter("tabName");
        if (StringUtils.isBlank(tabName)) tabName = DEFAULT_TAB_NAME;
    IUserLayoutFolderDescription newTab = new UserLayoutFolderDescription();
    newTab.setName(tabName);
    newTab.setId(id);
    newTab.setFolderType(IUserLayoutFolderDescription.REGULAR_TYPE);
    newTab.setHidden(false);
    newTab.setUnremovable(false);
    newTab.setImmutable(false);

    // add the tab to the layout
    ulm.addNode(newTab, ulm.getRootFolderId(), null);

    try {
      // save the user's layout
            ulm.saveUserLayout();
    } catch (Exception e) {
      log.warn("Error saving layout", e);
    }

    // get the id of the newly added tab
    String tabId = newTab.getId();

        for (String width : widths) {

            // create new column element
            IUserLayoutFolderDescription newColumn = new UserLayoutFolderDescription();
            newColumn.setName("Column");
            newColumn.setId("tbd");
            newColumn
                    .setFolderType(IUserLayoutFolderDescription.REGULAR_TYPE);
            newColumn.setHidden(false);
            newColumn.setUnremovable(false);
            newColumn.setImmutable(false);

            // add the column to our layout
            ulm.addNode(newColumn, tabId, null);

            this.stylesheetUserPreferencesService.setLayoutAttribute(request, PreferencesScope.STRUCTURE, newColumn.getId(), "width", width + "%");
            try {
                // This sets the column attribute in memory but doesn't persist it.  Comment says saves changes "prior to persisting"
                Element folder = ulm.getUserLayoutDOM().getElementById(newColumn.getId());
                UserPrefsHandler.setUserPreference(folder, "width", per);
            } catch (Exception e) {
                log.error("Error saving new column widths", e);
            }
View Full Code Here

TOP

Related Classes of org.jasig.portal.layout.node.UserLayoutFolderDescription

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.