Migrating Deprecated Code in 9.2

Hi all,
I have begun an attempt at removing as much (if not all) of the code in this legacy project I have been working on that has been deprecated by 9.2 from v8.x.
I am currently having two issues:
1) Our code is acting on the type of the Node. In 8.1, there is the Node.getType(), which is marked as deprecated, but shows no alternative. Is the concept of a Content node and a Hierarchy node still applicable? If so, how do I differentiate? If not, are all nodes treated the same?
2) The ObjectClass used to be a parameter of the Node.createContentNode/Node.createHierarchyNode methods. It no longer is present. When I replace the following statement:
nodeOps.createHierarchyNode(parent.getId(),
document.getFileName(),
objectClass.getId(),
(Property[]) propertiesList.toArray(new Property[propertiesList.size()]));
with this:
nodeManager.addNode(new ContentContext(),
parent.getPath(),
document.getFileName(),
(Property[]) propertiesList.toArray(new Property[propertiesList.size()]));
then it fails with a NoSuchObjectClassException.
Can anyone explain this a bit better to me, or point me to the documentation that details this? I have searched for a day and cannot find anything related to these 2 issues.
Thanks in advance,
-mike

That may work. It seems there is a different issue now in that we are not finding the ObjectClasses when we do a lookup. We have code that is using the deprecated API:
getObjectClassOps().getObjectClasses(PortalRepositoryNames.REPOSITORY_NAME);
And as soon as I change that to:
ContentManagerFactory.getTypeManager().getViewableTypes(new ContentContext(), PortalRepositoryNames.REPOSITORY_NAME);
it appears to return an empty list. I read in the JavaDoc that this should "Return all the types for the given repository for which the user has VIEW privileges on."
So this would appear to be more of an authorization issue, as there are 5 object classes in the CM_OBJECT_CLASS table, but none of them are being returned.
As far as I can tell, I cannot see anywhere in the code where we are checking against a user's privileges. Has this behaviour changed as well if I use the new API? How would I go about ensuring that the getViewableTypes() method will return me everything from the CM_OBJECT_CLASS table?
Thanks,
-mike

