mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
. WCM UI
- Added Edit and Delete actions for AVM files and Delete action for AVM folders - Available on the Modified Items list for a user and also in the website sandbox browse screens - Edit is working using the inline editors for plain text and HTML files - XML form content editing to be integrated shortly! - Edit for non-inline editable files is working (i.e. download file), but no "Update" action available at present for saving updates - Delete will delete files/folders structures from the current sandbox, deleted files in a layer are shown in My Modified Files (see below) - User sandbox My Modified Files now shows deleted files as differences (as ghosted out rows) - Refactoring of the modified Create Content Wizard into a new wizard Create Web Content Wizard - responsible for creating content in the AVM store rather than usual SpacesStore - removed XML specific handling from Create Content Wizard (now only present in Create Web Content Wizard) - Create Content action added to sandbox view - NOTE: does not yet create content in the AVM world! - Added "jsp" filetype as plain text format mimetype (to allow inline-edit for JSP files as website content) - Open/closed state of My Modified Files panel is remembered between screen refreshes git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3863 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
57
source/web/jsp/wcm/create-web-content-wizard/create-html.jsp
Normal file
57
source/web/jsp/wcm/create-web-content-wizard/create-html.jsp
Normal file
@@ -0,0 +1,57 @@
|
||||
<%--
|
||||
Copyright (C) 2005 Alfresco, Inc.
|
||||
|
||||
Licensed under the Mozilla Public License version 1.1
|
||||
with a permitted attribution clause. You may obtain a
|
||||
copy of the License at
|
||||
|
||||
http://www.alfresco.org/legal/license.txt
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
either express or implied. See the License for the specific
|
||||
language governing permissions and limitations under the
|
||||
License.
|
||||
--%>
|
||||
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
|
||||
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
|
||||
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
|
||||
|
||||
<f:verbatim>
|
||||
<script language="javascript" type="text/javascript" src="<%=request.getContextPath()%>/scripts/tiny_mce/tiny_mce.js"></script>
|
||||
<script language="javascript" type="text/javascript">
|
||||
|
||||
<%-- Init the Tiny MCE in-line HTML editor --%>
|
||||
tinyMCE.init({
|
||||
theme : "advanced",
|
||||
mode : "exact",
|
||||
elements : "editor",
|
||||
save_callback : "saveContent",
|
||||
plugins : "table",
|
||||
theme_advanced_toolbar_location : "top",
|
||||
theme_advanced_toolbar_align : "left",
|
||||
theme_advanced_buttons1_add : "fontselect,fontsizeselect",
|
||||
theme_advanced_buttons2_add : "separator,forecolor,backcolor",
|
||||
theme_advanced_buttons3_add_before : "tablecontrols,separator",
|
||||
theme_advanced_disable: "styleselect",
|
||||
extended_valid_elements : "a[href|target|name],font[face|size|color|style],span[class|align|style]"
|
||||
});
|
||||
|
||||
function saveContent(id, content)
|
||||
{
|
||||
document.getElementById("wizard:wizard-body:editor-output").value = content;
|
||||
}
|
||||
|
||||
var isIE = (document.all);
|
||||
|
||||
</script>
|
||||
|
||||
<div id='editor' style='width:100%; height:360px'>
|
||||
</f:verbatim>
|
||||
<h:outputText value="#{WizardManager.bean.content}" escape="false" />
|
||||
<f:verbatim>
|
||||
</div>
|
||||
</f:verbatim>
|
||||
<h:inputHidden id="editor-output" value="#{WizardManager.bean.content}" />
|
24
source/web/jsp/wcm/create-web-content-wizard/create-text.jsp
Normal file
24
source/web/jsp/wcm/create-web-content-wizard/create-text.jsp
Normal file
@@ -0,0 +1,24 @@
|
||||
<%--
|
||||
Copyright (C) 2005 Alfresco, Inc.
|
||||
|
||||
Licensed under the Mozilla Public License version 1.1
|
||||
with a permitted attribution clause. You may obtain a
|
||||
copy of the License at
|
||||
|
||||
http://www.alfresco.org/legal/license.txt
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
either express or implied. See the License for the specific
|
||||
language governing permissions and limitations under the
|
||||
License.
|
||||
--%>
|
||||
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
|
||||
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
|
||||
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
|
||||
|
||||
<h:inputTextarea id="textArea" rows="24" cols="112" value="#{WizardManager.bean.content}" />
|
||||
|
||||
|
81
source/web/jsp/wcm/create-web-content-wizard/create-xml.jsp
Normal file
81
source/web/jsp/wcm/create-web-content-wizard/create-xml.jsp
Normal file
@@ -0,0 +1,81 @@
|
||||
<%--
|
||||
Copyright (C) 2005 Alfresco, Inc.
|
||||
|
||||
Licensed under the Mozilla Public License version 1.1
|
||||
with a permitted attribution clause. You may obtain a
|
||||
copy of the License at
|
||||
|
||||
http://www.alfresco.org/legal/license.txt
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
either express or implied. See the License for the specific
|
||||
language governing permissions and limitations under the
|
||||
License.
|
||||
--%>
|
||||
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
|
||||
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
|
||||
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
|
||||
<%@ page import="org.alfresco.web.app.Application" %>
|
||||
<%@ page import="org.alfresco.web.templating.*" %>
|
||||
<%@ page import="org.alfresco.web.bean.wcm.CreateWebContentWizard" %>
|
||||
<%@ page import="org.w3c.dom.Document" %>
|
||||
|
||||
<%
|
||||
final CreateWebContentWizard wiz = (CreateWebContentWizard)
|
||||
Application.getWizardManager().getBean();
|
||||
TemplateType tt = wiz.getTemplateType();
|
||||
TemplateInputMethod tim = tt.getInputMethods().get(0);
|
||||
final TemplatingService ts = TemplatingService.getInstance();
|
||||
final InstanceData instanceData = new InstanceData()
|
||||
{
|
||||
public Document getContent()
|
||||
{
|
||||
try
|
||||
{
|
||||
return (wiz.getContent() != null ? ts.parseXML(wiz.getContent()) : null);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void setContent(final Document d)
|
||||
{
|
||||
wiz.setContent(ts.writeXMLToString(d));
|
||||
}
|
||||
};
|
||||
tim.generate(instanceData, tt, out);
|
||||
%>
|
||||
<script type="text/javascript">
|
||||
dojo.addOnLoad(function()
|
||||
{
|
||||
addSubmitHandlerToButton(document.getElementById("wizard:next-button"));
|
||||
addSubmitHandlerToButton(document.getElementById("wizard:finish-button"));
|
||||
});
|
||||
//
|
||||
//var baseOnClick = b.onclick;
|
||||
//b.onclick = function()
|
||||
//{
|
||||
// if (!document.submitTrigger.done)
|
||||
// {
|
||||
// document.submitTrigger.buttonClick();
|
||||
// return false;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return baseOnClick();
|
||||
// }
|
||||
//}
|
||||
//});
|
||||
//function doSubmit()
|
||||
//{
|
||||
//var b = document.getElementById("wizard:next-button");
|
||||
//b.click();
|
||||
//}
|
||||
|
||||
</script>
|
113
source/web/jsp/wcm/create-web-content-wizard/details.jsp
Normal file
113
source/web/jsp/wcm/create-web-content-wizard/details.jsp
Normal file
@@ -0,0 +1,113 @@
|
||||
<%--
|
||||
Copyright (C) 2005 Alfresco, Inc.
|
||||
|
||||
Licensed under the Mozilla Public License version 1.1
|
||||
with a permitted attribution clause. You may obtain a
|
||||
copy of the License at
|
||||
|
||||
http://www.alfresco.org/legal/license.txt
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
either express or implied. See the License for the specific
|
||||
language governing permissions and limitations under the
|
||||
License.
|
||||
--%>
|
||||
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
|
||||
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
|
||||
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
|
||||
|
||||
<f:verbatim>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/scripts/validation.js"> </script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var finishButtonPressed = false;
|
||||
window.onload = pageLoaded;
|
||||
|
||||
function pageLoaded()
|
||||
{
|
||||
document.getElementById("wizard:wizard-body:file-name").focus();
|
||||
document.getElementById("wizard").onsubmit = validate;
|
||||
document.getElementById("wizard:next-button").onclick = function() {finishButtonPressed = true; clear_wizard();}
|
||||
document.getElementById("wizard:finish-button").onclick = function() {finishButtonPressed = true; clear_wizard();}
|
||||
}
|
||||
|
||||
function checkButtonState()
|
||||
{
|
||||
if (document.getElementById("wizard:wizard-body:file-name").value.length == 0 )
|
||||
{
|
||||
document.getElementById("wizard:next-button").disabled = true;
|
||||
document.getElementById("wizard:finish-button").disabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById("wizard:next-button").disabled = false;
|
||||
document.getElementById("wizard:finish-button").disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
function validate()
|
||||
{
|
||||
if (finishButtonPressed)
|
||||
{
|
||||
finishButtonPressed = false;
|
||||
return validateName(document.getElementById("wizard:wizard-body:file-name"),
|
||||
'</f:verbatim><a:outputText value="#{msg.validation_invalid_character}" /><f:verbatim>',
|
||||
true);
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</f:verbatim>
|
||||
|
||||
<h:panelGrid columns="1" cellpadding="2" style="padding-top: 4px; padding-bottom: 4px;"
|
||||
width="100%" rowClasses="wizardSectionHeading">
|
||||
<h:outputText value=" #{msg.general_properties}" escape="false" />
|
||||
</h:panelGrid>
|
||||
|
||||
<h:panelGrid columns="3" cellpadding="3" cellspacing="3" border="0">
|
||||
<h:graphicImage value="/images/icons/required_field.gif" alt="Required Field" />
|
||||
<h:outputText value="#{msg.name}:"/>
|
||||
<h:inputText id="file-name" value="#{WizardManager.bean.fileName}"
|
||||
maxlength="1024" size="35"
|
||||
onkeyup="checkButtonState();"
|
||||
onchange="checkButtonState();" />
|
||||
|
||||
<h:outputText value=""/>
|
||||
<h:outputText value="#{msg.type}:"/>
|
||||
<h:selectOneMenu value="#{WizardManager.bean.objectType}">
|
||||
<f:selectItems value="#{WizardManager.bean.objectTypes}" />
|
||||
</h:selectOneMenu>
|
||||
|
||||
<h:outputText value=""/>
|
||||
<h:outputText value="#{msg.content_type}:"/>
|
||||
<h:selectOneMenu value="#{WizardManager.bean.mimeType}"
|
||||
valueChangeListener="#{WizardManager.bean.createContentChanged}">
|
||||
<f:selectItems value="#{WizardManager.bean.createMimeTypes}" />
|
||||
</h:selectOneMenu>
|
||||
|
||||
<h:outputText value=""/>
|
||||
<h:outputText value="#{msg.template_type}:"/>
|
||||
<h:selectOneMenu value="#{WizardManager.bean.templateTypeName}">
|
||||
<f:selectItems value="#{WizardManager.bean.createTemplateTypes}" />
|
||||
</h:selectOneMenu>
|
||||
</h:panelGrid>
|
||||
|
||||
<h:panelGrid columns="1" cellpadding="3" cellspacing="3" border="0" style="padding-top: 4px;"
|
||||
width="100%" rowClasses="wizardSectionHeading, paddingRow"
|
||||
rendered="#{WizardManager.bean.otherPropertiesChoiceVisible}">
|
||||
<h:outputText value=" #{msg.other_properties}" escape="false" />
|
||||
<h:outputText value="#{msg.modify_props_help_text}" />
|
||||
</h:panelGrid>
|
||||
|
||||
<h:panelGrid style="padding-top: 2px;" columns="2"
|
||||
rendered="#{WizardManager.bean.otherPropertiesChoiceVisible}">
|
||||
<h:selectBooleanCheckbox value="#{WizardManager.bean.showOtherProperties}" />
|
||||
<h:outputText value="#{msg.modify_props_when_wizard_closes}" />
|
||||
</h:panelGrid>
|
Reference in New Issue
Block a user