Verschiedener Kleinkram meist in Zusammenhang mit Umbau AtoZ.
git-svn-id: https://svn.libreccm.org/ccm/trunk@1624 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
63a9ed8e1c
commit
ebbba43a7c
|
|
@ -0,0 +1,8 @@
|
|||
LibreCMS Default Items Page,Default Navigation Index Page ordering items in ascending order,/templates/ccm-navigation/navigation/gen-default.jsp
|
||||
LibreCMS Recent Items Page,List of items ordered with most recent first,/templates/ccm-navigation/navigation/gen-recent.jsp
|
||||
LibreCMS A-Z Items,List of items paginated as A-Z,/templates/ccm-navigation/navigation/gen-atoz.jsp
|
||||
LibreCMS Events Page,Events Page ordering events in decending order,/templates/ccm-navigation/navigation/gen-events.jsp
|
||||
LibreCMS Portal Page,Portal Page for embedding a portal page as navigation leaves page,/templates/ccm-navigation/navigation/gen-portal.jsp
|
||||
LibreCMS Portal Welcome Page,Portal page meant as site welcome page,/templates/ccm-navigation/navigation/gen-portal-welcome.jsp
|
||||
LibreCMS Navigation Welcome Page,Site welcome page created by navigation root term,/templates/ccm-navigation/navigation/gen-welcome.jsp
|
||||
LibreCMS Specializing Items List,Specialising List item page,/templates/ccm-navigation/navigation/SpecializingList.jsp
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
ScientificCMS Default Items Page,Sci Default Navigation Index Page ordering items in ascending order,/templates/ccm-navigation/navigation/sci-default.jsp
|
||||
ScientificCMS Recent Items Page,Sci List of items ordered with most recent first,/templates/ccm-navigation/navigation/sci-recent.jsp
|
||||
ScientificCMS A-Z Items,Sci List of items paginated as A-Z,/templates/ccm-navigation/navigation/sci-atoz.jsp
|
||||
ScientificCMS Events Page,Sci Events Page ordering events in ??? order,/templates/ccm-navigation/navigation/sci-events.jsp
|
||||
ScientificCMS Portal Page,Sci Portal Page for embedding a portal page as navigation leaves page,/templates/ccm-navigation/navigation/sci-portal.jsp
|
||||
ScientificCMS Portal Welcome Page,Sci Portal page meant as site welcome page,/templates/ccm-navigation/navigation/sci-portal-welcome.jsp
|
||||
ScientificCMS Navigation Welcome Page,Sci site welcome page created by navigation root term,/templates/ccm-navigation/navigation/sci-welcome.jsp
|
||||
ScientificCMS Specializing Items List,Sci Specialising List item page,/templates/ccm-navigation/navigation/SpecializingList.jsp
|
||||
ScientificCMS Publications List,Sci publications listing page,/templates/ccm-navigation/navigation/SciPublicationList.jsp
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
LibreCMS Default Items Page,Sci Default Navigation Index Page ordering items in ascending order,/templates/ccm-ldn-navigation/navigation/gen-default.jsp
|
||||
LibreCMS Recent Items Page,Sci List of items ordered with most recent first,/templates/ccm-ldn-navigation/navigation/gen-recent.jsp
|
||||
LibreCMS A-Z Items,Sci List of items paginated as A-Z,/templates/ccm-ldn-navigation/navigation/gen-atoz.jsp
|
||||
LibreCMS Events Page,Sci Events Page ordering events in ??? order,/templates/ccm-ldn-navigation/navigation/gen-events.jsp
|
||||
LibreCMS Portal Page,Sci Portal Page for embedding a portal page as navigation leaves page,/templates/ccm-ldn-navigation/navigation/gen-portal.jsp
|
||||
LibreCMS Portal Welcome Page,Sci Portal page meant as site welcome page,/templates/ccm-ldn-navigation/navigation/gen-portal-welcome.jsp
|
||||
LibreCMS Navigation Welcome Page,Sci site welcome page created by navigation root term,/templates/ccm-ldn-navigation/navigation/gen-welcome.jsp
|
||||
LibreCMS Specializing Items List,Sci Specialising List item page,/templates/ccm-ldn-navigation/navigation/SpecializingList.jsp
|
||||
LibreCMS Default Items Page,Default Navigation Index Page ordering items in ascending order,/templates/ccm-navigation/navigation/gen-default.jsp
|
||||
LibreCMS Recent Items Page,List of items ordered with most recent first,/templates/ccm-navigation/navigation/gen-recent.jsp
|
||||
LibreCMS A-Z Items,List of items paginated as A-Z,/templates/ccm-navigation/navigation/gen-atoz.jsp
|
||||
LibreCMS Events Page,Events Page ordering events in decending order,/templates/ccm-navigation/navigation/gen-events.jsp
|
||||
LibreCMS Portal Page,Portal Page for embedding a portal page as navigation leaves page,/templates/ccm-navigation/navigation/gen-portal.jsp
|
||||
LibreCMS Portal Welcome Page,Portal page meant as site welcome page,/templates/ccm-navigation/navigation/gen-portal-welcome.jsp
|
||||
LibreCMS Navigation Welcome Page,Site welcome page created by navigation root term,/templates/ccm-navigation/navigation/gen-welcome.jsp
|
||||
LibreCMS Specializing Items List,Specialising List item page,/templates/ccm-navigation/navigation/SpecializingList.jsp
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.packaging.Program;
|
||||
import com.arsdigita.util.cmd.Program;
|
||||
import com.arsdigita.runtime.RuntimeConfig;
|
||||
import com.arsdigita.util.jdbc.Connections;
|
||||
import java.math.BigDecimal;
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ public class ContentPage extends ContentItem {
|
|||
private static final Logger s_log = Logger.getLogger(ContentPage.class);
|
||||
|
||||
public static final String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.cms.ContentPage";
|
||||
"com.arsdigita.cms.ContentPage";
|
||||
|
||||
public static final String TITLE = "title";
|
||||
public static final String SUMMARY = "summary";
|
||||
|
|
@ -58,9 +58,9 @@ public class ContentPage extends ContentItem {
|
|||
|
||||
|
||||
protected static final String PAGES_IN_FOLDER =
|
||||
"com.arsdigita.cms.pagesInFolder";
|
||||
"com.arsdigita.cms.pagesInFolder";
|
||||
protected static final String PAGES_IN_CATEGORY =
|
||||
"com.arsdigita.cms.pagesInFolderByCategory";
|
||||
"com.arsdigita.cms.pagesInFolderByCategory";
|
||||
public static final String QUERY_PAGE = "page";
|
||||
public static final String QUERY_TYPE = "type";
|
||||
public static final String QUERY_ROOT_ID = "rootFolderID";
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.packaging.Program;
|
||||
import com.arsdigita.util.cmd.Program;
|
||||
import com.arsdigita.runtime.RuntimeConfig;
|
||||
import com.arsdigita.util.jdbc.Connections;
|
||||
import java.math.BigDecimal;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import com.arsdigita.kernel.PackageInstanceCollection;
|
|||
import com.arsdigita.kernel.PackageType;
|
||||
import com.arsdigita.kernel.Resource;
|
||||
import com.arsdigita.kernel.ResourceType;
|
||||
import com.arsdigita.packaging.Program;
|
||||
import com.arsdigita.util.cmd.Program;
|
||||
import com.arsdigita.persistence.Session;
|
||||
import com.arsdigita.persistence.SessionManager;
|
||||
import com.arsdigita.persistence.TransactionContext;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ import com.arsdigita.kernel.KernelExcursion;
|
|||
import org.apache.commons.cli.CommandLine;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.arsdigita.packaging.Program;
|
||||
import com.arsdigita.util.cmd.Program;
|
||||
import com.arsdigita.persistence.Session;
|
||||
import com.arsdigita.persistence.SessionManager;
|
||||
import com.arsdigita.persistence.TransactionContext;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import com.arsdigita.kernel.Group;
|
|||
import com.arsdigita.kernel.permissions.PermissionDescriptor;
|
||||
import com.arsdigita.kernel.permissions.PermissionService;
|
||||
import com.arsdigita.kernel.permissions.PrivilegeDescriptor;
|
||||
import com.arsdigita.packaging.Program;
|
||||
import com.arsdigita.util.cmd.Program;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
import com.arsdigita.persistence.OID;
|
||||
import com.arsdigita.persistence.SessionManager;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import com.arsdigita.forum.ThreadSubscription;
|
|||
import com.arsdigita.kernel.Group;
|
||||
import com.arsdigita.kernel.GroupCollection;
|
||||
import com.arsdigita.messaging.MessageThread;
|
||||
import com.arsdigita.packaging.Program;
|
||||
import com.arsdigita.util.cmd.Program;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
import com.arsdigita.persistence.Session;
|
||||
import com.arsdigita.persistence.SessionManager;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import com.arsdigita.forum.portlet.MyForumsPortlet;
|
|||
import com.arsdigita.kernel.Group;
|
||||
import com.arsdigita.kernel.Kernel;
|
||||
import com.arsdigita.kernel.KernelExcursion;
|
||||
import com.arsdigita.packaging.Program;
|
||||
import com.arsdigita.util.cmd.Program;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
import com.arsdigita.persistence.Session;
|
||||
import com.arsdigita.persistence.SessionManager;
|
||||
|
|
|
|||
|
|
@ -94,8 +94,8 @@ com.arsdigita.forum.use_wysiwyg_editor=true
|
|||
com.arsdigita.forum.allow_quick_finish=true
|
||||
com.arsdigita.forum.disable_page_caching=true
|
||||
|
||||
; atoz
|
||||
com.arsdigita.london.atoz.root_category_picker=com.arsdigita.london.terms.ui.RootCategoryPicker
|
||||
# atoz
|
||||
com.arsdigita.atoz.root_category_picker=com.arsdigita.london.terms.ui.RootCategoryPicker
|
||||
|
||||
# ccm-navigation application
|
||||
; com.arsdigita.navigation.category_menu_show_grand_children_min=1
|
||||
|
|
|
|||
|
|
@ -37,8 +37,6 @@
|
|||
|
||||
<!-- Content Types -->
|
||||
<ccm:application name="ccm-cms-types-article"/>
|
||||
<!-- Currently siteproxy is a prerequisite for ccm-ldn-atoz -->
|
||||
<ccm:application name="ccm-cms-types-siteproxy"/>
|
||||
|
||||
<!-- Applications -->
|
||||
<ccm:application name="ccm-atoz"/>
|
||||
|
|
@ -53,7 +51,6 @@
|
|||
|
||||
<!-- LDN core extensions -->
|
||||
<ccm:application name="ccm-ldn-aplaws"/>
|
||||
<!-- <ccm:application name="ccm-ldn-atoz"/> -->
|
||||
<ccm:application name="ccm-ldn-dublin"/>
|
||||
<ccm:application name="ccm-ldn-search"/>
|
||||
<ccm:application name="ccm-ldn-terms"/>
|
||||
|
|
@ -87,6 +84,7 @@
|
|||
<ccm:application name="ccm-forum"/>
|
||||
|
||||
<!-- Standard Bundle's LDN extensions -->
|
||||
<ccm:application name="ccm-ldn-atoz"/>
|
||||
<ccm:application name="ccm-ldn-importer"/>
|
||||
<ccm:application name="ccm-ldn-types-contact"/>
|
||||
<ccm:application name="ccm-ldn-types-esdservice"/>
|
||||
|
|
@ -111,11 +109,14 @@
|
|||
<ccm:application name="ccm-cms-types-organization"/>
|
||||
<ccm:application name="ccm-cms-types-service"/>
|
||||
<ccm:application name="ccm-cms-types-simpleaddress"/>
|
||||
<!-- CHECK: Really part of extended? -->
|
||||
<ccm:application name="ccm-cms-types-siteproxy"/>
|
||||
<!-- Current code does not include any xsl templates,
|
||||
neither it does not appear in content center -->
|
||||
<ccm:application name="ccm-cms-types-motditem"/>
|
||||
|
||||
<!-- Extended Bundle's Applications -->
|
||||
<ccm:application name="ccm-atoz-siteproxy"/> <!-- requires siteproxy!-->
|
||||
<ccm:application name="ccm-auth-http"/>
|
||||
<!-- currently doesn't work for unknown reason -->
|
||||
<ccm:application name="ccm-simplesurvey"/>
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ import com.arsdigita.web.Application;
|
|||
*
|
||||
* @author apevec@redhat.com
|
||||
*/
|
||||
public class AutoCategorisation extends com.arsdigita.packaging.Program {
|
||||
public class AutoCategorisation extends com.arsdigita.util.cmd.Program {
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(AutoCategorisation.class);
|
||||
private static final String CCM_PREFIX = "/ccm/";
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import org.apache.commons.cli.OptionBuilder;
|
|||
|
||||
import com.arsdigita.categorization.Category;
|
||||
import com.arsdigita.london.util.Transaction;
|
||||
import com.arsdigita.packaging.Program;
|
||||
import com.arsdigita.util.cmd.Program;
|
||||
import com.arsdigita.util.UncheckedWrapperException;
|
||||
import com.arsdigita.web.Application;
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import com.arsdigita.cms.ContentItem;
|
|||
import com.arsdigita.cms.ContentSection;
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.london.util.Transaction;
|
||||
import com.arsdigita.packaging.Program;
|
||||
import com.arsdigita.util.cmd.Program;
|
||||
import com.arsdigita.web.Application;
|
||||
import com.arsdigita.web.Web;
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import com.arsdigita.london.importer.DomainObjectMapper;
|
|||
import com.arsdigita.london.importer.ImportParser;
|
||||
import com.arsdigita.london.importer.ParserDispatcher;
|
||||
import com.arsdigita.london.util.Transaction;
|
||||
import com.arsdigita.packaging.Program;
|
||||
import com.arsdigita.util.cmd.Program;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ import com.arsdigita.london.importer.DomainObjectMapper;
|
|||
import com.arsdigita.london.importer.ImportParser;
|
||||
import com.arsdigita.london.importer.ParserDispatcher;
|
||||
import com.arsdigita.london.util.Transaction;
|
||||
import com.arsdigita.packaging.Program;
|
||||
import com.arsdigita.util.cmd.Program;
|
||||
import com.arsdigita.util.UncheckedWrapperException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ package com.arsdigita.london.search;
|
|||
|
||||
import com.arsdigita.domain.DomainObject;
|
||||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
import com.arsdigita.london.util.Program;
|
||||
import com.arsdigita.util.cmd.Program;
|
||||
import com.arsdigita.london.util.Transaction;
|
||||
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
|
|
|
|||
|
|
@ -16,11 +16,11 @@ while (<STDIN>) {
|
|||
or die "cannot run xsltproc: $@";
|
||||
} else {
|
||||
#FR: not working for me
|
||||
#print "wget -q -O - $src | ccm-run com.arsdigita.templating.ApplyTemplates $xsl - - | xmllint -format - > $dst\n";
|
||||
#(system "wget -q -O - $src | ccm-run com.arsdigita.templating.ApplyTemplates $xsl - - | - > $dst") == 0
|
||||
#print "wget -q -O - $src | ccm-run com.arsdigita.london.terms.util.ApplyTemplates $xsl - - | xmllint -format - > $dst\n";
|
||||
#(system "wget -q -O - $src | ccm-run com.arsdigita.london.terms.util.ApplyTemplates $xsl - - | - > $dst") == 0
|
||||
# or die "cannot can ApplyTemplates: $@";
|
||||
print "Processing $src \n";
|
||||
(system "wget -q -O - $src > src.xml; ccm-run com.arsdigita.templating.ApplyTemplates $xsl src.xml $dst; rm src.xml") == 0
|
||||
(system "wget -q -O - $src > src.xml; ccm-run com.arsdigita.london.terms.util.ApplyTemplates $xsl src.xml $dst; rm src.xml") == 0
|
||||
or die "cannot can ApplyTemplates: $@";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import org.apache.log4j.Logger;
|
|||
import com.arsdigita.categorization.Category;
|
||||
import com.arsdigita.categorization.CategoryCollection;
|
||||
import com.arsdigita.london.util.Transaction;
|
||||
import com.arsdigita.packaging.Program;
|
||||
import com.arsdigita.util.cmd.Program;
|
||||
|
||||
public class DefaultAncestorsFixer extends Program {
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import org.apache.commons.cli.CommandLine;
|
|||
|
||||
import com.arsdigita.london.terms.importer.Parser;
|
||||
import com.arsdigita.london.util.Transaction;
|
||||
import com.arsdigita.packaging.Program;
|
||||
import com.arsdigita.util.cmd.Program;
|
||||
|
||||
public class Importer extends Program {
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ package com.arsdigita.london.terms;
|
|||
import org.apache.commons.cli.CommandLine;
|
||||
|
||||
import com.arsdigita.london.util.Transaction;
|
||||
import com.arsdigita.packaging.Program;
|
||||
import com.arsdigita.util.cmd.Program;
|
||||
import com.arsdigita.web.Application;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import org.apache.log4j.Logger;
|
|||
import com.arsdigita.kernel.Kernel;
|
||||
import com.arsdigita.kernel.KernelExcursion;
|
||||
import com.arsdigita.london.util.Transaction;
|
||||
import com.arsdigita.packaging.Program;
|
||||
import com.arsdigita.util.cmd.Program;
|
||||
import com.arsdigita.util.WrappedError;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -56,6 +56,11 @@ public abstract class ACSObjectCategoryPicker extends SimpleContainer {
|
|||
private ACSObjectCategoryForm m_form;
|
||||
private BigDecimalParameter m_root;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param root
|
||||
* @param mode
|
||||
*/
|
||||
public ACSObjectCategoryPicker(BigDecimalParameter root, StringParameter mode) {
|
||||
|
||||
m_form = getForm(root, mode);
|
||||
|
|
@ -65,93 +70,28 @@ public abstract class ACSObjectCategoryPicker extends SimpleContainer {
|
|||
m_form.addCompletionListener(new ItemCategoryFormCompletion());
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param root
|
||||
* @param mode
|
||||
* @return
|
||||
*/
|
||||
protected abstract ACSObjectCategoryForm getForm(BigDecimalParameter root,
|
||||
StringParameter mode);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param state
|
||||
* @return
|
||||
*/
|
||||
protected abstract ACSObject getObject(PageState state);
|
||||
|
||||
private class ItemCategoryFormCompletion implements ActionListener {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent ev) {
|
||||
|
||||
PageState state = ev.getPageState();
|
||||
Domain domain = getDomain(state);
|
||||
String domainKey = domain.getKey();
|
||||
|
||||
if (s_log.isDebugEnabled()) {
|
||||
s_log.debug("Saving categories in: " + domainKey);
|
||||
}
|
||||
|
||||
// ACSObject object = getObject(state);
|
||||
//
|
||||
// if ("LGCL".equals(domainKey)) {
|
||||
// lgclSelected(domain, object);
|
||||
// } else if ("LGDL".equals(domainKey)) {
|
||||
// lgdlSelected(domain, object);
|
||||
// }
|
||||
|
||||
fireCompletionEvent(state);
|
||||
}
|
||||
// private void lgclSelected(Domain domain, ACSObject object) {
|
||||
// List lgclTerms = getCurrentCategories(domain, object);
|
||||
//
|
||||
// Domain gcl = Domain.retrieve("GCL");
|
||||
// Collection gclTerms = getRelatedTerms(lgclTerms, gcl);
|
||||
// clearTerms(gcl, object);
|
||||
// assignTerms(gclTerms, object);
|
||||
//
|
||||
// // The assignment below is removed to satisfy requirement 4.1,
|
||||
// // use case 1 of the document "Metadata Improvements" version 1
|
||||
// // by Camden, dated 23/01/05.
|
||||
// //Domain lgsl = Domain.retrieve("LGSL");
|
||||
// //Collection lgslTerms = getRelatedTerms(lgclTerms, lgsl);
|
||||
// //clearTerms(lgsl, object);
|
||||
// //assignTerms(lgslTerms, object);
|
||||
//
|
||||
// // adding processing or mapping from LGCL to APLAWS-NAV too
|
||||
//// Deactivated here.
|
||||
//// If needed
|
||||
//// boolean lgclOverrideAnav = Aplaws.getAplawsConfig().getOverrideAnavFromLGCLMappings().booleanValue();
|
||||
//// if (lgclOverrideAnav) {
|
||||
//// Domain aplawsNav = Domain.retrieve("APLAWS-NAV");
|
||||
//// Collection aplawsNavTerms = getRelatedTerms(lgclTerms, aplawsNav);
|
||||
//// clearTerms(aplawsNav, object);
|
||||
//// assignTerms(aplawsNavTerms, object);
|
||||
//// }
|
||||
// }
|
||||
//
|
||||
// // User has selected a term in the LGDL hierarchy, which includes
|
||||
// // terms from the LGSL. We're only interested in LGSL terms here.
|
||||
// private void lgdlSelected(Domain domain, ACSObject object) {
|
||||
// Domain lgsl = Domain.retrieve("LGSL");
|
||||
// Domain gcl = Domain.retrieve("GCL");
|
||||
// Domain lgcl = Domain.retrieve("LGCL");
|
||||
//
|
||||
// // We have a mapping LGSL -> LGCL based on the reverse of a
|
||||
// // published mapping. We don't have a mapping LGSL -> GCL, so we
|
||||
// // do LGSL -> LGCL -> GCL instead.
|
||||
//
|
||||
// List lgslTerms = getCurrentCategories(lgsl, object);
|
||||
// Collection lgclTerms = getRelatedTerms(lgslTerms, lgcl);
|
||||
//
|
||||
// LinkedList lgclIDs = new LinkedList();
|
||||
// Iterator i = lgclTerms.iterator();
|
||||
// while (i.hasNext()) {
|
||||
// Term term = (Term) i.next();
|
||||
// lgclIDs.add(term.getModel().getID());
|
||||
// }
|
||||
//
|
||||
// Collection gclTerms = getRelatedTerms(lgclIDs, gcl);
|
||||
//
|
||||
// clearTerms(lgcl, object);
|
||||
// assignTerms(lgclTerms, object);
|
||||
//
|
||||
// clearTerms(gcl, object);
|
||||
// assignTerms(gclTerms, object);
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param domain
|
||||
* @param object
|
||||
* @return
|
||||
*/
|
||||
protected List getCurrentCategories(Domain domain, ACSObject object) {
|
||||
if (s_log.isDebugEnabled()) {
|
||||
s_log.debug("Getting terms from " + domain + " to " + object);
|
||||
|
|
@ -264,4 +204,96 @@ public abstract class ACSObjectCategoryPicker extends SimpleContainer {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private class ItemCategoryFormCompletion implements ActionListener {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param ev
|
||||
*/
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent ev) {
|
||||
|
||||
PageState state = ev.getPageState();
|
||||
Domain domain = getDomain(state);
|
||||
String domainKey = domain.getKey();
|
||||
|
||||
if (s_log.isDebugEnabled()) {
|
||||
s_log.debug("Saving categories in: " + domainKey);
|
||||
}
|
||||
|
||||
// ACSObject object = getObject(state);
|
||||
//
|
||||
// if ("LGCL".equals(domainKey)) {
|
||||
// lgclSelected(domain, object);
|
||||
// } else if ("LGDL".equals(domainKey)) {
|
||||
// lgdlSelected(domain, object);
|
||||
// }
|
||||
|
||||
fireCompletionEvent(state);
|
||||
}
|
||||
|
||||
// private void lgclSelected(Domain domain, ACSObject object) {
|
||||
// List lgclTerms = getCurrentCategories(domain, object);
|
||||
//
|
||||
// Domain gcl = Domain.retrieve("GCL");
|
||||
// Collection gclTerms = getRelatedTerms(lgclTerms, gcl);
|
||||
// clearTerms(gcl, object);
|
||||
// assignTerms(gclTerms, object);
|
||||
//
|
||||
// // The assignment below is removed to satisfy requirement 4.1,
|
||||
// // use case 1 of the document "Metadata Improvements" version 1
|
||||
// // by Camden, dated 23/01/05.
|
||||
// //Domain lgsl = Domain.retrieve("LGSL");
|
||||
// //Collection lgslTerms = getRelatedTerms(lgclTerms, lgsl);
|
||||
// //clearTerms(lgsl, object);
|
||||
// //assignTerms(lgslTerms, object);
|
||||
//
|
||||
// // adding processing or mapping from LGCL to APLAWS-NAV too
|
||||
//// Deactivated here.
|
||||
//// If needed
|
||||
//// boolean lgclOverrideAnav = Aplaws.getAplawsConfig().getOverrideAnavFromLGCLMappings().booleanValue();
|
||||
//// if (lgclOverrideAnav) {
|
||||
//// Domain aplawsNav = Domain.retrieve("APLAWS-NAV");
|
||||
//// Collection aplawsNavTerms = getRelatedTerms(lgclTerms, aplawsNav);
|
||||
//// clearTerms(aplawsNav, object);
|
||||
//// assignTerms(aplawsNavTerms, object);
|
||||
//// }
|
||||
// }
|
||||
//
|
||||
// // User has selected a term in the LGDL hierarchy, which includes
|
||||
// // terms from the LGSL. We're only interested in LGSL terms here.
|
||||
// private void lgdlSelected(Domain domain, ACSObject object) {
|
||||
// Domain lgsl = Domain.retrieve("LGSL");
|
||||
// Domain gcl = Domain.retrieve("GCL");
|
||||
// Domain lgcl = Domain.retrieve("LGCL");
|
||||
//
|
||||
// // We have a mapping LGSL -> LGCL based on the reverse of a
|
||||
// // published mapping. We don't have a mapping LGSL -> GCL, so we
|
||||
// // do LGSL -> LGCL -> GCL instead.
|
||||
//
|
||||
// List lgslTerms = getCurrentCategories(lgsl, object);
|
||||
// Collection lgclTerms = getRelatedTerms(lgslTerms, lgcl);
|
||||
//
|
||||
// LinkedList lgclIDs = new LinkedList();
|
||||
// Iterator i = lgclTerms.iterator();
|
||||
// while (i.hasNext()) {
|
||||
// Term term = (Term) i.next();
|
||||
// lgclIDs.add(term.getModel().getID());
|
||||
// }
|
||||
//
|
||||
// Collection gclTerms = getRelatedTerms(lgclIDs, gcl);
|
||||
//
|
||||
// clearTerms(lgcl, object);
|
||||
// assignTerms(lgclTerms, object);
|
||||
//
|
||||
// clearTerms(gcl, object);
|
||||
// assignTerms(gclTerms, object);
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import com.arsdigita.kernel.Kernel;
|
|||
import com.arsdigita.kernel.KernelExcursion;
|
||||
import com.arsdigita.london.terms.Loader;
|
||||
import com.arsdigita.london.util.Transaction;
|
||||
import com.arsdigita.packaging.Program;
|
||||
import com.arsdigita.util.cmd.Program;
|
||||
|
||||
|
||||
public class Upgrade100to101 extends Program {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,180 @@
|
|||
/*
|
||||
* Copyright (C) 2003-2004 Red Hat Inc. 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.terms.util;
|
||||
|
||||
import com.arsdigita.util.cmd.CommandLine;
|
||||
import com.arsdigita.util.cmd.StringSwitch;
|
||||
import com.arsdigita.util.cmd.BooleanSwitch;
|
||||
import com.arsdigita.util.UncheckedWrapperException;
|
||||
|
||||
import javax.xml.transform.Templates;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.TransformerConfigurationException;
|
||||
import javax.xml.transform.TransformerException;
|
||||
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.apache.log4j.ConsoleAppender;
|
||||
import org.apache.log4j.Level;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.log4j.BasicConfigurator;
|
||||
import org.apache.log4j.PatternLayout;
|
||||
|
||||
/**
|
||||
* (Obviously) command line utility
|
||||
* Purpose?
|
||||
* Not used anywhere in CCM code (java or jsp), but used in
|
||||
* ccm-ldn-terms/doc/esd/generate.pl which is part of an upgrade of ESD terms
|
||||
*/
|
||||
// Moved from com.arsdigita.templating to com.arsdigita.london.terms.util
|
||||
// because it has nothing to do with core's templating machinery!
|
||||
public class ApplyTemplates {
|
||||
|
||||
private static final String OPT_LOOP = "-loop";
|
||||
private static final String OPT_LOG = "-log";
|
||||
private static final String OPT_WARMUP = "-warmup";
|
||||
private static final String OPT_VERBOSE = "-verbose";
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(ApplyTemplates.class);
|
||||
|
||||
/* Command line parameter object.
|
||||
* 1. Param: Name
|
||||
* 2. Param: Usage */
|
||||
private static CommandLine s_cmd = new CommandLine(
|
||||
"apply-templates",
|
||||
"java com.arsdigita.templating.ApplyTemplates " +
|
||||
"-loop [count] -log [loglevel] -verbose -warmup [count] Stylesheet Input Output "
|
||||
);
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
s_cmd.addSwitch(new StringSwitch(OPT_LOG,
|
||||
"Log4j debug level",
|
||||
"warn"));
|
||||
s_cmd.addSwitch(new StringSwitch(OPT_LOOP,
|
||||
"Number of iterations to apply xsl",
|
||||
"1"));
|
||||
s_cmd.addSwitch(new StringSwitch(OPT_WARMUP,
|
||||
"Number of iterations to warm up on",
|
||||
"0"));
|
||||
s_cmd.addSwitch(new BooleanSwitch(OPT_VERBOSE,
|
||||
"Display progress",
|
||||
Boolean.FALSE));
|
||||
s_log.debug("Static initalizer finished.");
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
/* Setup logger */
|
||||
ConsoleAppender log = new ConsoleAppender(
|
||||
new PatternLayout(
|
||||
"%d{ISO8601} [%5.5t] %-5p %c{2} - %m%n"));
|
||||
log.setThreshold(Level.toLevel("warn"));
|
||||
BasicConfigurator.configure(log);
|
||||
|
||||
|
||||
/* Process command line options and parameter */
|
||||
Map options = new HashMap();
|
||||
args = s_cmd.parse(options, args);
|
||||
|
||||
String stylesheet = args[0];
|
||||
String input = args[1];
|
||||
String output = args[2];
|
||||
|
||||
log.setThreshold(Level.toLevel((String)options.get(OPT_LOG)));
|
||||
|
||||
s_log.debug("Build xml source " + new Date());
|
||||
StreamSource xml = new StreamSource(input);
|
||||
|
||||
s_log.debug("Build xsl source " + new Date());
|
||||
StreamSource xsl = new StreamSource(stylesheet);
|
||||
|
||||
s_log.debug("Build html dest " + new Date());
|
||||
StreamResult html = new StreamResult(output);
|
||||
|
||||
s_log.debug("Build transformer factory " + new Date());
|
||||
TransformerFactory fact = TransformerFactory.newInstance();
|
||||
|
||||
s_log.debug("Build templates " + new Date());
|
||||
Templates templates = null;
|
||||
try {
|
||||
templates = fact.newTemplates(xsl);
|
||||
} catch (TransformerConfigurationException tce) {
|
||||
throw new UncheckedWrapperException(tce);
|
||||
}
|
||||
|
||||
|
||||
Transformer xf = null;
|
||||
try {
|
||||
xf = templates.newTransformer();
|
||||
} catch (TransformerConfigurationException tce) {
|
||||
throw new UncheckedWrapperException(tce);
|
||||
}
|
||||
|
||||
boolean verbose = Boolean.TRUE.equals(options.get(OPT_VERBOSE));
|
||||
|
||||
try {
|
||||
int warmup = (new Integer((String)options.get(OPT_WARMUP))).intValue();
|
||||
Date start = new Date();
|
||||
s_log.debug("Warming up " + start);
|
||||
for (int i = 0 ; i < warmup ; i++) {
|
||||
xf.setOutputProperty("encoding", "UTF-8");
|
||||
xf.transform(xml,
|
||||
html);
|
||||
if (verbose) {
|
||||
System.out.print(".");
|
||||
System.out.flush();
|
||||
}
|
||||
}
|
||||
if (warmup > 0 && verbose) {
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
int loop = (new Integer((String)options.get(OPT_LOOP))).intValue();
|
||||
start = new Date();
|
||||
s_log.debug("Start " + start);
|
||||
for (int i = 0 ; i < loop ; i++) {
|
||||
xf.setOutputProperty("encoding", "UTF-8");
|
||||
xf.transform(xml,
|
||||
html);
|
||||
if (verbose) {
|
||||
System.out.print(".");
|
||||
System.out.flush();
|
||||
}
|
||||
}
|
||||
if (verbose) {
|
||||
System.out.println();
|
||||
}
|
||||
Date end = new Date();
|
||||
s_log.debug("End " + end);
|
||||
|
||||
long duration = end.getTime() - start.getTime();
|
||||
s_log.info("Duration for " + loop + " iterations with " +
|
||||
" is " + duration + " milliseconds");
|
||||
} catch (TransformerException ex) {
|
||||
throw new UncheckedWrapperException("cannot transform document", ex);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -21,14 +21,14 @@ package com.arsdigita.london.util;
|
|||
import com.arsdigita.xml.Element;
|
||||
import com.arsdigita.xml.XML;
|
||||
import com.arsdigita.xml.Document;
|
||||
import com.arsdigita.util.UncheckedWrapperException;
|
||||
import com.arsdigita.util.Classes;
|
||||
import com.arsdigita.util.StringUtils;
|
||||
import com.arsdigita.util.UncheckedWrapperException;
|
||||
import com.arsdigita.util.cmd.Program;
|
||||
import com.arsdigita.util.parameter.Parameter;
|
||||
import com.arsdigita.util.parameter.ParameterInfo;
|
||||
import com.arsdigita.util.parameter.ParameterContext;
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ public class Initializer extends CompoundInitializer {
|
|||
new NameFilter(DbHelper.getDatabaseSuffix(database), "pdl"))));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(DataInitEvent ev) {
|
||||
super.init(ev);
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ package com.arsdigita.london.util;
|
|||
|
||||
/**
|
||||
*
|
||||
* @deprecated - use {@link com.arsdigita.packaging.Program}
|
||||
* @deprecated - use {@link com.arsdigita.util.cmd.Program}
|
||||
*
|
||||
*/
|
||||
public abstract class Program extends com.arsdigita.util.cmd.Program {
|
||||
|
|
@ -22,7 +22,7 @@ import com.arsdigita.logging.ErrorReport;
|
|||
|
||||
/**
|
||||
*
|
||||
* @deprecated - use {@link com.arsdigita.packaging.ProgramErrorReport}
|
||||
* @deprecated - use {@link com.arsdigita.util.cmd.ProgramErrorReport}
|
||||
*
|
||||
*/
|
||||
public class ProgramErrorReport extends com.arsdigita.util.cmd.ProgramErrorReport {
|
||||
|
|
@ -18,15 +18,9 @@
|
|||
|
||||
package com.arsdigita.london.util.cmd;
|
||||
|
||||
import com.arsdigita.london.util.Program;
|
||||
import com.arsdigita.london.util.Transaction;
|
||||
import com.arsdigita.persistence.CompoundFilter;
|
||||
import com.arsdigita.persistence.Filter;
|
||||
import com.arsdigita.persistence.FilterFactory;
|
||||
import com.arsdigita.persistence.OID;
|
||||
import com.arsdigita.persistence.SessionManager;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
import com.arsdigita.persistence.OID;
|
||||
import com.arsdigita.london.util.Transaction;
|
||||
|
||||
import com.arsdigita.cms.ContentBundle;
|
||||
import com.arsdigita.cms.ContentPage;
|
||||
|
|
@ -40,11 +34,8 @@ import org.apache.commons.cli.Options;
|
|||
import org.apache.log4j.Logger;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
public class BulkDelete extends BulkUnpublish {
|
||||
|
||||
|
|
@ -52,6 +43,9 @@ public class BulkDelete extends BulkUnpublish {
|
|||
|
||||
protected boolean deleteFolderStructure;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public BulkDelete() {
|
||||
super("Bulk Delete", "1.0.0");
|
||||
|
||||
|
|
@ -66,6 +60,11 @@ public class BulkDelete extends BulkUnpublish {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param cmdLine
|
||||
*/
|
||||
@Override
|
||||
protected void doRun(CommandLine cmdLine) {
|
||||
//delete(new OID(ContentItem.BASE_DATA_OBJECT_TYPE, 13890351));
|
||||
|
||||
|
|
|
|||
|
|
@ -18,22 +18,22 @@
|
|||
package com.arsdigita.london.util.cmd;
|
||||
|
||||
import com.arsdigita.cms.ContentBundle;
|
||||
import com.arsdigita.london.util.Program;
|
||||
import com.arsdigita.london.util.Transaction;
|
||||
import com.arsdigita.persistence.CompoundFilter;
|
||||
import com.arsdigita.persistence.FilterFactory;
|
||||
import com.arsdigita.persistence.Filter;
|
||||
import com.arsdigita.persistence.OID;
|
||||
import com.arsdigita.persistence.SessionManager;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
|
||||
import com.arsdigita.cms.ContentPage;
|
||||
import com.arsdigita.cms.ContentItem;
|
||||
import com.arsdigita.cms.ContentTypeLifecycleDefinition;
|
||||
import com.arsdigita.cms.Folder;
|
||||
import com.arsdigita.cms.contentitem.ContentBundleHelper;
|
||||
import com.arsdigita.cms.lifecycle.LifecycleDefinition;
|
||||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
import com.arsdigita.persistence.CompoundFilter;
|
||||
import com.arsdigita.persistence.FilterFactory;
|
||||
import com.arsdigita.persistence.Filter;
|
||||
import com.arsdigita.persistence.OID;
|
||||
import com.arsdigita.persistence.SessionManager;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
import com.arsdigita.util.cmd.Program;
|
||||
import com.arsdigita.london.util.Transaction;
|
||||
|
||||
|
||||
import org.apache.commons.cli.CommandLine;
|
||||
import org.apache.commons.cli.OptionBuilder;
|
||||
|
|
|
|||
|
|
@ -18,19 +18,18 @@
|
|||
package com.arsdigita.london.util.cmd;
|
||||
|
||||
import com.arsdigita.cms.ContentBundle;
|
||||
import com.arsdigita.london.util.Program;
|
||||
import com.arsdigita.london.util.Transaction;
|
||||
import com.arsdigita.cms.ContentItem;
|
||||
import com.arsdigita.cms.ContentPage;
|
||||
import com.arsdigita.cms.Folder;
|
||||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
import com.arsdigita.persistence.CompoundFilter;
|
||||
import com.arsdigita.persistence.Filter;
|
||||
import com.arsdigita.persistence.FilterFactory;
|
||||
import com.arsdigita.persistence.OID;
|
||||
import com.arsdigita.persistence.SessionManager;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
|
||||
import com.arsdigita.cms.ContentItem;
|
||||
import com.arsdigita.cms.ContentPage;
|
||||
import com.arsdigita.cms.Folder;
|
||||
import com.arsdigita.util.cmd.Program;
|
||||
import com.arsdigita.london.util.Transaction;
|
||||
|
||||
import org.apache.commons.cli.CommandLine;
|
||||
import org.apache.commons.cli.OptionBuilder;
|
||||
|
|
|
|||
|
|
@ -18,12 +18,11 @@
|
|||
|
||||
package com.arsdigita.london.util.cmd;
|
||||
|
||||
|
||||
import com.arsdigita.london.util.Program;
|
||||
import org.apache.commons.cli.CommandLine;
|
||||
|
||||
import com.arsdigita.web.Application;
|
||||
import com.arsdigita.web.ApplicationCollection;
|
||||
import com.arsdigita.util.cmd.Program;
|
||||
|
||||
import org.apache.commons.cli.CommandLine;
|
||||
|
||||
public class SiteMapList extends Program {
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,9 @@ import com.arsdigita.persistence.SessionManager;
|
|||
import com.arsdigita.persistence.metadata.MetadataRoot;
|
||||
import com.arsdigita.persistence.metadata.ObjectType;
|
||||
import com.arsdigita.util.Assert;
|
||||
import com.arsdigita.util.cmd.Program;
|
||||
import com.arsdigita.london.util.Transaction;
|
||||
|
||||
import com.redhat.persistence.metadata.Column;
|
||||
import com.redhat.persistence.metadata.ObjectMap;
|
||||
import com.redhat.persistence.metadata.Table;
|
||||
|
|
@ -32,11 +35,8 @@ import java.util.Iterator;
|
|||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.arsdigita.london.util.Program;
|
||||
import com.arsdigita.london.util.Transaction;
|
||||
import org.apache.commons.cli.CommandLine;
|
||||
import org.apache.log4j.Logger;
|
||||
import java.util.Iterator;
|
||||
|
||||
public class ACSObjectInvariantCheck extends Program {
|
||||
|
||||
|
|
|
|||
|
|
@ -18,12 +18,14 @@
|
|||
|
||||
package com.arsdigita.london.util.db;
|
||||
|
||||
import com.arsdigita.london.util.Program;
|
||||
import com.arsdigita.london.util.Transaction;
|
||||
import com.arsdigita.xml.XML;
|
||||
import com.arsdigita.util.cmd.Program;
|
||||
import com.arsdigita.london.util.Transaction;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.apache.commons.cli.CommandLine;
|
||||
import org.apache.log4j.Logger;
|
||||
import java.util.Iterator;
|
||||
|
||||
public class InvariantCheck extends Program {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,22 @@
|
|||
package com.arsdigita.navigation;
|
||||
/*
|
||||
* Copyright (C) 2001-2004 Red Hat Inc. 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.navigation.tools;
|
||||
|
||||
import com.arsdigita.domain.DomainObject;
|
||||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
|
|
@ -6,24 +24,45 @@ import com.arsdigita.domain.DomainObjectInstantiator;
|
|||
import com.arsdigita.kernel.Kernel;
|
||||
import com.arsdigita.kernel.KernelExcursion;
|
||||
import com.arsdigita.london.terms.Domain;
|
||||
import com.arsdigita.london.util.Program;
|
||||
import com.arsdigita.util.cmd.Program;
|
||||
import com.arsdigita.london.util.Transaction;
|
||||
import com.arsdigita.navigation.Navigation;
|
||||
import com.arsdigita.persistence.DataObject;
|
||||
import com.arsdigita.web.Application;
|
||||
|
||||
import org.apache.commons.cli.CommandLine;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
public class AddNavigation extends Program {
|
||||
/**
|
||||
* Command line utility to create an application instance of Navigation.
|
||||
*
|
||||
* Usually Loader creates a (default) application instance.
|
||||
*
|
||||
*/
|
||||
public class NavigationCreator extends Program {
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(AddNavigation.class);
|
||||
/** A logger instance to assist debugging. */
|
||||
private static final Logger s_log = Logger.getLogger(NavigationCreator.class);
|
||||
|
||||
public AddNavigation() {
|
||||
/**
|
||||
* Default Constructor
|
||||
*/
|
||||
public NavigationCreator() {
|
||||
super("Add Navigation instance", "1.0.0", "URL-FRAGMENT TITLE DOMAIN-KEY");
|
||||
}
|
||||
|
||||
private void addNavigation(String navURL, String navTitle, String defaultDomain) {
|
||||
if (!Application.isInstalled(Navigation.BASE_DATA_OBJECT_TYPE, "/"+navURL+"/")) {
|
||||
/**
|
||||
*
|
||||
* @param navURL
|
||||
* @param navTitle
|
||||
* @param defaultDomain
|
||||
*/
|
||||
private void createNavigation(String navURL,
|
||||
String navTitle,
|
||||
String defaultDomain) {
|
||||
|
||||
if (!Application.isInstalled(Navigation.BASE_DATA_OBJECT_TYPE,
|
||||
"/"+navURL+"/")) {
|
||||
|
||||
DomainObjectFactory.registerInstantiator(
|
||||
Navigation.BASE_DATA_OBJECT_TYPE, new DomainObjectInstantiator() {
|
||||
|
|
@ -37,13 +76,21 @@ public class AddNavigation extends Program {
|
|||
app.save();
|
||||
Domain domain = Domain.retrieve(defaultDomain);
|
||||
domain.setAsRootForObject(app, null);
|
||||
|
||||
} else {
|
||||
|
||||
System.err.println(Navigation.BASE_DATA_OBJECT_TYPE
|
||||
+ " already installed at " + navURL);
|
||||
System.exit(1);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param cmdLine
|
||||
*/
|
||||
protected void doRun(final CommandLine cmdLine) {
|
||||
new Transaction() {
|
||||
public void doRun() {
|
||||
|
|
@ -58,7 +105,7 @@ public class AddNavigation extends Program {
|
|||
if (navURL != null && navURL.length() != 0
|
||||
&& navTitle != null && navTitle.length() != 0
|
||||
&& domainKey != null && domainKey.length() != 0) {
|
||||
addNavigation(navURL, navTitle, domainKey);
|
||||
createNavigation(navURL, navTitle, domainKey);
|
||||
} else {
|
||||
help(System.err);
|
||||
System.exit(1);
|
||||
|
|
@ -77,7 +124,7 @@ public class AddNavigation extends Program {
|
|||
* @param args
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
new AddNavigation().run(args);
|
||||
new NavigationCreator().run(args);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
package com.arsdigita.navigation.tools;
|
||||
|
||||
import com.arsdigita.navigation.Template;
|
||||
import com.arsdigita.london.util.Program;
|
||||
import com.arsdigita.util.cmd.Program;
|
||||
import com.arsdigita.london.util.Transaction;
|
||||
|
||||
import org.apache.commons.cli.CommandLine;
|
||||
|
|
|
|||
|
|
@ -16,21 +16,30 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
package com.arsdigita.navigation;
|
||||
package com.arsdigita.navigation.tools;
|
||||
|
||||
import com.arsdigita.london.util.Program;
|
||||
import com.arsdigita.london.util.Transaction;
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.navigation.Template;
|
||||
import com.arsdigita.util.cmd.Program;
|
||||
|
||||
import com.arsdigita.london.util.Transaction;
|
||||
|
||||
import org.apache.commons.cli.CommandLine;
|
||||
import org.apache.commons.cli.OptionBuilder;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class TemplateTool extends Program {
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(TemplateTool.class);
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
TemplateTool() {
|
||||
super("Template Tool",
|
||||
"1.0.0",
|
||||
|
|
@ -43,7 +52,12 @@ public class TemplateTool extends Program {
|
|||
.create("d"));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param cmdLine
|
||||
*/
|
||||
protected void doRun(CommandLine cmdLine) {
|
||||
|
||||
final String[] args = cmdLine.getArgs();
|
||||
final boolean delete = cmdLine.hasOption("d");
|
||||
|
||||
|
|
@ -84,7 +98,11 @@ public class TemplateTool extends Program {
|
|||
}.run();
|
||||
}
|
||||
|
||||
public static final void main(String[] args) {
|
||||
/**
|
||||
*
|
||||
* @param args
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
new TemplateTool().run(args);
|
||||
}
|
||||
}
|
||||
|
|
@ -53,7 +53,7 @@ import com.arsdigita.util.StringUtils;
|
|||
import com.arsdigita.kernel.ResourceType;
|
||||
|
||||
import com.arsdigita.categorization.ui.CategoryPicker;
|
||||
import com.arsdigita.london.util.ui.ApplicationCategoryPicker;
|
||||
import com.arsdigita.categorization.ui.ApplicationCategoryPicker;
|
||||
|
||||
import com.redhat.persistence.metadata.Root;
|
||||
import com.redhat.persistence.common.Path;
|
||||
|
|
|
|||
|
|
@ -19,12 +19,12 @@
|
|||
package com.arsdigita.navigation.upgrades;
|
||||
|
||||
|
||||
import com.arsdigita.london.util.Program;
|
||||
import com.arsdigita.london.util.Transaction;
|
||||
import com.arsdigita.navigation.Loader;
|
||||
|
||||
import com.arsdigita.kernel.Kernel;
|
||||
import com.arsdigita.kernel.KernelExcursion;
|
||||
import com.arsdigita.london.util.Transaction;
|
||||
import com.arsdigita.navigation.Loader;
|
||||
import com.arsdigita.util.cmd.Program;
|
||||
|
||||
import org.apache.commons.cli.CommandLine;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -13,17 +13,16 @@ import com.arsdigita.kernel.Group;
|
|||
import com.arsdigita.kernel.permissions.PermissionDescriptor;
|
||||
import com.arsdigita.kernel.permissions.PermissionService;
|
||||
import com.arsdigita.kernel.permissions.PrivilegeDescriptor;
|
||||
import com.arsdigita.london.util.Program;
|
||||
import com.arsdigita.london.util.Transaction;
|
||||
import com.arsdigita.web.Application;
|
||||
import com.arsdigita.util.cmd.Program;
|
||||
|
||||
|
||||
/**
|
||||
* @author chris.gilbert@westsussex.gov.uk
|
||||
* create and grant permission to group who can then add quick
|
||||
* links under any category
|
||||
*
|
||||
*
|
||||
|
||||
* @author chris.gilbert@westsussex.gov.uk
|
||||
*/
|
||||
public class Upgrade650to651 extends Program {
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import com.arsdigita.kernel.GroupCollection;
|
|||
import com.arsdigita.kernel.Party;
|
||||
import com.arsdigita.portalworkspace.Workspace;
|
||||
import com.arsdigita.portalworkspace.WorkspaceCollection;
|
||||
import com.arsdigita.london.util.Program;
|
||||
import com.arsdigita.util.cmd.Program;
|
||||
import com.arsdigita.persistence.SessionManager;
|
||||
import com.arsdigita.persistence.TransactionContext;
|
||||
import com.arsdigita.web.ApplicationType;
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import org.apache.commons.cli.CommandLine;
|
|||
import com.arsdigita.portalworkspace.portlet.FlashPortlet;
|
||||
import com.arsdigita.portalworkspace.portlet.FlashPortletInitializer;
|
||||
import com.arsdigita.london.util.Transaction;
|
||||
import com.arsdigita.packaging.Program;
|
||||
import com.arsdigita.util.cmd.Program;
|
||||
|
||||
/**
|
||||
* Loads the {@link FlashPortlet}.
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import org.apache.commons.cli.CommandLine;
|
|||
|
||||
import com.arsdigita.navigation.portlet.NavigationTreePortlet;
|
||||
import com.arsdigita.london.util.Transaction;
|
||||
import com.arsdigita.packaging.Program;
|
||||
import com.arsdigita.util.cmd.Program;
|
||||
|
||||
public class CreateNavigationDirectoryPortlet extends Program
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.packaging.Program;
|
||||
import com.arsdigita.util.cmd.Program;
|
||||
import com.arsdigita.runtime.RuntimeConfig;
|
||||
import com.arsdigita.util.jdbc.Connections;
|
||||
import java.math.BigDecimal;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
*/
|
||||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.packaging.Program;
|
||||
import com.arsdigita.util.cmd.Program;
|
||||
import com.arsdigita.runtime.RuntimeConfig;
|
||||
import com.arsdigita.util.jdbc.Connections;
|
||||
import java.math.BigDecimal;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@
|
|||
<initializer class="com.arsdigita.core.Initializer"/>
|
||||
<table name="cms_items"/>
|
||||
<initializer class="com.arsdigita.cms.Initializer"/>
|
||||
<initializer class="com.arsdigita.london.util.Initializer"/>
|
||||
<initializer class="com.arsdigita.navigation.Initializer"/>
|
||||
</requires>
|
||||
<provides>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import com.arsdigita.util.parameter.Parameter;
|
|||
import com.arsdigita.util.parameter.ResourceParameter;
|
||||
import com.arsdigita.util.parameter.StringArrayParameter;
|
||||
import com.arsdigita.util.parameter.StringParameter;
|
||||
import com.arsdigita.london.util.ui.ApplicationCategoryPicker;
|
||||
import com.arsdigita.categorization.ui.ApplicationCategoryPicker;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.Map;
|
||||
|
|
|
|||
|
|
@ -16,4 +16,4 @@ com.arsdigita.subsite.front_page_parent_url.example=/portal/
|
|||
com.arsdigita.subsite.root_category_picker.title=Class for picking root categories
|
||||
com.arsdigita.subsite.root_category_picker.purpose=The UI class for picking root categories
|
||||
com.arsdigita.subsite.root_category_picker.format=[class]
|
||||
com.arsdigita.subsite.root_category_picker.example=com.arsdigita.london.util.ui.ApplicationCategoryPicker
|
||||
com.arsdigita.subsite.root_category_picker.example=com.arsdigita.categorization.ui.ApplicationCategoryPicker
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
<ccm:dependencies>
|
||||
<ccm:requires name="ccm-core" version="6.6.0" relation="ge"/>
|
||||
<ccm:requires name="ccm-cms" version="6.6.0" relation="ge"/>
|
||||
<ccm:requires name="ccm-ldn-util" version="6.6.0" relation="ge"/>
|
||||
<ccm:requires name="ccm-portalworkspace" version="6.6.0" relation="ge"/>
|
||||
</ccm:dependencies>
|
||||
<ccm:contacts>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,172 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2006 UNDP. 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.cms.webpage.tools;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.parameters.ParameterModel;
|
||||
import com.arsdigita.web.ParameterMap;
|
||||
import com.arsdigita.web.URL;
|
||||
|
||||
public class UrlUtil {
|
||||
|
||||
/**
|
||||
* Processes the URL for location.
|
||||
*/
|
||||
public static String prepareURL(final PageState state,
|
||||
String location,
|
||||
ParameterMap params) {
|
||||
return prepareURL(state, location, params, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes the URL for location.
|
||||
*/
|
||||
public static String prepareURL(PageState state,
|
||||
String location,
|
||||
ParameterMap params,
|
||||
boolean includeDispatcherPath) {
|
||||
return prepareURL(state, location, params, includeDispatcherPath,
|
||||
(List) null, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes the URL for location.
|
||||
*/
|
||||
public static String prepareURL(final PageState state,
|
||||
String location,
|
||||
ParameterMap params,
|
||||
boolean includeDispatcherPath,
|
||||
String ignoreParam) {
|
||||
ArrayList ignoreParams = new ArrayList();
|
||||
ignoreParams.add(ignoreParam);
|
||||
return prepareURL(state, location, params, includeDispatcherPath, ignoreParams, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes the URL for location.
|
||||
*/
|
||||
public static String prepareURL(final PageState state,
|
||||
String location,
|
||||
ParameterMap params,
|
||||
boolean includeDispatcherPath,
|
||||
List ignoreParams,
|
||||
boolean addPageStateParams) {
|
||||
final HttpServletRequest req = state.getRequest();
|
||||
final HttpServletResponse resp = state.getResponse();
|
||||
|
||||
if (params == null) {
|
||||
params = new ParameterMap();
|
||||
}
|
||||
//add global state parameters
|
||||
if (addPageStateParams) {
|
||||
Iterator stateParams = state.getPage().getParameters();
|
||||
while (stateParams.hasNext()) {
|
||||
ParameterModel param = (ParameterModel) stateParams.next();
|
||||
Object value = state.getValue(param);
|
||||
if (value != null) {
|
||||
String paramName = param.getName();
|
||||
//don't replace param
|
||||
if (params.getParameter(paramName) == null) {
|
||||
params.setParameter(paramName, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
params.runListeners(req);
|
||||
|
||||
if (includeDispatcherPath && location.startsWith("/")) {
|
||||
location = URL.getDispatcherPath() + location;
|
||||
}
|
||||
|
||||
String url;
|
||||
if (location.indexOf("?") == -1) {
|
||||
// m_params adds the "?" as needed.
|
||||
url = resp.encodeURL(location + params);
|
||||
}
|
||||
else {
|
||||
// The location already includes a query string, so
|
||||
// append to it without including a "?".
|
||||
if (location.endsWith("&")) {
|
||||
url = resp.encodeURL(location + params.getQueryString());
|
||||
}
|
||||
else {
|
||||
url = resp.encodeURL(location + "&" + params.getQueryString());
|
||||
}
|
||||
}
|
||||
|
||||
//remove ignored params
|
||||
if (ignoreParams != null) {
|
||||
Iterator iParsIter = ignoreParams.iterator();
|
||||
while (iParsIter.hasNext()) {
|
||||
String ignoreParam = (String) iParsIter.next();
|
||||
url = removeParameter(url, ignoreParam);
|
||||
}
|
||||
}
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the URL's paremeter
|
||||
*/
|
||||
public static String removeParameter(String url, String parameter) {
|
||||
|
||||
Pattern p = Pattern.compile("[?&]" + parameter + "=[^&]*");
|
||||
Matcher m = p.matcher(url);
|
||||
|
||||
int index = 0;
|
||||
int lastIndex = 0;
|
||||
int length = url.length();
|
||||
StringBuffer out = new StringBuffer();
|
||||
while (m.find(index)) {
|
||||
index = m.start();
|
||||
int end = m.end();
|
||||
if (url.charAt(index) == '&') {
|
||||
out.append(url.substring(lastIndex, index));
|
||||
}
|
||||
else {
|
||||
//start with ?...
|
||||
out.append(url.substring(lastIndex, index + 1));
|
||||
if (length > end && url.charAt(end) == '&') {
|
||||
end++;
|
||||
}
|
||||
}
|
||||
index = end;
|
||||
lastIndex = index;
|
||||
}
|
||||
if (url.length() > lastIndex) {
|
||||
out.append(url.substring(lastIndex));
|
||||
}
|
||||
//remove '?' as last char
|
||||
index = out.length() - 1;
|
||||
if (index >= 0 && out.charAt(index) == '?') {
|
||||
out.deleteCharAt(index);
|
||||
}
|
||||
return out.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -30,7 +30,7 @@ import com.arsdigita.kernel.permissions.PermissionDescriptor;
|
|||
import com.arsdigita.kernel.permissions.PermissionService;
|
||||
import com.arsdigita.kernel.permissions.PrivilegeDescriptor;
|
||||
import com.arsdigita.portalworkspace.WorkspacePage;
|
||||
import com.arsdigita.london.util.UrlUtil;
|
||||
import com.arsdigita.cms.webpage.tools.UrlUtil;
|
||||
import com.arsdigita.persistence.DataObject;
|
||||
import com.arsdigita.portal.Portal;
|
||||
import com.arsdigita.portal.Portlet;
|
||||
|
|
|
|||
Loading…
Reference in New Issue