Similar Messages

  • Migrating AS2 Code to AS3

    ORIGINAL AS1 SCRIPT
    I have already tried several ways to migrate this code, but I
    get unexpected behaviors. Can any one help me?
    The volume control on the stage is made out of two
    movieClips: one called knob and the other volume_track over which
    the knob slides (is dragged by user) This two Clips are turned into
    one movieClip called volume_control. The Sound Object is within an
    Empty MovieClip called soundMc. the pos variable gathers the knob's
    position on the volume_track.
    The following code is the original one, which works
    perfectly.

    Hi, Kglad,
    I had made a mistake, that's why the code didn't work at all.
    My bad.
    I modified a little the code you suggested as well as the
    Clips Instance Names.
    I used the Rectangle Class to get the
    startDrag(lockCenter:Boolean = false, bounds:Rectangle = null)
    method's bound argument. This is how the Rectangle is set up:
    Rectangle(x:Number, y:Number, width:Number, height:Number);
    It works now, but there's a couple of unexpected things
    happening.
    1. It really hard to make the knob move left and right
    because the cursor seems not to get a firm hold of it.
    2. Once it starts dragging, I have to move it very slowly
    otherwise I lose a hold on the knob.
    3 - In order to get the knob to drag within the bounderies of
    its track, I had to add extra numbers in the x (8 instead of 0),
    width (a -12), and height (0 instead of e.currentTarget.y), but
    this poses a problem later when I try to get a definite value to
    control the volume intensity between 0.0 (Minimum volume) and 1.0
    (Max Vol). Tracing pos, I got these results:
    Min pos: 0.10810810810810811
    Max pos: 0.9459459459459459
    Is there a way to clean up those results, like a Math
    function, so that I can get something like this 0.1 and 0.9 instead
    of those long numbers?
    volume_control.volKnob.addEventListener(MouseEvent.MOUSE_DOWN,
    dragKnob);
    volume_control.volKnob.addEventListener(MouseEvent.MOUSE_UP,
    stopKnob);
    volume_control.volKnob.addEventListener(MouseEvent.MOUSE_OUT,
    stopKnob);
    var t:Timer=new Timer(70,0);
    t.addEventListener(TimerEvent.TIMER,volF);
    function dragKnob(e:MouseEvent) {
    trace("Begin dragging");
    var rect:Rectangle = new Rectangle(8, e.currentTarget.y,
    e.currentTarget.parent.volTrack.width-12, 0);
    e.currentTarget.startDrag(false, rect);
    t.start();
    function stopKnob(e:MouseEvent) {
    trace("Stop draggin");
    e.currentTarget.stopDrag();
    t.stop();
    function volF(e:TimerEvent) {
    var pos:Number =
    (volume_control.volKnob.x/volume_control.volTrack.width);
    //soundObjChannel.soundTransform.volume =pos; // you need to
    define your soundChannel object whereever you're applying the play
    method to your sound object
    trace("pos" + pos);
    }

  • Migrating Sybase code to Oracle 11g

    Hi All,
    We have to migrate Sybase code to Oracle 11g.
    When we are doing a SELECT .. INTO in Sybase , even if the query is returning more than 1 row , sybase selects 1 of the rows and populates the variables.
    But while migrating this code to oracle, we are getting TOO_MANY_ROWS Exception.
    We need to migrate the code from SYBASE to ORACLE without disturbing the logic.
    Can someone please tell me the logic applied by SYBASE to pick up the record?
    And if someone has faced this issue, then what can be done to resolve this.
    Regards,
    Riddhisha Khamesra

    The result 3 is the last entered record (not the amount of records..).
    So the first approach to write a dummy procedure that will select all records in Oracle like:
    CREATE OR REPLACE PROCEDURE last_record
    v_arg1 OUT NUMBER
    AS
    BEGIN
    SELECT col1
    INTO v_arg1
    FROM tt_tmp ;
    END;
    and hopefully returns only the last record will fail with:
    SQL> variable outvar number
    SQL> exec last_record (:outvar)
    BEGIN last_record (:outvar); END;
    ERROR at line 1:
    ORA-01422: exact fetch returns more than requested number of rows
    ORA-06512: at "SYSTEM.LAST_RECORD", line 9
    ORA-06512: at line 1
    One possible approach to get the last (and only the last) record that was entered into the table is to use rownum:
    The select might look like "select col1 from (select col1, rownum from tt_tmp order by rownum desc) where rownum=1;"
    So the procedure can be coded as:
    CREATE OR REPLACE PROCEDURE last_record
    v_arg1 OUT NUMBER
    AS
    BEGIN
    SELECT col1
    INTO v_arg1
    from (select col1, rownum from tt_tmp order by rownum desc) where rownum=1;
    END;
    Now calling it in SQL*Plus:
    SQL> variable outvar number
    SQL> exec last_record (:outvar)
    PL/SQL procedure successfully completed.
    SQL> print :outvar
    OUTVAR
    7
    The value 7 is the last record I've inserted into my tt_tmp table:
    SQL> select * from tt_tmp;
    COL1 COL2
    1 1
    2 2
    8 8
    7 7

  • How to find deprecated code

    Hi there
    I've just been handed over a great big project that was coded a couple of years ago and have just recompiled most of it - problem is that the compiler keeps telling me that the code has deprecated stuff in it but it won't tell me WHERE! (I'm using netbeans 4.1, Java 5.0)
    Does anyone know of a tool that can pick out deprecated code or wether netbeans can do this please?
    Cheers
    JJ

    C:\temp>javac someApplet.java
    Note: someApplet.java uses or overrides a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    C:\temp>javac -Xlint:deprecation someApplet.java
    someApplet.java:9: warning: [deprecation] stop() in java.lang.Thread has been de
    precated
    Thread.currentThread().stop();
    ^
    1 warning

  • How to migrate source code from TFS 2010 to a new TFS 2010

    Hi,
    Please help me, How to migrate source code from TFS 2010 to a new TFS 2010. we are using SQL 2008 R2 for DB storage and we have Backup of TFS DB. First TFS 2010 is live environment and second TFS 2010 is test environment both OS and SQL version is same. 

    Hi Pankaj0439,
    In general, to move TFS from a hardware to another, you can follow the steps as below:
    1. Check your permissions
    2. Back up databases and install software
    3. Restore TFS databases to the new hardware
    4. Update the configuration of the new application-tier server
    5. Verify permissions, notify users, and configure backups
    And you can also refer to this
    article in MSDN for more details.
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Deprecated Code - Migration from SQL 2005 to 2012

    Hi,
    We're planning to upgrade our database from SQL Server 2005 to 2012. Based on this
    link, it seems there's no code conversion needed in terms of Data Type, Keywords in creating SPs, Function, trigger.
    The only thing that concerns me is this
    Set options
    SET ROWCOUNT for INSERT, UPDATE, and DELETE statements
    TOP keyword
    SET ROWCOUNT
    109
    But other than that, it should be good.
    I would also like to get any feedback from other user who migrated their database from 2005 to 2012. What were the issues encountered during the process. Any tips and suggestion will be much appreciated.
    Many Thanks.

    What is your mode of upgrade
    1. In place
    2. Side by side
    You must also read
    Breaking changes to DB engine features in SQL Server 2012
    Breaking changes to SQL Server features in SQL Server 2012
    If you are just using DB engine features and SSIS I would advise you to first run upgrade advisor and look for breaking changes or unsupported scenarios. make sure you mitigate all such issues.
    There is also a feature where you can side by side upgrade database by backup restore to SQL Server 2012 and still keep
    compatibility level to 90
    (but that is not advised)
    I have migrated database from 2008 to 2012 but not from 2005 but above documents were very handy and would work quite well.
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
    My Technet Wiki Article
    MVP

  • Migrating of code from JAXB 1.0 to JAXB 2.0

    Hi,
    We have used JAXB 1.0.3 for the binding purpose and other stuff. Now we have to migrate to JAXB 2.0.
    While migrating i am facing the following issues, as we shouldnot use any deprecated method iin the code so need to replace the appropriate Interface/Class/Method:
    1. The type Validator is deprecated.
    2. The type SchemaLocationFilter is deprecated.
    3. The field Messages.ERR_DANGLING_IDREF is deprecated.
    4. The field Messages.ERR_NOT_IDENTIFIABLE is deprecated.
    5. The constructor SchemaLocationFilter(String, String, ContentHandler) is deprecated
    6. The method DefaultJAXBContextImpl.createValidator() overrides a deprecated method from JAXBContext.
    7. The method parse(Element, ContentHandler) from the type DOMScanner is deprecated.
    8. The method ValidatorImpl.getEventHandler() overrides a deprecated method from Validator.
    9. The method ValidatorImpl.getProperty(String) overrides a deprecated method from Validator
    10. The method ValidatorImpl.setEventHandler(ValidationEventHandler) overrides a deprecated method from Validator.
    11. The method ValidatorImpl.setProperty(String, Object) overrides a deprecated method from Validator.
    12. The method ValidatorImpl.validate(Object) overrides a deprecated method from Validator.
    13. The method ValidatorImpl.validateRoot(Object) overrides a deprecated method from Validator.
    Please help me on the same. Suggest me the appropriate solution.
    Thanks in advance.
    LK.

    I'm sorry, but this forum is dealing with foreign database to Oracle migrations using SQL Developer or Migration Workbench. As far as I know JAXB belongs to JAVA and thus should be posted in this forum.

  • Migrate existing code of AS3 to AS2 - URLRequest, URLLoader

    Hi,
    I have written code to read an XML file by using URLRequest and URLLoader in ActionScript 3.0. Code is pasted below. This runs well in AS3.  Problem I am facing is because I wrote this in AS3, I am not able to use the DateChooser component in another part of the flash module because it seems like DateChooser component is not supported in AS3. So I want to migrate my below AS3 code back to AS2.
    **** Code in AS3 (I need help in writing equivalent code in AS2) :-
    var xmlText:XML ;
    var xmlReq:URLRequest = new URLRequest("myFile.xml");
    var xmlLoader:URLLoader = new URLLoader();
    xmlLoader.load(xmlReq);
    xmlLoader.addEventListener(Event.COMPLETE,xmlLoaded);
    function xmlLoaded(event:Event):void
        xmlText = new XML(xmlLoader.data);  
        info_txt.htmlText = xmlText.someTag ;
    **** I cannot use the above as is because, when I change the publish settings from AS3 to AS2, I get following errors -
    The class or interface 'URLRequest' could not be loaded.
    The class or interface 'URLLoader' could not be loaded.
    The class or interface 'Event' could not be loaded.
    Same works well in AS3. What should I do to make this work in AS2 or can anyone direct me in writing an equivalent in AS2.
    Please assist.
    Thanks in advance.
    MG

    parsing is done using the xmlnode methods and properties.  how you parse an xml file (in as2) depends on its structure.  but generally, you use firstChild, nextSibling, childNodes and nodeValue in the appropriate sequence to extact data.  the flash help files have sample code.  for tutorials, check google.
    if you're trying to load a cross-domain xml file, you'll have a cross-domain security issue to deal with.

  • PROBLEM WITH MY CLA- DEPRECATED CODE

    Hi all,
    I really need some help to sort out my small class which generates a random string. Here is the code:
    package project_gui;
    import java.util.Random;
    //Random string generator class
            public class randomString {
                    private static Random rn = new Random();
                    public randomString()
                    public static int rand(int lo, int hi)
                            int n = hi - lo + 1;
                            int i = rn.nextInt() % n;
                            if (i < 0)
                                    i = -i;
                            return lo + i;
                    public String randomstring(int lo, int hi)
                            int n = rand(lo, hi);
                            byte b[] = new byte[n];
                            for (int i = 0; i < n; i++)
                                    b[i] = (byte)rand('a', 'z');
                            return new String(b, 0);
                    public String randomstring()
                            return randomstring(1, 12);
            }The error I get is:
    project_gui/randomString.java:28: warning: String(byte[],int) in java.lang.String
    has been deprecated
              return new String(b, 0);I'm already looked through the API to try and find an alternative way of doing it, but I'm an inexperienced programmer and so I'm not sure what to do.
    Please help!!!

    JDK1.4.2 API docs:
    I believe it's:
    old
    String(byte[] ascii, int hibyte)
              Deprecated. This method does not properly convert bytes into characters. As of JDK
    1.1, the preferred way to do this is via the String constructors that take a charset name or
    that use the platform's default charset.
    new
    String(byte[] bytes, String charsetName)
              Constructs a new String by decoding the specified array of bytes using the
    specified charset.Try looking under class Charset for more details. I have not used these constructors myself though.

  • Problems while migrating ODI code from 1 env to other

    Hi,
    I had some ODI code in Env1 i moved it to Env2 and did some new development(created new models, packages etc) over there and then tried to migrate it into Env3.What i found that the exports for new development done at Env2 got imported easily in Env3 however, the exports of the code(of Env1) taken from Env2 are giving error ODI-10018: The repository {0} is not coherent between the current repository and the import file.
    This has put me in lot of trouble is there any way to resolve this.

    Well. This problem is not new and not unusual.
    What are the repository IDs for Env 1, Env 2 and Env 3 ?
    I suspect that Env 1 ID and Env 3 ID are same.
    There is an option in ODI 11g to renumber the repository IDs. In Topology Manager -> Repositories and then select and right click.
    You can select Env 2 and select an unused repository number and renumber your repository. Then the objects wilil be easily imported into Env 3.

  • Migration of code from one instance to another instance

    Hi OAF Team,
    i want to migrate the (OAF)code form one instance(test) to another instance(Dev), what is the procedure and how can i migrate from one instance to another instance.
    could you please solution for this.
    Regards,
    Muthu

    Hi
    General procedure is to zip all the java & xml page files and copy to dev instance. Then you can write a shell script to extract the zipped files and place it in appropriate locations.
    If there are any AOL objects defined by you, then you need to include that in shell script
    Regards
    Ravi

  • Migrating reuse code to lvlib files... namespace conversion leading to inability to find VIs?

    I am attempting to migrate my reuse code from llb files to directories, and in the process grouping code within lvlib files.  All of the reuse code resides within my user.lib directory (which is in the search path).  After this conversion process, which has resulted in VIs being in different physical locations and having their namespaces altered, my other code is unable to automatically find them?  Is there an automated method for telling my programs how to find the new reuse code.  If not, does anyone have any suggestions for where to start writing a program that could help with the conversion process?  Note, none of the VI names have changed, but of course their logical namespaces have.

    You can also manually change the VI search paths.
    http://zone.ni.com/reference/en-XX/help/371361B-01/lvhowto/adding_dir_vi_srch_path/
    Maybe you can temporarily add the new locations and go back to the defaults once you have saved all the VIs with the new paths.
    LabVIEW Champion . Do more with less code and in less time .

  • Migration from CoD to CRM.

    Hi Experts,
    I need to migrate Opportunity data from CoD to CRM on premise for my client.Could you please let me know if the table structure in CoD is same as that of CRM on premise? Any tips on the migration strategy would also be appreciated.
    Regards,
    Aneesh

    Hi,
    What version of CoD is your customer currently using?
    Regards,
    Parul

  • How to migrate source code

    Hi.
    We're creating a new JDI environment, but we need to know how can we migrate all the source code / applications from the old environment to that new structure...
    Anyone already do that?!
    Thanks.

    Hi ,
    check alternative to system copy for jdi migration is 14th page
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/70ee5ab2-8d7a-2c10-d88b-dbe2fdf666e7?quicklink=index&overridelayout=true
    Regards,
    Koti Reddy

  • AS2 to AS3 migration of code...

    ==============
    This code is in AS2
    ==============
    _root.createEmptyMovieClip("tmp",900);
    _root.createEmptyMovieClip("tmpLoded",101);
    _root.interval = setInterval(_root.logger,5000);
    loadVariables("http://www.site.com/trackL.php?eid="+_root.id+"&rdoc="+_root.rdoc+"&str="+_root.generateRandomStr(),_root.tmpLoded);  
    function logger () {
    loadVariables("http://www.site.com/track.php?eid="+_root.id+"&str="+_root.generateRandomStr(),_root.tmp);
    function generateRandomStr () {
    var dt = new Date();
    var str = dt.getMilliseconds()+""+dt.getSeconds()+""+dt.getMinutes()+""+dt.getHours()+""+dt.getDate ()+""+dt.getMonth()+""+dt.getFullYear();
    return str;
    trackL.php - tracking if it loads correctly
    while
    track.php - will be generated periodically every 5 seconds.
    How would I pass a variable from flash to php?
    I've been in many tutorials in the net but I cannot understand much of the tutorials...
    I only saw same method like using URLRequest & URLLoader with the location of the php files then the variables in the php which connects to the database is accessible.
    All are accessing the php not passing flash variables to the php file like in the above code.
    All help is greatly appreciated.

    that's really poor as2 coding so it will translate to really poor as3 coding.
    but, to answer your question, you assign a data property to your urlrequest to convey data from flash to php.  the data property will be a urlvariables instance and you assign variables/values to your urlvariables instance:
    var urlVar:URLVariables=new URLVariables();
    urlVar.eid=whatevervalue;
    urlVar.rdoc=whatever;
    urlVar.str=whateverelse;
    yourURLRequest.data=urlVar;

Maybe you are looking for