addMostRecent deprecated?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

addMostRecent deprecated?

Jacques Le Roux
Administrator
Hi,

This service definition is commented out (I don't know why)

    <!--
    <service name="addMostRecent"
            engine="java"
            location="org.ofbiz.content.ContentManagementServices"
            invoke="addMostRecent" auth="false">
        <description>Get subContent of passed contentId/mapKey or subContentId</description>
        <attribute mode="IN" name="suffix" optional="true" type="String"/>
        <attribute mode="IN" name="pk" optional="true" type="org.ofbiz.entity.GenericValue"/>
        <attribute mode="IN" name="session" optional="true" type="javax.servlet.http.HttpSession"/>
    </service>
    -->

Should we remove it or is there a reason to keep it?

    /**
     * addMostRecent
     * A service for adding the most recently used of an entity class to the cache.
     * Entities make it to the most recently used list primarily by being selected for editing,
     * either by being created or being selected from a list.
     */
    public static Map<String, Object> addMostRecent(DispatchContext dctx, Map<String, ? extends Object> context) {
        //Security security = dctx.getSecurity();
        //Delegator delegator = dctx.getDelegator();
        //LocalDispatcher dispatcher = dctx.getDispatcher();
        //HttpServletRequest request = (HttpServletRequest)context.get("request");
        //String suffix = (String) context.get("suffix");
        GenericValue val = (GenericValue)context.get("pk");
        GenericPK pk = val.getPrimaryKey();
        HttpSession session = (HttpSession)context.get("session");

        ContentManagementWorker.mruAdd(session, pk);
        return ServiceUtil.returnSuccess();
    }

Jacques
Reply | Threaded
Open this post in threaded view
|

Re: addMostRecent deprecated?

Jacques Le Roux
Administrator
OK I will remove push this code to Attic

What I found strange is to have the session as service parameter and especially the service definition commented out

Jacques

From: "Jacques Le Roux" <[hidden email]>

> Hi,
>
> This service definition is commented out (I don't know why)
>
>    <!--
>    <service name="addMostRecent"
>            engine="java"
>            location="org.ofbiz.content.ContentManagementServices"
>            invoke="addMostRecent" auth="false">
>        <description>Get subContent of passed contentId/mapKey or subContentId</description>
>        <attribute mode="IN" name="suffix" optional="true" type="String"/>
>        <attribute mode="IN" name="pk" optional="true" type="org.ofbiz.entity.GenericValue"/>
>        <attribute mode="IN" name="session" optional="true" type="javax.servlet.http.HttpSession"/>
>    </service>
>    -->
>
> Should we remove it or is there a reason to keep it?
>
>    /**
>     * addMostRecent
>     * A service for adding the most recently used of an entity class to the cache.
>     * Entities make it to the most recently used list primarily by being selected for editing,
>     * either by being created or being selected from a list.
>     */
>    public static Map<String, Object> addMostRecent(DispatchContext dctx, Map<String, ? extends Object> context) {
>        //Security security = dctx.getSecurity();
>        //Delegator delegator = dctx.getDelegator();
>        //LocalDispatcher dispatcher = dctx.getDispatcher();
>        //HttpServletRequest request = (HttpServletRequest)context.get("request");
>        //String suffix = (String) context.get("suffix");
>        GenericValue val = (GenericValue)context.get("pk");
>        GenericPK pk = val.getPrimaryKey();
>        HttpSession session = (HttpSession)context.get("session");
>
>        ContentManagementWorker.mruAdd(session, pk);
>        return ServiceUtil.returnSuccess();
>    }
>
> Jacques