### Eclipse Workspace Patch 1.0 #P web Index: standard/src/main/webapp/templates/editobject.vm =================================================================== --- standard/src/main/webapp/templates/editobject.vm (revision 14906) +++ standard/src/main/webapp/templates/editobject.vm (working copy) @@ -1,89 +1,159 @@ #if($request.xpage && $request.xpage=="editobject") -$response.sendRedirect($doc.getURL($context.action, "editor=object")) -#else -#set($formname = "update") -#set($saveaction = "save") -#set($hasCustomClass = ($request.classname && (!$request.classname.trim().equals("")))) -#set($hasCustomObject = ($hasCustomClass && $request.nb && (!$request.nb.trim().equals("")))) -#set($hasCustomField = ($hasCustomClass && ("$!request.property.trim()" != ""))) -#if($hasCustomClass) -#set($classes = [$xwiki.getDocument($request.classname).getxWikiClass()]) + $response.sendRedirect($doc.getURL($context.action, "editor=object")) #else -#set($classes = $doc.getxWikiClasses()) -#end -#set($redirect = $xwiki.getRequestURL()) + #set($formname = "update") + #set($saveaction = "save") + #set($hasCustomClass = ($request.classname && (!$request.classname.trim().equals("")))) + #set($hasCustomObject = ($hasCustomClass && $request.nb && (!$request.nb.trim().equals("")))) + #set($hasCustomField = ($hasCustomClass && ("$!request.property.trim()" != ""))) + #if($hasCustomClass) + #set($classes = [$xwiki.getDocument($request.classname).getxWikiClass()]) + #else + #set($classes = $doc.getxWikiClasses()) + #end + #set($redirect = $xwiki.getRequestURL()) +
+ #if($hasobjs) -#end #end \ No newline at end of file #P skins Index: toucan/src/main/resources/toucan/toucan.css =================================================================== --- toucan/src/main/resources/toucan/toucan.css (revision 14906) +++ toucan/src/main/resources/toucan/toucan.css (working copy) @@ -125,17 +125,6 @@ border: none; } -pre { - background-color: #F1F7FF; - border: 1px dotted #555555; - float: left; - white-space: pre; - padding: 10px; - margin: 0; - overflow: auto; - position: relative; /*word-wrap:break-word;*/ -} - /* Used to signify a rendering error in the rendered page. Valid only with new rendering */ .xwikirenderingerror { background-color: #FF5555; @@ -292,8 +281,8 @@ border: 1px dotted #555555; } -#xwikimaincontainerinner .code p { - font-family: courier, courier new, monospace; +#xwikimaincontainerinner .code pre { + font-family: courier, courier new, monospace; } .java-keyword { @@ -2421,7 +2410,7 @@ padding-right: 4px; } -#xwikiclassproperties, #xwikiobjects { +.xwikiclassproperties, .xwikiobjects { border: 1px solid #DDD !important; } @@ -2742,8 +2731,9 @@ width: 100%; } -div#xwikiclassproperties.accordion dt label, - div#xwikiobjects.accordion label { +#editcolumn div.xwikiclassproperties.accordion dt label, +div.xwikiclassproperties.accordion dt label, + div.xwikiobjects.accordion label { display: block; font: normal 0.8em sans-serif; text-transform: uppercase; @@ -2758,21 +2748,21 @@ border-bottom: 1px dashed #ccc; } -#editcolumn div.alleditcontent div#xwikiclassproperties.accordion dd label { +#editcolumn div.alleditcontent div.xwikiclassproperties.accordion dd label { text-align: left; margin: 0; font-size: 0.8em; font-weight: normal; } -div#xwikiclassproperties.accordion textarea, - div#xwikiobjects.accordion textarea, - div#xwikiclassproperties.accordion input[type=text], - div#xwikiobjects.accordion input[type=text] { +div.xwikiclassproperties.accordion textarea, + div.xwikiobjects.accordion textarea, + div.xwikiclassproperties.accordion input[type=text], + div.xwikiobjects.accordion input[type=text] { width: 98%; } -div#xwikiclassproperties.accordion +div.xwikiclassproperties.accordion #xwikidoctitleinput { width: 40%; #P core Index: xwiki-core/src/main/resources/ApplicationResources.properties =================================================================== --- xwiki-core/src/main/resources/ApplicationResources.properties (revision 14906) +++ xwiki-core/src/main/resources/ApplicationResources.properties (working copy) @@ -70,8 +70,14 @@ actions=Actions default=default confirmobjectremove=Are you sure you want to remove this object? +confirmobjectpropdelete=Are you sure you want to delete this property from this object? +confirmobjectpropsynchronize=Are you sure you want to synchronize this object with the class (all deprecated properties will be removed DEFINITELY)? +confirmobjectpropallclasssynchronize=Are you sure you want to synchronize all the objects of this class (ALL deprecated properties of ALL objects will be removed DEFINITELY)? confirmdelete=This action is not reversible. Are you sure you want to delete this document? confirmdelete2=Please confirm you want to delete this document? +confirmpropdisable=Please confirm you want to disable this property? +confirmpropenable=Please confirm you want to enable this property? +confirmpropdelete=This action is not reversible. Are you sure you want to delete this property? backlinkswarningdelete=There are pages that link here! confirmdelattachment=Please confirm you want to delete this attachment? deleted=The document has been deleted. @@ -83,6 +89,15 @@ propname=Name selectproptype=Select a type addproperty=Add Property +disablethisprop= Disable Property +enablethisprop= Enable Property +deletethisprop= Delete Property +enabledproperties= Enabled Properties +disabledproperties= Disabled Properties +deprecatedproperties= Deprecated Properties +noenabledproperties= No Enabled Properties +nodisabledproperties= No Disabled Properties +nodeprecatedproperties= No Deprecated Properties saveclass=Save Class welcometoclasseditor=Welcome to the class editor. Choose a field to edit or add a field to the class. editfield=Edit Field @@ -91,11 +106,15 @@ welcometoobjecteditor=Welcome to the objects editor. Choose an object to edit or add an object to the document. saveobjects=Save Objects youcan=You can -removethisobject=remove this object +removethisobject=Remove this object +synchronizethisobject=Synchronize this object +synchronizethisobject_title=Synchronize this object properties with current class properties +synchronizeallobjects=Synchronize all objects +synchronizeallobjects_title=Synchronize all objects'properties with their class properties (remove deprecated properties) rightseditor=Access Rights Editor addrightentry=Add Access Right Entry welcometorightseditor=Welcome to the Access Rights editor. Choose a right entry to edit or add a new right entry: -removethisrightentry=remove this right entry +removethisrightentry=Remove this right entry saverights=Save Access Rights accountdisabled=Your account has been disabled. Please contact the administrator if you think this is a problem. accountnotactive=Your account is not yet active, because your email has not yet been confirmed. @@ -756,11 +775,17 @@ core.comment.addObject=Added object core.comment.updateObject=Updated object core.comment.deleteObject=Deleted object +core.comment.deleteObjectProp=Deleted object property +core.comment.synchronizeObjectProp=Synchronized object property +core.comment.synchronizeObjectPropAllClass=Synchronized object property for the whole class core.comment.addProperty=Added property core.comment.updateProperty=Updated property core.comment.updatePropertyName=Updated property name core.comment.addClassProperty=Added class property core.comment.updateClassProperty=Updated class property +core.comment.disableClassProperty=Disabled class property +core.comment.enableClassProperty=Enabled class property +core.comment.removeClassProperty=Removed class property core.comment.updateClassPropertyName=Updated class property name core.comment.createdUser=Created user core.comment.addedUserToGroup=Added user to group @@ -1053,6 +1078,7 @@ platform.core.action.objectRemove.noClassnameSpecified=No object type specified. platform.core.action.objectRemove.noObjectSpecified=No object specified. platform.core.action.objectRemove.invalidObject=Invalid object specified. +platform.core.action.objectRemove.noPropnameSpecified=No object property specified. tags.save=Save tags.save.success=Tags saved successfuly Index: xwiki-core/src/main/java/com/xpn/xwiki/web/PropDisableForm.java =================================================================== --- xwiki-core/src/main/java/com/xpn/xwiki/web/PropDisableForm.java (revision 0) +++ xwiki-core/src/main/java/com/xpn/xwiki/web/PropDisableForm.java (revision 0) @@ -0,0 +1,71 @@ +/* + * See the NOTICE file distributed with this work for additional + * information regarding copyright ownership. + * + * This 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 software 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 software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + * + */ + +package com.xpn.xwiki.web; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + + + +public class PropDisableForm extends XWikiForm { + + private static final Log LOG = LogFactory.getLog(PropDisableForm.class); + + private String className; + private String propName; + + public void readRequest() + { + try { + setClassName(getRequest().getParameter("classname")); + } catch (Exception ex) { + setClassName(null); + LOG.warn("No or bad classname found while processing an propdelete request: " + + getRequest().getParameter("classname")); + } + + try { + setPropName(getRequest().getParameter("propname")); + } catch (Exception ex) { + setPropName(null); + LOG.warn("No or bad propname found while processing an propdelete request: " + + getRequest().getParameter("propname")); + } + } + + public String getClassName() { + return className; + } + + public void setClassName(String className) { + this.className = className; + } + + public String getPropName() { + return propName; + } + + public void setPropName(String propName) { + this.propName = propName; + } + +} Index: xwiki-core/src/main/java/com/xpn/xwiki/objects/classes/PropertyClass.java =================================================================== --- xwiki-core/src/main/java/com/xpn/xwiki/objects/classes/PropertyClass.java (revision 14906) +++ xwiki-core/src/main/java/com/xpn/xwiki/objects/classes/PropertyClass.java (working copy) @@ -62,6 +62,7 @@ setPrettyName(prettyname); setxWikiClass(xWikiClass); setUnmodifiable(false); + setEnabled(true); } public BaseClass getxWikiClass() @@ -471,6 +472,20 @@ } } + public boolean isEnabled() + { + return (getIntValue("enabled") == 1); + } + + public void setEnabled(boolean enabled) + { + if (enabled) { + setIntValue("enabled", 1); + } else { + setIntValue("enabled", 0); + } + } + public BaseProperty fromStringArray(String[] strings) { return fromString(strings[0]); Index: xwiki-core/src/main/java/com/xpn/xwiki/web/ObjectPropAllClassSynchronizeAction.java =================================================================== --- xwiki-core/src/main/java/com/xpn/xwiki/web/ObjectPropAllClassSynchronizeAction.java (revision 0) +++ xwiki-core/src/main/java/com/xpn/xwiki/web/ObjectPropAllClassSynchronizeAction.java (revision 0) @@ -0,0 +1,127 @@ +/* + * See the NOTICE file distributed with this work for additional + * information regarding copyright ownership. + * + * This 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 software 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 software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + * + */ +package com.xpn.xwiki.web; + +import java.io.IOException; +import java.util.Collection; +import java.util.Vector; + +import org.apache.commons.lang.BooleanUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.velocity.VelocityContext; + +import com.xpn.xwiki.XWiki; +import com.xpn.xwiki.XWikiContext; +import com.xpn.xwiki.XWikiException; +import com.xpn.xwiki.doc.XWikiDocument; +import com.xpn.xwiki.objects.BaseObject; +import com.xpn.xwiki.objects.BaseProperty; +import com.xpn.xwiki.objects.classes.BaseClass; +import com.xpn.xwiki.objects.classes.PropertyClass; + +public class ObjectPropAllClassSynchronizeAction extends XWikiAction +{ + + /** + * {@inheritDoc} + * + * @see XWikiAction#action(XWikiContext) + */ + public boolean action(XWikiContext context) throws XWikiException + { + XWiki xwiki = context.getWiki(); + XWikiResponse response = context.getResponse(); + XWikiDocument doc = context.getDoc(); + + ObjectPropAllClassSynchronizeForm form = (ObjectPropAllClassSynchronizeForm) context.getForm(); + + Collection