Source Code Cross Referenced for TabColumnPrefsHandler.java in  » Portal » uPortal_rel-2-6-1-GA » org » jasig » portal » layout » dlm » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Portal » uPortal_rel 2 6 1 GA » org.jasig.portal.layout.dlm 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* Copyright 2005 The JA-SIG Collaborative.  All rights reserved.
002:         *  See license distributed with this file and
003:         *  available online at http://www.uportal.org/license.html
004:         */
005:
006:        package org.jasig.portal.layout.dlm;
007:
008:        import org.apache.commons.logging.Log;
009:        import org.apache.commons.logging.LogFactory;
010:        import org.jasig.portal.PortalException;
011:        import org.jasig.portal.security.IPerson;
012:        import org.w3c.dom.Document;
013:        import org.w3c.dom.Element;
014:
015:        /** 
016:         * Applies user prefs changes to the user's plf prior to persisting.
017:         * 
018:         * @version $Revision: 36335 $ $Date: 2005-12-09 10:47:42 -0700 (Fri, 09 Dec 2005) $
019:         * @since uPortal 2.5
020:         */
021:        public class TabColumnPrefsHandler {
022:            public static final String RCS_ID = "@(#) $Header$";
023:            private static Log LOG = LogFactory
024:                    .getLog(TabColumnPrefsHandler.class);
025:
026:            /**
027:               This method is called from the TabColumnPrefsState class after a node
028:               has already been moved from its old parent to its new in the ILF. We can
029:               get at the new parent via the compViewNode moved but need a separate
030:               handle of the parent from whence it came. The goal of this method is to
031:               make the appropriate change in the PLF to persist this action take by
032:               the user. For ILF nodes this generally means adding an entry to the
033:               position set for the new parent and removing any entry if it existed in
034:               the position set in the old parent. For nodes that are owned by the
035:               user (PLF owned nodes) the nodes are moved outright and now position
036:               set is needed unless the new parent contains ILF nodes as well
037:               requiring preservation of the user's ordering of the nodes for when the
038:               ILF and PLF are merged again later on.
039:             */
040:            public static void moveElement(Element compViewNode,
041:                    Element oldCompViewParent, IPerson person)
042:                    throws PortalException {
043:                if (LOG.isInfoEnabled())
044:                    LOG.info("moving "
045:                            + compViewNode.getAttribute(Constants.ATT_ID));
046:                Element compViewParent = (Element) compViewNode.getParentNode();
047:
048:                if (oldCompViewParent != compViewParent) {
049:                    if (LOG.isInfoEnabled())
050:                        LOG
051:                                .info("reparenting from "
052:                                        + oldCompViewParent
053:                                                .getAttribute(Constants.ATT_ID)
054:                                        + " to "
055:                                        + compViewParent
056:                                                .getAttribute(Constants.ATT_ID));
057:                    // update previous parent if found in PLF
058:                    Element plfParent = HandlerUtils.getPLFNode(
059:                            oldCompViewParent, person, // only needed if creating
060:                            false, // only look, don't create
061:                            false); // also not needed
062:                    if (plfParent != null) {
063:                        PositionManager.updatePositionSet(oldCompViewParent,
064:                                plfParent, person);
065:                        if (LOG.isInfoEnabled())
066:                            LOG.info("updating old parent's position set");
067:                    }
068:                }
069:                // now take care of the destination
070:                Element plfParent = HandlerUtils.getPLFNode(compViewParent,
071:                        person, true, // create parent if not found
072:                        false); // don't create children
073:                if (compViewNode.getAttribute(Constants.ATT_ID).startsWith(
074:                        Constants.FRAGMENT_ID_USER_PREFIX)) {
075:                    // ilf node being inserted
076:                    if (LOG.isInfoEnabled())
077:                        LOG
078:                                .info("ilf node being moved, only update new parent pos set");
079:                    PositionManager.updatePositionSet(compViewParent,
080:                            plfParent, person);
081:                } else {
082:                    // plf node
083:                    if (LOG.isInfoEnabled())
084:                        LOG
085:                                .info("plf node being moved, updating old parent's position set");
086:                    Document plf = (Document) person
087:                            .getAttribute(Constants.PLF);
088:                    HandlerUtils.createOrMovePLFOwnedNode(compViewNode,
089:                            compViewParent, false, // should always be found
090:                            false, // irrelevant, not creating
091:                            plf, plfParent, person);
092:                }
093:            }
094:
095:            /**
096:               Handles user requests to delete UI elements. For ILF owned nodes it
097:               delegates to the DeleteManager to add a delete directive. For PLF
098:               owned nodes it deletes the node outright.
099:             */
100:            public static void deleteNode(Element compViewNode,
101:                    Element compViewParent, IPerson person)
102:                    throws PortalException {
103:                String ID = compViewNode.getAttribute(Constants.ATT_ID);
104:
105:                if (ID.startsWith(Constants.FRAGMENT_ID_USER_PREFIX)) // ilf node
106:                    DeleteManager.addDeleteDirective(compViewNode, ID, person);
107:                else {
108:                    // plf node
109:                    Document plf = (Document) person
110:                            .getAttribute(Constants.PLF);
111:                    Element node = plf.getElementById(ID);
112:
113:                    if (node == null)
114:                        return;
115:                    Element parent = (Element) node.getParentNode();
116:                    if (parent == null)
117:                        return;
118:                    parent.removeChild(node);
119:                }
120:            }
121:
122:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.