001/*
002 * Copyright 2025 devteam@scivicslab.com
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing,
011 * software distributed under the License is distributed on an
012 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
013 * either express or implied.  See the License for the
014 * specific language governing permissions and limitations
015 * under the License.
016 */
017
018package com.scivicslab.actoriac.report.sections.basic;
019
020import com.scivicslab.actoriac.report.SectionBuilder;
021
022/**
023 * POJO section builder that outputs the workflow file path.
024 *
025 * <p>Pure business logic - no {@code CallableByActionName}.
026 * Use {@link WorkflowFileSectionIIAR} to expose as an actor.</p>
027 *
028 * <h2>Output example:</h2>
029 * <pre>
030 * [Workflow File]
031 * workflows/main-cluster-status.yaml
032 * </pre>
033 *
034 * @author devteam@scivicslab.com
035 * @since 2.16.0
036 */
037public class WorkflowFileSection implements SectionBuilder {
038
039    private String workflowPath;
040
041    /**
042     * Sets the workflow file path.
043     *
044     * @param path the workflow file path
045     */
046    public void setWorkflowPath(String path) {
047        this.workflowPath = path;
048    }
049
050    @Override
051    public String generate() {
052        String path = workflowPath != null ? workflowPath : "(unknown)";
053        return "[Workflow File]\n" + path + "\n";
054    }
055
056    @Override
057    public String getTitle() {
058        return null;  // Title is embedded in content
059    }
060}