How to set the primary file in custom filter UCM

Hi all

I have a requirement where I need to change the primary file that is downloaded.

I use validateStandard filter and above the file gets checked... I want to change the primary file for some another file...

But the problem is that I don't get what function I can set the value for the metadata of the primary file.

Here is my code:

public int doFilter (workspace ws, linking DataBinder, ExecutionContext cxt) survey DataException, ServiceException
{
Report.trace ("IMG_COMPRESS", "Start doFilter", null);

String xcontentType = binder.getLocal ("xContentType");
String primaryFilePath = binder.getLocal("primaryFile:path");
String primaryFileName = binder.getLocal ("primaryFile");

If (xcontentType.Equals ("CTID24"))
{
Report.trace ("IMG_COMPRESS", "Original file path:" + primaryFilePath, null);
Report.trace ("IMG_COMPRESS", "file name:" + primaryFileName, null);

Try
{
The output if the primaryFile:path are missing
If (primaryFilePath == null | primaryFilePath.trim () .length () < 1)
{
Report.trace ("IMG_COMPRESS", "Could not find the primary file path", null);
Back to CONTINUE;
}

Change the original image (input image) to the compressed Image (output image file)
primaryFilePath = "E:\\ImgCompression";
primaryFileName = "compressed.jpg.txt";

binder.putLocal ("primaryFile:path", primaryFilePath + "\" + primaryFileName);
binder.addFile (primaryFilePath + "\" + primaryFileName);

Report.trace ("IMG_COMPRESS", "new Img path:" + primaryFilePath, null);
Report.trace ("IMG_COMPRESS", "new Image Name:" + primaryFileName, null);
}
catch (System.Exception e)
{
Report.trace ("IMG_COMPRESS", "Unable to read file", null);
}
}
executed properly, filter return CONTINUE
Report.trace ("IMG_COMPRESS", "End doFilter", null);

Return FilterImplementor.CONTINUE;
}

There is no function with addFile in the DataBinder class.

Help, please

As I understand it, you create your own compression via a custom filter and you want to replace the original file with this compression.

That being said, why not do exactly as that - the original file is placed in some ~ temp directory on the server (after download), so go ahead, create compression and put it instead of the original file. One thing to consider is the MIME type - if replacing it, it should be the same; If it is not that you had to adjust first some metadata.

Tags: Fusion Middleware

Similar Questions

  • How to set the ALX file for compatibility of the storm

    Well, he can't ' be that lasts.  How to set a value in the ALX file so that my application when it is installed by the Manager of funds an ALX and COD file, behaves like a native storm app?

    Anyone?

    Thank you

    Gerry

    I asked this before but never got a response from RIM.

    I guess that they neglected to provide a way to do it.

    Strike 3 for compatibility mode.

  • C# / JavaScript how to set the primary text block?

    Hello

    I'm working with InDesign scripting API with c# for my work. I'm new to both the InDesign scripting API and using InDesign as well.

    I am building a gap of master, with blocks of text so that the text block on the left page of the cheese would pass in the block of text on the right page.


    I read there is the option block of primary text for the master spread, but I can't seem to understand how to use it.

    Is there someone who could show me an example of script code to define the framework of primary text for a master page/spread?


    Here is the code I have for now.

    The question I have is in line 53, where when I try to run it, it gives me a very generic error 'Invalid object for this request.', which leads me to believe I'm doing it wrong.

            public static byte[] CreatePageBasedOnCreatedMasterSpread(string savePath)
            {
                Application application = ActivateInDesign();
    
    
                // Create new document
                application.Documents.Add(true, application.DocumentPresets.FirstItem());
    
    
                // Get active document and change some settings
                Document document = application.ActiveDocument;
                document.DocumentPreferences.FacingPages = true;
                document.DocumentPreferences.PageWidth = 210;
                document.DocumentPreferences.PageHeight = 297;
    
    
                document.DocumentPreferences.CreatePrimaryTextFrame = true;
                document.TextPreferences.SmartTextReflow = true;
    
    
                MasterSpread masterSpread = document.MasterSpreads.Add();
                masterSpread.BaseName = "CustomMasterSpread";
                masterSpread.NamePrefix = "AC";
    
    
                //Set the document's ruler origin to page origin. This is very important
                //--if you don't do this, getting objects to the correct position on the
                //page is much more difficult.
                document.ViewPreferences.RulerOrigin = idRulerOrigin.idPageOrigin;
    
    
                Page leftPage = masterSpread.Pages.FirstItem();
                Page rightPage = masterSpread.Pages.LastItem();
    
    
                leftPage.MarginPreferences.Top = rightPage.MarginPreferences.Top = 10;
                leftPage.MarginPreferences.Bottom = rightPage.MarginPreferences.Bottom = 10;
                leftPage.MarginPreferences.Left = rightPage.MarginPreferences.Left = 30;
                leftPage.MarginPreferences.Right = rightPage.MarginPreferences.Right = 20;
    
    
                // Create a text frame. Do not add text to this, as this is a master spread text frame.
                // Link their flow together
                TextFrame primaryFirstPageTextFrame = leftPage.TextFrames.Add(document.Layers.FirstItem(), idLocationOptions.idUnknown, leftPage);
                TextFrame primarySecondPageTextFrame = rightPage.TextFrames.Add(document.Layers.FirstItem(), idLocationOptions.idUnknown, rightPage);
                primaryFirstPageTextFrame.NextTextFrame = primarySecondPageTextFrame;
                //Set primary text frame of master spread to be the two linked textframes
    
    
                primaryFirstPageTextFrame.GeometricBounds = GetPageBoundsWithMargin(leftPage, document);
                primarySecondPageTextFrame.GeometricBounds = GetPageBoundsWithMargin(rightPage, document);
             
                masterSpread.PrimaryTextFrame = primaryFirstPageTextFrame; //This causes the error
             
                return GetFileData(document, savePath);
            }
    
    

    I noticed the JavaScript API that is very similar to c#, so it would be useful if I get a response from JavaScript.

    Hi Michael,

    Basically, you can do something like this (in ExtendScript):

    //Store value:
    var storedPreset = app.documentPresets[0].createPrimaryTextFrame;
    
    //Let's set it to true:
    app.documentPresets[0].createPrimaryTextFrame = true;
    
    //Add the document, name the master as you wish etc.pp. :
    app.documents.add
    (
    
        {
            documentPrefreneces :
                {
                    facingPages : true
                    ,
                    pageWidth : "210 mm"
                    ,
                    pageHeight : "297 mm"
    
                }
        }
    
    );
    //Reset to stored value:
    app.documentPresets[0].createPrimaryTextFrame = storedPreset;
    

    Uwe

  • Mac Mavericks. Camera raw 9.1. Camera Nikon D810. How to set the default settings of the camera profile standard (now available after downloading the camera profile and copy it into the appropriate file)? Is it possible to apply also in the pictures showe

    Oops... did not write the question where I... How to set the default settings of the camera profile standard (now available after downloading the camera profile and copy it into the appropriate file)? Is it possible to apply too in images showed in the bridge? I'm a newbie in the forums and I'm not sure how to proceed.

    You can right click and copy the settings on an image that has the right profile. Then highlight all the images that you want to edit, right click and paste the settings. On the list that is displayed, simply choose the camera calibration.

  • File adapter. How to set the file creation mode (e.g. 666)?

    Hi all

    I use outbound adapter file to write files.
    Adapter creates the access mode of the Pentecost 622 files (rw - r - r)-.
    My requirement is to have files in access mode 666.
    How can I achieve that?

    Thank you
    Oleg.

    Hello

    This can be done by the user via the umask command...

    Take a look at this...
    http://www.AvaJava.com/tutorials/lessons/how-do-i-set-the-default-file-and-directory-permissions.html

    See you soon,.
    Vlad

  • How to set the password on the body of the e-mail in custom e-mail template

    HY,
    I have a model of personalized message in the definition of e-mail > Console Design.
    I send this "Email Template" with the user password, but I do not know how to set the variable "password" in the body of the e-mail.
    I searched Varables > objectives > Variables, but I have not found any variable think as password.

    Some have an idea about this? How to set the password on the body of the email?

    Kind regards
    PIZA

    You can use a custom Java code. See the following:

    Notification by e-mail to the users after that they change their password from IOM

  • How to set the condition of rule to check the Primary Key, Foreign Key and Unique

    I use Oracle 10.2
    Could someone tell me please how to set the rule condition to check the primary key, foreign key constraint of uniqueness?

    Hello

    Primary key, unique constraints and foreign key are better applied using the native functionality of database constraint. If you like the rules to check if a key exists at the time of the evaluation, you can use a function defined by the user in a rule condition and this function can ask to turn the table keys.

    Hope this helps,
    -Aravind.

  • How to set the position and size of the façade using the FPRunTimePosRunCustom method in a c# application?

    How to set the position and size of the façade using the FPRunTimePosRunCustom method in a c# application?

    I found a solution! -Set the size and position of the façade with the help of the

    File > VI properties > window running Position (in category list) > custom (in position of menu drop-down).

    then just accept the current position and size (leave the boxes checked) or set values you want directly (uncheck the boxes and fill in the numbers), or physically position and size the façade and use, the "set to current location" button and press "set size" current All that is easier for you.

    OK so it does not make use of the method VI Methods (Active X) FPRunTimePosRunCustom ([Position], [Size]) but if labview want to make him difficult to use then other means must be found.

  • How to set the path of the report in a plugin for model

    I'm trying to figure out how to set the path of the report in a plugin process model. I can't find a way to have access to it. It seems this would be a reasonable thing to do since the plug-ins are for the treatment of the results. Does anyone know how to do this? We generally use the sequential process model, but I try to keep my plug-in as independent as possible.

    Thank you.

    If I understand correctly, you want your plug-in, when enabled, change the settings of all other instances of the report OR plugin as their reports share the same directory that your plug-in is configured to use.

    If so, your plug-in can access and change the settings of all other instances of plugin. All instances are passed to all the points of plugin entries in the subproperty of the plugins of the ModelConfiguration parameter table. You can browse this table. Any element of the array with an equal to "NI_ReportGenerator.seq" Base.SequenceFilename is an instance of the report OR plugin. Its report options are stored in the element under PluginSpecific.Options.

    You can change the report options to what you want. Note that the recall of the ReportOptions model is called from template-plugin Initialize entry point, then you might want to ensure that your changes are applied after that, so they are not replaced. To do this, you could make your changes in the Initialize entry point of your plugin and make sure your plugin runs last. To rotate the last, you can set the FileGlobals.ModelPluginComponentDescription.Default.Base.RunOrder in your file of plug-in with a value greater than 0, for example 1.0 (see Help for TestStand > Fundamentals > process template Architecture > plug-in for the model process Architecture > Structure of the plugin sequence files > plugin model of entry Points > Order Execution of Point of entry at run time).

  • How to set the voltage on a 3.3 volt NI 9237 module?

    Hello

    How to set the voltage on a 3.3 volt NI 9237 module?

    The voltage is now at 2.5 volts.

    This is my first time with this camera.

    This set of MAX or are there jumpers?

    I want the value of the excitation voltage at 3.3 Volts and do not change.

    The NI 9237 is a NEITHER cDAQ-9172.

    Thank you

    Bill

    Hi POBA,.

    This can be set to your programming environment.  For example, LabVIEW Signal Express, a task of MAX, or a DLL call in a text-based environment.  You want to create a strain, tension Custom with excitement, or any bridge based task in any environment.

    "" "In MAX, right-click on your device and choose create a task" acquire signals "analog input"...

    "" "In LabVIEW, place a DAQ Assistant" acquire signals "analog input"...

    "" "In Signal Express, add a step for Acquire" DAQmx Acquire"analog input"...

    In any C language based, you will want to call a function such as: DAQmxCreateAIVoltageChanWithExcit, DAQmxCreateAIStrainGageChan, DAQmxCreateAIBridgeChan

    You can then specify the Source of Exictation to be internal to 3.3V.

    Best,

  • How to set the Date and time on a remote target in Measurement &amp; Automation Explorer (MAX)?

    Hello

    I'm trying to follow the steps described in the following link:

    How to set the Date and time on a remote target in Measurement & Automation Explorer (MAX)?

    It is said

    The software on the target currently supports only the time zoneand deletes the old files?

    I need set the date and time

    and remove all the old unwanted files

    the calendar was gray does not allow me to change the current date.

    Anyone know how to change

    Hi all!

    According to this the below Knowledge Base article, Remote Configuration System Support must be installed on the target for time settings to change in MAX.

    http://digital.NI.com/public.nsf/allkb/FAB0EC4D6E5EE0F386257738005733A3?OpenDocument&MeTC=max_MAXDat...

    If you don't know what version of the system supported remote Configuration software that you have installed on your device target, it is likely that it is not yet installed. Add this software by clicking below your target to the MAX software option and selecting "Add/Remove Software". This is where you will install the System Configuration Remote Support software.

    Please let us know if you have any questions!

  • How to set the zoom settings menu for lecroywaverunner 6050A

    Hello

    I am trying to initialize the zoom settings of a track of the labview on a Lecroy WaveRunner 6050 A fft. I found how to set the parameters of the fft with the manual of the remote control for LeCroy scopes  http://cdn.lecroy.com/files/manuals/wm-rcm-e_rev_d.pdf ) but I have not found how to set the menu zoom settings.

    I also tried with find command using the command of automation of Lecroy. ( http://cdn.lecroy.com/files/manuals/automation_command_ref_manual_wr.pdf ). but I think that there is a problem with the settings of the commands I send to the scope.

    I just need to put the horizontal and vertical centers and scales.

    If anyone can help,

    Thank you.

    Hello

    I use F1 as my FFT here track.

    Commands to change the scales are:

    Vertical Center: VBS ' app. Math.F1.Zoom.VerCenter = XXXX"

    Portrait/div scale: VBS ' app. Math.F1.Zoom.VerScale = XXXX"

    Horizontal at the Center: VBS ' app. Math.F1.Zoom.HorCenter = XXXX"

    Horzontal scale/div: VBS ' app. Math.F1.Zoom.HorScale = XXXX"

    I also want to point you to an application on the scope that will help you.

    If you go to the file menu and select cut, to the office, there is a shortcut to an application called "XStream Browser"

    The browser is an interactive application that will present all automation methods and properties that are available on the scope.  He acually connects to the scope of the request, so you can use it to test various components to see what they do on the scope.  It is very intuitive and I use it exclusively. (this is where I went looking for the commands above for you).

    Here is a link to Chapter 1 of the manual of automation: http://cdn.lecroy.com/files/manuals/04_xstreamautomation_ch1.pdf

    Page 1 - 5 has a quick introduction to the browser and its use.

    I hope that it becomes operational.

    Kind regards

    Leonard Brown

    LeCroy sales engineer

    1-800-5LeCroy

  • How to set the time stamp for incoming mail?

    How to set the time stamp for incoming mail?  I have windows vista. I use hotmail/windows live email. My computer has the time is set correctly. My e-mail timestamps incoming messages 7 hours a head of real time. Example: it is now 09:48. A new email is stamped as to settle at 16:48. How can I fix it? Note: the computer is correct.

    Thank you
    Laura
    2.13.2012

    If you mean the customer of email Windows Live Mail, the time stamp on messages is governed by your time zonesystem. Right-click on the clock in the lower right of the screen and select CONFIGURATION... Change your time zone, and then set your clock at the present time.

    If you are talking about the Windows Live Hotmail service, the time zone (s) used are those contained in your account data. Reach
    https://account.live.com/EditProf.aspx
    and change the time zones for the good...

    Windows Live programs and services have their own forums for support at the Windows Live Solution Center. Please address any questions you may have about Windows Live Mail to one of the forums on the right side of this page. For Hotmail, forums and responses are available via this page.

    Noel

  • How to set the name of the author and where I find all of the debug option token during the race or the creation of the application on QNX IDE?

    How to set the name of the author and where I find all of the debug option token during the race or the creation of the application on QNX IDE?

    Here is the error

    Failure of deployment: Info: request shipment: install and launch
    Info: Action: install and launch
    News: Native debugging: on
    Info: File size: 219949
    Info: Installing com.example.UIBB10AppTest1.testDev_B10AppTest15dd51c62...
    Info: Treatment 219949 bytes
    actual_dname:
    actual_id:
    actual_version:
    result::failure 881 the application author does not match the author token of debugging

    The author information is located in the bar - descriptor.xml in the tab "General". But the information must be defined automatically. In addition, you must install the token debug on your device.

    If everything is configured properly there is only one problem that happened to me. I had several chips debugging Momentics. I had to remove all chips debugging and leave alone the I want to use. Perhaps, you have also several debugging chips installed in Momentics. This seems to be a bug in Momentics who can't handle several chips debugging.

  • How to set the timing correctly?

    Based on the following batch file, I would like to raise the window at 11:05 and 11:07.

    Because he wanted to wait 1 minute before you restart, if the batch file is executed at 11:05, which wait a minute before you restart the window at 11:06.

    If the window does not always complete restart until the 11:07:36 or after 11:08, I would like to know about the question of whether or not the second restart at 11:07 process would be treated. On other words, if the window si la fenetre termine end relaunch 11:07:36, because the schedule at 11:07 is over, window would still go this annex missed 11:07?

    Does anyone have any suggestions?
    Thanks in advance for your suggestions

    Batch file: restart.bat

    %windir%\System32\shutdown.exe - r t 60 f

    How to set the timing correctly?

    Hello

    Sorry for the delay in responding.

    You run a batch file, your Windows question is more complex than what is generally answered in the Microsoft Answers forums. Appropriate in the TechNet forums.

    Please post your question in the Windows 7 IT Pro TechNet Forums: http://social.technet.microsoft.com/Forums/windows/en-US/home?category=w7itpro

    Thank you.

Maybe you are looking for