- Renamed Report-queries.pdl to Report-queries.ora.pdl because the queries definied in this work only with an Oracle DB.

- Reports Tab is not shown in the content center when using a PostgreSQL database. The queries used for this tab work
  only for Oracle DB. Also the reports are not helpful.


git-svn-id: https://svn.libreccm.org/ccm/trunk@2791 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2014-08-08 12:08:51 +00:00
parent 83714277d8
commit 8598ee25b5
2 changed files with 79 additions and 69 deletions

View File

@ -42,6 +42,7 @@ import com.arsdigita.cms.ui.role.RoleAdminPane;
import com.arsdigita.cms.ui.type.ContentTypeAdminPane; import com.arsdigita.cms.ui.type.ContentTypeAdminPane;
import com.arsdigita.cms.ui.workflow.WorkflowAdminPane; import com.arsdigita.cms.ui.workflow.WorkflowAdminPane;
import com.arsdigita.cms.util.SecurityConstants; import com.arsdigita.cms.util.SecurityConstants;
import com.arsdigita.db.DbHelper;
import com.arsdigita.globalization.GlobalizedMessage; import com.arsdigita.globalization.GlobalizedMessage;
import com.arsdigita.kernel.User; import com.arsdigita.kernel.User;
import com.arsdigita.toolbox.ui.LayoutPanel; import com.arsdigita.toolbox.ui.LayoutPanel;
@ -56,10 +57,8 @@ import org.apache.log4j.Logger;
/** /**
* Contains the entire admin UI for a content section. * Contains the entire admin UI for a content section.
* *
* Developers Note: * Developers Note: It is based on the dispatcher model is is going to be replaced by the newer
* It is based on the dispatcher model is is going to be replaced by the newer * servlet based model. @see c.ad.cms.ui.contentsection.MainPage (currently not active).
* servlet based model. @see c.ad.cms.ui.contentsection.MainPage (currently
* not active).
* *
* @author Jack Chung * @author Jack Chung
* @author Michael Pih * @author Michael Pih
@ -70,23 +69,20 @@ import org.apache.log4j.Logger;
public class ContentSectionPage extends CMSPage implements ActionListener { public class ContentSectionPage extends CMSPage implements ActionListener {
private static final Logger s_log = Logger.getLogger(ContentSectionPage.class); private static final Logger s_log = Logger.getLogger(ContentSectionPage.class);
public static final String RESOURCE_BUNDLE = public static final String RESOURCE_BUNDLE = "com.arsdigita.cms.CMSResources";
"com.arsdigita.cms.CMSResources";
/** /**
* The URL parameter that can be passed in in order to set the current * The URL parameter that can be passed in in order to set the current folder. This is used in
* folder. This is used in getting back to the correct level of folder * getting back to the correct level of folder expansion from content item page.
* expansion from content item page.
*/ */
public static final String SET_FOLDER = "set_folder"; public static final String SET_FOLDER = "set_folder";
/** /**
* The URL parameter that can be passed in in order to set the current * The URL parameter that can be passed in in order to set the current template (for setting the
* template (for setting the content type) * content type)
*/ */
public static final String SET_TEMPLATE = "set_template"; public static final String SET_TEMPLATE = "set_template";
/** /**
* The URL parameter that can be passed in in order to set the current tab. * The URL parameter that can be passed in in order to set the current tab. This is a KLUDGE
* This is a KLUDGE right now because the TabbedDialog's current tab is * right now because the TabbedDialog's current tab is selected with a local state parameter.
* selected with a local state parameter.
*/ */
public static final String SET_TAB = "set_tab"; public static final String SET_TAB = "set_tab";
/** /**
@ -133,11 +129,9 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
private ReportPane m_reportPane; private ReportPane m_reportPane;
/** /**
* Creates the content section index page containing * Creates the content section index page containing - a Navigaton bar for the various tasks
* - a Navigaton bar for the various tasks (items, search, images, ....) * (items, search, images, ....) - a breadcrumb - .... Contains the UI for administering a
* - a breadcrumb * content section.
* - ....
* Contains the UI for administering a content section.
*/ */
public ContentSectionPage() { public ContentSectionPage() {
super(new Label(new TitlePrinter()), new SimpleContainer()); super(new Label(new TitlePrinter()), new SimpleContainer());
@ -170,6 +164,7 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
add(m_tabbedPane); add(m_tabbedPane);
addActionListener(new ActionListener() { addActionListener(new ActionListener() {
@Override @Override
public final void actionPerformed(ActionEvent e) { public final void actionPerformed(ActionEvent e) {
final PageState state = e.getPageState(); final PageState state = e.getPageState();
@ -185,24 +180,30 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
//m_tabbedPane.setTabVisible(state, m_userAdminPane, sm.canAccess(user, SecurityConstants.STAFF_ADMIN)); //m_tabbedPane.setTabVisible(state, m_userAdminPane, sm.canAccess(user, SecurityConstants.STAFF_ADMIN));
if (ContentSection.getConfig().getHideAdminTabs()) { if (ContentSection.getConfig().getHideAdminTabs()) {
m_tabbedPane.setTabVisible(state, m_workflowPane, sm.canAccess(user, SecurityConstants.WORKFLOW_ADMIN)); m_tabbedPane.setTabVisible(state, m_workflowPane, sm.canAccess(user,
m_tabbedPane.setTabVisible(state, m_categoryPane, sm.canAccess(user, SecurityConstants.CATEGORY_ADMIN)); SecurityConstants.WORKFLOW_ADMIN));
m_tabbedPane.setTabVisible(state, m_lifecyclePane, sm.canAccess(user, SecurityConstants.LIFECYCLE_ADMIN)); m_tabbedPane.setTabVisible(state, m_categoryPane, sm.canAccess(user,
m_tabbedPane.setTabVisible(state, m_typePane, sm.canAccess(user, SecurityConstants.CONTENT_TYPE_ADMIN)); SecurityConstants.CATEGORY_ADMIN));
m_tabbedPane.setTabVisible(state, m_rolePane, sm.canAccess(user, SecurityConstants.STAFF_ADMIN)); m_tabbedPane.setTabVisible(state, m_lifecyclePane, sm.canAccess(user,
SecurityConstants.LIFECYCLE_ADMIN));
m_tabbedPane.setTabVisible(state, m_typePane, sm.canAccess(user,
SecurityConstants.CONTENT_TYPE_ADMIN));
m_tabbedPane.setTabVisible(state, m_rolePane, sm.canAccess(user,
SecurityConstants.STAFF_ADMIN));
// csePane: should check permission // csePane: should check permission
m_tabbedPane.setTabVisible(state, m_csePane, true); m_tabbedPane.setTabVisible(state, m_csePane, true);
// TODO Check for reportPane as well // TODO Check for reportPane as well
} }
} }
}); });
add(new DebugPanel()); add(new DebugPanel());
} }
/** /**
* Creates, and then caches, the browse pane. Overriding this method to * Creates, and then caches, the browse pane. Overriding this method to return null will prevent
* return null will prevent this tab from appearing. * this tab from appearing.
*/ */
protected FolderAdminPane getFolderAdminPane() { protected FolderAdminPane getFolderAdminPane() {
if (m_folderPane == null) { if (m_folderPane == null) {
@ -212,8 +213,9 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
} }
/** /**
* Creates, and then caches, the browse pane. Overriding this method to * Creates, and then caches, the browse pane. Overriding this method to return null will prevent
* return null will prevent this tab from appearing. * this tab from appearing.
*
* @return * @return
*/ */
protected BrowsePane getBrowsePane() { protected BrowsePane getBrowsePane() {
@ -224,12 +226,13 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
} }
/** /**
* Creates, and then caches, the search pane. Overriding this method to * Creates, and then caches, the search pane. Overriding this method to return null will prevent
* return null will prevent this tab from appearing. * this tab from appearing.
*/ */
protected ItemSearch getSearchPane() { protected ItemSearch getSearchPane() {
if (m_searchPane == null) { if (m_searchPane == null) {
m_searchPane = new ItemSearch(ContentItem.DRAFT, CMS.getConfig().limitToContentSection()); m_searchPane
= new ItemSearch(ContentItem.DRAFT, CMS.getConfig().limitToContentSection());
} }
return m_searchPane; return m_searchPane;
} }
@ -249,8 +252,8 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
} }
/** /**
* Creates, and then caches, the workflow administration pane. Overriding * Creates, and then caches, the workflow administration pane. Overriding this method to return
* this method to return null will prevent this tab from appearing. * null will prevent this tab from appearing.
*/ */
protected WorkflowAdminPane getWorkflowAdminPane() { protected WorkflowAdminPane getWorkflowAdminPane() {
if (m_workflowPane == null) { if (m_workflowPane == null) {
@ -260,8 +263,8 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
} }
/** /**
* Creates, and then caches, the lifecycle administration pane. Overriding * Creates, and then caches, the lifecycle administration pane. Overriding this method to return
* this method to return null will prevent this tab from appearing. * null will prevent this tab from appearing.
*/ */
protected LifecycleAdminPane getLifecycleAdminPane() { protected LifecycleAdminPane getLifecycleAdminPane() {
if (m_lifecyclePane == null) { if (m_lifecyclePane == null) {
@ -271,8 +274,8 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
} }
/** /**
* Creates, and then caches, the category administration pane. Overriding * Creates, and then caches, the category administration pane. Overriding this method to return
* this method to return null will prevent this tab from appearing. * null will prevent this tab from appearing.
*/ */
protected CategoryAdminPane getCategoryAdminPane() { protected CategoryAdminPane getCategoryAdminPane() {
if (m_categoryPane == null) { if (m_categoryPane == null) {
@ -282,9 +285,8 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
} }
/** /**
* Creates, and then caches, the content type administration pane. * Creates, and then caches, the content type administration pane. Overriding this method to
* Overriding this method to return null will prevent this tab from * return null will prevent this tab from appearing.
* appearing.
*/ */
protected ContentTypeAdminPane getContentTypeAdminPane() { protected ContentTypeAdminPane getContentTypeAdminPane() {
if (m_typePane == null) { if (m_typePane == null) {
@ -301,7 +303,6 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
// } // }
// return m_userAdminPane; // return m_userAdminPane;
// } // }
protected LayoutPanel getCSEPane() { protected LayoutPanel getCSEPane() {
if (m_csePane == null) { if (m_csePane == null) {
m_csePane = new LayoutPanel(); m_csePane = new LayoutPanel();
@ -319,12 +320,12 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
} }
/** /**
* Adds the specified component, with the specified tab name, to the tabbed * Adds the specified component, with the specified tab name, to the tabbed pane only if it is
* pane only if it is not null. * not null.
* *
* @param pane The pane to which to add the tab * @param pane The pane to which to add the tab
* @param tabName The name of the tab if it's added * @param tabName The name of the tab if it's added
* @param comp The component to add to the pane * @param comp The component to add to the pane
*/ */
protected void addToPane(TabbedPane pane, String tabName, Component comp) { protected void addToPane(TabbedPane pane, String tabName, Component comp) {
if (comp != null) { if (comp != null) {
@ -333,22 +334,24 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
} }
private void tab(final TabbedPane pane, private void tab(final TabbedPane pane,
final String key, final String key,
final Component tab) { final Component tab) {
if (tab != null) { if (tab != null) {
pane.addTab(new Label(gz(key)), tab); pane.addTab(new Label(gz(key)), tab);
} }
} }
/** /**
* <p>Created the TabbedPane to use for this page. Adds the tabs to the * <p>
* pane. The default implementation uses a {@link * Created the TabbedPane to use for this page. Adds the tabs to the pane. The default
* com.arsdigita.bebop.TabbedPane}. This implementation also adds browse, * implementation uses a {@link
* search, staff admin, viewers admin, workflow admin, category admin, and * com.arsdigita.bebop.TabbedPane}. This implementation also adds browse, search, staff admin,
* content type panes.</p> * viewers admin, workflow admin, category admin, and content type panes.</p>
*
* <p>
* Developers can override this method to add only the tabs they want, or to add additional tabs
* after the default CMS tabs are added.</p>
* *
* <p>Developers can override this method to add only the tabs they want, or
* to add additional tabs after the default CMS tabs are added.</p>
* @return * @return
*/ */
protected TabbedPane createTabbedPane() { protected TabbedPane createTabbedPane() {
@ -367,7 +370,9 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
// (reset home folder) moved to folder browser // (reset home folder) moved to folder browser
// tab(pane, "cms.ui.user_admin", getUserAdminPane()); // tab(pane, "cms.ui.user_admin", getUserAdminPane());
tab(pane, "cms.ui.cse", getCSEPane()); tab(pane, "cms.ui.cse", getCSEPane());
tab(pane, "cms.ui.reports", getReportPane()); if (DbHelper.getDatabase() == DbHelper.DB_ORACLE) {
tab(pane, "cms.ui.reports", getReportPane());
}
return pane; return pane;
} }
@ -376,6 +381,7 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
* Fetch the request-local content section. * Fetch the request-local content section.
* *
* @param request The HTTP request * @param request The HTTP request
*
* @return The current content section * @return The current content section
*/ */
@Override @Override
@ -387,8 +393,7 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
} }
/** /**
* When a new tab is selected, reset the state of the formerly-selected * When a new tab is selected, reset the state of the formerly-selected pane.
* pane.
* *
* @param event The event fired by selecting a tab * @param event The event fired by selecting a tab
*/ */
@ -427,7 +432,8 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
* Construct a URL for displaying the tab * Construct a URL for displaying the tab
* *
* @param item The item from which we get the corresponding content section * @param item The item from which we get the corresponding content section
* @param tab The index of the tab to display * @param tab The index of the tab to display
*
* @return * @return
*/ */
public static String getSectionURL(ContentItem item, int tab) { public static String getSectionURL(ContentItem item, int tab) {
@ -435,7 +441,7 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
ContentSection section = ContentSection.getContentSection(item); ContentSection section = ContentSection.getContentSection(item);
String url = section.getURL() + PageLocations.SECTION_PAGE String url = section.getURL() + PageLocations.SECTION_PAGE
+ "?" + SET_TAB + "=" + tab; + "?" + SET_TAB + "=" + tab;
return url; return url;
} }
@ -448,7 +454,9 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
* Getting the GlobalizedMessage using a CMS Class targetBundle. * Getting the GlobalizedMessage using a CMS Class targetBundle.
* *
* @param key The resource key * @param key The resource key
*
* @return * @return
*
* @pre key != null * @pre key != null
*/ */
public static GlobalizedMessage globalize(final String key) { public static GlobalizedMessage globalize(final String key) {
@ -459,6 +467,7 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
* *
* @param key * @param key
* @param args * @param args
*
* @return * @return
*/ */
public static GlobalizedMessage globalize(final String key, public static GlobalizedMessage globalize(final String key,
@ -467,8 +476,7 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
} }
/** /**
* Helper class to be able to use a PrintListener to set the titel of the * Helper class to be able to use a PrintListener to set the titel of the page.
* page.
*/ */
private static class TitlePrinter implements PrintListener { private static class TitlePrinter implements PrintListener {
@ -482,5 +490,7 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
l.setLabel(CMS.getContext().getContentSection().getName()); l.setLabel(CMS.getContext().getContentSection().getName());
} }
} }
} }