incorporating APLAWS r1669, r1670, r1671

r1669 | chrisg23 | 2007-09-19 15:10:46 +0200 (Mi, 19 Sep 2007) 
Sourceforge patch 1797770 - put all those portal workspaces into one tidy group instead of having them clutter up the top level of the group admin tree. execute ccm upgrade --from-version 6.5.0 --to-version 6.5.1 in order to create top level group and move existing groups
------------------------------------------------------------------------
r1670 | chrisg23 | 2007-09-19 15:21:20 +0200 (Mi, 19 Sep 2007) 
Sourceforge patch 1569884 - option to use your selected html editor for the freeform html portlet - switch it on with ccm set com.arsdigita.london.portal.portlet.freeform_html.wysiwyg_editor=true - by default there is no change. If you use fckeditor, the included config prevents access to back end file system or content centre via the link dialog (on our site non-authors customise their homepages).
------------------------------------------------------------------------
r1671 | chrisg23 | 2007-09-19 15:48:47 +0200 (Mi, 19 Sep 2007) 
Sourceforge patch 1797923 - move individual application details above application list at ccm/portal/admin/sitemap.jsp


git-svn-id: https://svn.libreccm.org/ccm/trunk@29 8810af33-2d31-482b-a856-94f89814c4df
master
pb 2008-02-15 20:22:21 +00:00
parent 6acf25bc14
commit 42133caec0
9 changed files with 201 additions and 4 deletions

View File

@ -2,7 +2,7 @@
<ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project"
name="ccm-ldn-portal"
prettyName="Portal"
version="6.5.0"
version="6.5.1"
release="2"
webapp="ROOT">
<ccm:dependencies>

View File

@ -8,4 +8,7 @@
<version from="6.3.1" to="6.3.2">
<script sql="ccm-ldn-portal/upgrade/::database::-6.3.1-6.3.2.sql"/>
</version>
<version from="6.5.0" to="6.5.1">
<script class="com.arsdigita.london.portal.upgrade.CreateContainerGroups"/>
</version>
</upgrade>

View File

