Skip jsp page of import component

AlexeyPr
AlexeyPr Member
edited May 30, 2014 in Documentum #1

Dear developers!

My import in Taskspace customized a little bit:


<component id="importcontainer" extends="importcontainer:webcomponent/config/library/contenttransfer/importcontent/importcontainer_component.xml">
  ...
</component>  

Is there any way in Taskspace to skip <start> page while doing Import after selecting files in <fileselection> page of importcontainer?

Default values of object_name and r_object_type fields which are created will be enough.

Tagged:

Comments

  • PanfilovAB
    PanfilovAB Member
    edited May 29, 2014 #2

    Примерно так можно.

    определение действия:


    <action id="silentimport">
        <desc>Imports an object from the local file system to the repository. The user must have a contributor role. The permit value folder_link_permit performs a check for write permissions on the folder when folder security is enabled.</desc>
        <params>
            <param name="objectId" required="true"/>
            <param name="objectName" required="false"/>
            <param name="ownerName" required="false"/>
            <param name="docbaseType" required="false"/>
            <param name="baseDocbaseType" required="false"/>
            <param name="filePath" required="false"/>
            <param name="parentPath" required="false"/>
            <param name="isDirectory" required="false"/>
            <param name="format" required="false"/>
            <param name="componentArgs" required="false"/>
            <param name="component" required="false"/>
        </params>
        <execution class="com.documentum.web.formext.action.LaunchComponent">
            <component>import</component>
            <container>silentimportcontainer</container>
        </execution>
        <invocation>
            <modalpopup>
                <windowsize>medium</windowsize>
                <refreshparentwindow>onok</refreshparentwindow>
            </modalpopup>
        </invocation>
    </action>

    Определение контейнера:


    <component id="silentimportcontainer" extends="importcontainer: application='webcomponent'">
        <class>SilentImportContainer</class>
        <ucfrequired>
            <events>
                <event name="onOk" enabled="true"/>
                <event name="onRender" enabled="true"/>
            </events>
        </ucfrequired>
        <propagatepreviouspagevalues>true</propagatepreviouspagevalues>
    </component>

    Код контейнера:


    public class SilentImportContainer extends UcfImportContainer {

        private boolean _commitWasTried;

        public SilentImportContainer() {
            super();
        }

        @Override
        public void onRender() {
            super.onRender();
            if (isCommitWasTried()) {
                return;
            }

            String[] paths = getInitArgs().getValues("filePath");

            if (paths == null || paths.length == 0) {
                return;
            }

            tryCommitChanges();
        }

        @Override
        protected void tryCommitChanges() {
            try {
                invokeService();
            } catch (ContentTransferException e) {
                throw new WrapperRuntimeException(e);
            } finally {
                setCommitWasTried(true);
            }
        }

        protected final boolean isCommitWasTried() {
            return _commitWasTried;
        }

        protected final void setCommitWasTried(boolean commitWasTried) {
            _commitWasTried = commitWasTried;
        }

    }

  • AlexeyPr
    AlexeyPr Member
    edited May 30, 2014 #3

    Andrew, thanks for a quick answer!

    What is the best place in your example to define attributes for new object (object_name, r_object_type, format name)?