sharepoint feature upgrade failing to update module - sharepoint

Ok guys, I've been bending my head over this problem for quite some time now. Let me give you a little bit of context here. I have a site collection feature (FileCentral) working on it's version '1.0.0.0'. What this feature does is to create a document library in which I can upload files that will be stored on a network share. So each item in this document library stores a link to the file path. No problem here. Recently I've got the following requirement: "It should be possible to synchronize files from the folder to the document library". In other words, I need some way to scan for files placed in the network share and create the respective list items pointing to these files. The proposed solution is to create a custom action on this document library that when clicked would open a dialog with a page called SyncFiles.aspx in it. This page would then call an asynchronous service responsible for listing the files that have not been synchronized. The user would then select the files he wants to sync and confirm the operation. The project structure for this solution is:
|Features
|-- FileCentral (Site scoped feature)
|---- FileCentral.feature
|------ FileCentral.Template.xml
|branding (module)
|-- js (folder)
|---- app (folder)
|------ fileCentral (folder)
|-------- home.js
|-- Elements.xml
|Pages (module)
|-- Home.aspx (file)
|Updates (folder)
|-- SyncFileCentral (folder)
|---- Assets (module)
|------ js (folder)
|-------- app (folder)
|---------- fileCentral (folder)
|------------ sync.js
|------ Elements.xml
|---- Button (custom action)
|------ Elements.xml
|---- Pages (module)
|------ SyncFiles.aspx
|------ Elements.xml
The Assets module deploys to the Masterpage Gallery the necessary javascript e css files for the SyncFiles.aspx page to work:
<!-- Assets module -->
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="branding" Url="_catalogs/masterpage" RootWebOnly="TRUE">
<File Path="branding\js\app\fileCentral\sync.js" Url="branding/js/app/fileCentral/sync.js" ReplaceContent="TRUE" IgnoreIfAlreadyExists="TRUE" Type="GhostableInLibrary" Level="Published"/>
</Module>
</Elements>
The Button custom action deploys the (guess what?) the custom action. And the Pages modules deploys the SyncFiles.aspx page to the Pages document library.
<-- Pages module -->
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="Pages" Url="Pages" RootWebOnly="TRUE">
<File Path="Pages\SyncFiles.aspx" Url="Pages/SyncFiles.aspx" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE" ReplaceContent="TRUE" Level="Published" />
</Module>
</Elements>
The FileCentral.Template.xml looks like:
<?xml version="1.0" encoding="utf-8"?>
<Feature xmlns="http://schemas.microsoft.com/sharepoint/" **Version="2.0.0.0"** Title="File Central" ActivateOnDefault="FALSE" AlwaysForceInstall="TRUE" Description="DESCRIPTION HERE" Id="XXX" Scope="Site">
<!-- Feature Upgrade -->
<UpgradeActions>
<VersionRange BeginVersion="2.0.0.0" EndVersion="3.0.0.0">
<ApplyElementManifests>
<ElementManifest Location="Assets\Elements.xml" />
<ElementFile Location="Assets\js\app\fileCentral\sync.js" />
<ElementManifest Location="Button\Elements.xml" />
<ElementManifest Location="Pages\Elements.xml" />
<ElementFile Location="Pages\SyncFiles.aspx" />
</ApplyElementManifests>
</VersionRange>
</UpgradeActions>
<ElementManifests>
<ElementManifest Location="branding\Elements.xml" />
<ElementFile Location="branding\js\app\fileCentral\home.js" />
<ElementManifest Location="Assets\Elements.xml" />
<ElementFile Location="Assets\js\app\fileCentral\sync.js" />
<ElementManifest Location="Button\Elements.xml" />
<ElementManifest Location="Pages\Elements.xml" />
<ElementFile Location="Pages\SyncFiles.aspx" />
</ElementManifests>
</Feature>
Ok, enough of context. Here is the problem: When I Update-SPSolution -Identity "FileCentralSolution.wsp" -LiteralPath "X" -GACDeployment, I can see ($site.QueryFeatures([Microsoft.SharePoint.SPFeatureScope]::Site, $true)) that there are features needing update. Then, when I update the features, I'm not able to see neither my assets nor my pages changes. The only thing that gets deployed is my custom action. So when I click the button a blank dialog open up. And if I inspect the network tab, I can see the assets and page requests return 404 status responses. WHAT HAVE I DONE WRONG?