@ -249,6 +249,14 @@ public class Workspace extends Application {
Group members = new Group();
members.setName(title);
members.save();
// set this group as subgroup of workspace application type
// although workspace applications can be nested, place all
// member groups directly under main container (rather than reflecting
// hierarchical structure) because (a) workspace already manages its
// own groups so doesn't need a hierarchy and (b) hierarchy would
// mean for a given workspace, role would be on the same level
// as member groups of sub workspaces - messy & confusing
getApplicationType().getGroup().addSubgroup(members);
Role admins = members.createRole("Administrators");
admins.save();

View File

@ -50,6 +50,8 @@ public class WorkspaceConfig extends AbstractConfig {
private Parameter m_adminPortletTypes;
private BooleanParameter m_htmlPortletWysiwygEditor;
private StringParameter m_workspacePartyPrivilege;
private BooleanParameter m_checkWorkspaceReadPermissions;
@ -81,6 +83,11 @@ public class WorkspaceConfig extends AbstractConfig {
"com.arsdigita.london.portal.admin_only_portlet_types",
Parameter.OPTIONAL, new String[0]);
m_htmlPortletWysiwygEditor = new BooleanParameter(
"com.arsdigita.london.portal.portlet.freeform_html.wysiwyg_editor",
Parameter.REQUIRED,
Boolean.FALSE);
m_workspacePartyPrivilege = new StringParameter(
"com.arsdigita.london.portal.workspacePartyPrivilege",
Parameter.OPTIONAL, "read");
@ -94,6 +101,7 @@ public class WorkspaceConfig extends AbstractConfig {
register(m_createUserWorkspaces);
register(m_excludedPortletTypes);
register(m_adminPortletTypes);
register(m_htmlPortletWysiwygEditor);
register(m_workspacePartyPrivilege);
register(m_checkWorkspaceReadPermissions);
@ -126,6 +134,10 @@ public class WorkspaceConfig extends AbstractConfig {
return Arrays.asList(adminTypes);
}
public boolean useWysiwygEditor() {
return ((Boolean) get(m_htmlPortletWysiwygEditor)).booleanValue();
}
private PrivilegeDescriptor workspacePartyPrivilegeDescriptor = null;
private void initWorkspacePartyPrivilegeDescriptor() {

View File

@ -23,6 +23,11 @@ com.arsdigita.london.portal.admin_only_portlet_types.purpose=Only available to a
com.arsdigita.london.portal.admin_only_portlet_types.format=[string,string,string]
com.arsdigita.london.portal.admin_only_portlet_types.example=com.arsdigita.london.portal.portlet.ApplicationDirectoryPortlet,com.arsdigita.london.portal.portlet.TimeOfDayPortlet
com.arsdigita.london.portal.portlet.freeform_html.wysiwyg_editor.title=use wysiwyg editor for freeform html portlet
com.arsdigita.london.portal.portlet.freeform_html.wysiwyg_editor.purpose=If true, use editor specified by waf.bebop.dhtml_editor when user edits freeform html portlet
com.arsdigita.london.portal.portlet.freeform_html.wysiwyg_editor.format=[boolean]
com.arsdigita.london.portal.portlet.freeform_html.wysiwyg_editor.example=false
com.arsdigita.london.portal.workspacePartyPrivilege.title=Privilege granted to the workspace party
com.arsdigita.london.portal.workspacePartyPrivilege.purpose=Specify which privilege is granted to the workspace party. Should be "read" or "edit".
com.arsdigita.london.portal.workspacePartyPrivilege.format=[string]

View File

@ -15,22 +15,33 @@
package com.arsdigita.london.portal.ui.portlet;
import org.apache.log4j.Logger;
import com.arsdigita.bebop.Bebop;
import com.arsdigita.bebop.ColumnPanel;
import com.arsdigita.bebop.FormProcessException;
import com.arsdigita.bebop.Label;
import com.arsdigita.bebop.PageState;
import com.arsdigita.bebop.RequestLocal;
import com.arsdigita.bebop.form.DHTMLEditor;
import com.arsdigita.bebop.form.TextArea;
import com.arsdigita.bebop.parameters.NotNullValidationListener;
import com.arsdigita.bebop.parameters.StringInRangeValidationListener;
import com.arsdigita.bebop.parameters.StringParameter;
import com.arsdigita.bebop.util.BebopConstants;
import com.arsdigita.cms.ui.CMSDHTMLEditor;
import com.arsdigita.cms.ui.authoring.TextAssetBody.PageTextForm;
import com.arsdigita.kernel.ResourceType;
import com.arsdigita.london.portal.Workspace;
import com.arsdigita.london.portal.portlet.FreeformHTMLPortlet;
import com.arsdigita.london.portal.ui.PortletConfigFormSection;
import com.arsdigita.portal.Portlet;
public class FreeformHTMLPortletEditor extends PortletConfigFormSection {
private Logger s_log = Logger.getLogger(FreeformHTMLPortletEditor.class);
private static final String FCK_PORTLET_CONFIG = "/assets/fckeditor/config/fckconfig_portlet.js";
private TextArea m_content;
public FreeformHTMLPortletEditor(ResourceType resType,
@ -45,7 +56,20 @@ public class FreeformHTMLPortletEditor extends PortletConfigFormSection {
protected void addWidgets() {
super.addWidgets();
if (Workspace.getConfig().useWysiwygEditor()) {
m_content = new CMSDHTMLEditor(PageTextForm.TEXT_ENTRY);
m_content.setWrap(CMSDHTMLEditor.SOFT);
if (Bebop.getConfig().getDHTMLEditor().equals(BebopConstants.BEBOP_FCKEDITOR)) {
((DHTMLEditor)m_content).setConfig(new DHTMLEditor.Config("portlet-fck", FCK_PORTLET_CONFIG));
m_content.setMetaDataAttribute("height", "300");
} else {
// remove this so end users cannot browse through back end folder system
((DHTMLEditor)m_content).hideButton("insertlink");
}
} else {
m_content = new TextArea(new StringParameter("content"));
}
m_content.setRows(10);
m_content.setCols(35);
m_content.addValidationListener(new NotNullValidationListener());

View File

@ -0,0 +1,115 @@
/*
* Copyright (C) 2007 Chris Gilbert All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
package com.arsdigita.london.portal.upgrade;
import org.apache.commons.cli.CommandLine;
import org.apache.log4j.Logger;
import com.arsdigita.kernel.Group;
import com.arsdigita.kernel.GroupCollection;
import com.arsdigita.kernel.Party;
import com.arsdigita.london.portal.Workspace;
import com.arsdigita.london.portal.WorkspaceCollection;
import com.arsdigita.london.util.Program;
import com.arsdigita.persistence.SessionManager;
import com.arsdigita.persistence.TransactionContext;
import com.arsdigita.web.ApplicationType;
/**
* @author chris gilbert (chris.gilbert@westsussex.gov.uk)
*
* Tidy up portal groups so they are not all at root level
*
*
*/
public class CreateContainerGroups extends Program {
public CreateContainerGroups() {
super("CreateGroups", "1.0.0", "");
}
private static Logger s_log = Logger.getLogger(CreateContainerGroups.class);
public void doRun(CommandLine cmdLine) {
try {
final TransactionContext tc = SessionManager.getSession().getTransactionContext();
tc.beginTxn();
WorkspaceCollection existingWorkSpaces = Workspace.retrieveAll();
Group parentGroup = null;
while (existingWorkSpaces.next()) {
Workspace workspace = existingWorkSpaces.getWorkspace();
// do this inside the loop because we get the workspace application
// type from an instance of a workspace
if (parentGroup == null) {
s_log.info("Creating group for workspace application type");
System.out.println("Creating group for workspace application type");
ApplicationType workspaceType = workspace.getApplicationType();
if (workspaceType.getGroup() == null) {
workspaceType.createGroup();
}
parentGroup = workspaceType.getGroup();
}
Group workspaceGroup = null;
Party party = workspace.getParty();
if (party instanceof Group) {
workspaceGroup = (Group)party;
} else {
GroupCollection groups = Group.retrieveAll();
groups.addEqualsFilter("name", workspace.getTitle());
if (groups.next()) {
workspaceGroup = groups.getGroup();
}
groups.close();
groups.reset();
}
if (workspaceGroup != null) {
GroupCollection supergroups = workspaceGroup.getSupergroups();
supergroups.addEqualsFilter(Group.ID, parentGroup.getID());
if (supergroups.size() == 0) {
s_log.info("moving group for " + workspace.getTitle());
System.out.println("moving group for " + workspace.getTitle());
parentGroup.addSubgroup(workspaceGroup);
} else {
s_log.info("group for " + workspace.getTitle() + " is already child of workspace type group");
System.out.println("group for " + workspace.getTitle() + " is already child of workspace type group");
}
} else {
s_log.info("can't find group for " + workspace.getTitle());
System.out.println("can't find group for " + workspace.getTitle());
}
}
tc.commitTxn();
} catch (Throwable e) {
s_log.error("error occured", e);
System.out.println("error occured. Check logs for details");
}
}
public static final void main(final String[] args) {
new CreateContainerGroups().run(args);
}
}

View File

@ -0,0 +1,30 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 Frederico Caldeira Knabben
*
* Custom amendments for freeform html portlet
*/
FCKConfig.FillEmptyBlocks = true ;
FCKConfig.ToolbarSets["Basic"] = [
['Source','-','Preview','-'],
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
['Cut','Copy','Paste','PasteText','PasteWord','-','Print'],
['OrderedList','UnorderedList','-','Outdent','Indent'],
['Link','Unlink'],
['Undo','Redo','-','SelectAll'],
['TextColor','BGColor'],
['Rule','SpecialChar'],
['FontFormat','FontName'],
['FontSize']
] ;
//only licenced for personal use
//FCKConfig.SpellChecker = 'ieSpell' ; // 'ieSpell' | 'SpellerPages'
//FCKConfig.IeSpellDownloadUrl = 'http://www.iespell.com/rel/ieSpellSetup211325.exe' ;
FCKConfig.LinkBrowser = false ;
FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Connector=connectors/' + _FileBrowserLanguage + '/connector.' + _FileBrowserExtension ;
FCKConfig.SmileyImages = ['regular_smile.gif','sad_smile.gif','wink_smile.gif','teeth_smile.gif','confused_smile.gif','tounge_smile.gif','embaressed_smile.gif','omg_smile.gif','whatchutalkingabout_smile.gif','angry_smile.gif','angel_smile.gif','shades_smile.gif','devil_smile.gif','cry_smile.gif','lightbulb.gif','thumbs_down.gif','thumbs_up.gif','heart.gif','broken_heart.gif','kiss.gif','envelope.gif'] ;

View File

@ -26,9 +26,9 @@
</xsl:template>
<xsl:template match="portal:sitemap">
<h3>Applications</h3>
<xsl:apply-templates select="portal:applicationList"/>
<xsl:apply-templates select="portal:applicationPane"/>
<h3>All Applications</h3>
<xsl:apply-templates select="portal:applicationList"/>
</xsl:template>
<xsl:template match="portal:workspaceDelete">