How to set the lifetime properties of a document

Hi Experts,
Do somebody know how to set the lifetime attributes "valid from" and "valid to" via java of the lifetime properties?
Which java class should I use?
Do somebody have an example for this issue maybe?
Thanks in advanced!
Best Regards,
Markus

Hi Markus,
Below is a sample method which i am using for setting expiry date for a KM Doc...
public void setTimeBasedPublish(IResource resource) throws WcmException {
          IRepositoryServiceFactory repServiceFactory =
               ResourceFactory.getInstance().getServiceFactory();
          IRepositoryService repositoryService =
               repServiceFactory.getRepositoryService(
                    resource,
                    IWcmConst.TIMEBASED_PUBLISH_SERVICE);
          ITimebasedPublishServiceManager tpbService =
               (ITimebasedPublishServiceManager) repositoryService;
          java.util.Date startDate = new java.util.Date();
          java.util.Date endDate = new java.util.Date();
          endDate.setMinutes(
               startDate.getMinutes()
                    + Integer
                         .valueOf(getproperty("LIFETIME_MINUTES_FOR_LATEST_REPORTS"))
                         .intValue());
          endDate.setDate(
               startDate.getDate()
                    + Integer
                         .valueOf(getproperty("LIFETIME_DAYS_FOR_LATEST_REPORTS"))
                         .intValue());
          tpbService.saveValidDate(resource, startDate);
          tpbService.saveInvalidDate(resource, endDate);
Regards
BP

Similar Messages

  • How to set the show properties as  a default in KM

    Hello All,
    I am trying to upload the documents in KM repository using File-> Upload. If I click this Upload button, it will open a new window, it will show (show properties) this properties. But I want this one as default. Can any one help to set the (show properties) as a default? 
    Thanks in  Advance.

    Hi Gowsika,
    I'm sorry, but you seem not to get my explanation.
    First, there is no such "switch" for "Show Properties" or "Hide Properties", and there is also not Resource Type "Show Properties". It is hardcoded in the UICommand "upload" (so in the Screenflow implemented by com.sapportals.wcm.rendering.uicommand.cm.UIUploadCommand), that if the ResourceType "normalrt" (http://sap.com/xmlns/cm/framework/normal-resource-type) displayed "Normal Document" is selected, you will see the "Show Properties" link. Only by changing the implementation of this UICommand you could change this behavior, but it's not recommended because you have to make sure on upgrades that you don't overwrite it again.
    So again my suggestion:
    1. Go to KM->CM->Configuration->CM->Global Services->Resource Types
    2. Duplicate the Resouce Type "normalrt" changing:
      Name: my_normalrt
      Resource Type ID: http://sap.com/xmlns/cm/framework/my-normal-resource-type
    3. Go to KM->CM->Configuration->CM->Global Services->Property Structures->Property Structures
    4. Duplicate "DefaultPropertiesStructure" changing:
      Name: My_DefaultPropertiesStructure
      Resource Types: http://sap.com/xmlns/cm/framework/my-normal-resource-type
      Structure Items: "Input_here_your_properties_and_property_groups"
    BTW: If you want to have the same properties as in DefaultPropertiesStructure you might be obligated to remove some of them from the original Property Structure.
    5. Go to KM->CM->Configuration->CM->User Interface->Commands->UI Commands
    6. Duplicate "new_file" changing:
      Alias: my_upload
      Parameters: ResourceType=http://sap.com/xmlns/cm/framework/my-normal-resource-type,standalone=true
    7. Go to KM->CM->Configuration->CM->User Interface->Commands->UI Command Groups
    8. Edit AdminNewResourceGroup by renaming upload to my_upload in the "Commmand List" parameter.
    BTW: It's advisable to duplicate the whole Command Group and use it in your Layout Set and not to change the standard configuration, but I will not describe the whole process here
    9. Now go to KM Content and use the menu Folder->New...->Upload
    Hope this helps,
    Robert

  • How to set the root path of XML document when calling Inserting procedure

    Hi,
    I was create a procedure to insert XML Document in to DBMS Tables, but i am not able to set the Start root element in calling procedure.
    My calling procedure is
    exec insXmldoc('pmc_sample.xml', 'pmc')
    When i am calling this procedure i got this error
    11:23:54 Error: ORA-29532: Java call terminated by uncaught Java exception: oracle.xml.sql.OracleXMLSQLException: Start of root element expected.
    ORA-06512: at "SYS.DBMS_XMLSAVE", line 65
    ORA-06512: at "SCOTT.INSPROC", line 8
    ORA-06512: at line 2
    I am checking my XML file using XML Validator. My XML file was parsed with out errors.
    Please give the solution,and tell me where i did wrong in my calling procedure.
    suppose i have this XML file in local E drive ,how to set the path for that XML file in my calling procedure.

    Hi, I am doing the code likthis,please give the solution.
    SQL> create or replace procedure insProc(xmlDoc IN CLOB, tableName IN VARCHAR2) is
    2 insCtx DBMS_XMLSave.ctxType;
    3 l_ctx dbms_xmlsave.ctxtype;
    4 rows number;
    5 begin
    6 insCtx := DBMS_XMLSave.newContext(tableName); -- get the context handle
    7 rows := DBMS_XMLSave.insertXML(insCtx,xmlDoc); -- this inserts the document
    8 DBMS_XMLSave.closeContext(insCtx); -- this closes the handle
    9 end;
    10 /
    Procedure created.
    SQL> begin
    2 insProc('/usr/tmp/ROWSET.xml', 'emp');
    3 end;
    4 /
    begin
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception: oracle.xml.sql.OracleXMLSQLException:
    Start of root element expected.
    ORA-06512: at "SYS.DBMS_XMLSAVE", line 65
    ORA-06512: at "SCOTT.INSPROC", line 7
    ORA-06512: at line 2
    Kishore B

  • How to set the encoding of an XML-document

    I need to change the encoding of an xml-document.
    When I convert the document into a string, UTF-8
    is used, I want to use ISO-8859-1.

    use this in your identity transform:
    transformer.setOutputProperty(OutputKeys.ENCODING, "ISO-8859-1");

  • How to set the language key in Sales document header text?

    Hi Guys,
    When I am creating a sales order I found in the header text tab only three languages English, Thai and Ukranian are mentained.. So can you please tell me how to add/ delete more language keys in language key field in a step by step process???
    Thanx and regards,
    JEET

    Just select the "unwanted language" keys (By 'right clicking') on each & then use the "delete" icon (3rd icon) on the bottom half.
    you can also manintain as many languages as you want.
    Pls do the needful.
    Rgds
    Sumanth.Gururaj
    Edited by: SUMANTH GURURAJ on Jan 21, 2011 6:21 PM

  • Setting the resolution of a Pages document

    I'd be very grateful if some kind soul could tell me how to set the resolution of a new document in Pages.
    I want to use Pages to create an advert for inclusion in a magazine. They need artwork at 300dpi resolution and preferably in jpeg format. I've tried adding an image (300dpi) to a blank Pages document then saving it as a pdf (via File>Print) then opening the pdf in Preview and saving it as a jpeg. However, the resulting jpeg is only 150dpi for some reason.
    Any help (or easier method, or tip for what other application is more suitable for this job) would be much appreciated!
    Michael

    I'd be very grateful if some kind soul could tell me how to set the resolution of a new document in Pages.
    I want to use Pages to create an advert for inclusion in a magazine. They need artwork at 300dpi resolution and preferably in jpeg format. I've tried adding an image (300dpi) to a blank Pages document then saving it as a pdf (via File>Print) then opening the pdf in Preview and saving it as a jpeg. However, the resulting jpeg is only 150dpi for some reason.
    Any help (or easier method, or tip for what other application is more suitable for this job) would be much appreciated!
    Michael

  • How to set the properties

    If I want to use java ORB to visit Visibroker ORB , how to set the Properties for init ?? can you help me ?
    thanks !

    System.setProperty("org.omg.CORBA.ORBClass","com.inprise.vbroker.orb.ORB");
    System.setProperty("org.omg.CORBA.ORBSingletonClass","com.inprise.vbroker.orb.ORB");You can get some examples here:
    http://maris.site.lv/ejb.html
    best regards,
    Maris Orbidans

  • TABLE - How to set the row in the table

    I have a problem where I have a selection on one view and then call a second view to display the results in a table. The table displays 5 rows. I then go down to the 20th row and select the row. When I have finished processing, I still have row 20 selected and I go back via a plug to the selection screen. I then enter new criteria and go back to the second view and the table displays that data showing row 20 as the first row. How do I get it to go back to row 1 every time I go into the second view??

    Hello Graeme,
    assuming i understand the problem, as a quick solution it would perhaps help to set the lifetime of the second view from "framework controlled" to "when visible" (in the properties of the view). Another way could be to explictly invalidate the context node holding the data for the second view after having left the view.
    Kind regards
    Andreas

  • How to set the out point beyond 9.95 seconds???

    how to set the out point  in Motion 5 beyond 9.95 seconds???

    First you need to make sure your project is long enough then you can adjust the play range (in/out). To make sure the project is long enough:
    1. From the project properties (command-J) go to the Duration field and enter a new duration.
    2. Click on the down arrow icon to the right of the current time, there is an option to show the project duration. Once set to this you can double click the number and type in a new project duration. I'd recommend setting it back to show current time when done.
    3. Of course you can also change the duration of a project when it is first created, in the project browser.
    Once you're sure you have a long enough project you can adjust the in and out range.  You then use the zoom controls in the bottom of the timeline to show more of the timeline and adjust the play range as needed. There's lots more about project and play range duration adjustments in the documentation: http://help.apple.com/motion/mac/5.1/

  • How to set the size for height of iView tray?

    Hi,
    I have created a ABAP webdynpro component and integrated this comp with iView. Then i integrated iView into Page in portal. That is working fine.
    But the size of tray/window which is displayed in the page is very small.
    How to increase the height of that Tray/window/iView containing my component?

    Hi,
    By changing the maximum automatic height and Minimum automatic height property of the iview you can set the size for height of your iview.
    to do this follow the setps:
    goto content administrator -> portal content -> your folder where you created your iview or directly to your iview -> right click -> open -> object,
    and now in property category choose appearance-Size from the drop down menu and set the above properties to your required height.
    if you want the end user to modify this property set the property to read/write .
    *********please reward points if the information is helpful to you********************

  • How to start weblogic in debug mode ? and how to set the eclipse in the deb

    how to start weblogic in debug mode ? and how to set the eclipse in the debug

    Put this in JAVA_OPTIONS :
    Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=3999,suspend=y,server=y
    After restarted weblogic, in eclipse set your breakpoint , open debug perspective then choose Remote Java Appliction and configure Connection Properties (host=localhost and port=3999)

  • Sun ONE Studio 4 aka Forte: How to set the output path for classes ?

    Help !
    Beginner's question:
    Sun ONE Studio 4 aka Forte:
    How to set the output path for classes ?
    As default, the class files are created in the same directory as the
    sources.
    In opposite, both JBuilder and Together support that there is a tree
    with the sources and another tree with the classes.
    The first answer I got was "not possible with Forte, but just if you write your own "ANT Build script" !
    a) Please point me to a ready-to-use ANT script for this purpose, if such is available
    b) Is using ANT instead of the MAKE as comfortable ? Besides the separation of sourcecode and classes, I would like to keep everything else to be the same, i.e. I don�t want to edit the ANT file if I enlarge the project by directories or files.
    Tia
    Sincerely
    Rolf

    You can set S1S's options to place newly created .class files in a specific location.
    Identify the compiler that is being used - Open the S1S's Tools/Options window, expand Editing and select Java Sources. Note the Default Compiler value. (If it's one if the Ant options, you use Ant to specify this option, not S1S.)
    Open the S1S's Tools/Options window, expand Building/Compiler Types and select the appropriate compiler.
    The Properties tab of the compiler has the property Target, which sets the filesystem where the compiler output is directed. If you choose <not set>, the .class files are written to their source directory.
    When you set the Target, your change affects all classes that use this compiler.
    Very few options can't be set in S1S; the challenge is finding out where they're set!

  • How to set the default profiles in pi i have a problem

    hi friends
    can any one give me the solulation for this problem
    Exception class: com.sap.aii.utilxi.prop.api.PropertiesException
    Unable to read configuration data (ExchangeProfile/aii.properties)
    Exception Details
    Exception class: com.sap.aii.utilxi.prop.api.PropertiesException
    Message
    Unable to read configuration data (ExchangeProfile/aii.properties)
    Stacktrace
    Thrown:
    MESSAGE ID: com.sap.aii.utilxi.prop.api.rb_all.NO_PROPERTIES
    com.sap.aii.utilxi.prop.api.PropertiesException: Unable to read configuration data (ExchangeProfile/aii.properties)
         at com.sap.aii.utilxi.prop.api.PropertySourceFactory.initServerMode(PropertySourceFactory.java:202)
         at com.sap.aii.utilxi.misc.api.AIIProperties.initServerMode(AIIProperties.java:401)
         at com.sap.aii.ib.server.applcomp.StartupServerProperties.initPropertiesForServer(StartupServerProperties.java:95)
         at com.sap.aii.ibrep.server.applcomp.StartupCodeEntry.startup(StartupCodeEntry.java:152)
         at com.sap.aii.ib.core.applcomp.IStartupCodeEntry.startupIfNotAlreadyDone(IStartupCodeEntry.java:33)
         at com.sap.aii.ib.core.applcomp.ExplicitApplicationComponentImpl.startup(ExplicitApplicationComponentImpl.java:116)
         at com.sap.aii.ib.core.applcomp.ExplicitApplicationComponents.startup(ExplicitApplicationComponents.java:383)
         at com.sap.aii.ib.core.applcomp.ApplicationComponent.startup(ApplicationComponent.java:209)
         at jsp_Main1198312518875._jspService(jsp_Main1198312518875.java:21)
         at com.sap.engine.services.servlets_jsp.server.jsp.JspBase.service(JspBase.java:112)
         at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:544)
         at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:186)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Error History, Build Info, Generic Application Info
    plz help me i could not do any work
    how to set the defult profiles
    raja

    Please look at this thread. This might resolve your problem.
    Unable to read configuration data (ExchangeProfile/aii.properties)
    -Pinkle

  • [ISA 4.0 SP5] How to set the language of an order

    Hi,
    how to set the language of an order?
    I use address.setCountry( myCountry ) and works fine, but:
    an Order in R3 has also a field "Language" under the tab "Communication", but it's not set automatically, corresponding to the country.
    How do i set this field on the Java-side in InternetSales 4.0 Sp5?

    Hi vikram!
    Sorry for the still inconvenience, but I'm getting this error:
    Error in method invocation: Static method sendNotification( com.sap.odp.usermgmt.masterdata.UserAccountBo, com.sap.odp.usermgmt.masterdata.UserAccountBo, com.sap.odp.api.comp.messaging.MailTypeEnumType, java.util.Properties, null, null ) not found in class'com.sap.odp.api.util.NotificationUtil'
    Im making the code the following way:
    Properties params = new Properties();
    params.put(new String("PHASE_NAME"), faseName);
    params.put(new String("DOCUMENT_TYPE"), docType);
    params.put(new String("DOCUMENT_NAME"), contractName);
    params.put(new String("RECIPIENT_FIRST_NAME"), nombre);
    params.put(new String("OWNER_FIRST_LAST_NAME"), owner.toString());
    params.put(new String("START_DATE"), fecha);
    params.put(new String("ORG_UNIT"), orgUnit);
    params.put(new String("INSTRUCTION"), "");
    params.put(new String("DOCUMENT_HEADER_URL"), vinculo);
    recipients = IapiAccountLocator.lookup(session, collaborator.getPrincipal()); // This Changed.
    ( I also tried like this:
    IapiAccountIfc recipients = IapiAccountLocator.lookup(session, collaborator.getPrincipal());)
    sender = session.getAccount();
    mailTypeEnum = new MailTypeEnumType(MailTypeEnumType.ODP_WORKFLOW_APPROVAL_REQUEST_MSG);
    NotificationUtil.sendNotification(recipients,sender, mailTypeEnum,params,null,null);
    Thanks again!

  • How to set the view privilege of a portlet?

    Dear all,
    I would like to ask how to set the view privilege of a portlet (which is located on the Intranet homepage) to only a group of users?
    As far as I know, I can create a tab with view privilege to address the about scenario. But is it possible to directly set the view privilege to the portlet ?
    thanks
    George (HK)
    Welcome to my photo albums at http://community.webshots.com/user/GeorgeLee80
    Message was edited by:
    georgelkh

    OK, you got me there George. I don't know where you can set view rights to an out of box portlet. So how about a different approach?
    1) Create a blank page with no nav bar or anything else
    2) Assign the group you want to see the notifications portlet view rights on the page
    3) Make sure the show as portlet check box is checked on the Optional tab in the page properties
    4) Add the notifications portlet to the page
    5) Ensure the portlet settings are how you desire in terms of what notifications to show and the region settings are how they should be in terms of border, headers, etc
    6) Edit the page where you want the notifications portlet to be shown and add the page portlet you just created instead of the notification portlet
    This should achieve what you seek without having to dig into out-of-box portlets.
    Rgds/Mark M.

