Author: xlawrence
Date: Thu May 31 12:46:54 2007
New Revision: 689

URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D689&repname=
=3Dcorporate_portal_templates_v2
Log:
Added option to delete a whole line in the Form Generator posted values tab=
le

Modified:
    branches/JAHIA-5-0-SP-BRANCH/src/jsp/eventlistener.jsp
    branches/JAHIA-5-0-SP-BRANCH/src/jsp/form_generator/display_form.inc
    branches/JAHIA-5-0-SP-BRANCH/src/jsp/form_generator/eventlistener.inc

Modified: branches/JAHIA-5-0-SP-BRANCH/src/jsp/eventlistener.jsp
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/src/jsp/eventlistener.jsp&rev=3D689&repname=3Dcorporate_portal_temp=
lates_v2
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-5-0-SP-BRANCH/src/jsp/eventlistener.jsp (original)
+++ branches/JAHIA-5-0-SP-BRANCH/src/jsp/eventlistener.jsp Thu May 31 12:46=
:54 2007
@@ -42,6 +42,7 @@
        eventsToTrap.add("addContainerEngineBeforeSave");
        eventsToTrap.add("containerAdded");
        eventsToTrap.add("containerUpdated");
+       eventsToTrap.add("containerDeleted");
 }
 =

 String eventName =3D (String) request.getAttribute("eventName");

Modified: branches/JAHIA-5-0-SP-BRANCH/src/jsp/form_generator/display_form.=
inc
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/src/jsp/form_generator/display_form.inc&rev=3D689&repname=3Dcorpora=
te_portal_templates_v2
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-5-0-SP-BRANCH/src/jsp/form_generator/display_form.inc (o=
riginal)
+++ branches/JAHIA-5-0-SP-BRANCH/src/jsp/form_generator/display_form.inc Th=
u May 31 12:46:54 2007
@@ -457,6 +457,9 @@
                                        %>
                                <display:column 
title=3D"<%=3DcreationDateTitle%>=
" sortable=3D"true" comparator=3D"<%=3D comparator %>" >
                                                
<%=3DcurrentValue.getContentContainer().getMeta=
dataDateValue("creationDate", jParams, "-", sdf) %>
+                                               <a 
href=3D"javascript:<%=3DjData.gui().html().d=
rawDeleteContainerLauncher(currentValue)%>">
+                                                                               
                                                <img border=3D"0" alt=3D"delete 
row" src=3D"<%=3DcontextUR=
L%>/img/actions/delete.gif" />
+                                                                               
                                        </a>            =

                                </display:column>       =

                                <% } %>
                                =


Modified: branches/JAHIA-5-0-SP-BRANCH/src/jsp/form_generator/eventlistener=
.inc
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/src/jsp/form_generator/eventlistener.inc&rev=3D689&repname=3Dcorpor=
ate_portal_templates_v2
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-5-0-SP-BRANCH/src/jsp/form_generator/eventlistener.inc (=
original)
+++ branches/JAHIA-5-0-SP-BRANCH/src/jsp/form_generator/eventlistener.inc T=
hu May 31 12:46:54 2007
@@ -38,5 +38,66 @@
             logger.error("Error while trying to flush HTML cache", t);
        }
                }
+} else if ( "textValues".equals(theContainer.getDefinition().getName()) || =

+                                               
"fileValues".equals(theContainer.getDefinition().getName())     ){ =

+                                       =

+               if ( "containerDeleted".equals(eventName)) {
+                               logger.fatal("deletedddddddddddddddddddddddd: " 
+ theContainer.getDefi=
nition().getName());
+                               final String id =3D 
theContainer.getFieldValue("id", "");       =

+                               logger.fatal("ididid: " + id);
+                               final org.jahia.services.cache.HtmlCache 
htmlCache =3D ServicesRegistr=
y.getInstance().getCacheService().getHtmlCacheInstance(); =

+                               if (id !=3D null && id.length() > 0) {
+                                               final 
org.jahia.services.search.ContainerSearcher theTextSearcher =
=3D new org.jahia.services.search.ContainerSearcher("textValues",
+                                                       jParams, id, 
jParams.getEntryLoadRequest());    =

+                       final org.jahia.data.search.JahiaSearchResult result1 
=3D theTex=
tSearcher.search(id, jParams);          =

+                       final Iterator ite =3D result1.results().iterator();
+                       while (ite.hasNext()) {
+                                       final 
org.jahia.data.search.JahiaSearchHit hit =3D (org.jahia.=
data.search.JahiaSearchHit) ite.next();
+                                       final int ctnId =3D 
Integer.parseInt(hit.getId());
+                                       =

+                                       final ContentContainer contentContainer 
=3D ContentContainer.g=
etContainer(ctnId);
+
+                // we only need to remove the shared language since this w=
ill
+                // automatically mark all sub languages for deletion too...
+                final Set curLanguageCodes =3D new HashSet();
+                curLanguageCodes.add(ContentObject.SHARED_LANGUAGE);
+
+                final StateModificationContext stateModifContext =3D new S=
tateModificationContext(
+                                                               new 
ContentContainerKey(ctnId), curLanguageCodes, tr=
ue);
+                stateModifContext.pushAllLanguages(true);
+                contentContainer.markLanguageForDeletion(
+                        jParams.getUser(),
+                        ContentObject.SHARED_LANGUAGE,
+                        stateModifContext);            =

+                       }                                       =

+                                                        =

+                       final org.jahia.services.search.ContainerSearcher 
theFileSearche=
r =3D new org.jahia.services.search.ContainerSearcher("fileValues",
+                                                       jParams, id, 
jParams.getEntryLoadRequest());            =

+                       final org.jahia.data.search.JahiaSearchResult result2 
=3D theFil=
eSearcher.search(id, jParams);  =

+                       final Iterator ite2 =3D result2.results().iterator();
+                       while (ite2.hasNext()) {
+                                       final 
org.jahia.data.search.JahiaSearchHit hit =3D (org.jahia.=
data.search.JahiaSearchHit) ite2.next();
+                                       final int ctnId =3D 
Integer.parseInt(hit.getId());
+                                       =

+                                       final ContentContainer contentContainer 
=3D ContentContainer.g=
etContainer(ctnId);
+
+                // we only need to remove the shared language since this w=
ill
+                // automatically mark all sub languages for deletion too...
+                final Set curLanguageCodes =3D new HashSet();
+                curLanguageCodes.add(ContentObject.SHARED_LANGUAGE);
+
+                final StateModificationContext stateModifContext =3D new S=
tateModificationContext(
+                                                               new 
ContentContainerKey(ctnId), curLanguageCodes, tr=
ue);
+                stateModifContext.pushAllLanguages(true);
+                contentContainer.markLanguageForDeletion(
+                        jParams.getUser(),
+                        ContentObject.SHARED_LANGUAGE,
+                        stateModifContext);            =

+                       }       =

+                       if (htmlCache !=3D null) {
+                       
htmlCache.invalidatePageEntries(String.valueOf(jParams.getPa=
geID()), EntryLoadRequest.STAGING_WORKFLOW_STATE);              =

+            }                                  =

+       }                                                                       
                                                                =

+               } =

 }
 %>
\ No newline at end of file

_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list

Reply via email to