This is an automated email from the ASF dual-hosted git repository.

jacopoc pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git

commit 503a46a74a25a2ad0000535d7da1f09309e85958
Author: Jacopo Cappellato <[email protected]>
AuthorDate: Fri May 15 10:03:30 2026 +0200

    Fixed: Remove unused traverse method from ContentWorker class
---
 .../ofbiz/content/content/ContentWorker.java       | 90 ----------------------
 1 file changed, 90 deletions(-)

diff --git 
a/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentWorker.java
 
b/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentWorker.java
index f8a6f8953b..0ea15c0def 100644
--- 
a/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentWorker.java
+++ 
b/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentWorker.java
@@ -499,96 +499,6 @@ public class ContentWorker implements 
org.apache.ofbiz.widget.content.ContentWor
         return contentAssocDataResourceViewFrom;
     }
 
-    public static void traverse(Delegator delegator, GenericValue content, 
Timestamp fromDate, Timestamp thruDate, Map<String, Object> whenMap,
-            int depthIdx, Map<String, Object> masterNode, String 
contentAssocTypeId, List<GenericValue> pickList, String direction) {
-        String contentTypeId = null;
-        String contentId = null;
-        try {
-            if (contentAssocTypeId == null) {
-                contentAssocTypeId = "";
-            }
-            contentId = (String) content.get("contentId");
-            contentTypeId = (String) content.get("contentTypeId");
-            List<GenericValue> topicList = 
content.getRelated("ToContentAssoc", UtilMisc.toMap("contentAssocTypeId", 
"TOPIC"), null, false);
-            List<String> topics = new LinkedList<>();
-            for (GenericValue assoc : topicList) {
-                topics.add(assoc.getString("contentId"));
-            }
-            List<GenericValue> keywordList = 
content.getRelated("ToContentAssoc", UtilMisc.toMap("contentAssocTypeId", 
"KEYWORD"), null, false);
-            List<String> keywords = new LinkedList<>();
-            for (GenericValue assoc : keywordList) {
-                keywords.add(assoc.getString("contentId"));
-            }
-            List<GenericValue> purposeValueList = 
content.getRelated("ContentPurpose", null, null, true);
-            List<String> purposes = new LinkedList<>();
-            for (GenericValue purposeValue : purposeValueList) {
-                purposes.add(purposeValue.getString("contentPurposeTypeId"));
-            }
-            List<String> contentTypeAncestry = new LinkedList<>();
-            getContentTypeAncestry(delegator, contentTypeId, 
contentTypeAncestry);
-
-            Map<String, Object> context = new HashMap<>();
-            context.put("content", content);
-            context.put("contentAssocTypeId", contentAssocTypeId);
-            context.put("purposes", purposes);
-            context.put("topics", topics);
-            context.put("keywords", keywords);
-            context.put("typeAncestry", contentTypeAncestry);
-            boolean isPick = checkWhen(context, (String) 
whenMap.get("pickWhen"), true);
-            boolean isReturnBefore = checkWhen(context, (String) 
whenMap.get("returnBeforePickWhen"), false);
-            Map<String, Object> thisNode = null;
-            if (isPick || !isReturnBefore) {
-                thisNode = new HashMap<>();
-                thisNode.put("contentId", contentId);
-                thisNode.put("contentTypeId", contentTypeId);
-                thisNode.put("contentAssocTypeId", contentAssocTypeId);
-                List<Map<String, Object>> kids = 
UtilGenerics.cast(masterNode.get("kids"));
-                if (kids == null) {
-                    kids = new LinkedList<>();
-                    masterNode.put("kids", kids);
-                }
-                kids.add(thisNode);
-            }
-            if (isPick) {
-                pickList.add(content);
-                thisNode.put("value", content);
-            }
-            boolean isReturnAfter = checkWhen(context, (String) 
whenMap.get("returnAfterPickWhen"), false);
-            if (!isReturnAfter) {
-                List<String> assocTypes = new LinkedList<>();
-                List<GenericValue> relatedAssocs = 
getContentAssocsWithId(delegator, contentId, fromDate, thruDate, direction, 
assocTypes);
-                Map<String, Object> assocContext = new HashMap<>();
-                assocContext.put("related", relatedAssocs);
-                for (GenericValue assocValue : relatedAssocs) {
-                    contentAssocTypeId = (String) 
assocValue.get("contentAssocTypeId");
-                    assocContext.put("contentAssocTypeId", contentAssocTypeId);
-                    assocContext.put("parentContent", content);
-                    String assocRelation = null;
-                    // This needs to be the opposite
-                    String relatedDirection = null;
-                    if (direction != null && 
"From".equalsIgnoreCase(direction)) {
-                        assocContext.put("contentIdFrom", 
assocValue.get("contentId"));
-                        assocRelation = "ToContent";
-                        relatedDirection = "From";
-                    } else {
-                        assocContext.put("contentIdTo", 
assocValue.get("contentId"));
-                        assocRelation = "FromContent";
-                        relatedDirection = "To";
-                    }
-
-                    boolean isFollow = checkWhen(assocContext, (String) 
whenMap.get("followWhen"), true);
-                    if (isFollow) {
-                        GenericValue thisContent = 
assocValue.getRelatedOne(assocRelation, false);
-                        traverse(delegator, thisContent, fromDate, thruDate, 
whenMap, depthIdx + 1, thisNode, contentAssocTypeId, pickList,
-                                relatedDirection);
-                    }
-                }
-            }
-        } catch (GenericEntityException e) {
-            Debug.logError("Entity Error:" + e.getMessage(), null);
-        }
-    }
-
     public static boolean traverseSubContent(Map<String, Object> ctx) {
         boolean inProgress = false;
         List<Map<String, Object>> nodeTrail = 
UtilGenerics.cast(ctx.get("nodeTrail"));

Reply via email to