Maybe you are looking for

  • HELP !!! URGENT !!! How to read passwd (console) without printing it ???

    Hello !!! I need help. I write program for console.I'd like to read for example password. I dont like it to be written on screen. I use: BufferedReader is = new BufferedReader( new InputStreamReader(System.in)); passwd = is.readLine( ); but default a

  • Wwv_flow_item.popupkey_from_query in combination  SQL updateable report

    Hi, I found out that wwv_flow_item.popupkey_from_query in combination 'SQL updateable report' does not work. It does not display the popup. It creates a extra column with the message below. In combination with 'SQL query' it works. Is it possible to

  • Need help with backup files made by HP Recovery.

    So in 2011 I had made a post about a DV9 series HP laptop I had that I felt needed a harddrive. Well the laptop has been sold to a friend of mine and he has since fixed the issue it had. My curent deboggle is trying to deal with the 36GB of data it b

  • Name cannot be resolved

    hi, how to modify this code?to solve name cannot be resolved error. function ValidateUsername(formobj) var name=formobj.username.value; alert(name); <% UserDAO userDao = new UserDAOHibernate(); Integer userID = userDao.getValidUserForForgotPassword(n

  • Enum type class hierarchy.

    Hi, I was reviewing and eagerly testing the Typesafe Enum Facility (enum types) on 1.5.0 beta, which is still in Public Review in the JCP (JSR-201). I would would like to mention a missing feature that I find usefull and powerfull for a custom framew