Have you checked your file system to see if the files have indeed been deployed to the correct hive? If this is SharePoint 2013, are your solution files being deployed to the folder appropriate to your selected UI mode? (CompatibilityLevel 14,15?)

Related

module named 'app' already exists on Android Studio

I did something wrong and I don't know what I did. But the module name has been changed to my-android-app.
And I am trying to get it back to app. The default name of single module.
I tried Rename Module. But I get.
in the drop down menu of build, there are my-android-app and app. But I just have one build.gradle of module from my-android-app.
In the project structure. I just have my-android-app. Nothing to delete.
How can I fix this problem?
You need to rename *.iml file(IntelliJ IDEA Module). This is the name of module. This file describes about the module.
Edit configuration if you see two.
Delete all except for app. And change Name to app if its name is different.
.idea >your-app.iml`
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/app/your-app.iml" filepath="$PROJECT_DIR$/app/your-app.iml" />
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
</modules>
</component>
</project>
Delete one of them. (Maybe your-app.iml module tags.) Or if the location is incorrect then fix it.
File > Invalidate Caches & Restart.
Clean Build.

vqmod doesn't make changes in frontend files in opencart Version 2.0.0.0

hi friends i am working on open cart Version 2.0.0.0 to build an e-commerce site. i had downloaded some vqmod modules and integrate it in my localhost and its work fine.
if i uploaded the same files in my live site. the vqmod changes for frond end file are not working. i have tested with my own vqmod files to its to works for admin files and doesn't for front end files.
<?xml version="1.0" encoding="utf-8"?><modification>
<id>test content</id>
<version>1.0.3</version>
<vqmver>2.2.1</vqmver>
<author>test</author>
<decription><![CDATA[
/*
This file is part test content
*/
]]>
</decription>
<file name="catelog/view/template/common/menu.tpl" error="log">
<operation error="log">
<search position="after"><![CDATA[
<li><?php echo $text_information; ?></li>
]]>
</search>
<add trim="true"><![CDATA[
<li><?php echo "jinna"; ?></li>
]]>
</add>
</operation>
</file></modification>
and this doesn't
<?xml version="1.0" encoding="utf-8"?><modification>
<id>test content</id>
<version>1.0.3</version>
<vqmver>2.2.1</vqmver>
<author>test</author>
<decription><![CDATA[
/*
This file is part test content
*/
]]>
</decription>
<file name="catalog/view/theme/*/template/common/header.tpl" error="log">
<operation error="log">
<search position="after"><![CDATA[
</header>
]]>
</search>
<add trim="true"><![CDATA[
<li><?php echo "jinna"; ?></li>
]]>
</add>
</operation>
</file></modification>
As you said in comment that
it means, Vqmod is not installed on server.
Install vqmod
To check vqmod is installed on your server or not. Follow the url
http://your-domain/vqmod/install/
Also give the 0777 permission to following folder and files.
vqmod/vqcache folder
vqmod/mods.cache file

I want to add code using OC mode in all module file

I want to add code in all controller file of module in admin side using OCMOD.
My code is:
<file path="admin/controller/module/*.php">
<operation>
<search trim="true"><![CDATA[
public function index() {
]]></search>
<add position="after" trim="true"><![CDATA[
$this->document->addScript('catalog/view/javascript/xxxx.js');
]]></add>
</operation> </file>
But it doesn't work.
I have try your code. It is working fine. please try following.
You have to create ocmod xml file with ".ocmod.xml" extension, then you can upload that file using "Extension Installer" from admin panel of opencart.
You have to clear and refresh the modification cache to update the system and make the extension work. You can clear and refresh by top right buttons on Extension > Modification page in admin panel.
Example OCMOD file with your code: (File name: test.ocmod.xml)
<?xml version="1.0" encoding="utf-8"?>
<modification>
<code>mycode001</code>
<name>Modification Default</name>
<version>1.0</version>
<author>OpenCart</author>
<link>http://www.opencart.com</link>
<file path="admin/controller/module/*.php">
<operation>
<search trim="true">
<![CDATA[public function index() {]]>
</search>
<add position="after" trim="true">
<![CDATA[$this->document->addScript('catalog/view/javascript/xxxx.js');]]>
</add>
</operation>
</file>
</modification>

Liferay 6.1 Theme - look and feel

I have liferay-look-and-feel.xml file:
<?xml version="1.0"?>
<!DOCTYPE look-and-feel PUBLIC "-//Liferay//DTD Look and Feel 6.1.0//EN"
"http://www.liferay.com/dtd/liferay-look-and-feel_6_1_0.dtd">
<look-and-feel>
<compatibility>
<version>6.1.10+</version>
</compatibility>
<theme id="sample-theme" name="Sample Theme">
<settings>
<setting key="portlet-setup-show-borders-default" value="false" />
</settings>
</theme>
</look-and-feel>
I use maven to build my project and build success
But when I open localhost in Eclipse I see:
[ThemeLocalServiceImpl:149] No theme found for specified theme id sample_WAR_sampletheme. Returning the default theme.
What is wrong?
Just remove the property antiJarLocking and set antiResourceLocking to false in Liferay-6.1.10/tomcat-7.0.27/webapps/sample_WAR_sampletheme/META-INF/context.xml.
Read more here.
It is a problem of antiResourceLocking in tomcat 7.
Please check out the blog: No theme found for specified theme id … Returning the default theme

Visual Studio template ignores some project settings that are in template

I created a new template, which I can use. However it only uses some project settings
I made a project with a working libSDL hi world example. I exported as a template, but template doesn't save some of my settings: ( It 'saves' them, but new projects ignore them. )
Ignored settings:
include header folders:
for .h files
for .lib files
linker args: SDLmain.lib SDL.lib
windows subsystem: /SUBSYSTEM:WINDOWS
Here's the saved /template/sdl/sdl.vcxproj file, and the settings actually appear in it yet they are ignored.
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{8DDA73A6-86DD-4B03-BA9B-54BE878B648C}</ProjectGuid>
<RootNamespace>$safeprojectname$</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v110</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v110</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<IncludePath>C:\cpp_libs\SDL-1.2.15\include;$(IncludePath)</IncludePath>
<ReferencePath>C:\cpp_libs\SDL-1.2.15\lib\x86;$(ReferencePath)</ReferencePath>
<LibraryPath>C:\cpp_libs\SDL-1.2.15\lib\x86;$(LibraryPath)</LibraryPath>
<SourcePath>C:\cpp_libs\SDL-1.2.15\include;$(SourcePath)</SourcePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>SDLmain.lib;SDL.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="Source.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
It's likely that the project system is actually removing these items as the file is being created: when you create a new project, Visual Studio runs a wizard in the background which can affect what actually ends up in the newly-created .vcxproj file.
These wizards are specific to the project type so you can actually supply your own via the <WizardExtension> element in the .vstemplate file. Of course by overriding the project creation logic, you may lose certain functionality/behaviour (unless there's a way of inheriting the original wizard's base assembly).
Alternately, a solution which I've used in the past is to create a VSPackage which handles the SolutionEvents_ProjectAdded method (in DTE.SolutionEvents). This method gets called whenever a new project is created or added to the solution, so you could potentially use that to set your project up as needed.
Note that you would need a way to ensure that it only affects projects of your specific type; a flag in the .vcxproj template file would do this.

Resources