Author: pboy Date: 2013-02-02 18:40:36 +0000 (Sat, 02 Feb 2013) New Revision: 2470 Modified: trunk/ccm-atoz/src/com/arsdigita/atoz/tools/AtoZCreator.java trunk/ccm-atoz/src/com/arsdigita/atoz/ui/admin/ItemProviderForm.java trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig.java trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig_parameter.properties trunk/ccm-cms/src/com/arsdigita/cms/Initializer.java trunk/ccm-cms/src/com/arsdigita/cms/Loader.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/AbstractContentTypeLoader.java Log: Made various authoring steps configurable. Modified: trunk/ccm-atoz/src/com/arsdigita/atoz/tools/AtoZCreator.java =================================================================== --- trunk/ccm-atoz/src/com/arsdigita/atoz/tools/AtoZCreator.java 2013-02-02 18:31:17 UTC (rev 2469) +++ trunk/ccm-atoz/src/com/arsdigita/atoz/tools/AtoZCreator.java 2013-02-02 18:40:36 UTC (rev 2470) @@ -15,7 +15,6 @@ * 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.atoz.tools; import com.arsdigita.atoz.AtoZ; @@ -32,7 +31,6 @@ import org.apache.commons.cli.CommandLine; import org.apache.log4j.Logger; - /** * Command line utility to create an application instance of AtoZ. * @@ -53,14 +51,15 @@ private void addAtoZ(String atozURL, String atozTitle) { - if (!Application.isInstalled(AtoZ.BASE_DATA_OBJECT_TYPE, "/"+atozURL+"/")) { + if (!Application.isInstalled(AtoZ.BASE_DATA_OBJECT_TYPE, "/" + atozURL + "/")) { DomainObjectFactory.registerInstantiator( AtoZ.BASE_DATA_OBJECT_TYPE, new DomainObjectInstantiator() { - public DomainObject doNewInstance(DataObject dataObject) { - return new AtoZ(dataObject); - } - }); + public DomainObject doNewInstance(DataObject dataObject) { + return new AtoZ(dataObject); + } + + }); Application app = Application.createApplication( AtoZ.BASE_DATA_OBJECT_TYPE, atozURL, atozTitle, null); app.save(); @@ -68,7 +67,7 @@ } else { System.err.println(AtoZ.BASE_DATA_OBJECT_TYPE - + " already installed at " + atozURL); + + " already installed at " + atozURL); System.exit(1); } @@ -86,7 +85,7 @@ String atozURL = args[0]; String atozTitle = args[1]; if (atozURL != null && atozURL.length() != 0 - && atozTitle != null && atozTitle.length() != 0) { + && atozTitle != null && atozTitle.length() != 0) { addAtoZ(atozURL, atozTitle); } else { help(System.err); @@ -97,8 +96,10 @@ System.exit(1); } } + }.run(); } + }.run(); } Modified: trunk/ccm-atoz/src/com/arsdigita/atoz/ui/admin/ItemProviderForm.java =================================================================== --- trunk/ccm-atoz/src/com/arsdigita/atoz/ui/admin/ItemProviderForm.java 2013-02-02 18:31:17 UTC (rev 2469) +++ trunk/ccm-atoz/src/com/arsdigita/atoz/ui/admin/ItemProviderForm.java 2013-02-02 18:40:36 UTC (rev 2470) @@ -15,7 +15,6 @@ * 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.atoz.ui.admin; import com.arsdigita.atoz.ItemProvider; @@ -63,12 +62,12 @@ super.addWidgets(); m_loadPaths = new TextField(ItemProvider.LOAD_PATHS); - ((SimpleComponent)m_loadPaths).setMetaDataAttribute("label", "Attributes to retrieve"); + ((SimpleComponent) m_loadPaths).setMetaDataAttribute("label", "Attributes to retrieve"); add(m_loadPaths); m_loadPaths.addValidationListener(new StringInRangeValidationListener(0, 200)); m_picker = new AllCategoryPicker("rootCategory"); - ((SimpleComponent)m_picker).setMetaDataAttribute("label", "Category filter"); - ((SingleSelect)m_picker).addValidationListener(new NotNullValidationListener()); + ((SimpleComponent) m_picker).setMetaDataAttribute("label", "Category filter"); + ((SingleSelect) m_picker).addValidationListener(new NotNullValidationListener()); add(m_picker); } @@ -77,10 +76,10 @@ AtoZProvider provider) { super.processWidgets(state, provider); - ItemProvider myprovider = (ItemProvider)provider; + ItemProvider myprovider = (ItemProvider) provider; myprovider.setCategory(m_picker.getCategory(state)); - myprovider.setLoadPaths( (String) m_loadPaths.getValue(state)); + myprovider.setLoadPaths((String) m_loadPaths.getValue(state)); } @Override @@ -88,7 +87,7 @@ AtoZProvider provider) { super.initWidgets(state, provider); - ItemProvider myprovider = (ItemProvider)provider; + ItemProvider myprovider = (ItemProvider) provider; if (provider != null) { //m_compound.setValue(state, new Boolean(myprovider.isCompound())); @@ -107,26 +106,23 @@ SingleSelect target) { target.addOption(new Option(null, "-- pick one --")); - DataCollection domains = SessionManager.getSession() - .retrieve("com.arsdigita.london.terms.Domain"); + DataCollection domains = SessionManager.getSession().retrieve("com.arsdigita.london.terms.Domain"); domains.addPath("model.id"); domains.addPath("model.objectType"); domains.addOrder("title"); while (domains.next()) { - Category rootCategory = (Category) - DomainObjectFactory.newInstance( (DataObject) domains.get("model")); + Category rootCategory = (Category) DomainObjectFactory.newInstance((DataObject) domains.get("model")); categorySubtreePath(target, rootCategory, " > "); } } private void categorySubtreePath(SingleSelect target, Category root, String join) { DomainCollection cats = new DomainCollection( - SessionManager.getSession().retrieve(Category.BASE_DATA_OBJECT_TYPE) - ); + SessionManager.getSession().retrieve(Category.BASE_DATA_OBJECT_TYPE)); cats.addFilter("defaultAncestors like :ancestors") - .set("ancestors", - ((String)DomainServiceInterfaceExposer - .get(root, "defaultAncestors")) + "%"); + .set("ancestors", + ((String) DomainServiceInterfaceExposer + .get(root, "defaultAncestors")) + "%"); cats.addEqualsFilter("parents.link.isDefault", Boolean.TRUE); cats.addOrder("defaultAncestors"); cats.addPath("parents.id"); @@ -137,27 +133,27 @@ path2cat.put(root.getName(), root); cat2path.put(root.getID(), root.getName()); target.addOption(new Option(root.getOID().toString(), - " +++++++++++++++++++++++++ " - + root.getName() - + " +++++++++++++++++++++++++ ")); + " +++++++++++++++++++++++++ " + + root.getName() + + " +++++++++++++++++++++++++ ")); while (cats.next()) { - Category cat = (Category)cats.getDomainObject(); - BigDecimal parent = (BigDecimal)cats.get("parents.id"); + Category cat = (Category) cats.getDomainObject(); + BigDecimal parent = (BigDecimal) cats.get("parents.id"); if (parent == null) { path2cat.put(cat.getName(), cat); cat2path.put(cat.getID(), cat.getName()); target.addOption(new Option(cat.getOID().toString(), cat.getName())); } else { - String parentPath = (String)cat2path.get(parent); + String parentPath = (String) cat2path.get(parent); String path = parentPath + join + cat.getName(); path2cat.put(path, cat); cat2path.put(cat.getID(), path); // int breakPos = 0; String prefix = "---"; - while ((breakPos = 1+parentPath.indexOf(join, breakPos)) > 0) { + while ((breakPos = 1 + parentPath.indexOf(join, breakPos)) > 0) { prefix += "---"; } target.addOption(new Option(cat.getOID().toString(), prefix + " " + cat.getName())); @@ -166,5 +162,4 @@ } } - } Modified: trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig.java 2013-02-02 18:31:17 UTC (rev 2469) +++ trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig.java 2013-02-02 18:40:36 UTC (rev 2470) @@ -83,6 +83,7 @@ return s_config; } + /** * Storage (map) for method getAssetStepsToSkip(ContentType type) to store * mapping of steps that are deemed irrelevant for the passid in type. @@ -550,7 +551,6 @@ "com.arsdigita.cms.item_search.flat_browse_pane.page_size", Parameter.REQUIRED, 20); - ///////////////////////////////////////////// // FolderBrowse ///////////////////////////////////////////// @@ -592,7 +592,6 @@ "cms.arsdigita.cms.lifecycle.threaded_publishing.notify_on_error.to", Parameter.REQUIRED, ""); - ///////////////////////////////////////////////// // ImageBrowser Parameter ///////////////////////////////////////////////// @@ -604,7 +603,6 @@ "com.arsdigita.cms.image_browser.thumbnail_max_height", Parameter.REQUIRED, 50); - ///////////////////////////////////////////////// // ImageCache Parameter ///////////////////////////////////////////////// @@ -624,15 +622,17 @@ "com.arsdigita.cms.image_cache.max_age", Parameter.REQUIRED, 300); + private final Parameter m_attachPersonOrgaUnitsStep = new BooleanParameter( + "com.arsdigita.cms.contenttypes.genericperson.attach_person_orgaunits_step", + Parameter.REQUIRED, + Boolean.TRUE); - // /////////////////////////////////////////// // publishToFile package related parameter // /////////////////////////////////////////// // Moved to publishToFile.PublishToFileConfig as of version 6.0.2 // private final Parameter m_disableItemPfs; // private final Parameter m_publishToFileClass; - /** * Constructor, but do NOT instantiate this class directly. * @@ -733,6 +733,8 @@ // register(m_itemSearchFlatBrowsePaneEnable); register(m_itemSearchFlatBrowsePanePageSize); + register(m_attachPersonOrgaUnitsStep); + loadInfo(); } @@ -934,6 +936,7 @@ protected Object unmarshal(String value, ErrorList errors) { return DHTMLEditor.Config.valueOf(value); } + } protected static HashMap extraXMLGenerators = new HashMap(); @@ -1200,9 +1203,12 @@ // public Boolean getItemSearchFlatBrowsePaneEnable() { // return (Boolean) get(m_itemSearchFlatBrowsePaneEnable); // } - public Integer getItemSearchFlatBrowsePanePageSize() { - return (Integer) get(m_itemSearchFlatBrowsePanePageSize); + return (Integer) get(m_itemSearchFlatBrowsePanePageSize); } + public Boolean getAttachPersonOrgaUnitsStep() { + return (Boolean) get(m_attachPersonOrgaUnitsStep); + } + } Modified: trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig_parameter.properties =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig_parameter.properties 2013-02-02 18:31:17 UTC (rev 2469) +++ trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig_parameter.properties 2013-02-02 18:40:36 UTC (rev 2470) @@ -314,3 +314,8 @@ com.arsdigita.cms.image_cache.max_age.purpose=Max unused item age in seconds, keep this low to prevent filling you memory with unsused images com.arsdigita.cms.image_cache.max_age.example=300 com.arsdigita.cms.image_cache.max_age.format=[integer] + +com.arsdigita.cms.contenttypes.genericperson.attach_person_orgaunits_step.title = Attach PersonOrgaUnits step +com.arsdigita.cms.contenttypes.genericperson.attach_person_orgaunits_step.purpose = Attaches an authoring step to GenericPerson which displays all GenericOrganizationalUnits to which the person is assigned to +com.arsdigita.cms.contenttypes.genericperson.attach_person_orgaunits_step.example = true +com.arsdigita.cms.contenttypes.genericperson.attach_person_orgaunits_step.foramt = [boolean] \ No newline at end of file Modified: trunk/ccm-cms/src/com/arsdigita/cms/Initializer.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/Initializer.java 2013-02-02 18:31:17 UTC (rev 2469) +++ trunk/ccm-cms/src/com/arsdigita/cms/Initializer.java 2013-02-02 18:40:36 UTC (rev 2470) @@ -83,7 +83,6 @@ import org.apache.log4j.Logger; - /** * The main CMS initializer, executed recurringly at each system startup. * @@ -96,7 +95,6 @@ /** Creates a s_logging category with name = to the full name of class */ private static Logger s_log = Logger.getLogger(Initializer.class); /** Configuration object for the CMS module */ - /** Configuration object for the CMS module */ private static final CMSConfig s_conf = CMSConfig.getInstance(); /** @@ -120,7 +118,6 @@ s_log.debug("CMS.Initializer.(Constructor) completed"); } - /** * Initializes domain-coupling machinery, usually consisting of * registering object instantiators and observers. @@ -232,18 +229,18 @@ FileAsset.BASE_DATA_OBJECT_TYPE, new AssetMetadataProvider()); + if (s_conf.getAttachPersonOrgaUnitsStep()) { + AuthoringKitWizard.registerAssetStep( + GenericPerson.BASE_DATA_OBJECT_TYPE, + GenericPersonOrgaUnitsStep.class, + ContenttypesGlobalizationUtil.globalize("person.authoring.orgas.title"), + ContenttypesGlobalizationUtil.globalize("person.authoring.orgas.title"), + 20); + } - AuthoringKitWizard.registerAssetStep( - GenericPerson.BASE_DATA_OBJECT_TYPE, - GenericPersonOrgaUnitsStep.class, - ContenttypesGlobalizationUtil.globalize("person.authoring.orgas.title"), - ContenttypesGlobalizationUtil.globalize("person.authoring.orgas.title"), - 20); - s_log.debug("CMS.Initializer.init(DomainInitEvent) completed"); } // END init(DomainInitEvent e) - /** * Helper Method, registers stylesheet pattern generators */ @@ -257,7 +254,6 @@ new ItemDelegatedURLPatternGenerator()); } - /** * Registers object instantiators */ Modified: trunk/ccm-cms/src/com/arsdigita/cms/Loader.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/Loader.java 2013-02-02 18:31:17 UTC (rev 2469) +++ trunk/ccm-cms/src/com/arsdigita/cms/Loader.java 2013-02-02 18:40:36 UTC (rev 2470) @@ -64,6 +64,10 @@ * processing, otherwise hardcoded default values take effect. After processing, * the installation values can not be modified anymore without a fresh * installation of the whole system.</p> + * + * NOTE: Configuration parameters used at load time MUST be part of Loader + * class and can not delegated to a Config object (derived from AbstractConfig). + * They will (and can) not be persisted into an registry object (file). * * @author Peter Boy <pb...@ba...> * @since ccm-cms version 6.6.0 @@ -83,6 +87,7 @@ * time, the parameter must be relocated into this Loader class! */ private static final LoaderConfig s_conf = LoaderConfig.getInstance(); + // /////////////////////////////////////////////////////////////////// // Configurable parameters during load step. // /////////////////////////////////////////////////////////////////// @@ -96,6 +101,10 @@ "com.arsdigita.cms.loader.section_names", Parameter.REQUIRED, new String[]{"content"}); + // /////////////////////////////////////////////////////////////////// + // Configurable parameters during load step END. + // /////////////////////////////////////////////////////////////////// + /** * List of classnames of internal base content types (needed in every * section created), generated while loading those content types in Modified: trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/AbstractContentTypeLoader.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/AbstractContentTypeLoader.java 2013-02-02 18:31:17 UTC (rev 2469) +++ trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/AbstractContentTypeLoader.java 2013-02-02 18:40:36 UTC (rev 2470) @@ -53,6 +53,12 @@ * This is the base loader that can be used by individual content types. * Specifically, it provides type loading functionality in the "run" method * that can be used by content types to reduce code duplication. + * + * NOTE: Implementing clases may need to define and use configuration parameters + * to adjust things at load time. These MUST be part of Loader class + * implementationand itself and can not be delegated to a Config object + * (derived from AbstractConfig). They will (and can) not be persisted into an + * registry object (file). * * @author Rafael H. Schloming <rh...@mi...> * @authro Sören Bernstein (qu...@ba...) @@ -134,6 +140,16 @@ ContentTypeWorkflowTemplate.updateWorkflowTemplate(section, type, wf); } + /** + * Provides a list of contenttype property definitions. + * + * The file defines the types name as displayed in content center + * select box and the authoring steps. These are loaded into database. + * + * Must be implemented by each content type loader to provide its + * specific definition files. + * @return + */ protected abstract String[] getTypes(); /* |